From df3eaebf59c94d76c2e89160be7b4afdf377f46a Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Mar 2012 21:22:59 +0000 Subject: [PATCH 001/390] First check-in of NxWidgets git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4505 42af7a65-404d-4744-a932-0658087f49c3 --- Doxygen/Doxyfile | 1551 ++++++++ Doxygen/README.txt | 45 + Doxygen/gendoc.sh | 94 + UnitTests/CButton/Makefile | 172 + UnitTests/CButton/cbuttontest.cxx | 325 ++ UnitTests/CButton/cbuttontest.hxx | 167 + UnitTests/CButton/main.cxx | 155 + UnitTests/CButtonArray/Makefile | 172 + UnitTests/CButtonArray/cbuttonarraytest.cxx | 301 ++ UnitTests/CButtonArray/cbuttonarraytest.hxx | 182 + UnitTests/CButtonArray/main.cxx | 327 ++ UnitTests/CCheckBox/Makefile | 172 + UnitTests/CCheckBox/ccheckboxtest.cxx | 297 ++ UnitTests/CCheckBox/ccheckboxtest.hxx | 152 + UnitTests/CCheckBox/main.cxx | 209 + UnitTests/CGlyphButton/Makefile | 172 + UnitTests/CGlyphButton/cglyphbuttontest.cxx | 307 ++ UnitTests/CGlyphButton/cglyphbuttontest.hxx | 182 + UnitTests/CGlyphButton/main.cxx | 225 ++ UnitTests/CImage/Makefile | 172 + UnitTests/CImage/cimagetest.cxx | 240 ++ UnitTests/CImage/cimagetest.hxx | 150 + UnitTests/CImage/main.cxx | 222 ++ UnitTests/CKeypad/Makefile | 172 + UnitTests/CKeypad/ckeypadtest.cxx | 458 +++ UnitTests/CKeypad/ckeypadtest.hxx | 192 + UnitTests/CKeypad/main.cxx | 274 ++ UnitTests/CLabel/Makefile | 172 + UnitTests/CLabel/clabeltest.cxx | 263 ++ UnitTests/CLabel/clabeltest.hxx | 148 + UnitTests/CLabel/main.cxx | 130 + UnitTests/CLatchButton/Makefile | 172 + UnitTests/CLatchButton/clatchbuttontest.cxx | 321 ++ UnitTests/CLatchButton/clatchbuttontest.hxx | 165 + UnitTests/CLatchButton/main.cxx | 199 + UnitTests/CLatchButtonArray/Makefile | 172 + .../clatchbuttonarraytest.cxx | 301 ++ .../clatchbuttonarraytest.hxx | 182 + UnitTests/CLatchButtonArray/main.cxx | 301 ++ UnitTests/CListBox/Makefile | 172 + UnitTests/CListBox/clistboxtest.cxx | 224 ++ UnitTests/CListBox/clistboxtest.hxx | 147 + UnitTests/CListBox/main.cxx | 327 ++ UnitTests/CProgressBar/Makefile | 172 + UnitTests/CProgressBar/cprogressbartest.cxx | 224 ++ UnitTests/CProgressBar/cprogressbartest.hxx | 147 + UnitTests/CProgressBar/main.cxx | 238 ++ UnitTests/CRadioButton/Makefile | 172 + UnitTests/CRadioButton/cradiobuttontest.cxx | 305 ++ UnitTests/CRadioButton/cradiobuttontest.hxx | 162 + UnitTests/CRadioButton/main.cxx | 238 ++ UnitTests/CScrollbarHorizontal/Makefile | 172 + .../cscrollbarhorizontaltest.cxx | 225 ++ .../cscrollbarhorizontaltest.hxx | 147 + UnitTests/CScrollbarHorizontal/main.cxx | 231 ++ UnitTests/CScrollbarVertical/Makefile | 172 + .../cscrollbarverticaltest.cxx | 225 ++ .../cscrollbarverticaltest.hxx | 147 + UnitTests/CScrollbarVertical/main.cxx | 231 ++ UnitTests/CSliderHorizonal/Makefile | 172 + .../csliderhorizontaltest.cxx | 224 ++ .../csliderhorizontaltest.hxx | 147 + UnitTests/CSliderHorizonal/main.cxx | 231 ++ UnitTests/CSliderVertical/Makefile | 172 + .../CSliderVertical/csliderverticaltest.cxx | 225 ++ .../CSliderVertical/csliderverticaltest.hxx | 147 + UnitTests/CSliderVertical/main.cxx | 231 ++ UnitTests/CTextBox/Makefile | 172 + UnitTests/CTextBox/ctextboxtest.cxx | 287 ++ UnitTests/CTextBox/ctextboxtest.hxx | 152 + UnitTests/CTextBox/main.cxx | 141 + UnitTests/README.txt | 394 ++ UnitTests/tools/addobjs.sh | 141 + UnitTests/tools/install.sh | 152 + libnxwidgets/COPYING | 70 + libnxwidgets/Makefile | 135 + libnxwidgets/include/cbgwindow.hxx | 314 ++ libnxwidgets/include/cbitmap.hxx | 204 + libnxwidgets/include/cbutton.hxx | 235 ++ libnxwidgets/include/cbuttonarray.hxx | 317 ++ libnxwidgets/include/ccallback.hxx | 220 ++ libnxwidgets/include/ccheckbox.hxx | 210 + libnxwidgets/include/ccyclebutton.hxx | 356 ++ libnxwidgets/include/cglyphbutton.hxx | 229 ++ libnxwidgets/include/cgraphicsport.hxx | 411 ++ libnxwidgets/include/cimage.hxx | 199 + libnxwidgets/include/ckeypad.hxx | 156 + libnxwidgets/include/clabel.hxx | 355 ++ libnxwidgets/include/clatchbutton.hxx | 173 + libnxwidgets/include/clatchbuttonarray.hxx | 170 + libnxwidgets/include/clistbox.hxx | 431 ++ libnxwidgets/include/clistboxdataitem.hxx | 180 + libnxwidgets/include/clistdata.hxx | 351 ++ libnxwidgets/include/clistdataeventargs.hxx | 121 + libnxwidgets/include/clistdataitem.hxx | 189 + libnxwidgets/include/cmultilinetextbox.hxx | 621 +++ libnxwidgets/include/cnxfont.hxx | 238 ++ libnxwidgets/include/cnxserver.hxx | 199 + libnxwidgets/include/cnxstring.hxx | 484 +++ libnxwidgets/include/cnxtimer.hxx | 220 ++ libnxwidgets/include/cnxtkwindow.hxx | 327 ++ libnxwidgets/include/cnxtoolbar.hxx | 304 ++ libnxwidgets/include/cnxwidget.hxx | 1627 ++++++++ libnxwidgets/include/cnxwindow.hxx | 307 ++ libnxwidgets/include/cprogressbar.hxx | 251 ++ libnxwidgets/include/cradiobutton.hxx | 207 + libnxwidgets/include/cradiobuttongroup.hxx | 253 ++ libnxwidgets/include/crect.hxx | 424 ++ libnxwidgets/include/crectcache.hxx | 222 ++ libnxwidgets/include/crlepalettebitmap.hxx | 259 ++ libnxwidgets/include/cscrollbarhorizontal.hxx | 293 ++ libnxwidgets/include/cscrollbarpanel.hxx | 309 ++ libnxwidgets/include/cscrollbarvertical.hxx | 291 ++ libnxwidgets/include/cscrollinglistbox.hxx | 480 +++ libnxwidgets/include/cscrollingpanel.hxx | 372 ++ libnxwidgets/include/cscrollingtextbox.hxx | 467 +++ libnxwidgets/include/csliderhorizontal.hxx | 344 ++ .../include/csliderhorizontalgrip.hxx | 203 + libnxwidgets/include/cslidervertical.hxx | 344 ++ libnxwidgets/include/csliderverticalgrip.hxx | 202 + libnxwidgets/include/cstickybutton.hxx | 237 ++ libnxwidgets/include/cstickybuttonarray.hxx | 174 + libnxwidgets/include/cstringiterator.hxx | 192 + libnxwidgets/include/ctext.hxx | 386 ++ libnxwidgets/include/ctextbox.hxx | 375 ++ libnxwidgets/include/cwidgetcontrol.hxx | 641 +++ libnxwidgets/include/cwidgeteventargs.hxx | 237 ++ libnxwidgets/include/cwidgeteventhandler.hxx | 316 ++ .../include/cwidgeteventhandlerlist.hxx | 382 ++ libnxwidgets/include/cwidgetstyle.hxx | 135 + libnxwidgets/include/glyphs.hxx | 131 + libnxwidgets/include/ibitmap.hxx | 165 + libnxwidgets/include/ilistbox.hxx | 273 ++ .../include/ilistdataeventhandler.hxx | 127 + libnxwidgets/include/inxwindow.hxx | 268 ++ libnxwidgets/include/iscrollable.hxx | 208 + libnxwidgets/include/islider.hxx | 188 + libnxwidgets/include/itextbox.hxx | 209 + libnxwidgets/include/nxconfig.hxx | 444 +++ libnxwidgets/include/singletons.hxx | 136 + libnxwidgets/include/teventargs.hxx | 136 + libnxwidgets/include/tnxarray.hxx | 437 +++ libnxwidgets/src/cbgwindow.cxx | 364 ++ libnxwidgets/src/cbitmap.cxx | 197 + libnxwidgets/src/cbutton.cxx | 300 ++ libnxwidgets/src/cbuttonarray.cxx | 608 +++ libnxwidgets/src/ccallback.cxx | 195 + libnxwidgets/src/ccheckbox.cxx | 265 ++ libnxwidgets/src/ccyclebutton.cxx | 482 +++ libnxwidgets/src/cglyphbutton.cxx | 297 ++ libnxwidgets/src/cgraphicsport.cxx | 988 +++++ libnxwidgets/src/cimage.cxx | 343 ++ libnxwidgets/src/ckeypad.cxx | 214 + libnxwidgets/src/clabel.cxx | 426 ++ libnxwidgets/src/clatchbutton.cxx | 131 + libnxwidgets/src/clatchbuttonarray.cxx | 116 + libnxwidgets/src/clistbox.cxx | 661 ++++ libnxwidgets/src/clistboxdataitem.cxx | 114 + libnxwidgets/src/clistdata.cxx | 462 +++ libnxwidgets/src/clistdataitem.cxx | 128 + libnxwidgets/src/cmultilinetextbox.cxx | 1284 ++++++ libnxwidgets/src/cnxfont.cxx | 276 ++ libnxwidgets/src/cnxserver.cxx | 386 ++ libnxwidgets/src/cnxstring.cxx | 799 ++++ libnxwidgets/src/cnxtimer.cxx | 382 ++ libnxwidgets/src/cnxtkwindow.cxx | 387 ++ libnxwidgets/src/cnxtoolbar.cxx | 364 ++ libnxwidgets/src/cnxwidget.cxx | 2424 ++++++++++++ libnxwidgets/src/cnxwindow.cxx | 342 ++ libnxwidgets/src/cprogressbar.cxx | 230 ++ libnxwidgets/src/cradiobutton.cxx | 225 ++ libnxwidgets/src/cradiobuttongroup.cxx | 344 ++ libnxwidgets/src/crect.cxx | 380 ++ libnxwidgets/src/crectcache.cxx | 521 +++ libnxwidgets/src/crlepalettebitmap.cxx | 414 ++ libnxwidgets/src/cscrollbarhorizontal.cxx | 402 ++ libnxwidgets/src/cscrollbarpanel.cxx | 438 +++ libnxwidgets/src/cscrollbarvertical.cxx | 404 ++ libnxwidgets/src/cscrollinglistbox.cxx | 415 ++ libnxwidgets/src/cscrollingpanel.cxx | 320 ++ libnxwidgets/src/cscrollingtextbox.cxx | 577 +++ libnxwidgets/src/csliderhorizontal.cxx | 402 ++ libnxwidgets/src/csliderhorizontalgrip.cxx | 246 ++ libnxwidgets/src/cslidervertical.cxx | 402 ++ libnxwidgets/src/csliderverticalgrip.cxx | 245 ++ libnxwidgets/src/cstickybutton.cxx | 168 + libnxwidgets/src/cstickybuttonarray.cxx | 292 ++ libnxwidgets/src/cstringiterator.cxx | 198 + libnxwidgets/src/ctext.cxx | 675 ++++ libnxwidgets/src/ctextbox.cxx | 679 ++++ libnxwidgets/src/cwidgetcontrol.cxx | 890 +++++ libnxwidgets/src/cwidgeteventhandlerlist.cxx | 606 +++ libnxwidgets/src/glyph_arrowdown.cxx | 154 + libnxwidgets/src/glyph_arrowleft.cxx | 154 + libnxwidgets/src/glyph_arrowright.cxx | 154 + libnxwidgets/src/glyph_arrowup.cxx | 154 + libnxwidgets/src/glyph_backspace.cxx | 154 + libnxwidgets/src/glyph_capslock.cxx | 155 + libnxwidgets/src/glyph_checkboxmu.cxx | 154 + libnxwidgets/src/glyph_checkboxoff.cxx | 121 + libnxwidgets/src/glyph_checkboxon.cxx | 154 + libnxwidgets/src/glyph_control.cxx | 154 + libnxwidgets/src/glyph_cycle.cxx | 155 + libnxwidgets/src/glyph_nxlogo.cxx | 3450 +++++++++++++++++ libnxwidgets/src/glyph_radiobuttonmu.cxx | 154 + libnxwidgets/src/glyph_radiobuttonoff.cxx | 154 + libnxwidgets/src/glyph_radiobuttonon.cxx | 156 + libnxwidgets/src/glyph_return.cxx | 154 + libnxwidgets/src/glyph_screendepthdown.cxx | 154 + libnxwidgets/src/glyph_screendepthup.cxx | 154 + libnxwidgets/src/glyph_screenflipdown.cxx | 154 + libnxwidgets/src/glyph_screenflipup.cxx | 154 + libnxwidgets/src/glyph_shift.cxx | 154 + libnxwidgets/src/glyph_windowclose.cxx | 154 + libnxwidgets/src/glyph_windowdepthdown.cxx | 154 + libnxwidgets/src/glyph_windowdepthup.cxx | 156 + libnxwidgets/src/singletons.cxx | 202 + 217 files changed, 66325 insertions(+) create mode 100644 Doxygen/Doxyfile create mode 100644 Doxygen/README.txt create mode 100755 Doxygen/gendoc.sh create mode 100644 UnitTests/CButton/Makefile create mode 100644 UnitTests/CButton/cbuttontest.cxx create mode 100644 UnitTests/CButton/cbuttontest.hxx create mode 100644 UnitTests/CButton/main.cxx create mode 100644 UnitTests/CButtonArray/Makefile create mode 100644 UnitTests/CButtonArray/cbuttonarraytest.cxx create mode 100644 UnitTests/CButtonArray/cbuttonarraytest.hxx create mode 100644 UnitTests/CButtonArray/main.cxx create mode 100644 UnitTests/CCheckBox/Makefile create mode 100644 UnitTests/CCheckBox/ccheckboxtest.cxx create mode 100644 UnitTests/CCheckBox/ccheckboxtest.hxx create mode 100644 UnitTests/CCheckBox/main.cxx create mode 100644 UnitTests/CGlyphButton/Makefile create mode 100644 UnitTests/CGlyphButton/cglyphbuttontest.cxx create mode 100644 UnitTests/CGlyphButton/cglyphbuttontest.hxx create mode 100644 UnitTests/CGlyphButton/main.cxx create mode 100644 UnitTests/CImage/Makefile create mode 100644 UnitTests/CImage/cimagetest.cxx create mode 100644 UnitTests/CImage/cimagetest.hxx create mode 100644 UnitTests/CImage/main.cxx create mode 100644 UnitTests/CKeypad/Makefile create mode 100644 UnitTests/CKeypad/ckeypadtest.cxx create mode 100644 UnitTests/CKeypad/ckeypadtest.hxx create mode 100644 UnitTests/CKeypad/main.cxx create mode 100644 UnitTests/CLabel/Makefile create mode 100644 UnitTests/CLabel/clabeltest.cxx create mode 100644 UnitTests/CLabel/clabeltest.hxx create mode 100644 UnitTests/CLabel/main.cxx create mode 100644 UnitTests/CLatchButton/Makefile create mode 100644 UnitTests/CLatchButton/clatchbuttontest.cxx create mode 100644 UnitTests/CLatchButton/clatchbuttontest.hxx create mode 100644 UnitTests/CLatchButton/main.cxx create mode 100644 UnitTests/CLatchButtonArray/Makefile create mode 100644 UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx create mode 100644 UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx create mode 100644 UnitTests/CLatchButtonArray/main.cxx create mode 100644 UnitTests/CListBox/Makefile create mode 100644 UnitTests/CListBox/clistboxtest.cxx create mode 100644 UnitTests/CListBox/clistboxtest.hxx create mode 100644 UnitTests/CListBox/main.cxx create mode 100644 UnitTests/CProgressBar/Makefile create mode 100644 UnitTests/CProgressBar/cprogressbartest.cxx create mode 100644 UnitTests/CProgressBar/cprogressbartest.hxx create mode 100644 UnitTests/CProgressBar/main.cxx create mode 100644 UnitTests/CRadioButton/Makefile create mode 100644 UnitTests/CRadioButton/cradiobuttontest.cxx create mode 100644 UnitTests/CRadioButton/cradiobuttontest.hxx create mode 100644 UnitTests/CRadioButton/main.cxx create mode 100644 UnitTests/CScrollbarHorizontal/Makefile create mode 100644 UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx create mode 100644 UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx create mode 100644 UnitTests/CScrollbarHorizontal/main.cxx create mode 100644 UnitTests/CScrollbarVertical/Makefile create mode 100644 UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx create mode 100644 UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx create mode 100644 UnitTests/CScrollbarVertical/main.cxx create mode 100644 UnitTests/CSliderHorizonal/Makefile create mode 100644 UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx create mode 100644 UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx create mode 100644 UnitTests/CSliderHorizonal/main.cxx create mode 100644 UnitTests/CSliderVertical/Makefile create mode 100644 UnitTests/CSliderVertical/csliderverticaltest.cxx create mode 100644 UnitTests/CSliderVertical/csliderverticaltest.hxx create mode 100644 UnitTests/CSliderVertical/main.cxx create mode 100644 UnitTests/CTextBox/Makefile create mode 100644 UnitTests/CTextBox/ctextboxtest.cxx create mode 100644 UnitTests/CTextBox/ctextboxtest.hxx create mode 100644 UnitTests/CTextBox/main.cxx create mode 100644 UnitTests/README.txt create mode 100755 UnitTests/tools/addobjs.sh create mode 100755 UnitTests/tools/install.sh create mode 100644 libnxwidgets/COPYING create mode 100644 libnxwidgets/Makefile create mode 100644 libnxwidgets/include/cbgwindow.hxx create mode 100644 libnxwidgets/include/cbitmap.hxx create mode 100644 libnxwidgets/include/cbutton.hxx create mode 100644 libnxwidgets/include/cbuttonarray.hxx create mode 100644 libnxwidgets/include/ccallback.hxx create mode 100644 libnxwidgets/include/ccheckbox.hxx create mode 100644 libnxwidgets/include/ccyclebutton.hxx create mode 100644 libnxwidgets/include/cglyphbutton.hxx create mode 100644 libnxwidgets/include/cgraphicsport.hxx create mode 100644 libnxwidgets/include/cimage.hxx create mode 100644 libnxwidgets/include/ckeypad.hxx create mode 100644 libnxwidgets/include/clabel.hxx create mode 100644 libnxwidgets/include/clatchbutton.hxx create mode 100644 libnxwidgets/include/clatchbuttonarray.hxx create mode 100644 libnxwidgets/include/clistbox.hxx create mode 100644 libnxwidgets/include/clistboxdataitem.hxx create mode 100644 libnxwidgets/include/clistdata.hxx create mode 100644 libnxwidgets/include/clistdataeventargs.hxx create mode 100644 libnxwidgets/include/clistdataitem.hxx create mode 100644 libnxwidgets/include/cmultilinetextbox.hxx create mode 100644 libnxwidgets/include/cnxfont.hxx create mode 100644 libnxwidgets/include/cnxserver.hxx create mode 100644 libnxwidgets/include/cnxstring.hxx create mode 100644 libnxwidgets/include/cnxtimer.hxx create mode 100644 libnxwidgets/include/cnxtkwindow.hxx create mode 100644 libnxwidgets/include/cnxtoolbar.hxx create mode 100644 libnxwidgets/include/cnxwidget.hxx create mode 100644 libnxwidgets/include/cnxwindow.hxx create mode 100644 libnxwidgets/include/cprogressbar.hxx create mode 100644 libnxwidgets/include/cradiobutton.hxx create mode 100644 libnxwidgets/include/cradiobuttongroup.hxx create mode 100644 libnxwidgets/include/crect.hxx create mode 100644 libnxwidgets/include/crectcache.hxx create mode 100644 libnxwidgets/include/crlepalettebitmap.hxx create mode 100644 libnxwidgets/include/cscrollbarhorizontal.hxx create mode 100644 libnxwidgets/include/cscrollbarpanel.hxx create mode 100644 libnxwidgets/include/cscrollbarvertical.hxx create mode 100644 libnxwidgets/include/cscrollinglistbox.hxx create mode 100644 libnxwidgets/include/cscrollingpanel.hxx create mode 100644 libnxwidgets/include/cscrollingtextbox.hxx create mode 100644 libnxwidgets/include/csliderhorizontal.hxx create mode 100644 libnxwidgets/include/csliderhorizontalgrip.hxx create mode 100644 libnxwidgets/include/cslidervertical.hxx create mode 100644 libnxwidgets/include/csliderverticalgrip.hxx create mode 100644 libnxwidgets/include/cstickybutton.hxx create mode 100644 libnxwidgets/include/cstickybuttonarray.hxx create mode 100644 libnxwidgets/include/cstringiterator.hxx create mode 100644 libnxwidgets/include/ctext.hxx create mode 100644 libnxwidgets/include/ctextbox.hxx create mode 100644 libnxwidgets/include/cwidgetcontrol.hxx create mode 100644 libnxwidgets/include/cwidgeteventargs.hxx create mode 100644 libnxwidgets/include/cwidgeteventhandler.hxx create mode 100644 libnxwidgets/include/cwidgeteventhandlerlist.hxx create mode 100644 libnxwidgets/include/cwidgetstyle.hxx create mode 100644 libnxwidgets/include/glyphs.hxx create mode 100644 libnxwidgets/include/ibitmap.hxx create mode 100644 libnxwidgets/include/ilistbox.hxx create mode 100644 libnxwidgets/include/ilistdataeventhandler.hxx create mode 100644 libnxwidgets/include/inxwindow.hxx create mode 100644 libnxwidgets/include/iscrollable.hxx create mode 100644 libnxwidgets/include/islider.hxx create mode 100644 libnxwidgets/include/itextbox.hxx create mode 100644 libnxwidgets/include/nxconfig.hxx create mode 100644 libnxwidgets/include/singletons.hxx create mode 100644 libnxwidgets/include/teventargs.hxx create mode 100644 libnxwidgets/include/tnxarray.hxx create mode 100644 libnxwidgets/src/cbgwindow.cxx create mode 100644 libnxwidgets/src/cbitmap.cxx create mode 100644 libnxwidgets/src/cbutton.cxx create mode 100644 libnxwidgets/src/cbuttonarray.cxx create mode 100644 libnxwidgets/src/ccallback.cxx create mode 100644 libnxwidgets/src/ccheckbox.cxx create mode 100644 libnxwidgets/src/ccyclebutton.cxx create mode 100644 libnxwidgets/src/cglyphbutton.cxx create mode 100644 libnxwidgets/src/cgraphicsport.cxx create mode 100644 libnxwidgets/src/cimage.cxx create mode 100644 libnxwidgets/src/ckeypad.cxx create mode 100644 libnxwidgets/src/clabel.cxx create mode 100644 libnxwidgets/src/clatchbutton.cxx create mode 100644 libnxwidgets/src/clatchbuttonarray.cxx create mode 100644 libnxwidgets/src/clistbox.cxx create mode 100644 libnxwidgets/src/clistboxdataitem.cxx create mode 100644 libnxwidgets/src/clistdata.cxx create mode 100644 libnxwidgets/src/clistdataitem.cxx create mode 100644 libnxwidgets/src/cmultilinetextbox.cxx create mode 100644 libnxwidgets/src/cnxfont.cxx create mode 100644 libnxwidgets/src/cnxserver.cxx create mode 100644 libnxwidgets/src/cnxstring.cxx create mode 100644 libnxwidgets/src/cnxtimer.cxx create mode 100644 libnxwidgets/src/cnxtkwindow.cxx create mode 100644 libnxwidgets/src/cnxtoolbar.cxx create mode 100644 libnxwidgets/src/cnxwidget.cxx create mode 100644 libnxwidgets/src/cnxwindow.cxx create mode 100644 libnxwidgets/src/cprogressbar.cxx create mode 100644 libnxwidgets/src/cradiobutton.cxx create mode 100644 libnxwidgets/src/cradiobuttongroup.cxx create mode 100644 libnxwidgets/src/crect.cxx create mode 100644 libnxwidgets/src/crectcache.cxx create mode 100644 libnxwidgets/src/crlepalettebitmap.cxx create mode 100644 libnxwidgets/src/cscrollbarhorizontal.cxx create mode 100644 libnxwidgets/src/cscrollbarpanel.cxx create mode 100644 libnxwidgets/src/cscrollbarvertical.cxx create mode 100644 libnxwidgets/src/cscrollinglistbox.cxx create mode 100644 libnxwidgets/src/cscrollingpanel.cxx create mode 100644 libnxwidgets/src/cscrollingtextbox.cxx create mode 100644 libnxwidgets/src/csliderhorizontal.cxx create mode 100644 libnxwidgets/src/csliderhorizontalgrip.cxx create mode 100644 libnxwidgets/src/cslidervertical.cxx create mode 100644 libnxwidgets/src/csliderverticalgrip.cxx create mode 100644 libnxwidgets/src/cstickybutton.cxx create mode 100644 libnxwidgets/src/cstickybuttonarray.cxx create mode 100644 libnxwidgets/src/cstringiterator.cxx create mode 100644 libnxwidgets/src/ctext.cxx create mode 100644 libnxwidgets/src/ctextbox.cxx create mode 100644 libnxwidgets/src/cwidgetcontrol.cxx create mode 100644 libnxwidgets/src/cwidgeteventhandlerlist.cxx create mode 100644 libnxwidgets/src/glyph_arrowdown.cxx create mode 100644 libnxwidgets/src/glyph_arrowleft.cxx create mode 100644 libnxwidgets/src/glyph_arrowright.cxx create mode 100644 libnxwidgets/src/glyph_arrowup.cxx create mode 100644 libnxwidgets/src/glyph_backspace.cxx create mode 100644 libnxwidgets/src/glyph_capslock.cxx create mode 100644 libnxwidgets/src/glyph_checkboxmu.cxx create mode 100644 libnxwidgets/src/glyph_checkboxoff.cxx create mode 100644 libnxwidgets/src/glyph_checkboxon.cxx create mode 100644 libnxwidgets/src/glyph_control.cxx create mode 100644 libnxwidgets/src/glyph_cycle.cxx create mode 100644 libnxwidgets/src/glyph_nxlogo.cxx create mode 100644 libnxwidgets/src/glyph_radiobuttonmu.cxx create mode 100644 libnxwidgets/src/glyph_radiobuttonoff.cxx create mode 100644 libnxwidgets/src/glyph_radiobuttonon.cxx create mode 100644 libnxwidgets/src/glyph_return.cxx create mode 100644 libnxwidgets/src/glyph_screendepthdown.cxx create mode 100644 libnxwidgets/src/glyph_screendepthup.cxx create mode 100644 libnxwidgets/src/glyph_screenflipdown.cxx create mode 100644 libnxwidgets/src/glyph_screenflipup.cxx create mode 100644 libnxwidgets/src/glyph_shift.cxx create mode 100644 libnxwidgets/src/glyph_windowclose.cxx create mode 100644 libnxwidgets/src/glyph_windowdepthdown.cxx create mode 100644 libnxwidgets/src/glyph_windowdepthup.cxx create mode 100644 libnxwidgets/src/singletons.cxx diff --git a/Doxygen/Doxyfile b/Doxygen/Doxyfile new file mode 100644 index 000000000..0451ce6a0 --- /dev/null +++ b/Doxygen/Doxyfile @@ -0,0 +1,1551 @@ +# Doxyfile 1.6.3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = NXWidgets + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "1.0" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = NO + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = NO + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = NO + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= NO + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = "../libnxwidgets" + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = NO + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = NO + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = NO + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = NO + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = NO + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/Doxygen/README.txt b/Doxygen/README.txt new file mode 100644 index 000000000..4546d4903 --- /dev/null +++ b/Doxygen/README.txt @@ -0,0 +1,45 @@ +README +====== + +This directory contains the documentation automatically generated by Doxygen. + +Contents +======== + + o Installing the necessary packages in Ubuntu + o Generating documentation + +Installing the necessary packages in Ubuntu +=========================================== + +1. Install the following packages. + + $ sudo aptitude install doxygen doxygen-doc doxygen-gui dot2tex graphviz + +2. (Optional) Install from the latest sourcode. + + The Ubuntu package is outdated. The newer the version of Doxygen, the cooler + the documentation looks. + + Place yourself in some temporary folder where you can download the source, + and run (http://www.stack.nl/~dimitri/doxygen/download.html): + + $ svn co https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk doxygen-svn + $ cd doxygen-svn + $ ./configure + $ make + $ make install + +Generating documentation +======================== + +1. Position the shell into this folder: + + misc/NXWidgets/Doxygen + + The file "Doxyfile" contains the configuration of the Doxygen settings + for the run, edit only if necessary. + + To generate the documentation type: + + $ doxygen Doxyfile diff --git a/Doxygen/gendoc.sh b/Doxygen/gendoc.sh new file mode 100755 index 000000000..0132f8162 --- /dev/null +++ b/Doxygen/gendoc.sh @@ -0,0 +1,94 @@ +#!/bin/bash +################################################################################# +# NxWidgets/Doxygen/gendoc.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Jose Pablo Carballo +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# +# +# set -x +# Functions + +function ShowUsage() +{ + echo "" + echo "USAGE: $0 " + echo "" + echo "Where:" + echo " is the full, absolut path to place the doxygen output" + echo "" +} + +# Input parameters + +DOXYGENOUTPUT_DIR=$1 +if [ -z "${DOXYGENOUTPUT_DIR}" ]; then + echo "Missing required arguments" + ShowUsage + exit 1 +fi + +# Check that the directory exist + +if [ ! -d "${DOXYGENOUTPUT_DIR}" ]; then + echo "Directory ${DOXYGENOUTPUT_DIR} does not exist" + exit 1 +fi + +# Find the doxygen configuration file + +DOXYFILE="Doxyfile" +if [ ! -e "${DOXYFILE}" ]; then + echo "This script must be executed in the documentation/ directory" + exit 1 +fi + +doxygen "${DOXYFILE}" || \ + { + echo "Failed to run doxygen"; \ + exit 1; + + } + +cp -rf html "${DOXYGENOUTPUT_DIR}" || \ + { + echo "Failed to move html output"; \ + exit 1; + } + +rm -rf html || \ + { + echo "Failed to remove the html/ directory"; \ + exit 1; + } + +echo "open ${DOXYGENOUTPUT_DIR}/html/index.html to start browsing" + diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile new file mode 100644 index 000000000..fbb7d815b --- /dev/null +++ b/UnitTests/CButton/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/Unitests/CButton/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cbuttontest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cbutton +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CButton/cbuttontest.cxx b/UnitTests/CButton/cbuttontest.cxx new file mode 100644 index 000000000..49f32f551 --- /dev/null +++ b/UnitTests/CButton/cbuttontest.cxx @@ -0,0 +1,325 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButton/cbuttontest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbuttontest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CButtonTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CButtonTest Constructor + +CButtonTest::CButtonTest() +{ + m_bgWindow = (CBgWindow *)NULL; + m_nxFont = (CNxFont *)NULL; + m_text = (CNxString *)NULL; +} + +// CButtonTest Descriptor + +CButtonTest::~CButtonTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CButtonTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Create the default font instance + + m_nxFont = new CNxFont(NXFONT_DEFAULT, + CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + if (!m_nxFont) + { + printf("CButtonTest::connect: Failed to create the default font\n"); + } + + // Set the background color + + if (!setBackgroundColor(CONFIG_CBUTTONTEST_BGCOLOR)) + { + printf("CButtonTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CButtonTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the display string + + if (m_text) + { + delete m_text; + m_text = (CNxString *)NULL; + } + + // Free the default font + + if (m_nxFont) + { + delete m_nxFont; + m_nxFont = (CNxFont *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CButtonTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + printf("CButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + printf("CButtonTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CButton instance + +CButton *CButtonTest::createButton(FAR const char *text) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CButtonTest::createGraphics: Failed to get window size\n"); + return (CButton *)NULL; + } + + // Create a CNxString instance to contain the C string + + m_text = new CNxString(text); + + // Get the height and width of the text display area + + nxgl_coord_t stringWidth = m_nxFont->getStringWidth(*m_text); + nxgl_coord_t stringHeight = (nxgl_coord_t)m_nxFont->getHeight(); + + // The default CButton has borders enabled with thickness of the border + // width. Add twice the thickness of the borderto the width and height. (We + // could let CButton do this for us by calling CButton::getPreferredDimensions()) + + stringWidth += 2 * 1; + stringHeight += 2 * 1; + + // Pick an X/Y position such that the button will be centered in the display + + nxgl_coord_t buttonX; + if (stringWidth >= windowSize.w) + { + buttonX = 0; + } + else + { + buttonX = (windowSize.w - stringWidth) >> 1; + } + + nxgl_coord_t buttonY; + if (stringHeight >= windowSize.h) + { + buttonY = 0; + } + else + { + buttonY = (windowSize.h - stringHeight) >> 1; + } + + // Save the center position of the button for use by click and release + + m_center.x = buttonX + (stringWidth >> 1); + m_center.y = buttonY + (stringHeight >> 1); + + // Now we have enough information to create the button + + return new CButton(m_widgetControl, buttonX, buttonY, stringWidth, stringHeight, *m_text); +} + +// Draw the button + +void CButtonTest::showButton(CButton *button) +{ + button->enable(); // Un-necessary, the widget is enabled by default + button->enableDrawing(); + button->redraw(); +} + +// Perform a simulated mouse click on the button. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CButtonTest::click(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CButtonTest::release(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll +// then check if the event was processed corredly. + +bool CButtonTest::poll(CButton *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); + + // And return the button clicked state + + return button->isClicked(); +} + diff --git a/UnitTests/CButton/cbuttontest.hxx b/UnitTests/CButton/cbuttontest.hxx new file mode 100644 index 000000000..f125af6b3 --- /dev/null +++ b/UnitTests/CButton/cbuttontest.hxx @@ -0,0 +1,167 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButton/cbuttontest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CBUTTON_CBUTTONTEST_HXX +#define __UNITTESTS_CBUTTON_CBUTTONTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "cbutton.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CBUTTONTEST_BGCOLOR +# define CONFIG_CBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CBUTTONTEST_FONTCOLOR +# define CONFIG_CBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cbutton_main +# define MAIN_STRING "cbutton_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CButtonTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CNxFont *m_nxFont; // Default font + CBgWindow *m_bgWindow; // Background window instance + CNxString *m_text; // The button string + struct nxgl_point_s m_center; // X, Y position the center of the button + +public: + // Constructor/destructors + + CButtonTest(); + ~CButtonTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CButton instance. This method will show you how to create + // a CButton widget + + CButton *createButton(FAR const char *text); + + // Draw the button. This method illustrates how to draw the CButton widget. + + void showButton(CButton *button); + + // Perform a simulated mouse click on the button. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(void); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(void); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll + // then check if the event was processed corredly. + + bool poll(CButton *button); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CBUTTON_CBUTTONTEST_HXX diff --git a/UnitTests/CButton/main.cxx b/UnitTests/CButton/main.cxx new file mode 100644 index 000000000..13e9099d9 --- /dev/null +++ b/UnitTests/CButton/main.cxx @@ -0,0 +1,155 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButton/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "cbuttontest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static const char g_pushme[] = "Push Me"; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Create an instance of the font test + + printf(MAIN_STRING "Create CButtonTest instance\n"); + CButtonTest *test = new CButtonTest(); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CButtonTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CButtonTest instance to the NX server\n"); + delete test; + return 1; + } + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + + // Create a CButton instance + + CButton *button = test->createButton(g_pushme); + if (!button) + { + printf(MAIN_STRING "Failed to create a button\n"); + delete test; + return 1; + } + + // Show the button + + printf(MAIN_STRING "Show the button\n"); + test->showButton(button); + + // Wait two seconds, then perform a simulated mouse click on the button + + sleep(2); + printf(MAIN_STRING "Click the button\n"); + test->click(); + + // Poll for the mouse click event (of course this can hang if something fails) + + bool clicked = test->poll(button); + printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + + // Wait a second, then release the mouse buttone + + sleep(1); + test->release(); + + // Poll for the mouse release event (of course this can hang if something fails) + + clicked = test->poll(button); + printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + + // Wait a few more seconds so that the tester can ponder the result + + sleep(3); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete button; + delete test; + return 0; +} + diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile new file mode 100644 index 000000000..6bb67424c --- /dev/null +++ b/UnitTests/CButtonArray/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CButtonArray/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cbuttonarraytest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cbuttonarray +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CButtonArray/cbuttonarraytest.cxx b/UnitTests/CButtonArray/cbuttonarraytest.cxx new file mode 100644 index 000000000..4e4f4487f --- /dev/null +++ b/UnitTests/CButtonArray/cbuttonarraytest.cxx @@ -0,0 +1,301 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbuttonarraytest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CButtonArrayTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CButtonArrayTest Constructor + +CButtonArrayTest::CButtonArrayTest() +{ + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CButtonArrayTest Descriptor + +CButtonArrayTest::~CButtonArrayTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CButtonArrayTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CBUTTONARRAYTEST_BGCOLOR)) + { + message("CButtonArrayTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CButtonArrayTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Destroy the widget control + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CButtonArrayTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CButtonArrayTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CButtonArray instance + +CButtonArray *CButtonArrayTest::createButtonArray(void) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CButtonArrayTest::createGraphics: Failed to get window size\n"); + return (CButtonArray *)NULL; + } + + // Pick an X/Y position such that the button array will be centered in the display + + nxgl_coord_t buttonArrayX; + if (BUTTONARRAY_WIDTH >= windowSize.w) + { + buttonArrayX = 0; + } + else + { + buttonArrayX = (windowSize.w - BUTTONARRAY_WIDTH) >> 1; + } + + nxgl_coord_t buttonArrayY; + if (BUTTONARRAY_HEIGHT >= windowSize.h) + { + buttonArrayY = 0; + } + else + { + buttonArrayY = (windowSize.h - BUTTONARRAY_HEIGHT) >> 1; + } + + // Now we have enough information to create the button array + + return new CButtonArray(m_widgetControl, + buttonArrayX, buttonArrayY, + BUTTONARRAY_NCOLUMNS, BUTTONARRAY_NROWS, + BUTTONARRAY_BUTTONWIDTH, BUTTONARRAY_BUTTONHEIGHT); +} + +// Draw the button array + +void CButtonArrayTest::showButton(CButtonArray *buttonArray) +{ + buttonArray->enable(); // Un-necessary, the widget is enabled by default + buttonArray->enableDrawing(); + buttonArray->redraw(); +} + +// Perform a simulated mouse click on a button in the array. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CButtonArrayTest::click(CButtonArray *buttonArray, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the selected button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = buttonArray->getX() + + column * BUTTONARRAY_BUTTONWIDTH + + BUTTONARRAY_BUTTONWIDTH/2; + nxgl_coord_t buttonY = buttonArray->getY() + + row * BUTTONARRAY_BUTTONHEIGHT + + BUTTONARRAY_BUTTONHEIGHT/2; + + // Then inject the mouse click + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CButtonArrayTest::release(CButtonArray *buttonArray, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = buttonArray->getX() + + column * BUTTONARRAY_BUTTONWIDTH + + BUTTONARRAY_BUTTONWIDTH/2; + nxgl_coord_t buttonY = buttonArray->getY() + + row * BUTTONARRAY_BUTTONHEIGHT + + BUTTONARRAY_BUTTONHEIGHT/2; + + // Then inject the mouse release + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll +// then check if the event was processed corredly. + +void CButtonArrayTest::poll(CButtonArray *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); +} + diff --git a/UnitTests/CButtonArray/cbuttonarraytest.hxx b/UnitTests/CButtonArray/cbuttonarraytest.hxx new file mode 100644 index 000000000..ef265efbf --- /dev/null +++ b/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -0,0 +1,182 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CBUTTONARRAY_CBUTTONARRAYTEST_HXX +#define __UNITTESTS_CBUTTONARRAY_CBUTTONARRAYTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "cbuttonarray.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CBUTTONARRAYTEST_BGCOLOR +# define CONFIG_CBUTTONARRAYTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CBUTTONARRAYTEST_FONTCOLOR +# define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cbuttonarray_main +# define MAIN_STRING "cbuttonarray_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +// The geometry of the button array + +#define BUTTONARRAY_NCOLUMNS 4 +#define BUTTONARRAY_NROWS 7 +#define BUTTONARRAY_BUTTONWIDTH 60 +#define BUTTONARRAY_BUTTONHEIGHT 32 +#define BUTTONARRAY_WIDTH (BUTTONARRAY_BUTTONWIDTH * BUTTONARRAY_NCOLUMNS) +#define BUTTONARRAY_HEIGHT (BUTTONARRAY_BUTTONHEIGHT * BUTTONARRAY_NROWS) + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CButtonArrayTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The widget control for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CButtonArrayTest(); + ~CButtonArrayTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CButtonArray instance. This method will show you how to create + // a CButtonArray widget + + CButtonArray *createButtonArray(void); + + // Draw the button array. This method illustrates how to draw the CButtonArray widget. + + void showButton(CButtonArray *buttonArray); + + // Perform a simulated mouse click on a button in the array. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(CButtonArray *buttonArray, int column, int row); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(CButtonArray *buttonArray, int column, int row); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll + // then check if the event was processed corredly. + + void poll(CButtonArray *buttonArray); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CBUTTONARRAY_CBUTTONARRAYTEST_HXX diff --git a/UnitTests/CButtonArray/main.cxx b/UnitTests/CButtonArray/main.cxx new file mode 100644 index 000000000..fa02413a4 --- /dev/null +++ b/UnitTests/CButtonArray/main.cxx @@ -0,0 +1,327 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CButtonArray/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include + +#include + +#include "cnxstring.hxx" +#include "cbuttonarraytest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmPrevious; +static unsigned int g_mmPeak; + +static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { + "=>", "A", "B", " g_mmPeak) + { + g_mmPeak = mmcurrent.uordblks; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmPrevious = mmcurrent.uordblks; + g_mmPeak = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: checkHighlighting +///////////////////////////////////////////////////////////////////////////// + +static void checkHighlighting(CButtonArray *buttonArray) +{ + // Turn highlighting on + + buttonArray->setCursorPosition(0, 0); + buttonArray->cursor(true); + + // Then test the cursor movement + + for (int row = 0; row < BUTTONARRAY_NROWS; row++) + { + for (int column = 0; column < BUTTONARRAY_NCOLUMNS; column++) + { + // Set cursor position + + buttonArray->setCursorPosition(column, row); + + // Check cursor position + + int checkColumn; + int checkRow; + if (buttonArray->isCursorPosition(checkColumn, checkRow)) + { + printf("ERROR: Not button selected\n"); + printf(" Expected (%d,%d)\n", column, row); + } + else if (checkColumn != column || checkRow != row) + { + printf("ERROR: Wrong button selected\n"); + printf(" Expected (%d,%d)\n", column, row); + printf(" Selected (%d,%d)\n", checkColumn, checkRow); + } + + // Wait a bit so that we can see the highlighting + + usleep(500*1000); + } + } + + // Turn highlighting off + + buttonArray->cursor(false); +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the button array test + + printf(MAIN_STRING "Create CButtonArrayTest instance\n"); + CButtonArrayTest *test = new CButtonArrayTest(); + updateMemoryUsage(g_mmPrevious, "After creating CButtonArrayTest"); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CButtonArrayTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CButtonArrayTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After connecting to the server"); + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating a window"); + + // Create a CButtonArray instance + + CButtonArray *buttonArray = test->createButtonArray(); + if (!buttonArray) + { + printf(MAIN_STRING "Failed to create a button array\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating CButtonArray"); + + // Add the labels to each button + + FAR const char **ptr = g_buttonLabels; + for (int j = 0; j < BUTTONARRAY_NROWS; j++) + { + for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) + { + printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + CNxString string = *ptr++; + buttonArray->setText(i, j, string); + } + } + updateMemoryUsage(g_mmPrevious, "After adding labels to the buttons"); + + // Show the button array + + printf(MAIN_STRING "Show the button array\n"); + test->showButton(buttonArray); + sleep(1); + + // Verify that button highlighting works + + checkHighlighting(buttonArray); + updateMemoryUsage(g_mmPrevious, "After highliting"); + + // Then perform a simulated mouse click on a button in the array + + for (int j = 0; j < BUTTONARRAY_NROWS; j++) + { + for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) + { + printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + test->click(buttonArray, i, j); + + // Poll for the mouse click event + + test->poll(buttonArray); + + // Is anything clicked? + + int clickColumn; + int clickRow; + if (buttonArray->isButtonClicked(clickColumn, clickRow)) + { + printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + clickColumn == i && clickRow == j ? "OK" : "ERROR", + clickColumn, clickRow); + } + else + { + printf(MAIN_STRING "ERROR: No button is clicked\n"); + } + + // Wait a bit, then release the mouse button + + usleep(500*1000); + test->release(buttonArray, i, j); + + // Poll for the mouse release event (of course this can hang if something fails) + + test->poll(buttonArray); + if (buttonArray->isButtonClicked(clickColumn, clickRow)) + { + printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + clickColumn, clickRow); + } + + usleep(500*1000); + } + } + updateMemoryUsage(g_mmPrevious, "After pushing buttons"); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete buttonArray; + updateMemoryUsage(g_mmPrevious, "After deleting the button array"); + delete test; + updateMemoryUsage(g_mmPrevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + return 0; +} + diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile new file mode 100644 index 000000000..9dae246ce --- /dev/null +++ b/UnitTests/CCheckBox/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CCheckBox/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx ccheckboxtest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = ccheckbox +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CCheckBox/ccheckboxtest.cxx b/UnitTests/CCheckBox/ccheckboxtest.cxx new file mode 100644 index 000000000..90abf2e67 --- /dev/null +++ b/UnitTests/CCheckBox/ccheckboxtest.cxx @@ -0,0 +1,297 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CCheckBox/ccheckboxtest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "ccheckboxtest.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CCheckBoxTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CCheckBoxTest Constructor + +CCheckBoxTest::CCheckBoxTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; + m_checkBox = (CCheckBox *)NULL; +} + +// CCheckBoxTest Descriptor + +CCheckBoxTest::~CCheckBoxTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CCheckBoxTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CCHECKBOXTEST_BGCOLOR)) + { + message("CCheckBoxTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CCheckBoxTest::disconnect(void) +{ + // Free the radiobutton group + + if (m_checkBox) + { + delete m_checkBox; + m_checkBox = (CCheckBox *)NULL; + } + + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CCheckBoxTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CCheckBoxTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CCheckBoxTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CCheckBoxTest::createWindow: Failed to get window size\n"); + disconnect(); + return false; + } + + // Use the the size of the ON checkbox glyph. (adding twice the border thickness) + + nxgl_coord_t width = g_checkBoxOn.width + 2 * 1; + nxgl_coord_t height = g_checkBoxOn.height + 2 * 1; + + nxgl_coord_t checkboxX = (windowSize.w - width) >> 1; + nxgl_coord_t checkboxY = (windowSize.h - height) >> 1; + + // Create the checkbox + + m_checkBox = new CCheckBox(m_widgetControl, checkboxX, checkboxY, + width, height, (CWidgetStyle *)NULL); + if (!m_checkBox) + { + printf("CCheckBoxTest::createWindow: Failed to create CCheckBox\n"); + disconnect(); + return false; + } + + return true; +} + +// (Re-)draw the check box. + +void CCheckBoxTest::showCheckBox(void) +{ + m_checkBox->enable(); // Un-necessary, the widget is enabled by default + m_checkBox->enableDrawing(); + m_checkBox->redraw(); +} + +// Push the radio button + +void CCheckBoxTest::clickCheckBox(void) +{ + // Get the checkbox center coordinates + + nxgl_coord_t checkboxX = m_checkBox->getX() + (m_checkBox->getWidth() >> 1); + nxgl_coord_t checkboxY = m_checkBox->getY() + (m_checkBox->getHeight() >> 1); + + // Click the checkbox by calling nx_mousein. nx_mousein is meant to be + // called by mouse handling software. Here we just inject a left-button click + // directly in the center of the radio button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, checkboxX, checkboxY, NX_MOUSE_LEFTBUTTON); + + // Poll for mouse events + // + // Widget events are normally handled in a modal loop (by calling goModal()). + // However, for this case we know that we just pressed the mouse button + // so we don't have to poll. We can just perform a one pass poll then + // then check if the mouse event was processed corredly. + + m_widgetControl->pollEvents(m_checkBox); + + // Then inject the mouse release + + (void)nx_mousein(handle, checkboxX, checkboxY, 0); + + // And poll for more mouse events + + m_widgetControl->pollEvents(m_checkBox); + + // And re-draw the buttons (the mouse click event should have automatically + // triggered the re-draw) + // + // showCheckBox(); +} + +// Show the state of the radio button group + +void CCheckBoxTest::showCheckBoxState(void) +{ + CCheckBox::CheckBoxState state = m_checkBox->getState(); + switch (state) + { + case CCheckBox::CHECK_BOX_STATE_OFF: // Checkbox is unticked + message("CCheckBoxTest::showCheckBoxState Checkbox is in the unticked state\n"); + break; + + case CCheckBox::CHECK_BOX_STATE_ON: // Checkbox is ticked + message("CCheckBoxTest::showCheckBoxState Check is in the ticked state\n"); + break; + + default: + case CCheckBox::CHECK_BOX_STATE_MU: // Checkbox is in the third state + message("CCheckBoxTest::showCheckBoxState Checkbox is in the 3rd state\n"); + break; + } +} diff --git a/UnitTests/CCheckBox/ccheckboxtest.hxx b/UnitTests/CCheckBox/ccheckboxtest.hxx new file mode 100644 index 000000000..52371ab73 --- /dev/null +++ b/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -0,0 +1,152 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CCHECKBOX_CCHECKBOXTEST_HXX +#define __UNITTESTS_CCHECKBOX_CCHECKBOXTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "ccheckbox.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CCHECKBOXTEST_BGCOLOR +# define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME ccheckbox_main +# define MAIN_STRING "ccheckbox_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CCheckBoxTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + CCheckBox *m_checkBox; // Checkgox instance under test + +public: + // Constructor/destructors + + CCheckBoxTest(void); + ~CCheckBoxTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // (Re-)draw the checkbox. + + void showCheckBox(void); + + // Simulate pushing and releasing of the radio button + + void clickCheckBox(void); + + // Show the state of the radio button group + + void showCheckBoxState(void); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CCHECKBOX_CCHECKBOXTEST_HXX diff --git a/UnitTests/CCheckBox/main.cxx b/UnitTests/CCheckBox/main.cxx new file mode 100644 index 000000000..e9e8b516f --- /dev/null +++ b/UnitTests/CCheckBox/main.cxx @@ -0,0 +1,209 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CCheckBox/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" +#include "ccheckboxtest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CCheckBoxTest instance\n"); + CCheckBoxTest *test = new CCheckBoxTest(); + updateMemoryUsage(g_mmprevious, "After creating CCheckBoxTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CCheckBoxTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CCheckBoxTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Show the initial state of the checkbox + + test->showCheckBox(); + test->showCheckBoxState(); + sleep(1); + + // Now click the checkbox + + message(MAIN_STRING "Click 1\n"); + test->clickCheckBox(); + usleep(500*1000); + test->showCheckBoxState(); + updateMemoryUsage(g_mmprevious, "After click 1"); + usleep(500*1000); + + message(MAIN_STRING "Click 2\n"); + test->clickCheckBox(); + usleep(500*1000); + test->showCheckBoxState(); + updateMemoryUsage(g_mmprevious, "After click 2"); + usleep(500*1000); + + message(MAIN_STRING "Click 3\n"); + test->clickCheckBox(); + usleep(500*1000); + test->showCheckBoxState(); + updateMemoryUsage(g_mmprevious, "After click 3"); + sleep(2); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile new file mode 100644 index 000000000..527d882fa --- /dev/null +++ b/UnitTests/CGlyphButton/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CGlyphButton/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cglyphbuttontest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cglyphbutton +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.cxx b/UnitTests/CGlyphButton/cglyphbuttontest.cxx new file mode 100644 index 000000000..d44238c78 --- /dev/null +++ b/UnitTests/CGlyphButton/cglyphbuttontest.cxx @@ -0,0 +1,307 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cglyphbuttontest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CGlyphButtonTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CGlyphButtonTest Constructor + +CGlyphButtonTest::CGlyphButtonTest() +{ + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; + m_center.x = 0; + m_center.y = 0; +} + +// CGlyphButtonTest Descriptor + +CGlyphButtonTest::~CGlyphButtonTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CGlyphButtonTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CGLYPHBUTTONTEST_BGCOLOR)) + { + message("CGlyphButtonTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CGlyphButtonTest::disconnect(void) +{ + // Delete the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CGlyphButtonTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CGlyphButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CGlyphButtonTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CGlyphButton instance + +CGlyphButton *CGlyphButtonTest::createButton(FAR const struct SBitmap *clickGlyph, + FAR const struct SBitmap *unClickedGlyph) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CGlyphButtonTest::createGraphics: Failed to get window size\n"); + return (CGlyphButton *)NULL; + } + + // Get the height and width of the glyph display area + + nxgl_coord_t glyphWidth = MAX(clickGlyph->width, unClickedGlyph->width); + nxgl_coord_t glyphHeight = MAX(clickGlyph->height, unClickedGlyph->height); + + // The default CGlyphButton has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. (We + // could let CGlyphButton do this for us by calling + // CGlyphButton::getPreferredDimensions()) + + glyphWidth += 2 * 1; + glyphHeight += 2 * 1; + + // Pick an X/Y position such that the button will be centered in the display + + nxgl_coord_t buttonX; + if (glyphWidth >= windowSize.w) + { + buttonX = 0; + } + else + { + buttonX = (windowSize.w - glyphWidth) >> 1; + } + + nxgl_coord_t buttonY; + if (glyphHeight >= windowSize.h) + { + buttonY = 0; + } + else + { + buttonY = (windowSize.h - glyphHeight) >> 1; + } + + // Save the center position of the button for use by click and release + + m_center.x = buttonX + (glyphWidth >> 1); + m_center.y = buttonY + (glyphHeight >> 1); + + // Now we have enough information to create the button + + return new CGlyphButton(m_widgetControl, buttonX, buttonY, + glyphWidth, glyphHeight, + unClickedGlyph, clickGlyph); +} + +// Draw the button + +void CGlyphButtonTest::showButton(CGlyphButton *button) +{ + button->enable(); // Un-necessary, the widget is enabled by default + button->enableDrawing(); + button->redraw(); +} + +// Perform a simulated mouse click on the button. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CGlyphButtonTest::click(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CGlyphButtonTest::release(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll +// then check if the event was processed corredly. + +bool CGlyphButtonTest::poll(CGlyphButton *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); + + // And return the button clicked state + + return button->isClicked(); +} + diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/UnitTests/CGlyphButton/cglyphbuttontest.hxx new file mode 100644 index 000000000..889ce21ca --- /dev/null +++ b/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -0,0 +1,182 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CGLYPHBUTTON_CGLYPHBUTTONTEST_HXX +#define __UNITTESTS_CGLYPHBUTTON_CGLYPHBUTTONTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "cglyphbutton.hxx" +#include "cbitmap.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CGLYPHBUTTONTEST_BGCOLOR +# define CONFIG_CGLYPHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CGLYPHBUTTONTEST_FONTCOLOR +# define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cglyphbutton_main +# define MAIN_STRING "cglyphbutton_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +// Helper macros + +#ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CGlyphButtonTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + struct nxgl_point_s m_center; // X, Y position the center of the button + +public: + // Constructor/destructors + + CGlyphButtonTest(); + ~CGlyphButtonTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CGlyphButton instance. This method will show you how to create + // a CGlyphButton widget + + CGlyphButton *createButton(FAR const struct SBitmap *clickGlyph, + FAR const struct SBitmap *unClickedGlyph); + + // Draw the button. This method illustrates how to draw the CGlyphButton widget. + + void showButton(CGlyphButton *button); + + // Perform a simulated mouse click on the button. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(void); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(void); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll + // then check if the event was processed corredly. + + bool poll(CGlyphButton *button); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CGLYPHBUTTON_CGLYPHBUTTONTEST_HXX diff --git a/UnitTests/CGlyphButton/main.cxx b/UnitTests/CGlyphButton/main.cxx new file mode 100644 index 000000000..7812fa9e9 --- /dev/null +++ b/UnitTests/CGlyphButton/main.cxx @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphButton/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "cglyphbuttontest.hxx" +#include "glyphs.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the font test + + message(MAIN_STRING "Create CGlyphButtonTest instance\n"); + CGlyphButtonTest *test = new CGlyphButtonTest(); + updateMemoryUsage(g_mmprevious, "After creating CGlyphButtonTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CGlyphButtonTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CGlyphButtonTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "After creating a window"); + + // Create a CGlyphButton instance + + CGlyphButton *button = test->createButton(&g_arrowDown, &g_arrowUp); + if (!button) + { + message(MAIN_STRING "Failed to create a button\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "After creating the glyph button"); + + // Show the button + + message(MAIN_STRING "Show the button\n"); + test->showButton(button); + updateMemoryUsage(g_mmprevious, "After showing the glyph button"); + + // Wait two seconds, then perform a simulated mouse click on the button + + sleep(2); + message(MAIN_STRING "Click the button\n"); + test->click(); + updateMemoryUsage(g_mmprevious, "After clicking glyph button"); + + // Poll for the mouse click event (of course this can hang if something fails) + + bool clicked = test->poll(button); + message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + + // Wait a second, then release the mouse buttone + + sleep(1); + test->release(); + updateMemoryUsage(g_mmprevious, "After releasing glyph button"); + + // Poll for the mouse release event (of course this can hang if something fails) + + clicked = test->poll(button); + message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + + // Wait a few more seconds so that the tester can ponder the result + + sleep(3); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete button; + updateMemoryUsage(g_mmprevious, "After deleting the glyph button"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile new file mode 100644 index 000000000..e248761e7 --- /dev/null +++ b/UnitTests/CImage/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CImage/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cimagetest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cimage +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CImage/cimagetest.cxx b/UnitTests/CImage/cimagetest.cxx new file mode 100644 index 000000000..48814c4ce --- /dev/null +++ b/UnitTests/CImage/cimagetest.cxx @@ -0,0 +1,240 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CImage/cimagetest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "ibitmap.hxx" +#include "cbgwindow.hxx" +#include "cimagetest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CImageTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CImageTest Constructor + +CImageTest::CImageTest() +{ + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CImageTest Descriptor + +CImageTest::~CImageTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CImageTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CIMAGETEST_BGCOLOR)) + { + message("CImageTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CImageTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CImageTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CImageTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CImageTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CImage instance + +CImage *CImageTest::createImage(IBitmap *bitmap) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CImageTest::createGraphics: Failed to get window size\n"); + return (CImage *)NULL; + } + + // Get the height and width of the image + + nxgl_coord_t imageWidth = bitmap->getWidth(); + nxgl_coord_t imageHeight = (nxgl_coord_t)bitmap->getHeight(); + + // The default CImage has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. (We + // could let CImage do this for us by calling CImage::getPreferredDimensions()) + + imageWidth += 2 * 1; + imageHeight += 2 * 1; + + // Pick an X/Y position such that the image will be centered in the display + + nxgl_coord_t imageX; + if (imageWidth >= windowSize.w) + { + imageX = 0; + } + else + { + imageX = (windowSize.w - imageWidth) >> 1; + } + + nxgl_coord_t imageY; + if (imageHeight >= windowSize.h) + { + imageY = 0; + } + else + { + imageY = (windowSize.h - imageHeight) >> 1; + } + + // Now we have enough information to create the image + + return new CImage(m_widgetControl, imageX, imageY, imageWidth, imageHeight, bitmap); +} + +// Draw the image + +void CImageTest::showImage(CImage *image) +{ + image->enable(); + image->enableDrawing(); + image->redraw(); + image->disableDrawing(); +} diff --git a/UnitTests/CImage/cimagetest.hxx b/UnitTests/CImage/cimagetest.hxx new file mode 100644 index 000000000..8a8a55556 --- /dev/null +++ b/UnitTests/CImage/cimagetest.hxx @@ -0,0 +1,150 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CImage/cimagetest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CIMAGE_CIMAGETEST_HXX +#define __UNITTESTS_CIMAGE_CIMAGETEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "cimage.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CIMAGETEST_BGCOLOR +# define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cimage_main +# define MAIN_STRING "cimage_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CImageTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CImageTest(void); + ~CImageTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CImage instance. This method will show you how to create + // a CImage widget + + CImage *createImage(IBitmap *bitmap); + + // Draw the image. This method illustrates how to draw the CImage widget. + + void showImage(CImage *image); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CIMAGE_CIMAGETEST_HXX diff --git a/UnitTests/CImage/main.cxx b/UnitTests/CImage/main.cxx new file mode 100644 index 000000000..dd066b809 --- /dev/null +++ b/UnitTests/CImage/main.cxx @@ -0,0 +1,222 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CImage/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" +#include "cimagetest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static struct mallinfo g_mmInitial; +static struct mallinfo g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: showMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void showMemoryUsage(FAR struct mallinfo *mmbefore, + FAR struct mallinfo *mmafter) +{ + message("VARIABLE BEFORE AFTER\n"); + message("======== ======== ========\n"); + message("arena %8d %8d\n", mmbefore->arena, mmafter->arena); + message("ordblks %8d %8d\n", mmbefore->ordblks, mmafter->ordblks); + message("mxordblk %8d %8d\n", mmbefore->mxordblk, mmafter->mxordblk); + message("uordblks %8d %8d\n", mmbefore->uordblks, mmafter->uordblks); + message("fordblks %8d %8d\n", mmbefore->fordblks, mmafter->fordblks); +} + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(FAR struct mallinfo *previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + showMemoryUsage(previous, &mmcurrent); + + /* Set up for the next test */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + g_mmprevious = mmcurrent; +#else + memcpy(&g_mmprevious, &mmcurrent, sizeof(struct mallinfo)); +#endif +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ +#ifdef CONFIG_CAN_PASS_STRUCTS + g_mmInitial = mallinfo(); + g_mmprevious = g_mmInitial; +#else + (void)mallinfo(&g_mmInitial); + memcpy(&g_mmprevious, &g_mmInitial, sizeof(struct mallinfo)); +#endif +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the font test + + message(MAIN_STRING "Create CImageTest instance\n"); + CImageTest *test = new CImageTest(); + updateMemoryUsage(&g_mmprevious, "After creating CImageTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CImageTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CImageTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(&g_mmprevious, "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(&g_mmprevious, "After creating a window"); + + // Create an instance of the NuttX logo + + CRlePaletteBitmap *nuttxBitmap = new CRlePaletteBitmap(&g_nuttxBitmap); + updateMemoryUsage(&g_mmprevious, "After creating the bitmap"); + + // Create a CImage instance + + CImage *image = test->createImage(static_cast(nuttxBitmap)); + if (!image) + { + message(MAIN_STRING "Failed to create a image\n"); + delete test; + return 1; + } + updateMemoryUsage(&g_mmprevious, "After creating CImage"); + + // Show the image + + test->showImage(image); + updateMemoryUsage(&g_mmprevious, "After showing the image"); + sleep(5); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete image; + updateMemoryUsage(&g_mmprevious, "After deleting CImage"); + + delete nuttxBitmap; + updateMemoryUsage(&g_mmprevious, "After deleting the bitmap"); + + delete test; + updateMemoryUsage(&g_mmprevious, "After deleting the test"); + updateMemoryUsage(&g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile new file mode 100644 index 000000000..631be3b68 --- /dev/null +++ b/UnitTests/CKeypad/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CKeyPad/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx ckeypadtest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = ckeypad +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CKeypad/ckeypadtest.cxx b/UnitTests/CKeypad/ckeypadtest.cxx new file mode 100644 index 000000000..5d3eeda2a --- /dev/null +++ b/UnitTests/CKeypad/ckeypadtest.cxx @@ -0,0 +1,458 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CKeypad/ckeypadtest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "ckeypadtest.hxx" +#include "cbgwindow.hxx" +#include "cnxstring.hxx" +#include "cnxfont.hxx" +#include "crect.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CKeypadTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CKeypadTest Constructor + +CKeypadTest::CKeypadTest() +{ + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; + m_buttonWidth = 0; + m_buttonHeight = 0; + m_displayHeight = 0; +} + +// CKeypadTest Descriptor + +CKeypadTest::~CKeypadTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CKeypadTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CKEYPADTEST_BGCOLOR)) + { + message("CKeypadTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CKeypadTest::disconnect(void) +{ + // Destroy the text box + + if (m_textbox) + { + delete m_textbox; + } + + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Destroy the widget control + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CKeypadTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CKeypadTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CKeypadTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + // Then determine the display size + + setDisplaySize(); + return true; +} + +// Pick size of the display + +void CKeypadTest::setDisplaySize(void) +{ + // Get the height and width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CKeypadTest::createGraphics: Failed to get window size\n"); + return; + } + + // Pick a height and width of a button. Here we use inside information + // that the number of rows and columns in the keypad. This should not matter in + // a "real" application. + + // Lets aim for a width of 4*60 = 240 + + if (windowSize.w > KEYPAD_NCOLUMNS*60) + { + m_buttonWidth = 60; + } + else + { + // Otherwise, let's use what we have + + m_buttonWidth = windowSize.w >> 2; + } + + // Lets aim for a height of 7*32 = 224. But lets bump up the number of rows + // to allow one for the text box. + + if (windowSize.h > (KEYPAD_NROWS+1)*32) + { + m_buttonHeight = 32; + m_displayHeight = (KEYPAD_NROWS+1)*32; + } + else + { + // Otherwise, let's use what we have + + m_buttonHeight = windowSize.h >> 3; + m_displayHeight = windowSize.h; + } +} + +// Create a CKeypad instance + +CKeypad *CKeypadTest::createKeypad(void) +{ + // Get the height and width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CKeypadTest::createGraphics: Failed to get window size\n"); + return (CKeypad *)NULL; + } + + // Pick a height and width. Here we use inside information that the number + // of rows in the keypad is 7. This should not matter in a "real" application. + + nxgl_coord_t keypadWidth = KEYPAD_NCOLUMNS * m_buttonWidth; + nxgl_coord_t keypadHeight = KEYPAD_NROWS * m_buttonHeight; + + // Pick an X/Y position such that the keypad will be centered in the display + + nxgl_coord_t keypadOffset = m_displayHeight - keypadHeight; + + nxgl_coord_t keypadX = (windowSize.w - keypadWidth) >> 1; + nxgl_coord_t keypadY = keypadOffset + ((windowSize.h - m_displayHeight) >> 1); + + // Now we have enough information to create the keypad + + CKeypad *keypad = new CKeypad(m_widgetControl, getServer(), keypadX, keypadY, + keypadWidth, keypadHeight); + if (keypad) + { + // Create a text box to catch the keyboard inputs + + m_textbox = createTextBox(); + if (!m_textbox) + { + delete keypad; + keypad = (CKeypad *)NULL; + } + else + { + // Always show the cursor and wrap the cursor if it goes past the end + + m_textbox->showCursor(SHOW_CURSOR_ALWAYS); + m_textbox->wrapCursor(true); + + // Align text on the left + + m_textbox->setTextAlignmentHoriz(CTextBox::TEXT_ALIGNMENT_HORIZ_LEFT); + + // Configure the text box to receive the keyboard input + + keypad->addWidgetEventHandler(m_textbox); + } + } + + return keypad; +} + +// Create a CTextBox instance so that we can see the keypad output + +CTextBox *CKeypadTest::createTextBox(void) +{ + // Get the height and width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CKeypadTest::createGraphics: Failed to get window size\n"); + return (CTextBox *)NULL; + } + + // Pick a height and width. Here we use inside information that the number + // of rows in the keypad is 7. This should not matter in a "real" application. + + nxgl_coord_t textboxWidth = KEYPAD_NCOLUMNS * m_buttonWidth; + nxgl_coord_t textboxHeight = m_displayHeight - KEYPAD_NROWS * m_buttonHeight; + + // Pick an X/Y position such that the keypad will be centered in the display + + nxgl_coord_t textboxX = (windowSize.w - textboxWidth) >> 1; + nxgl_coord_t textboxY = (windowSize.h - m_displayHeight) >> 1; + + // Now we have enough information to create the TextBox + + return new CTextBox(m_widgetControl, textboxX, textboxY, + textboxWidth, textboxHeight, ""); +} + +// Draw the keypad + +void CKeypadTest::showKeypad(CKeypad *keypad) +{ + // Re-draw the keypad + + keypad->enable(); // Un-necessary, the widget is enabled by default + keypad->enableDrawing(); + keypad->redraw(); + + // Then redraw the text box + + m_textbox->enable(); // Un-necessary, the widget is enabled by default + m_textbox->enableDrawing(); + m_textbox->redraw(); +} + +// Perform a simulated mouse click on a button in the array. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CKeypadTest::click(CKeypad *keypad, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the selected button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = keypad->getX() + column * m_buttonWidth + (m_buttonWidth >> 1); + nxgl_coord_t buttonY = keypad->getY() + row * m_buttonHeight + (m_buttonHeight >> 1); + + // Then inject the mouse click + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CKeypadTest::release(CKeypad *keypad, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = keypad->getX() + + column * m_buttonWidth + + m_buttonWidth/2; + nxgl_coord_t buttonY = keypad->getY() + + row * m_buttonHeight + + m_buttonHeight/2; + + // Then inject the mouse release + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll +// then check if the event was processed corredly. + +void CKeypadTest::poll(CKeypad *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); + + // Limit the amount of text in the TextBox + + reverseAlignment(); +} + +// Start with left text alignment. When the text reaches the right sice +// of the text box, switch to right text alignment. + +void CKeypadTest::reverseAlignment(void) +{ + // Get the current horizontal text alignment + + CTextBox::TextAlignmentHoriz hAlign = m_textbox->getTextAlignmentHoriz(); + + // Are we still using left text alignment? + + if (hAlign == CTextBox::TEXT_ALIGNMENT_HORIZ_LEFT) + { + // Yes.. Get the string in the text box + + CNxString string = m_textbox->getText(); + + // Get the font + + CNxFont *font = m_textbox->getFont(); + + // Get the TextBox bounding box + + CRect rect; + m_textbox->getRect(rect); + + // When the length of string approaches the width of the display + // region, then switch to right text alignment + + int mxWidth = font->getMaxWidth(); + if (font->getStringWidth(string) + mxWidth >= rect.getWidth()) + { + // Switch to right text alignment + + m_textbox->setTextAlignmentHoriz(CTextBox::TEXT_ALIGNMENT_HORIZ_RIGHT); + } + } +} + diff --git a/UnitTests/CKeypad/ckeypadtest.hxx b/UnitTests/CKeypad/ckeypadtest.hxx new file mode 100644 index 000000000..820113960 --- /dev/null +++ b/UnitTests/CKeypad/ckeypadtest.hxx @@ -0,0 +1,192 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CKEYPAD_CKEYPADTEST_HXX +#define __UNITTESTS_CKEYPAD_CKEYPADTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "ctextbox.hxx" +#include "ckeypad.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CKEYPADTEST_BGCOLOR +# define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME ckeypad_main +# define MAIN_STRING "ckeypad_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +// This is the size of the keypad + +#define KEYPAD_NROWS 7 +#define KEYPAD_NCOLUMNS 4 + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CKeypadTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The widget control for the window + CBgWindow *m_bgWindow; // Background window instance + CTextBox *m_textbox; // TextBox to show the key presses + nxgl_coord_t m_buttonWidth; // The width of one button + nxgl_coord_t m_buttonHeight; // The height of one button + nxgl_coord_t m_displayHeight; // The height of the display + + // Pick size of the display + + void setDisplaySize(void); + + // Start with left text alignment. When the text reaches the right sice + // of the text box, switch to right text alignment. + + void reverseAlignment(void); + + // Create a CTextBox instance so that we can see the keypad output + + CTextBox *createTextBox(void); + +public: + + // Constructor/destructors + + CKeypadTest(); + ~CKeypadTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CKeypad instance. This method will show you how to create + // a CKeypad widget + + CKeypad *createKeypad(void); + + // Draw the keypad. This method illustrates how to draw the CKeypad widget. + + void showKeypad(CKeypad *keypad); + + // Perform a simulated mouse click on a button in the array. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(CKeypad *keypad, int column, int row); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(CKeypad *keypad, int column, int row); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll + // then check if the event was processed corredly. + + void poll(CKeypad *keypad); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CKEYPAD_CKEYPADTEST_HXX diff --git a/UnitTests/CKeypad/main.cxx b/UnitTests/CKeypad/main.cxx new file mode 100644 index 000000000..1c7679ee2 --- /dev/null +++ b/UnitTests/CKeypad/main.cxx @@ -0,0 +1,274 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CKeypad/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include + +#include + +#include "cnxstring.hxx" +#include "ckeypadtest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmPrevious; +static unsigned int g_mmPeak; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmPrevious = mmcurrent.uordblks; + if ((unsigned int)mmcurrent.uordblks > g_mmPeak) + { + g_mmPeak = mmcurrent.uordblks; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmPrevious = mmcurrent.uordblks; + g_mmPeak = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: clickButtons +///////////////////////////////////////////////////////////////////////////// + +static void clickButtons(CKeypadTest *test, CKeypad *keypad) +{ + // Perform a simulated mouse click on a button in the keypad + + for (int j = 0; j < KEYPAD_NROWS; j++) + { + for (int i = 0; i < KEYPAD_NCOLUMNS; i++) + { + printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + test->click(keypad, i, j); + + // Poll for the mouse click event + + test->poll(keypad); + + // Is anything clicked? + + int clickColumn; + int clickRow; + if (keypad->isButtonClicked(clickColumn, clickRow)) + { + printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + clickColumn == i && clickRow == j ? "OK" : "ERROR", + clickColumn, clickRow); + } + else + { + printf(MAIN_STRING "ERROR: No button is clicked\n"); + } + + // Wait a bit, then release the mouse button + + usleep(250*1000); + test->release(keypad, i, j); + + // Poll for the mouse release event (of course this can hang if something fails) + + test->poll(keypad); + if (keypad->isButtonClicked(clickColumn, clickRow)) + { + printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + clickColumn, clickRow); + } + + usleep(500*1000); + } + } + updateMemoryUsage(g_mmPrevious, "After pushing buttons"); +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the keypad test + + printf(MAIN_STRING "Create CKeypadTest instance\n"); + CKeypadTest *test = new CKeypadTest(); + updateMemoryUsage(g_mmPrevious, "After creating CKeypadTest"); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CKeypadTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CKeypadTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After connecting to the server"); + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating a window"); + + // Create a CKeypad instance + + CKeypad *keypad = test->createKeypad(); + if (!keypad) + { + printf(MAIN_STRING "Failed to create a keypad\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating CKeypad"); + + // Show the keypad in alphabetic mode + + printf(MAIN_STRING "Show the keypad in alphabetic mode\n"); + keypad->setKeypadMode(false); + test->showKeypad(keypad); + sleep(1); + + // Then click some buttons + + clickButtons(test, keypad); + sleep(1); + + // Show the keypad in numeric mode + + printf(MAIN_STRING "Show the keypad in numeric mode\n"); + keypad->setKeypadMode(true); + sleep(1); + + // Then click some buttons + + clickButtons(test, keypad); + sleep(1); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete keypad; + updateMemoryUsage(g_mmPrevious, "After deleting the keypad"); + delete test; + updateMemoryUsage(g_mmPrevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + return 0; +} + diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile new file mode 100644 index 000000000..163d04175 --- /dev/null +++ b/UnitTests/CLabel/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CLabel/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx clabeltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = clabel +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CLabel/clabeltest.cxx b/UnitTests/CLabel/clabeltest.cxx new file mode 100644 index 000000000..ef78cc3ce --- /dev/null +++ b/UnitTests/CLabel/clabeltest.cxx @@ -0,0 +1,263 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLabel/clabeltest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "clabeltest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CLabelTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CLabelTest Constructor + +CLabelTest::CLabelTest() +{ + m_bgWindow = (CBgWindow *)NULL; + m_nxFont = (CNxFont *)NULL; + m_text = (CNxString *)NULL; +} + +// CLabelTest Descriptor + +CLabelTest::~CLabelTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CLabelTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Create the default font instance + + m_nxFont = new CNxFont(NXFONT_DEFAULT, + CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + if (!m_nxFont) + { + printf("CLabelTest::connect: Failed to create the default font\n"); + } + + // Set the background color + + if (!setBackgroundColor(CONFIG_CLABELTEST_BGCOLOR)) + { + printf("CLabelTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CLabelTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the display string + + if (m_text) + { + delete m_text; + m_text = (CNxString *)NULL; + } + + // Free the default font + + if (m_nxFont) + { + delete m_nxFont; + m_nxFont = (CNxFont *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CLabelTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + printf("CLabelTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + printf("CLabelTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CLabel instance + +CLabel *CLabelTest::createLabel(FAR const char *text) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CLabelTest::createGraphics: Failed to get window size\n"); + return (CLabel *)NULL; + } + + // Create a CNxString instance to contain the C string + + m_text = new CNxString(text); + + // Get the height and width of the text display area + + nxgl_coord_t stringWidth = m_nxFont->getStringWidth(*m_text); + nxgl_coord_t stringHeight = (nxgl_coord_t)m_nxFont->getHeight(); + + // The default CLabel has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. (We + // could let CLabel do this for us by calling CLabel::getPreferredDimensions()) + + stringWidth += 2 * 1; + stringHeight += 2 * 1; + + // Pick an X/Y position such that the label will be centered in the display + + nxgl_coord_t labelX; + if (stringWidth >= windowSize.w) + { + labelX = 0; + } + else + { + labelX = (windowSize.w - stringWidth) >> 1; + } + + nxgl_coord_t labelY; + if (stringHeight >= windowSize.h) + { + labelY = 0; + } + else + { + labelY = (windowSize.h - stringHeight) >> 1; + } + + // Now we have enough information to create the label + + return new CLabel(m_widgetControl, labelX, labelY, stringWidth, stringHeight, *m_text); +} + +// Draw the label + +void CLabelTest::showLabel(CLabel *label) +{ + label->enable(); + label->enableDrawing(); + label->redraw(); + label->disableDrawing(); +} diff --git a/UnitTests/CLabel/clabeltest.hxx b/UnitTests/CLabel/clabeltest.hxx new file mode 100644 index 000000000..2d404b2df --- /dev/null +++ b/UnitTests/CLabel/clabeltest.hxx @@ -0,0 +1,148 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLabel/clabeltest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CLABEL_CLABELTEST_HXX +#define __UNITTESTS_CLABEL_CLABELTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "clabel.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CLABELTEST_BGCOLOR +# define CONFIG_CLABELTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CLABELTEST_FONTCOLOR +# define CONFIG_CLABELTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME clabel_main +# define MAIN_STRING "clabel_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CLabelTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CNxFont *m_nxFont; // Default font + CBgWindow *m_bgWindow; // Background window instance + CNxString *m_text; // The label string + +public: + // Constructor/destructors + + CLabelTest(); + ~CLabelTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CLabel instance. This method will show you how to create + // a CLabel widget + + CLabel *createLabel(FAR const char *text); + + // Draw the label. This method illustrates how to draw the CLabel widget. + + void showLabel(CLabel *label); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CLABEL_CLABELTEST_HXX diff --git a/UnitTests/CLabel/main.cxx b/UnitTests/CLabel/main.cxx new file mode 100644 index 000000000..953e6afbc --- /dev/null +++ b/UnitTests/CLabel/main.cxx @@ -0,0 +1,130 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLabel/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "clabeltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static const char g_hello[] = "Hello, World!"; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Create an instance of the font test + + printf(MAIN_STRING "Create CLabelTest instance\n"); + CLabelTest *test = new CLabelTest(); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CLabelTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CLabelTest instance to the NX server\n"); + delete test; + return 1; + } + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + + // Create a CLabel instance + + CLabel *label = test->createLabel(g_hello); + if (!label) + { + printf(MAIN_STRING "Failed to create a label\n"); + delete test; + return 1; + } + + // Show the label + + test->showLabel(label); + sleep(5); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete label; + delete test; + return 0; +} + diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile new file mode 100644 index 000000000..ea6e7d662 --- /dev/null +++ b/UnitTests/CLatchButton/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CLatchButton/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx clatchbuttontest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = clatchbutton +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CLatchButton/clatchbuttontest.cxx b/UnitTests/CLatchButton/clatchbuttontest.cxx new file mode 100644 index 000000000..2b41eca63 --- /dev/null +++ b/UnitTests/CLatchButton/clatchbuttontest.cxx @@ -0,0 +1,321 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButton/clatchbuttontest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "clatchbuttontest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CLatchButtonTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CLatchButtonTest Constructor + +CLatchButtonTest::CLatchButtonTest() +{ + m_bgWindow = (CBgWindow *)NULL; + m_nxFont = (CNxFont *)NULL; + m_text = (CNxString *)NULL; +} + +// CLatchButtonTest Descriptor + +CLatchButtonTest::~CLatchButtonTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CLatchButtonTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Create the default font instance + + m_nxFont = new CNxFont(NXFONT_DEFAULT, + CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + if (!m_nxFont) + { + printf("CLatchButtonTest::connect: Failed to create the default font\n"); + } + + // Set the background color + + if (!setBackgroundColor(CONFIG_CLATCHBUTTONTEST_BGCOLOR)) + { + printf("CLatchButtonTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CLatchButtonTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the display string + + if (m_text) + { + delete m_text; + m_text = (CNxString *)NULL; + } + + // Free the default font + + if (m_nxFont) + { + delete m_nxFont; + m_nxFont = (CNxFont *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CLatchButtonTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + printf("CLatchButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + printf("CLatchButtonTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CLatchButton instance + +CLatchButton *CLatchButtonTest::createButton(FAR const char *text) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CLatchButtonTest::createGraphics: Failed to get window size\n"); + return (CLatchButton *)NULL; + } + + // Create a CNxString instance to contain the C string + + m_text = new CNxString(text); + + // Get the height and width of the text display area + + nxgl_coord_t stringWidth = m_nxFont->getStringWidth(*m_text); + nxgl_coord_t stringHeight = (nxgl_coord_t)m_nxFont->getHeight(); + + // The default CLatchButton has borders enabled with thickness of the border + // width. Add twice the thickness of border the to the width and height. (We + // could let CLatchButton do this for us by calling + // CLatchButton::getPreferredDimensions()) + + stringWidth += 2 * 1; + stringHeight += 2 * 1; + + // Pick an X/Y position such that the button will be centered in the display + + nxgl_coord_t buttonX; + if (stringWidth >= windowSize.w) + { + buttonX = 0; + } + else + { + buttonX = (windowSize.w - stringWidth) >> 1; + } + + nxgl_coord_t buttonY; + if (stringHeight >= windowSize.h) + { + buttonY = 0; + } + else + { + buttonY = (windowSize.h - stringHeight) >> 1; + } + + // Save the center position of the button for use by click and release + + m_center.x = buttonX + (stringWidth >> 1); + m_center.y = buttonY + (stringHeight >> 1); + + // Now we have enough information to create the button + + return new CLatchButton(m_widgetControl, buttonX, buttonY, stringWidth, stringHeight, *m_text); +} + +// Draw the button + +void CLatchButtonTest::showButton(CLatchButton *button) +{ + button->enable(); // Un-necessary, the widget is enabled by default + button->enableDrawing(); + button->redraw(); +} + +// Perform a simulated mouse click on the button. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CLatchButtonTest::click(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CLatchButtonTest::release(void) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll. + +void CLatchButtonTest::poll(CLatchButton *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); +} + diff --git a/UnitTests/CLatchButton/clatchbuttontest.hxx b/UnitTests/CLatchButton/clatchbuttontest.hxx new file mode 100644 index 000000000..22ded3d77 --- /dev/null +++ b/UnitTests/CLatchButton/clatchbuttontest.hxx @@ -0,0 +1,165 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CLATCHBUTTON_CLATCHBUTTONTEST_HXX +#define __UNITTESTS_CLATCHBUTTON_CLATCHBUTTONTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "clatchbutton.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CLATCHBUTTONTEST_BGCOLOR +# define CONFIG_CLATCHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CLATCHBUTTONTEST_FONTCOLOR +# define CONFIG_CLATCHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME clatchbutton_main +# define MAIN_STRING "clatchbutton_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CLatchButtonTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CNxFont *m_nxFont; // Default font + CBgWindow *m_bgWindow; // Background window instance + CNxString *m_text; // The button string + struct nxgl_point_s m_center; // X, Y position the center of the button + +public: + // Constructor/destructors + + CLatchButtonTest(void); + ~CLatchButtonTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CLatchButton instance. This method will show you how to create + // a CLatchButton widget + + CLatchButton *createButton(FAR const char *text); + + // Draw the button. This method illustrates how to draw the CLatchButton widget. + + void showButton(CLatchButton *button); + + // Perform a simulated mouse click on the button. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(void); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(void); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll. + + void poll(CLatchButton *button); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CLATCHBUTTON_CLATCHBUTTONTEST_HXX diff --git a/UnitTests/CLatchButton/main.cxx b/UnitTests/CLatchButton/main.cxx new file mode 100644 index 000000000..d51f613c1 --- /dev/null +++ b/UnitTests/CLatchButton/main.cxx @@ -0,0 +1,199 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButton/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "clatchbuttontest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static const char g_pushme[] = "Push Me"; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: showButtonState +///////////////////////////////////////////////////////////////////////////// + +static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) +{ + bool nowClicked = button->isClicked(); + bool nowLatched = button->isLatched(); + + printf(MAIN_STRING "Button state: %s and %s\n", + nowClicked ? "clicked" : "released", + nowLatched ? "latched" : "unlatched"); + + if (clicked != nowClicked || latched != nowLatched) + { + printf(MAIN_STRING "ERROR: Expected %s and %s\n", + clicked ? "clicked" : "released", + latched ? "latched" : "unlatched"); + + clicked = nowClicked; + latched = nowLatched; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Create an instance of the font test + + printf(MAIN_STRING "Create CLatchButtonTest instance\n"); + CLatchButtonTest *test = new CLatchButtonTest(); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CLatchButtonTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CLatchButtonTest instance to the NX server\n"); + delete test; + return 1; + } + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + + // Create a CLatchButton instance + + CLatchButton *button = test->createButton(g_pushme); + if (!button) + { + printf(MAIN_STRING "Failed to create a button\n"); + delete test; + return 1; + } + + // Show the button + + printf(MAIN_STRING "Show the button\n"); + test->showButton(button); + + bool clicked = false; + bool latched = false; + showButtonState(button, clicked, latched); + + // Toggle the button state a few times + + for (int i = 0; i < 8; i++) + { + // Wait two seconds, then perform a simulated mouse click on the button + + sleep(2); + printf(MAIN_STRING "Click the button\n"); + test->click(); + test->poll(button); + + // Test the button state it should be clicked with the latch state + // toggled + + clicked = true; + latched = !latched; + showButtonState(button, clicked, latched); + + // And release the button after 0.5 seconds + + usleep(500 * 1000); + printf(MAIN_STRING "Release the button\n"); + test->release(); + test->poll(button); + + // Test the button state it should be unclicked with the latch state + // unchanged + + clicked = false; + showButtonState(button, clicked, latched); + fflush(stdout); + } + + // Wait a few more seconds so that the tester can ponder the result + + sleep(3); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete button; + delete test; + return 0; +} + diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile new file mode 100644 index 000000000..faa9d8fd9 --- /dev/null +++ b/UnitTests/CLatchButtonArray/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CLatchButtonArray/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx clatchbuttonarraytest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = clatchbuttonarray +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx new file mode 100644 index 000000000..5b1737e06 --- /dev/null +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx @@ -0,0 +1,301 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "clatchbuttonarraytest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CLatchButtonArrayTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CLatchButtonArrayTest Constructor + +CLatchButtonArrayTest::CLatchButtonArrayTest() +{ + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CLatchButtonArrayTest Descriptor + +CLatchButtonArrayTest::~CLatchButtonArrayTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CLatchButtonArrayTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR)) + { + message("CLatchButtonArrayTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CLatchButtonArrayTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Destroy the widget control + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CLatchButtonArrayTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CLatchButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CLatchButtonArrayTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CLatchButtonArray instance + +CLatchButtonArray *CLatchButtonArrayTest::createButtonArray(void) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CLatchButtonArrayTest::createGraphics: Failed to get window size\n"); + return (CLatchButtonArray *)NULL; + } + + // Pick an X/Y position such that the button array will be centered in the display + + nxgl_coord_t buttonArrayX; + if (BUTTONARRAY_WIDTH >= windowSize.w) + { + buttonArrayX = 0; + } + else + { + buttonArrayX = (windowSize.w - BUTTONARRAY_WIDTH) >> 1; + } + + nxgl_coord_t buttonArrayY; + if (BUTTONARRAY_HEIGHT >= windowSize.h) + { + buttonArrayY = 0; + } + else + { + buttonArrayY = (windowSize.h - BUTTONARRAY_HEIGHT) >> 1; + } + + // Now we have enough information to create the button array + + return new CLatchButtonArray(m_widgetControl, + buttonArrayX, buttonArrayY, + BUTTONARRAY_NCOLUMNS, BUTTONARRAY_NROWS, + BUTTONARRAY_BUTTONWIDTH, BUTTONARRAY_BUTTONHEIGHT); +} + +// Draw the button array + +void CLatchButtonArrayTest::showButton(CLatchButtonArray *buttonArray) +{ + buttonArray->enable(); // Un-necessary, the widget is enabled by default + buttonArray->enableDrawing(); + buttonArray->redraw(); +} + +// Perform a simulated mouse click on a button in the array. This method injects +// the mouse click through the NX heirarchy just as would real mouse +// hardward. + +void CLatchButtonArrayTest::click(CLatchButtonArray *buttonArray, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the selected button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = buttonArray->getX() + + column * BUTTONARRAY_BUTTONWIDTH + + BUTTONARRAY_BUTTONWIDTH/2; + nxgl_coord_t buttonY = buttonArray->getY() + + row * BUTTONARRAY_BUTTONHEIGHT + + BUTTONARRAY_BUTTONHEIGHT/2; + + // Then inject the mouse click + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_LEFTBUTTON); +} + +// The counterpart to click. This simulates a button release through +// the same mechanism. + +void CLatchButtonArrayTest::release(CLatchButtonArray *buttonArray, int column, int row) +{ + // nx_mousein is meant to be called by mouse handling software. + // Here we just inject a left-button click directly in the center of + // the button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // The the coorinates of the center of the button + + nxgl_coord_t buttonX = buttonArray->getX() + + column * BUTTONARRAY_BUTTONWIDTH + + BUTTONARRAY_BUTTONWIDTH/2; + nxgl_coord_t buttonY = buttonArray->getY() + + row * BUTTONARRAY_BUTTONHEIGHT + + BUTTONARRAY_BUTTONHEIGHT/2; + + // Then inject the mouse release + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); +} + +// Widget events are normally handled in a modal loop (by calling goModal()). +// However, for this case we know when there should be press and release +// events so we don't have to poll. We can just perform a one pass poll +// then check if the event was processed corredly. + +void CLatchButtonArrayTest::poll(CLatchButtonArray *button) +{ + // Poll for mouse events + + m_widgetControl->pollEvents(button); +} + diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx new file mode 100644 index 000000000..89ed242e7 --- /dev/null +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -0,0 +1,182 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CLATCHBUTTONARRAY_CLATCHBUTTONARRAYTEST_HXX +#define __UNITTESTS_CLATCHBUTTONARRAY_CLATCHBUTTONARRAYTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "clatchbuttonarray.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR +# define CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR +# define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME clatchbuttonarray_main +# define MAIN_STRING "clatchbuttonarray_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +// The geometry of the button array + +#define BUTTONARRAY_NCOLUMNS 4 +#define BUTTONARRAY_NROWS 7 +#define BUTTONARRAY_BUTTONWIDTH 60 +#define BUTTONARRAY_BUTTONHEIGHT 32 +#define BUTTONARRAY_WIDTH (BUTTONARRAY_BUTTONWIDTH * BUTTONARRAY_NCOLUMNS) +#define BUTTONARRAY_HEIGHT (BUTTONARRAY_BUTTONHEIGHT * BUTTONARRAY_NROWS) + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CLatchButtonArrayTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The widget control for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CLatchButtonArrayTest(); + ~CLatchButtonArrayTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CLatchButtonArray instance. This method will show you how to create + // a CLatchButtonArray widget + + CLatchButtonArray *createButtonArray(void); + + // Draw the button array. This method illustrates how to draw the CLatchButtonArray widget. + + void showButton(CLatchButtonArray *buttonArray); + + // Perform a simulated mouse click on a button in the array. This method injects + // the mouse click through the NX heirarchy just as would real mouse + // hardward. + + void click(CLatchButtonArray *buttonArray, int column, int row); + + // The counterpart to click. This simulates a button release through + // the same mechanism. + + void release(CLatchButtonArray *buttonArray, int column, int row); + + // Widget events are normally handled in a model loop (by calling goModel()). + // However, for this case we know when there should be press and release + // events so we don't have to poll. We can just perform a one pass poll + // then check if the event was processed corredly. + + void poll(CLatchButtonArray *buttonArray); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CLATCHBUTTONARRAY_CLATCHBUTTONARRAYTEST_HXX diff --git a/UnitTests/CLatchButtonArray/main.cxx b/UnitTests/CLatchButtonArray/main.cxx new file mode 100644 index 000000000..d38651ae9 --- /dev/null +++ b/UnitTests/CLatchButtonArray/main.cxx @@ -0,0 +1,301 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CLatchButtonArray/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include + +#include + +#include "cnxstring.hxx" +#include "clatchbuttonarraytest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmPrevious; +static unsigned int g_mmPeak; + +static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { + "=>", "A", "B", "isThisButtonClicked(i,j); + bool nowLatched = buttonArray->isThisButtonLatched(i,j); + + printf(MAIN_STRING "Button(%d,%d) state: %s and %s\n", + i, j, + nowClicked ? "clicked" : "released", + nowLatched ? "latched" : "unlatched"); + + if (clicked != nowClicked || latched != nowLatched) + { + printf(MAIN_STRING "ERROR: Expected %s and %s\n", + clicked ? "clicked" : "released", + latched ? "latched" : "unlatched"); + + clicked = nowClicked; + latched = nowLatched; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmPrevious = mmcurrent.uordblks; + if ((unsigned int)mmcurrent.uordblks > g_mmPeak) + { + g_mmPeak = mmcurrent.uordblks; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmPrevious = mmcurrent.uordblks; + g_mmPeak = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the button array test + + printf(MAIN_STRING "Create CLatchButtonArrayTest instance\n"); + CLatchButtonArrayTest *test = new CLatchButtonArrayTest(); + updateMemoryUsage(g_mmPrevious, "After creating CLatchButtonArrayTest"); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CLatchButtonArrayTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CLatchButtonArrayTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After connecting to the server"); + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating a window"); + + // Create a CLatchButtonArray instance + + CLatchButtonArray *buttonArray = test->createButtonArray(); + if (!buttonArray) + { + printf(MAIN_STRING "Failed to create a button array\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, "After creating CLatchButtonArray"); + + // Add the labels to each button + + FAR const char **ptr = g_buttonLabels; + for (int j = 0; j < BUTTONARRAY_NROWS; j++) + { + for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) + { + printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + CNxString string = *ptr++; + buttonArray->setText(i, j, string); + } + } + updateMemoryUsage(g_mmPrevious, "After adding labels to the buttons"); + + // Show the button array + + printf(MAIN_STRING "Show the button array\n"); + test->showButton(buttonArray); + sleep(1); + + // Then perform a simulated mouse click on a button in the array + + bool clicked = false; + bool latched = false; + + for (int j = 0; j < BUTTONARRAY_NROWS; j++) + { + for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) + { + // Initially, this button should be neither clicked nor latched + + clicked = false; + latched = false; + showButtonState(buttonArray, i, j, clicked, latched); + + printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + test->click(buttonArray, i, j); + + // Poll for the mouse click event + + test->poll(buttonArray); + + // Now it should be clicked and latched + + clicked = true; + latched = true; + showButtonState(buttonArray, i, j, clicked, latched); + + // Wait a bit, then release the mouse button + + usleep(200*1000); + test->release(buttonArray, i, j); + + // Poll for the mouse release event (of course this can hang if something fails) + + test->poll(buttonArray); + + // Now it should be un-clicked and latched + + clicked = false; + latched = true; + showButtonState(buttonArray, i, j, clicked, latched); + + usleep(300*1000); + } + } + updateMemoryUsage(g_mmPrevious, "After pushing buttons"); + + // Clean up and exit + + printf(MAIN_STRING "Clean-up and exit\n"); + delete buttonArray; + updateMemoryUsage(g_mmPrevious, "After deleting the button array"); + delete test; + updateMemoryUsage(g_mmPrevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + return 0; +} + diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile new file mode 100644 index 000000000..9f3d5721d --- /dev/null +++ b/UnitTests/CListBox/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CListBox/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx clistboxtest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = clistbox +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CListBox/clistboxtest.cxx b/UnitTests/CListBox/clistboxtest.cxx new file mode 100644 index 000000000..cd41dacc7 --- /dev/null +++ b/UnitTests/CListBox/clistboxtest.cxx @@ -0,0 +1,224 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CListBox/clistboxtest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "clistboxtest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CListBoxTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CListBoxTest Constructor + +CListBoxTest::CListBoxTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CListBoxTest Descriptor + +CListBoxTest::~CListBoxTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CListBoxTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CLISTBOXTEST_BGCOLOR)) + { + message("CListBoxTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CListBoxTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CListBoxTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CListBoxTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CListBoxTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a listbox in the center of the window + +CListBox *CListBoxTest::createListBox(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CListBoxTest::createListBox: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the listbox in the center of the display + + nxgl_coord_t listboxWidth = windowSize.w >> 1; + nxgl_coord_t listboxX = windowSize.w >> 2; + + nxgl_coord_t listboxHeight = windowSize.h >> 1; + nxgl_coord_t listboxY = windowSize.h >> 2; + + // Create the listbox + + CListBox *listbox = new CListBox(m_widgetControl, + listboxX, listboxY, + listboxWidth, listboxHeight); + if (!listbox) + { + printf("CListBoxTest::createListBox: Failed to create CListBox\n"); + disconnect(); + } + return listbox; +} + +// (Re-)draw the listbox. + +void CListBoxTest::showListBox(CListBox *listbox) +{ + listbox->enable(); // Un-necessary, the widget is enabled by default + listbox->enableDrawing(); + listbox->redraw(); +} diff --git a/UnitTests/CListBox/clistboxtest.hxx b/UnitTests/CListBox/clistboxtest.hxx new file mode 100644 index 000000000..5cc356849 --- /dev/null +++ b/UnitTests/CListBox/clistboxtest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CListBox/clistboxtest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CLISTBOX_CLISTBOXTEST_HXX +#define __UNITTESTS_CLISTBOX_CLISTBOXTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "clistbox.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CLISTBOXTEST_BGCOLOR +# define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME clistbox_main +# define MAIN_STRING "clistbox_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CListBoxTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CListBoxTest(void); + ~CListBoxTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a listbox in the center of the window + + CListBox *createListBox(void); + + // (Re-)draw the listbox. + + void showListBox(CListBox *listbox); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CLISTBOX_CLISTBOXTEST_HXX diff --git a/UnitTests/CListBox/main.cxx b/UnitTests/CListBox/main.cxx new file mode 100644 index 000000000..5783e255d --- /dev/null +++ b/UnitTests/CListBox/main.cxx @@ -0,0 +1,327 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CListBox/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "clistboxtest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmPrevious; +static unsigned int g_mmPeak; + +static FAR const char *g_options[] = +{ + "American groundnut (Apios americana)", + "Azuki bean (Vigna angularis)", + "Black-eyed pea (Vigna unguiculata subsp. unguiculata)", + "Chickpea (Cicer arietinum)", + "Common bean (Phaseolus vulgaris)", + "Drumstick (Moringa oleifera)", + "Dolichos bean (Lablab purpureus)", + "Fava bean (Vicia faba)", + "Garbanzo (Cicer arietinum)", + "Green bean (Phaseolus vulgaris)", + "Guar (Cyamopsis tetragonoloba)", + "Gumbo (Abelmoschus esculentus)", + "Horse gram (Macrotyloma uniflorum)", + "Indian pea (Lathyrus sativus)", + "Lentil (Lens culinaris)", + "Lima Bean (Phaseolus lunatus)", + "Moth bean (Vigna acontifolia)", + "Mung bean (Vigna radiata)", + "Okra (Abelmoschus esculentus)", + "Pea (Pisum sativum)", + "Peanut (Arachis hypogaea)", + "Pigeon pea (Cajanus cajan)", + "Ricebean (Vigna umbellata)", + "Runner bean (Phaseolus coccineus)", + "Soybean (Glycine max)", + "Tarwi (tarhui, chocho; Lupinus mutabilis)", + "Tepary bean (Phaseolus acutifolius)", + "Urad bean (Vigna mungo)", + "Velvet bean (Mucuna pruriens)", + "Winged bean (Psophocarpus tetragonolobus)", + "Yardlong bean (Vigna unguiculata subsp. sesquipedalis)" +}; +#define NOPTIONS (sizeof(g_options)/sizeof(FAR const char *)) + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmPrevious = mmcurrent.uordblks; + if ((unsigned int)mmcurrent.uordblks > g_mmPeak) + { + g_mmPeak = mmcurrent.uordblks; + } +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmPrevious = mmcurrent.uordblks; + g_mmPeak = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the listbox test + + message(MAIN_STRING "Create CListBoxTest instance\n"); + CListBoxTest *test = new CListBoxTest(); + updateMemoryUsage(g_mmPrevious, "After creating CListBoxTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CListBoxTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CListBoxTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a window"); + + // Create a listbox + + message(MAIN_STRING "Create a ListBox\n"); + CListBox *listbox = test->createListBox(); + if (!listbox) + { + message(MAIN_STRING "Failed to create a listbox\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a listbox"); + + // Show the initial state of the listbox + + listbox->setAllowMultipleSelections(true); + test->showListBox(listbox); + sleep(1); + + // Now add items to the list box (in reverse alphabetical order) + + message(MAIN_STRING "Add options to the ListBox\n"); + for (int i = NOPTIONS - 1; i >= 0; i--) + { + listbox->addOption(g_options[i],i); + test->showListBox(listbox); + message(MAIN_STRING "%d. New option %s\n", i, g_options[i]); + usleep(500000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After adding the listbox items"); + sleep(1); + + // Sort the list box + + message(MAIN_STRING "Sort the ListBox\n"); + listbox->sort(); + test->showListBox(listbox); + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After sorting the listbox"); + sleep(1); + + // Select and remove items from the listbox + + srand(1978); + int nOptions; + while ((nOptions = listbox->getOptionCount()) > 0) + { + message(MAIN_STRING "Option count: %d\n", nOptions); + if (nOptions <= 5) + { + message(MAIN_STRING "Selecting all remaining options\n"); + listbox->selectAllOptions(); + test->showListBox(listbox); + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting all options"); + sleep(1); + + message(MAIN_STRING "Removing all remaining options\n"); + listbox->removeAllOptions(); + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing all options"); + test->showListBox(listbox); + } + else + { + int selected[5]; + + message(MAIN_STRING "Selecting five options\n"); + for (int i = 0; i < 5; i++) + { + selected[i] = ((nOptions - 1) * rand()) / MAX_RAND; + message(MAIN_STRING "Selecting option %d\n", selected[i]); + listbox->removeOption(selected[i]); + test->showListBox(listbox); + usleep(500000); + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting five options"); + + message(MAIN_STRING "De-selecting options\n"); + int index; + int count = 0; + while ((index = listbox->getSelectedIndex()) >= 0) + { + message(MAIN_STRING "De-selecting option %d\n", index); + listbox->deselectOption(index); + test->showListBox(listbox); + count++; + usleep(500000); + } + + message(MAIN_STRING "%s: %d options de-selected\n", + count == 5 ? "OK" : "ERROR", count); + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After de-selecting options"); + + message(MAIN_STRING "Removing the selected options\n"); + for (int i = 0; i < 5; i++) + { + message(MAIN_STRING "Removing option %d\n", selected[i]); + listbox->removeOption(selected[i]); + test->showListBox(listbox); + usleep(500000); + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing five options"); + } + sleep(1); + } + updateMemoryUsage(g_mmPrevious, MAIN_STRING "After the listbox is empty again"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete listbox; + updateMemoryUsage(g_mmPrevious, "After deleting the listbox"); + delete test; + updateMemoryUsage(g_mmPrevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + return 0; +} + diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile new file mode 100644 index 000000000..53d66fefa --- /dev/null +++ b/UnitTests/CProgressBar/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CProgressBar/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cprogressbartest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cprogressbar +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CProgressBar/cprogressbartest.cxx b/UnitTests/CProgressBar/cprogressbartest.cxx new file mode 100644 index 000000000..60821d751 --- /dev/null +++ b/UnitTests/CProgressBar/cprogressbartest.cxx @@ -0,0 +1,224 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/ProgressBar/cprogressbartest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "cprogressbartest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CProgressBarTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CProgressBarTest Constructor + +CProgressBarTest::CProgressBarTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CProgressBarTest Descriptor + +CProgressBarTest::~CProgressBarTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CProgressBarTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CPROGRESSBARTEST_BGCOLOR)) + { + message("CProgressBarTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CProgressBarTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CProgressBarTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CProgressBarTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CProgressBarTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a bar in the center of the window + +CProgressBar *CProgressBarTest::createProgressBar(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CProgressBarTest::createProgressBar: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the bar in the center of the display + + nxgl_coord_t barWidth = windowSize.w >> 1; + nxgl_coord_t barX = windowSize.w >> 2; + + nxgl_coord_t barHeight = 16; + nxgl_coord_t barY = (windowSize.h - barHeight) >> 1; + + // Create the bar + + CProgressBar *bar = new CProgressBar(m_widgetControl, + barX, barY, + barWidth, barHeight); + if (!bar) + { + printf("CProgressBarTest::createProgressBar: Failed to create CProgressBar\n"); + disconnect(); + } + return bar; +} + +// (Re-)draw the bar. + +void CProgressBarTest::showProgressBar(CProgressBar *bar) +{ + bar->enable(); // Un-necessary, the widget is enabled by default + bar->enableDrawing(); + bar->redraw(); +} diff --git a/UnitTests/CProgressBar/cprogressbartest.hxx b/UnitTests/CProgressBar/cprogressbartest.hxx new file mode 100644 index 000000000..f5058a0c4 --- /dev/null +++ b/UnitTests/CProgressBar/cprogressbartest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CPROGRESSBAR_CPROGRESSBARTEST_HXX +#define __UNITTESTS_CPROGRESSBAR_CPROGRESSBARTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cprogressbar.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CPROGRESSBARTEST_BGCOLOR +# define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cprogressbar_main +# define MAIN_STRING "cprogressbar_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CProgressBarTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CProgressBarTest(void); + ~CProgressBarTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a progress bar in the center of the window + + CProgressBar *createProgressBar(void); + + // (Re-)draw the progress bar. + + void showProgressBar(CProgressBar *bar); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CPROGRESSBAR_CPROGRESSBARTEST_HXX diff --git a/UnitTests/CProgressBar/main.cxx b/UnitTests/CProgressBar/main.cxx new file mode 100644 index 000000000..525c509d3 --- /dev/null +++ b/UnitTests/CProgressBar/main.cxx @@ -0,0 +1,238 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CProgressBar/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "cprogressbartest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_PROGRESSBAR 50 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CProgressBarTest instance\n"); + CProgressBarTest *test = new CProgressBarTest(); + updateMemoryUsage(g_mmprevious, "After creating CProgressBarTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CProgressBarTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CProgressBarTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create a progress bar + + message(MAIN_STRING "Create a ProgressBar\n"); + CProgressBar *bar = test->createProgressBar(); + if (!bar) + { + message(MAIN_STRING "Failed to create a progress bar\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a progress bar"); + + // Set the progress bar minimum and maximum values + + bar->setMinimumValue(0); + bar->setMaximumValue(MAX_PROGRESSBAR); + bar->setValue(0); + bar->hidePercentageText(); + message(MAIN_STRING "ProgressBar range %d->%d Initial value %d\n", + bar->getMinimumValue(), bar->getMaximumValue(), + bar->getValue()); + + // Show the initial state of the checkbox + + test->showProgressBar(bar); + sleep(1); + + // Now move the progress bar up from 0 to 100% (with percentages off) + + for (int i = 0; i <= MAX_PROGRESSBAR; i++) + { + bar->setValue(i); + test->showProgressBar(bar); + message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #1"); + usleep(500*1000); + + // Now move the progress bar up from 0 to 100% (with percentages off) + + bar->showPercentageText(); + bar->setValue(0); + test->showProgressBar(bar); + usleep(500*1000); + + for (int i = 0; i <= MAX_PROGRESSBAR; i++) + { + bar->setValue(i); + test->showProgressBar(bar); + message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #2"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete bar; + updateMemoryUsage(g_mmprevious, "After deleting the progress bar"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile new file mode 100644 index 000000000..0b4906dd8 --- /dev/null +++ b/UnitTests/CRadioButton/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CRadioButton/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cradiobuttontest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cradiobutton +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CRadioButton/cradiobuttontest.cxx b/UnitTests/CRadioButton/cradiobuttontest.cxx new file mode 100644 index 000000000..f97089ce7 --- /dev/null +++ b/UnitTests/CRadioButton/cradiobuttontest.cxx @@ -0,0 +1,305 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CRadioButton/cradiobuttontest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "cradiobuttontest.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CRadioButtonTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CRadioButtonTest Constructor + +CRadioButtonTest::CRadioButtonTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; + + // Peek at the radio button glyph to get a good estimate of the size + + m_size.w = g_radioButtonOn.width; + m_size.h = g_radioButtonOn.height; +} + +// CRadioButtonTest Descriptor + +CRadioButtonTest::~CRadioButtonTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CRadioButtonTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CRADIOBUTTONTEST_BGCOLOR)) + { + message("CRadioButtonTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CRadioButtonTest::disconnect(void) +{ + // Free the radiobutton group + + if (m_radioButtonGroup) + { + delete m_radioButtonGroup; + m_radioButtonGroup = (CRadioButtonGroup *)NULL; + } + + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CRadioButtonTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CRadioButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CRadioButtonTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CRadioButton instance + +CRadioButton *CRadioButtonTest::newRadioButton(void) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + message("CRadioButtonTest::newRadioButton: Failed to get window size\n"); + return (CRadioButton *)NULL; + } + + // Create the radio button group, if we have not already done so + + if (!m_radioButtonGroup) + { + // Start the radio button group in the center of the upper, left + // quadrant. The initial size is 0,0 and the default style is used. + + nxgl_coord_t groupX = windowSize.w >> 2; + nxgl_coord_t groupY = windowSize.h >> 2; + + m_radioButtonGroup = new CRadioButtonGroup(m_widgetControl, groupX, groupY); + if (!m_radioButtonGroup) + { + message("CRadioButtonTest::newRadioButton: Failed to create the radio button group\n"); + return (CRadioButton *)NULL; + } + } + + // Create the new radio button at the botton of the radio button group and + // with the size of the ON radio button glyph (they all need to be the same + // size!). Note that coordinates are relative to the parent bounding box. + + nxgl_coord_t buttonX = 0; + nxgl_coord_t buttonY = m_radioButtonGroup->getHeight(); + + return m_radioButtonGroup->newRadioButton(buttonX, buttonY, m_size.w, m_size.h); +} + +// (Re-)draw the buttons. + +void CRadioButtonTest::showButtons(void) +{ + m_radioButtonGroup->enable(); // Un-necessary, the widget is enabled by default + m_radioButtonGroup->enableDrawing(); + m_radioButtonGroup->redraw(); +} + +// Push the radio button + +void CRadioButtonTest::pushButton(CRadioButton *button) +{ + // Get the button center coordinates + + nxgl_coord_t buttonX = button->getX() + (button->getWidth() >> 1); + nxgl_coord_t buttonY = button->getY() + (button->getHeight() >> 1); + + // Then push the button by calling nx_mousein. nx_mousein is meant to be + // called by mouse handling software. Here we just inject a left-button click + // directly in the center of the radio button. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level mouse interface + + NXHANDLE handle = getServer(); + + // Then inject the mouse click + + (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_LEFTBUTTON); + + // Poll for mouse events + // + // Widget events are normally handled in a modal loop (by calling goModal()). + // However, for this case we know that we just pressed the mouse button + // so we don't have to poll. We can just perform a one pass poll then + // then check if the mouse event was processed corredly. + + m_widgetControl->pollEvents(m_radioButtonGroup); + + // Then inject the mouse release + + (void)nx_mousein(handle, buttonX, buttonY, 0); + + // And poll for more mouse events + + m_widgetControl->pollEvents(m_radioButtonGroup); + + // And re-draw the buttons (the mouse click event should have automatically + // triggered the re-draw) + // + // showButtons(); +} + +// Show the state of the radio button group + +void CRadioButtonTest::showButtonState(void) +{ + int index = m_radioButtonGroup->getSelectedIndex(); + if (index < 0) + { + message("CRadioButtonTest::showButtonState No button is pressed\n"); + } + else + { + message("CRadioButtonTest::showButtonState button%d is selected\n", index+1); + } +} diff --git a/UnitTests/CRadioButton/cradiobuttontest.hxx b/UnitTests/CRadioButton/cradiobuttontest.hxx new file mode 100644 index 000000000..563049dcf --- /dev/null +++ b/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -0,0 +1,162 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CRADIOBUTTON_CRADIOBUTTONTEST_HXX +#define __UNITTESTS_CRADIOBUTTON_CRADIOBUTTONTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cradiobutton.hxx" +#include "cradiobuttongroup.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CRADIOBUTTONTEST_BGCOLOR +# define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cradiobutton_main +# define MAIN_STRING "cradiobutton_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CRadioButtonTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + CRadioButtonGroup *m_radioButtonGroup; // The radio button group + + // These are the dimensions that we will use for creating new radio buttons + + struct nxgl_size_s m_size; // The size of each radio button + +public: + // Constructor/destructors + + CRadioButtonTest(void); + ~CRadioButtonTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // (Re-)draw the buttons. + + void showButtons(void); + + // Create a CRadioButton instance. This method will show you how to create + // a CRadioButton widget + + CRadioButton *newRadioButton(void); + + // Simulate pushing and releasing of the radio button + + void pushButton(CRadioButton *button); + + // Show the state of the radio button group + + void showButtonState(void); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CRADIOBUTTON_CRADIOBUTTONTEST_HXX diff --git a/UnitTests/CRadioButton/main.cxx b/UnitTests/CRadioButton/main.cxx new file mode 100644 index 000000000..d53cd4a09 --- /dev/null +++ b/UnitTests/CRadioButton/main.cxx @@ -0,0 +1,238 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CRadioButton/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" +#include "cradiobuttontest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the radio button test + + message(MAIN_STRING "Create CRadioButtonTest instance\n"); + CRadioButtonTest *test = new CRadioButtonTest(); + updateMemoryUsage(g_mmprevious, "After creating CRadioButtonTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CRadioButtonTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CRadioButtonTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create three radio buttons + + CRadioButton *button1 = test->newRadioButton(); + if (!button1) + { + message(MAIN_STRING "Failed to create radio button 1\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 1"); + + CRadioButton *button2 = test->newRadioButton(); + if (!button2) + { + message(MAIN_STRING "Failed to create radio button 2\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 2"); + + CRadioButton *button3 = test->newRadioButton(); + if (!button3) + { + message(MAIN_STRING "Failed to create radio button 3\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 3"); + + // Show the initial state of the buttons + + test->showButtons(); + test->showButtonState(); + sleep(1); + + // Now push some buttons + + message(MAIN_STRING "Pushing button 1\n"); + test->pushButton(button1); + usleep(500*1000); + test->showButtonState(); + updateMemoryUsage(g_mmprevious, "After pushing button 1"); + usleep(500*1000); + + message(MAIN_STRING "Pushing button 2\n"); + test->pushButton(button2); + usleep(500*1000); + test->showButtonState(); + updateMemoryUsage(g_mmprevious, "After pushing button 2"); + usleep(500*1000); + + message(MAIN_STRING "Pushing button 3\n"); + test->pushButton(button3); + usleep(500*1000); + test->showButtonState(); + updateMemoryUsage(g_mmprevious, "After pushing button 3"); + sleep(2); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile new file mode 100644 index 000000000..6be8f7cd6 --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CScrollbarHorizontal/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cscrollbarhorizontaltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cscrollbarhorizontal +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx new file mode 100644 index 000000000..06673f080 --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "cscrollbarhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CScrollbarHorizontalTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CScrollbarHorizontalTest Constructor + +CScrollbarHorizontalTest::CScrollbarHorizontalTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CScrollbarHorizontalTest Descriptor + +CScrollbarHorizontalTest::~CScrollbarHorizontalTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CScrollbarHorizontalTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR)) + { + message("CScrollbarHorizontalTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CScrollbarHorizontalTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CScrollbarHorizontalTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CScrollbarHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CScrollbarHorizontalTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a scrollbar in the center of the window + +CScrollbarHorizontal *CScrollbarHorizontalTest::createScrollbar(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CScrollbarHorizontalTest::createScrollbar: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the scrollbar in the center of the display + + nxgl_coord_t scrollbarWidth = windowSize.w >> 1; + nxgl_coord_t scrollbarX = windowSize.w >> 2; + + nxgl_coord_t scrollbarHeight = 10; + nxgl_coord_t scrollbarY = (windowSize.h - scrollbarHeight) >> 1; + + // Create the scrollbar + + CScrollbarHorizontal *scrollbar = + new CScrollbarHorizontal(m_widgetControl, + scrollbarX, scrollbarY, + scrollbarWidth, scrollbarHeight); + if (!scrollbar) + { + printf("CScrollbarHorizontalTest::createScrollbar: Failed to create CScrollbarHorizontal\n"); + disconnect(); + } + return scrollbar; +} + +// (Re-)draw the scrollbar. + +void CScrollbarHorizontalTest::showScrollbar(CScrollbarHorizontal *scrollbar) +{ + scrollbar->enable(); // Un-necessary, the widget is enabled by default + scrollbar->enableDrawing(); + scrollbar->redraw(); +} diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx new file mode 100644 index 000000000..feae319d0 --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CSCROLLBARHORIZONTAL_CSCROLLBARHORIZONTALTEST_HXX +#define __UNITTESTS_CSCROLLBARHORIZONTAL_CSCROLLBARHORIZONTALTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cscrollbarhorizontal.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR +# define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cscrollbarhorizontal_main +# define MAIN_STRING "cscrollbarhorizontal_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CScrollbarHorizontalTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CScrollbarHorizontalTest(void); + ~CScrollbarHorizontalTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a scrollbar in the center of the window + + CScrollbarHorizontal *createScrollbar(void); + + // (Re-)draw the scrollbar. + + void showScrollbar(CScrollbarHorizontal *scrollbar); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CSCROLLBARHORIZONTAL_CSCROLLBARHORIZONTALTEST_HXX diff --git a/UnitTests/CScrollbarHorizontal/main.cxx b/UnitTests/CScrollbarHorizontal/main.cxx new file mode 100644 index 000000000..a6a08cdbd --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/main.cxx @@ -0,0 +1,231 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarHorizontal/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "cscrollbarhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SCROLLBAR 50 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CScrollbarHorizontalTest instance\n"); + CScrollbarHorizontalTest *test = new CScrollbarHorizontalTest(); + updateMemoryUsage(g_mmprevious, "After creating CScrollbarHorizontalTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CScrollbarHorizontalTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CScrollbarHorizontalTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create a scrollbar + + message(MAIN_STRING "Create a Scrollbar\n"); + CScrollbarHorizontal *scrollbar = test->createScrollbar(); + if (!scrollbar) + { + message(MAIN_STRING "Failed to create a scrollbar\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a scrollbar"); + + // Set the scrollbar minimum and maximum values + + scrollbar->setMinimumValue(0); + scrollbar->setMaximumValue(MAX_SCROLLBAR); + scrollbar->setValue(0); + message(MAIN_STRING "Scrollbar range %d->%d Initial value %d\n", + scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), + scrollbar->getValue()); + + // Show the initial state of the checkbox + + test->showScrollbar(scrollbar); + sleep(1); + + // Now move the scrollbar up + + for (int i = 0; i <= MAX_SCROLLBAR; i++) + { + scrollbar->setValue(i); + test->showScrollbar(scrollbar); + message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar up"); + + // And move the scrollbar down + + for (int i = MAX_SCROLLBAR; i >= 0; i--) + { + scrollbar->setValue(i); + test->showScrollbar(scrollbar); + message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar down"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete scrollbar; + updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile new file mode 100644 index 000000000..a2c404aad --- /dev/null +++ b/UnitTests/CScrollbarVertical/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CScrollbarVertical/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx cscrollbarverticaltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cscrollbarvertical +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx new file mode 100644 index 000000000..df317adcd --- /dev/null +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "cscrollbarverticaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CScrollbarVerticalTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CScrollbarVerticalTest Constructor + +CScrollbarVerticalTest::CScrollbarVerticalTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CScrollbarVerticalTest Descriptor + +CScrollbarVerticalTest::~CScrollbarVerticalTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CScrollbarVerticalTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR)) + { + message("CScrollbarVerticalTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CScrollbarVerticalTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CScrollbarVerticalTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CScrollbarVerticalTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CScrollbarVerticalTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a scrollbar in the center of the window + +CScrollbarVertical *CScrollbarVerticalTest::createScrollbar(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CScrollbarVerticalTest::createScrollbar: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the scrollbar in the center of the display + + nxgl_coord_t scrollbarWidth = 10; + nxgl_coord_t scrollbarX = (windowSize.w - scrollbarWidth) >> 1; + + nxgl_coord_t scrollbarHeight = windowSize.h >> 1; + nxgl_coord_t scrollbarY = windowSize.h >> 2; + + // Create the scrollbar + + CScrollbarVertical *scrollbar = + new CScrollbarVertical(m_widgetControl, + scrollbarX, scrollbarY, + scrollbarWidth, scrollbarHeight); + if (!scrollbar) + { + printf("CScrollbarVerticalTest::createScrollbar: Failed to create CScrollbarVertical\n"); + disconnect(); + } + return scrollbar; +} + +// (Re-)draw the scrollbar. + +void CScrollbarVerticalTest::showScrollbar(CScrollbarVertical *scrollbar) +{ + scrollbar->enable(); // Un-necessary, the widget is enabled by default + scrollbar->enableDrawing(); + scrollbar->redraw(); +} diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx new file mode 100644 index 000000000..874a851fd --- /dev/null +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CSCROLLBARVERTICAL_CSCROLLBARVERTICALTEST_HXX +#define __UNITTESTS_CSCROLLBARVERTICAL_CSCROLLBARVERTICALTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cscrollbarvertical.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR +# define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cscrollbarvertical_main +# define MAIN_STRING "cscrollbarvertical_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CScrollbarVerticalTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CScrollbarVerticalTest(void); + ~CScrollbarVerticalTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a scrollbar in the center of the window + + CScrollbarVertical *createScrollbar(void); + + // (Re-)draw the scrollbar. + + void showScrollbar(CScrollbarVertical *scrollbar); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CSCROLLBARVERTICAL_CSCROLLBARVERTICALTEST_HXX diff --git a/UnitTests/CScrollbarVertical/main.cxx b/UnitTests/CScrollbarVertical/main.cxx new file mode 100644 index 000000000..16bd9eea6 --- /dev/null +++ b/UnitTests/CScrollbarVertical/main.cxx @@ -0,0 +1,231 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CScrollbarVertical/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "cscrollbarverticaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SCROLLBAR 20 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CScrollbarVerticalTest instance\n"); + CScrollbarVerticalTest *test = new CScrollbarVerticalTest(); + updateMemoryUsage(g_mmprevious, "After creating CScrollbarVerticalTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CScrollbarVerticalTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create a scrollbar + + message(MAIN_STRING "Create a Scrollbar\n"); + CScrollbarVertical *scrollbar = test->createScrollbar(); + if (!scrollbar) + { + message(MAIN_STRING "Failed to create a scrollbar\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a scrollbar"); + + // Set the scrollbar minimum and maximum values + + scrollbar->setMinimumValue(0); + scrollbar->setMaximumValue(MAX_SCROLLBAR); + scrollbar->setValue(0); + message(MAIN_STRING "Scrollbar range %d->%d Initial value %d\n", + scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), + scrollbar->getValue()); + + // Show the initial state of the checkbox + + test->showScrollbar(scrollbar); + sleep(1); + + // Now move the scrollbar up + + for (int i = 0; i <= MAX_SCROLLBAR; i++) + { + scrollbar->setValue(i); + test->showScrollbar(scrollbar); + message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar up"); + + // And move the scrollbar down + + for (int i = MAX_SCROLLBAR; i >= 0; i--) + { + scrollbar->setValue(i); + test->showScrollbar(scrollbar); + message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + usleep(5000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar down"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete scrollbar; + updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile new file mode 100644 index 000000000..b496bdda7 --- /dev/null +++ b/UnitTests/CSliderHorizonal/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CSliderHorizontal/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx csliderhorizontaltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = csliderhorizontal +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx new file mode 100644 index 000000000..1687448db --- /dev/null +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx @@ -0,0 +1,224 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderHorizontal/csliderhorizontaltest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "csliderhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CSliderHorizontalTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CSliderHorizontalTest Constructor + +CSliderHorizontalTest::CSliderHorizontalTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CSliderHorizontalTest Descriptor + +CSliderHorizontalTest::~CSliderHorizontalTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CSliderHorizontalTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR)) + { + message("CSliderHorizontalTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CSliderHorizontalTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CSliderHorizontalTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CSliderHorizontalTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a slider in the center of the window + +CSliderHorizontal *CSliderHorizontalTest::createSlider(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CSliderHorizontalTest::createSlider: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the slider in the center of the display + + nxgl_coord_t sliderWidth = windowSize.w >> 1; + nxgl_coord_t sliderX = windowSize.w >> 2; + + nxgl_coord_t sliderHeight = 10; + nxgl_coord_t sliderY = (windowSize.h - sliderHeight) >> 1; + + // Create the slider + + CSliderHorizontal *slider = new CSliderHorizontal(m_widgetControl, + sliderX, sliderY, + sliderWidth, sliderHeight); + if (!slider) + { + printf("CSliderHorizontalTest::createSlider: Failed to create CSliderHorizontal\n"); + disconnect(); + } + return slider; +} + +// (Re-)draw the slider. + +void CSliderHorizontalTest::showSlider(CSliderHorizontal *slider) +{ + slider->enable(); // Un-necessary, the widget is enabled by default + slider->enableDrawing(); + slider->redraw(); +} diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx new file mode 100644 index 000000000..1dde688a8 --- /dev/null +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderHorizontal/csliderhorizontaltest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CSLIDERHORIZONTAL_CSLIDERHORIZONTALTEST_HXX +#define __UNITTESTS_CSLIDERHORIZONTAL_CSLIDERHORIZONTALTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "csliderhorizontal.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR +# define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME csliderhorizontal_main +# define MAIN_STRING "csliderhorizontal_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CSliderHorizontalTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CSliderHorizontalTest(void); + ~CSliderHorizontalTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a slider in the center of the window + + CSliderHorizontal *createSlider(void); + + // (Re-)draw the slider. + + void showSlider(CSliderHorizontal *slider); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CSLIDERHORIZONTAL_CSLIDERHORIZONTALTEST_HXX diff --git a/UnitTests/CSliderHorizonal/main.cxx b/UnitTests/CSliderHorizonal/main.cxx new file mode 100644 index 000000000..b99d1c547 --- /dev/null +++ b/UnitTests/CSliderHorizonal/main.cxx @@ -0,0 +1,231 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderHorizontal/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "csliderhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SLIDER 50 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CSliderHorizontalTest instance\n"); + CSliderHorizontalTest *test = new CSliderHorizontalTest(); + updateMemoryUsage(g_mmprevious, "After creating CSliderHorizontalTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CSliderHorizontalTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CSliderHorizontalTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create a slider + + message(MAIN_STRING "Create a Slider\n"); + CSliderHorizontal *slider = test->createSlider(); + if (!slider) + { + message(MAIN_STRING "Failed to create a slider\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + + // Set the slider minimum and maximum values + + slider->setMinimumValue(0); + slider->setMaximumValue(MAX_SLIDER); + slider->setValue(0); + message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); + + // Show the initial state of the checkbox + + test->showSlider(slider); + sleep(1); + + // Now move the slider up + + for (int i = 0; i <= MAX_SLIDER; i++) + { + slider->setValue(i); + test->showSlider(slider); + message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + + // And move the slider down + + for (int i = MAX_SLIDER; i >= 0; i--) + { + slider->setValue(i); + test->showSlider(slider); + message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete slider; + updateMemoryUsage(g_mmprevious, "After deleting the slider"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile new file mode 100644 index 000000000..5d5e590f1 --- /dev/null +++ b/UnitTests/CSliderVertical/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CSliderVertical/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx csliderverticaltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cslidervertical +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CSliderVertical/csliderverticaltest.cxx b/UnitTests/CSliderVertical/csliderverticaltest.cxx new file mode 100644 index 000000000..d0691c52d --- /dev/null +++ b/UnitTests/CSliderVertical/csliderverticaltest.cxx @@ -0,0 +1,225 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// modify this software without notice. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbgwindow.hxx" +#include "csliderverticaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CSliderVerticalTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CSliderVerticalTest Constructor + +CSliderVerticalTest::CSliderVerticalTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CSliderVerticalTest Descriptor + +CSliderVerticalTest::~CSliderVerticalTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CSliderVerticalTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CSLIDERVERTICALTEST_BGCOLOR)) + { + message("CSliderVerticalTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CSliderVerticalTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CSliderVerticalTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CSliderVerticalTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CSliderVerticalTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a slider in the center of the window + +CSliderVertical *CSliderVerticalTest::createSlider(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CSliderVerticalTest::createSlider: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the slider in the center of the display + + nxgl_coord_t sliderWidth = 10; + nxgl_coord_t sliderX = (windowSize.w - sliderWidth) >> 1; + + nxgl_coord_t sliderHeight = windowSize.h >> 1; + nxgl_coord_t sliderY = windowSize.h >> 2; + + // Create the slider + + CSliderVertical *slider = new CSliderVertical(m_widgetControl, + sliderX, sliderY, + sliderWidth, sliderHeight); + if (!slider) + { + printf("CSliderVerticalTest::createSlider: Failed to create CSliderVertical\n"); + disconnect(); + } + return slider; +} + +// (Re-)draw the slider. + +void CSliderVerticalTest::showSlider(CSliderVertical *slider) +{ + slider->enable(); // Un-necessary, the widget is enabled by default + slider->enableDrawing(); + slider->redraw(); +} diff --git a/UnitTests/CSliderVertical/csliderverticaltest.hxx b/UnitTests/CSliderVertical/csliderverticaltest.hxx new file mode 100644 index 000000000..e8d506db9 --- /dev/null +++ b/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -0,0 +1,147 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CSLIDERVERTICAL_CSLIDERVERTICALTEST_HXX +#define __UNITTESTS_CSLIDERVERTICAL_CSLIDERVERTICALTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cslidervertical.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CSLIDERVERTICALTEST_BGCOLOR +# define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME cslidervertical_main +# define MAIN_STRING "cslidervertical_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +// If debug is enabled, use the debug function, lib_rawprintf() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lib_lowprintf +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CSliderVerticalTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CSliderVerticalTest(void); + ~CSliderVerticalTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a slider in the center of the window + + CSliderVertical *createSlider(void); + + // (Re-)draw the slider. + + void showSlider(CSliderVertical *slider); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CSLIDERVERTICAL_CSLIDERVERTICALTEST_HXX diff --git a/UnitTests/CSliderVertical/main.cxx b/UnitTests/CSliderVertical/main.cxx new file mode 100644 index 000000000..f5a53f018 --- /dev/null +++ b/UnitTests/CSliderVertical/main.cxx @@ -0,0 +1,231 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CSliderVertical/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "csliderverticaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SLIDER 50 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message(MAIN_STRING "Create CSliderVerticalTest instance\n"); + CSliderVerticalTest *test = new CSliderVerticalTest(); + updateMemoryUsage(g_mmprevious, "After creating CSliderVerticalTest"); + + // Connect the NX server + + message(MAIN_STRING "Connect the CSliderVerticalTest instance to the NX server\n"); + if (!test->connect()) + { + message(MAIN_STRING "Failed to connect the CSliderVerticalTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + + // Create a window to draw into + + message(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + message(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + + // Create a slider + + message(MAIN_STRING "Create a Slider\n"); + CSliderVertical *slider = test->createSlider(); + if (!slider) + { + message(MAIN_STRING "Failed to create a slider\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + + // Set the slider minimum and maximum values + + slider->setMinimumValue(0); + slider->setMaximumValue(MAX_SLIDER); + slider->setValue(0); + message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); + + // Show the initial state of the checkbox + + test->showSlider(slider); + sleep(1); + + // Now move the slider up + + for (int i = 0; i <= MAX_SLIDER; i++) + { + slider->setValue(i); + test->showSlider(slider); + message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + + // And move the slider down + + for (int i = MAX_SLIDER; i >= 0; i--) + { + slider->setValue(i); + test->showSlider(slider); + message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + usleep(1000); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + sleep(1); + + // Clean up and exit + + message(MAIN_STRING "Clean-up and exit\n"); + delete slider; + updateMemoryUsage(g_mmprevious, "After deleting the slider"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} + diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile new file mode 100644 index 000000000..3fe0fa43e --- /dev/null +++ b/UnitTests/CTextBox/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/UnitTests/CTextBox/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx ctextboxtest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = ctextbox +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/CTextBox/ctextboxtest.cxx b/UnitTests/CTextBox/ctextboxtest.cxx new file mode 100644 index 000000000..e54bd4e6a --- /dev/null +++ b/UnitTests/CTextBox/ctextboxtest.cxx @@ -0,0 +1,287 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CTextBox/ctextboxtest.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "ctextboxtest.hxx" +#include "cbgwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CTextBoxTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CTextBoxTest Constructor + +CTextBoxTest::CTextBoxTest() +{ + m_bgWindow = (CBgWindow *)NULL; + m_nxFont = (CNxFont *)NULL; + m_text = (CNxString *)NULL; +} + +// CTextBoxTest Descriptor + +CTextBoxTest::~CTextBoxTest() +{ + disconnect(); +} + +// Connect to the NX server + +bool CTextBoxTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Create the default font instance + + m_nxFont = new CNxFont(NXFONT_DEFAULT, + CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + if (!m_nxFont) + { + printf("CTextBoxTest::connect: Failed to create the default font\n"); + } + + // Set the background color + + if (!setBackgroundColor(CONFIG_CTEXTBOXTEST_BGCOLOR)) + { + printf("CTextBoxTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CTextBoxTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + } + + // Free the display string + + if (m_text) + { + delete m_text; + m_text = (CNxString *)NULL; + } + + // Free the default font + + if (m_nxFont) + { + delete m_nxFont; + m_nxFont = (CNxFont *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CTextBoxTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + printf("CTextBoxTest::createGraphics: Failed to create CBgWindow instance\n"); + delete m_widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + printf("CTextBoxTest::createGraphics: Failed to open background window\n"); + delete m_bgWindow; + m_bgWindow = (CBgWindow*)0; + return false; + } + + return true; +} + +// Create a CTextBox instance + +CTextBox *CTextBoxTest::createTextBox(void) +{ + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CTextBoxTest::createGraphics: Failed to get window size\n"); + return (CTextBox *)NULL; + } + + // Create an empty CNxString instance to contain the C string + + m_text = new CNxString(); + + // Get the height and width of the text display area. The width + // is half of the display width and the height is optimized for + // the font height + + nxgl_coord_t textBoxWidth = windowSize.w >> 1; + nxgl_coord_t textBoxHeight = (nxgl_coord_t)m_nxFont->getHeight(); + + // The default CTextBox has borders enabled with thickness of one. + // Add twice the thickness of the border to the height. + + textBoxHeight += 2 * 1; + + // Pick an X/Y position such that the label will be centered in the display + + nxgl_coord_t labelX = windowSize.w >> 2; + nxgl_coord_t labelY = (windowSize.h - textBoxHeight) >> 1; + + // Now we have enough information to create the label + + return new CTextBox(m_widgetControl, labelX, labelY, textBoxWidth, textBoxHeight, *m_text); +} + +// Draw the label + +void CTextBoxTest::showTextBox(CTextBox *label) +{ + label->enable(); + label->enableDrawing(); + label->redraw(); +} + +// Inject simulated keyboard characters into NX. + +void CTextBoxTest::injectChars(CTextBox *textbox, int nCh, FAR const uint8_t *string) +{ + // nx_kbdin is meant to be called by keyboard handling software. + // Here we just inject the string under unit test control. + + // First, get the server handle. Graphics software will never care + // about the server handle. Here we need it to get access to the + // low-level keyboard interface + + NXHANDLE handle = getServer(); + + // The widget must have focus to receive keyboard input + + m_widgetControl->setFocusedWidget(textbox); + + // Inject the string one character at a time to get a more realistic + // simulation of keyboard behavior. Note the API nx_kbdin() could + // be used to inject the string in its entirety. + + for (int i = 0; i < nCh; i++) + { + // Inject the next character + + (void)nx_kbdchin(handle, string[i]); + + // Widget events are normally handled in a modal loop (by calling goModal()). + // However, for this case we know when there should be keyboard events pending, + // events so we don't have to poll repeatedly. We can just perform a one pass + // poll + + m_widgetControl->pollEvents(textbox); + + // Sleep a bit, just for the effect (this also gives the X server loop a + // chance to run in the simulated environment. + + usleep(500*1000); + } +} diff --git a/UnitTests/CTextBox/ctextboxtest.hxx b/UnitTests/CTextBox/ctextboxtest.hxx new file mode 100644 index 000000000..2a839b06d --- /dev/null +++ b/UnitTests/CTextBox/ctextboxtest.hxx @@ -0,0 +1,152 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CTextBox/ctextboxtest.hxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CTEXTBOX_CTEXTBOXTEST_HXX +#define __UNITTESTS_CTEXTBOX_CTEXTBOXTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cnxfont.hxx" +#include "cnxstring.hxx" +#include "ctextbox.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CTEXTBOXTEST_BGCOLOR +# define CONFIG_CTEXTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +#endif + +#ifndef CONFIG_CTEXTBOXTEST_FONTCOLOR +# define CONFIG_CTEXTBOXTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +#endif + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME ctextbox_main +# define MAIN_STRING "ctextbox_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CTextBoxTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CNxFont *m_nxFont; // Default font + CBgWindow *m_bgWindow; // Background window instance + CNxString *m_text; // The label string + +public: + // Constructor/destructors + + CTextBoxTest(); + ~CTextBoxTest(); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a CTextBox instance. This method will show you how to create + // a CTextBox widget + + CTextBox *createTextBox(void); + + // Draw the label. This method illustrates how to draw the CTextBox widget. + + void showTextBox(CTextBox *label); + + // Inject simulated keyboard characters into NX. + + void injectChars(CTextBox *textbox, int nCh, FAR const uint8_t *string); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + + +#endif // __UNITTESTS_CTEXTBOX_CTEXTBOXTEST_HXX diff --git a/UnitTests/CTextBox/main.cxx b/UnitTests/CTextBox/main.cxx new file mode 100644 index 000000000..b5b8ec4d5 --- /dev/null +++ b/UnitTests/CTextBox/main.cxx @@ -0,0 +1,141 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CTextBox/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "ctextboxtest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static const char string1[] = "Johhn "; +static const char string2[] = "\b\b\bn Doe\r"; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Create an instance of the font test + + printf(MAIN_STRING "Create CTextBoxTest instance\n"); + CTextBoxTest *test = new CTextBoxTest(); + + // Connect the NX server + + printf(MAIN_STRING "Connect the CTextBoxTest instance to the NX server\n"); + if (!test->connect()) + { + printf(MAIN_STRING "Failed to connect the CTextBoxTest instance to the NX server\n"); + delete test; + return 1; + } + + // Create a window to draw into + + printf(MAIN_STRING "Create a Window\n"); + if (!test->createWindow()) + { + printf(MAIN_STRING "Failed to create a window\n"); + delete test; + return 1; + } + + // Create a CTextBox instance + + CTextBox *textbox = test->createTextBox(); + if (!textbox) + { + printf(MAIN_STRING "Failed to create a text box\n"); + delete test; + return 1; + } + + // Show the text box + + test->showTextBox(textbox); + + // Wait a bit, then inject a string with a typo + + sleep(1); + test->injectChars(textbox, sizeof(string1), (FAR const uint8_t*)string1); + + // Now fix the string with backspaces and finish it correctly + + usleep(500*1000); + test->injectChars(textbox, sizeof(string2), (FAR const uint8_t*)string2); + + // Clean up and exit + + sleep(2); + printf(MAIN_STRING "Clean-up and exit\n"); + delete textbox; + delete test; + return 0; +} + diff --git a/UnitTests/README.txt b/UnitTests/README.txt new file mode 100644 index 000000000..b0f3c9aab --- /dev/null +++ b/UnitTests/README.txt @@ -0,0 +1,394 @@ +README +====== + +This directory contains a collection of Unit Tests that can be used to verify +NXWidgets.: + +Contents +======== + o Installing and Building the Unit Tests + 1. Setup NuttX + a) Configure NuttX + b) Enable C++ Support + c) Enable Debug Options + d) Other Possible nuttx/.config changes + e) Other Possible apps/.config changes + 2. Configure in the Selected Unit Test + o Work-Arounds + 1. Build Issues + 2. Stack Size Issues with the X11 Simulation + o Theory of Operation + o Unit Test Directories + o Example + +Installing and Building the Unit Tests +====================================== + +1. Setup NuttX + + a) Configure NuttX + + Configure NuttX to run one of the target configurations. For example, + let's assume that you are using the sim/nsh2 configuration. The sim/nsh2 + configuration was specially created for use NXWidgets on the simulation + platform. A similar, special configuration stm3210e-eval/nsh2 is also + for the STM3210E-EVAL available. However, the unit test can be run on + other configurations (see steps d and e below). + + We will assume the sim/nsh2 configuration in this discussion. The + sim/nsh2 configuration is installed as follows: + + cd + make distclean + cd tools + ./configure.sh sim/nsh2 + + Where: + + is the full, absolute path to the NuttX build directory + + If you are using the sim/nsh2 or stm3210e-eval configurations, then skip + to step 2. + + There may be certain requirements for the configuration that you select... + for example, certain widget tests may require touchscreen support or special + font selections. These test-specific requirements are addressed below under + "Unit Test Directories" + + b) Enable C++ Support + + If you are not using the sim/nsh2 or stm3210e-eval, you will need to add + the following definitions to the nuttx configuration at nuttx/.config to + enable C++ support: + + CONFIG_HAVE_CXX=y + + Check first, some configurations already have C++ support enabled (As of this + writing *ONLY* the sim/nsh2 and stm321-e-eval configurations have C++ support + pre-enabled). + + c) Enable Debug Options + + If you are running on a simulated target, then you might also want to + enable debug symbols: + + CONFIG_DEBUG_SYMBOLS=y + + Then you can run the simulation using GDB or DDD which is a very powerful + debugging environment! + + d) Other nuttx/.config changes -- NSH configurations only. + + If the configuration that you are using supports NSH and NSH built-in tasks + then all is well. If it is an NSH configuration, then you will have to define + the following in your nuttx/.config file as well (if it is not already defined): + + CONFIG_NSH_BUILTIN_APPS=y + + sim/nsh2 and stm3210e-eval/nsh2 already has this setting. You do not need + to change anything further in the nuttx/.config file if you are using either + of these configurations. + + e) Other apps/.config changes -- NON-NSH configurations only. + + For non-NSH configurations (such as the sim/touchscreen) you will have to + remove the CONFIGURED_APPS seting that contains the user_start function so + that you use the user_start in the unit test code instead. So, for example, + with the sim/touchscreen configuration you need to remove the following from + the apps/.config file: + + CONFIGURED_APPS += examples/ ## REMOVE + + The following step will then install the new, correct directory containing + the user_start function for the selected unit test. If you see that NSH + is configured: + + CONFIGURED_APPS += examples/nsh ## DO NOT REMOVE + + Then DO NOT REMOVE the CONFIGURED_APPS setting. Go back and re-read c) + above. Do either c) or d). Don't do both! + + sim/nsh2 and stm3210e-eval/nsh2 both NSH configurations. You do not need + to change anything further in the apps/.config file for any NSH configuration. + +2. Configure/Install the Selected Unit Test + + Then reconfigure that to use the Unit Test of your choice: + + cd /trunk/UnitTests/tools + ./install.sh + + Where: + + is the full, absolute path to the NuttX apps/ directory + is the name of a sub-directory in the UnitTests directory + +3. Instantiate the Configuration + + Before we can make the NXWidgets Library, we have to instantiate the NuttX + configuration with the installed unit test: + + cd + . ./setenv.sh + make context + + This will create auto-generated files and will setup symbolic links needed + in order to build the NXWidgets Library. + +4. Adjust the Stack Size + + If using an simulation configuration (like sim/nsh2) and your unit test + uses X11 as its display device, then you would have to increase the size + of unit test stack as described below under "Stack Size Issues with the + X11 Simulation." + +5. Build the NXWidgets Library + + cd /trunk/NXWidgets/libnxwidgets + make TOPDIR= + +6. Build NuttX including the unit test and the NXWidget library + + cd + . ./setenv.sh + make + +Work-Arounds +============ + +Build Issues +------------ +1. I have seen this error on Cygwin building C++ code: + + LD: nuttx.rel + ld: skipping incompatible /home/patacongo/projects/nuttx/nuttx/trunk/nuttx/libxx//liblibxx.a when searching for -llibxx + ld: cannot find -llibxx + + The problem seems to be caused because gcc build code for 32-bit mode and g++ builds code for 64-bit mode. Add the -m32 option to the g++ command line seems to fix the problem. In Make.defs: + + CXXFLAGS = -m32 $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe + +2. Stack Size Issues with the X11 Simulation + + When you run the NuttX simulation, it uses stacks allocated by NuttX from the + NuttX heap. The memory management model is exactly the same in the simulation + as it is real, target system. This is good because this produces a higher + fidelity simulation. + + However, when the simulation calls into Linux/Cygwin libraries, it will still + use these small simulation stacks. This happens, for example, when you call + into the system to get and put characters to the console window or when you + make x11 calls into the system. The programming model within those libraries + will assume a Linux/Cygwin environment where the stack size grows dynamically + + As a consequence, those system libraries may allocate large data structures + on the stack and overflow the small NuttX stacks. X11, in particular, + requires large stacks. If you are using X11 in the simulation, make sure + that you set aside a "lot" of stack for the X11 system calls (maybe 8 or 16Kb). + The stack size for the thread that begins with user start is controlled + by the configuration setting CONFIG_USERMAIN_STACKSIZE; you may need to + increase this value to larger number to survive the X11 system calls. + + If you are running X11 applications as NSH add-on programs, then the stack + size of the add-on program is controlled in another way. Here are the + steps for increasing the stack size in that case: + + cd ../apps/namedapps # Go to the namedapps directory + vi namedapps_list.h # Edit this file and increase the stack size of the add-on + rm .built *.o # This will force the namedapps logic to rebuild + +Theory Of Operation +=================== + +The NuttX application Makefile at apps/Makefile has some special hooks for +building "external" applications. In particular, it will automatically +build in the contents any directory call "external/" that may appear in the +apps/ directory. There is no external/ directory in the repository. Rather, +this directory may be provided by the user (possibly as a symbolic link) to +add libraries and applications to the standard build from the repository. + +The script at tools/install.sh, then, just does a lot of careful validation and +sanity checking. Then it installs the UnitTest test sub-directory in the apps/ +directory by creating a symbolic link in the apps/ directory call "external". +That symbolic link will refer to the selected UnitTest sub-directory. + +UnitTests +========= + +The following provide simple unit tests for each of the NXWidgets. In +addition, these unit tests provide examples for the use of each widget +type. + +CButton + Exercises the CButton widget + Depends on CLabel + +CButtonArray + Exercises the CButtonArray widget + +CCheckBox + Exercises the CCheckBox widget + Depends on CLabel and CButton. + +CGlyphButton + Exercises the CGlyphButton widget. + Depends on CLabel and CButton. + +CImage + Exercises the CImage widget + +CLabel + Exercises the CLabel widget + +CProgressBar + Exercises the CProgressBar widget + +CRadioButton + Exercises the CRadioButton and CRadioButtonGroup widgets. + Depends on CLabel and CButton + +CScrollBarHorizontal + Exercises the ScrollbarHorizontal + Depends on CSliderHorizontal and CGlyphButton + +CScrollBarVertical + Exercises the ScrollbarHorizontal + Depends on CSliderVertical and CGlyphButton + +CSliderHorizontal + Exercises the CSliderHorizontal + Depends on CSliderHorizontalGrip + +CSliderVertical + Exercises the CSliderVertical + Depends on CSliderVerticalGrip + +CTextBox + Exercises the CTextBox widget + Depends on CLabel + +Example +======= + +1. Configure sim/nsh2 + Where: nuttx and nuttx/tools directory + + $ cd tools/ + $ ./configure.sh sim/nsh2 + $ cd - + +2. Edit nuttx/.config to enable C++ support + + Do nothing... sim/nsh2 already has C++ support enabled. + +3. Install the CButton C++ application (for example) + Where: NXWidgets/trunk/UnitTests/tool + + $ ./install.sh ~/projects/nuttx/nuttx/trunk/apps/ CButton + /home/patacongo/projects/nuttx/nuttx/trunk/apps//external already exists... + Removing the old symbolic link. + Creating symbolic link + - To /home/patacongo/projects/nuttx/gui/raztek-nxwidgets/trunk/UnitTests/tools/../CButton + - At /home/patacongo/projects/nuttx/nuttx/trunk/apps//external + +4. Instantiate the Configuration + Where: nuttx directory + + $ cd /home/patacongo/projects/nuttx/nuttx/trunk/nuttx + $ . ./setenv.sh + $ make context + + This will create auto-generated files and will setup symbolic links needed + in order to build the NXWidgets Library. + +6. Adjust the Stack Size + + If using an simulation configuration (like sim/nsh2) and your unit test + uses X11 as its display device, then you would have to increase the size + of unit test stack as described above under "Stack Size Issues." + +7. Build the NXWdigets Library + Where XWidgets/trunk/NXWidgets/libnxwidgets + + $ cd /home/patacongo/projects/nuttx/gui/raztek-nxwidgets/trunkXWidgets/libnxwidgets + $ make TOPDIR=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx + +8. Build NuttX + Where: nuttx directory + + $ cd /home/patacongo/projects/nuttx/nuttx/trunk/nuttx + $ make + ... + +8. Run the "bringup" task: + + a. Start NuttX + Where: nuttx directory + + ./nuttx + + NuttShell (NSH) NuttX-6.9 + nsh> + + b. Execute NuttX + Where: NSH command prompt + + NOTE that when you run NSH as a simulation, the commands are echoed + twice -- once by Linux/Cygwin and once by NuttX: + + nsh> help + help + ... + Builtin Apps: + nx + nxhello + tc + bringup + nsh> bringup + bringup + bringup [2:128] + + c. Then do a kludgy thing + Where: NSH command prompt + + The I/O with the Linux/Cygwin simulation is blocking. So while NSH is + waiting for input nothing can run (see configs/sim/README.txt for more info). + One way to make NSH stop asking for input is to sleep. + + nsh> sleep 10 + sleep 10 + + NOTE 1: This is not a problem if CONFIG_SCHED_WAITPID is defined in the + configuration file. If CONFIG_SCHED_WAITPID is defined, NSH will wait + for the unit test to complete and it will not be necessary to sleep. + + NOTE 2: CONFIG_SCHED_WAITPID is defined in the sim/nsh2 configuration + so you can probably ignore this kludgy thing. + + d. The Unit Test runs + + As soon as NSH sleeps, the unit test will run: + + bringup_main: Saying hello from the dynamically constructed instance + CHelloWorld::HelloWorld: Hello, World!! + bringup_main: Saying hello from the instance constructed on the stack + CHelloWorld::HelloWorld: Hello, World!! + bringup_main: Saying hello from the statically constructed instance + CHelloWorld::HelloWorld: Hello, World!! + +8. Debugging + Where: nuttx directory + + In the simulation (only) you can use GDB or, better, the graphic + front-end DDD to debug the code. Most embedded targets do not + have good debugging capabilities. + + In order to debug, you have to have build with CONFIG_DEBUG_SYMBOLS=y. + This setting is preselected in the sim/nsh2 configuration so that + you don't have to do anything. + + Then under Linux or in a Cygwin X11 window, you can start the graphic + debugger like: + + ddd nuttx & diff --git a/UnitTests/tools/addobjs.sh b/UnitTests/tools/addobjs.sh new file mode 100755 index 000000000..e998cfc64 --- /dev/null +++ b/UnitTests/tools/addobjs.sh @@ -0,0 +1,141 @@ +#!/bin/bash +################################################################################# +# NxWidgets/UnitTests/tools/addobjs.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +# set -x + +# Get input parameters + +usage="Usage: $0 [OPTIONS] " +advice="Try '$0 -h' for more information" + +unset prefix +wintool=n + +while [ ! -z "$1" ]; do + case $1 in + -d ) + set -x + ;; + -p ) + shift + prefix=$1 + ;; + -w ) + wintool=y + ;; + -h ) + echo "$0 will add all object (.o) files in directory to an archive." + echo "" + echo $usage + echo "" + echo "Where:" + echo " is the full, absolute path to the library to use" + echo " is full path to the directory containing the object files to be added" + echo "OPTIONS include:" + echo " -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-'" + echo " -w Use Windows style paths insted of POSIX paths" + echo " -d Enable script debug" + echo " -h Show this usage information" + exit 0 + ;; + * ) + break; + ;; + esac + shift +done + +libpath=$1 +objdir=$2 +archiver="${prefix}"ar + +# Verify input parameters + +if [ -z "${libpath}" ]; then + echo "Missing required arguments" + echo "" + echo $usage + echo $advice + exit 1 +fi + +if [ -z "${objdir}" ]; then + echo "Missing required argument " + echo "" + echo $usage + echo $advice + exit 1 +fi + +if [ ! -w ${libpath} ]; then + if [ -e ${libpath} ]; then + echo "${libpath} exists but is not a write-able file" + echo $advice + else + echo "${libpath} does not exist" + echo $advice + fi + exit 1 +fi + +if [ ! -d ${objdir} ]; then + if [ -e ${objdir} ]; then + echo "${objdir} exists but is not a directory" + echo $advice + else + echo "${objdir} does not exist" + echo $advice + fi + exit 1 +fi + +# Add each object file in to the archive at + +for obj in `ls "${objdir}"/*.o`; do + name=`basename "${obj}"` + if [ "X${wintool}" = "Xy" ]; then + objpath=`cygpath -w "${obj}"` + else + objpath=${obj} + fi + echo "AR: ${name}" + ${archiver} rcs ${libpath} ${objpath} || \ + { echo "Failed to archive the object file:"; \ + echo " Archive: ${libpath}"; \ + echo " Object: ${obj}"; \ + exit 1; \ + } +done \ No newline at end of file diff --git a/UnitTests/tools/install.sh b/UnitTests/tools/install.sh new file mode 100755 index 000000000..3ba086aff --- /dev/null +++ b/UnitTests/tools/install.sh @@ -0,0 +1,152 @@ +#!/bin/bash +################################################################################# +# NxWidgets/UnitTests/tools/install.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# +# +# set -x +# Functions + +function ShowUsage() +{ + echo "" + echo "USAGE: $0 " + echo "" + echo "Where:" + echo " is the full, absolute path to the NuttX apps/ directory" + echo " is the name of a sub-directory in the UnitTests directory" + echo "" +} + +function ShowTests() +{ + for testdir in ${UNITTEST_DIRPATH}/*; do + subdir=`basename ${testdir}` + if [ -d "${UNITTEST_DIRPATH}/${subdir}" ]; then + if [ -f "${UNITTEST_DIRPATH}/${subdir}/Makefile" ]; then + echo $subdir + fi + fi + done +} + +# Input parameters + +APPS_DIRPATH=$1 +TEST_SUBDIR=$2 + +if [ -z "${APPS_DIRPATH}" ]; then + echo "Missing required arguments" + ShowUsage + exit 1 +fi + +if [ -z "${TEST_SUBDIR}" ]; then + echo "Missing required argument " + ShowUsage + exit 1 +fi + +# Make sure that we know where we are and where we are going + +WD=`pwd` +if [ -x install.sh ]; then + UNITTEST_DIRPATH="${WD}/.." + TOOLS_DIRPATH="${WD}" +else + if [ -x tools/install.sh ]; then + UNITTEST_DIRPATH="${WD}" + TOOLS_DIRPATH="${WD}/tools" + else + echo "This script must be executed in the UnitTest or UnitTest/tools directory" + ShowUsage + exit 1 + fi +fi + +if [ ! -d "${APPS_DIRPATH}" ]; then + echo "Directory ${APPS_DIRPATH} does not exist" + ShowUsage + exit 1 +fi + +if [ ! -f "${APPS_DIRPATH}/Makefile" ]; then + echo "Directory ${APPS_DIRPATH} does not look like a NuttX apps directory" + ShowUsage + exit 1 +fi + +TEST_PATH="${UNITTEST_DIRPATH}/${TEST_SUBDIR}" +if [ ! -d "${TEST_PATH}" ]; then + echo "Directory ${TEST_PATH} does not exist" + ShowUsage + ShowTests + exit 1 +fi + +if [ ! -f "${TEST_PATH}/Makefile" ]; then + echo "Directory ${TEST_PATH} does not look like a unit test directory" + ShowUsage + ShowTests + exit 1 +fi + +# Check if the symbolic link "external" exists in the NuttX apps directory + +if [ -e "${APPS_DIRPATH}/external" ]; then + echo "${APPS_DIRPATH}/external already exists..." + if [ -h "${APPS_DIRPATH}/external" ]; then + echo " Removing the old symbolic link." + rm "${APPS_DIRPATH}/external" || \ + { echo " ERROR: Failed to remove old symbolic link"; \ + exit 1; + } + else + echo " ERROR: But it is not a symbolic link!" + echo " Please remove ${APPS_DIRPATH}/external" + echo " and run this script again" + fi +fi + +# Then set up the symbolic link "external" in the NuttX apps to point to the +# UnitTest subdirectory + +echo "Creating symbolic link" +echo " - To ${TEST_PATH}" +echo " - At ${APPS_DIRPATH}/external" + +ln -s "${TEST_PATH}" "${APPS_DIRPATH}/external" || \ + { echo "Failed to create symbollic link"; \ + exit 1; + } + diff --git a/libnxwidgets/COPYING b/libnxwidgets/COPYING new file mode 100644 index 000000000..5e78c2ac2 --- /dev/null +++ b/libnxwidgets/COPYING @@ -0,0 +1,70 @@ +/******************************************************************************** + * NxWidgets + * Graphical Widgets for the NuttX RTOS + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * + ******************************************************************************* + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in almost all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ********************************************************************************/ + \ No newline at end of file diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile new file mode 100644 index 000000000..e3ff57339 --- /dev/null +++ b/libnxwidgets/Makefile @@ -0,0 +1,135 @@ +################################################################################# +# NxWidgets/libnxwidgets/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs + +NXWDIR := ${shell pwd | sed -e 's/ /\\ /g'} + + +ASRCS = +CSRCS = +# Infrastructure +CXXSRCS = cbitmap.cxx cbgwindow.cxx ccallback.cxx cgraphicsport.cxx +CXXSRCS += clistdata.cxx clistdataitem.cxx cnxfont.cxx +CXXSRCS += cnxserver.cxx cnxstring.cxx cnxtimer.cxx cnxwidget.cxx cnxwindow.cxx +CXXSRCS += cnxtkwindow.cxx cnxtoolbar.cxx crect.cxx crectcache.cxx +CXXSRCS += crlepalettebitmap.cxx cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx +CXXSRCS += cwidgeteventhandlerlist.cxx singletons.cxx +# Widget APIs +CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx +CXXSRCS += cglyphbutton.cxx cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx +CXXSRCS += clatchbuttonarray.cxx clistbox.cxx clistboxdataitem.cxx cmultilinetextbox.cxx +CXXSRCS += cprogressbar.cxx cradiobutton.cxx cradiobuttongroup.cxx cscrollbarhorizontal.cxx +CXXSRCS += cscrollbarpanel.cxx cscrollbarvertical.cxx cscrollinglistbox.cxx +CXXSRCS += cscrollingpanel.cxx cscrollingtextbox.cxx csliderhorizontal.cxx +CXXSRCS += csliderhorizontalgrip.cxx cslidervertical.cxx csliderverticalgrip.cxx +CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx ctextbox.cxx +# Images +CXXSRCS += glyph_nxlogo.cxx +CXXSRCS += glyph_arrowdown.cxx glyph_checkboxon.cxx glyph_screendepthup.cxx +CXXSRCS += glyph_arrowleft.cxx glyph_control.cxx glyph_screenflipdown.cxx +CXXSRCS += glyph_arrowright.cxx glyph_cycle.cxx glyph_screenflipup.cxx +CXXSRCS += glyph_arrowup.cxx glyph_radiobuttonoff.cxx glyph_shift.cxx +CXXSRCS += glyph_backspace.cxx glyph_radiobuttonmu.cxx glyph_windowclose.cxx +CXXSRCS += glyph_capslock.cxx glyph_radiobuttonon.cxx glyph_windowdepthdown.cxx +CXXSRCS += glyph_checkboxmu.cxx glyph_return.cxx glyph_windowdepthup.cxx +CXXSRCS += glyph_checkboxoff.cxx glyph_screendepthdown.cxx +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +BIN = libnxwidgets$(LIBEXT) + +CFLAGS += -I include +CXXFLAGS += -I include +DEPPATH = --dep-path src +VPATH = src + +all: $(BIN) +.PHONY = check_nuttx depend clean distclean export + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +check_nuttx: + @( \ + if [ -z "$(TOPDIR)" ]; then \ + echo "The path to the nuttx directory must be provided on the command line."; \ + echo "Usage: make -C $(NXWDIR) TOPDIR=\"\""; \ + exit 1; \ + fi; \ + if [ ! -d "$(TOPDIR)" ]; then \ + echo "The nuttx directory (TOPDIR) does not exist: $(TOPDIR)"; \ + exit 1; \ + fi; \ + if [ ! -f "$(TOPDIR)/.config" ]; then \ + echo "The nuttx directory (TOPDIR) has not been configured"; \ + echo "Please configure NuttX and try again"; \ + exit 1; \ + fi; \ + ) + +$(BIN): check_nuttx $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f $(BIN) *.a *.o *~ .*.sw* + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +export: $(BIN) + zip -r nxwidgets-export.zip include $(BIN) COPYING + +-include Make.dep diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx new file mode 100644 index 000000000..1f8e417af --- /dev/null +++ b/libnxwidgets/include/cbgwindow.hxx @@ -0,0 +1,314 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbgwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CBGWINDOW_HXX +#define __INCLUDE_CBGWINDOW_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "ccallback.hxx" +#include "inxwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class INxWindow; + struct SBitmap; + + /** + * This class defines operations on a the NX background 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. + */ + + class CBgWindow : protected CCallback, public INxWindow + { + private: + NXHANDLE m_hNxServer; /**< Handle to the NX server. */ + NXWINDOW m_hWindow; /**< Handle to the NX background window */ + CWidgetControl *m_widgetControl; /**< The controlling widget for the window */ + + public: + + /** + * Constructor. Obtains the background window from server and wraps + * the window as CBgWindow. Creates an uninitialized instance of the + * CBgWindow object. The open() method must be called to initialize + * the instance. + * + * The general steps to create any window include: + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. + * 3) The window constructor call CWidgetControl methods to "smarten" + * the CWidgetControl instance with window-specific knowledge. + * 4) Call the open() method on the window to display the window. + * 5) After that, the fully smartend CWidgetControl instance can + * be used to generate additional widgets. + * 6) After that, the fully smartened CWidgetControl instance can + * be used to generate additional widgets by passing it to the + * widget constructor + * + * @param hNxServer Handle to the NX server. + * @param widgetControl Controlling widget for this window. + */ + + CBgWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl); + + /** + * Destructor. Returns the background window to the server. + */ + + virtual ~CBgWindow(void); + + /** + * Creates a the new window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully created. + */ + + bool open(void); + + /** + * 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. + * + * @return True on success, false on any failure. + */ + + bool requestPosition(void); + + /** + * Get the position of the window (as reported by the NX callback). NOTE: + * The background window is always positioned at {0,0} + * + * @return The position. + */ + + bool getPosition(FAR struct nxgl_point_s *pPos); + + /** + * Get the size of the window (as reported by the NX callback). NOTE: + * The size of the background window is always the entire display. + * + * @return The size. + */ + + bool getSize(FAR struct nxgl_size_s *pSize); + + /** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on any failure. + */ + + bool setPosition(FAR const struct nxgl_point_s *pPos); + + /** + * Set the size of the selected window. NOTE: The size of the + * background window is always the entire display and cannot be + * changed. + * + * @param pSize The new size of the window. + * @return True on success, false on any failure. + */ + + bool setSize(FAR const struct nxgl_size_s *pSize); + + /** + * Bring the window to the top of the display. NOTE: The background + * window cannot be raised. + * + * @return True on success, false on any failure. + */ + + bool raise(void); + + /** + * Lower the window to the bottom of the display. NOTE: The background + * window is always at the bottom of the window hierarchy. + * + * @return True on success, false on any failure. + */ + + bool lower(void); + + /** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color); + + /** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color); + + /** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + + void getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest); + + /** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color); + + /** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + + bool drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, + nxgl_mxpixel_t color); + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + bool drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color); + + /** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + + bool move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset); + + /** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + + bool bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CBGWINDOW_HXX + diff --git a/libnxwidgets/include/cbitmap.hxx b/libnxwidgets/include/cbitmap.hxx new file mode 100644 index 000000000..473403aa8 --- /dev/null +++ b/libnxwidgets/include/cbitmap.hxx @@ -0,0 +1,204 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbitmap.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CBITMAP_HXX +#define __INCLUDE_CBITMAP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "ibitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Bitmap Structure + */ + + struct SBitmap + { + uint8_t bpp; /**< Bits per pixel */ + uint8_t fmt; /**< Color format */ + nxgl_coord_t width; /**< Width in pixels */ + nxgl_coord_t height; /**< Height in rows */ + uint16_t stride; /**< Width in bytes */ + FAR const void *data; /**< Pointer to the beginning of pixel data */ + }; + + /** + * Class providing bitmap accessor for a bitmap represented by SBitmap. + */ + + class CBitmap : public IBitmap + { + protected: + const struct SBitmap *m_bitmap; /**< The bitmap that is being managed */ + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CBitmap(const CBitmap &bitmap) { } + + public: + + /** + * Constructor. + * + * @param bitmap The bitmap structure being wrapped. + */ + + CBitmap(const struct SBitmap *bitmap); + + /** + * Destructor. + */ + + inline ~CBitmap(void) {} + + /** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + + const uint8_t getColorFormat(void) const; + + /** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + + const uint8_t getBitsPerPixel(void) const; + + /** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + + const nxgl_coord_t getWidth(void) const; + + /** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height. + */ + + const nxgl_coord_t getHeight(void) const; + + /** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width. + */ + + const nxgl_coord_t getStride(void) const; + + /** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + + bool getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CBITMAP_HXX diff --git a/libnxwidgets/include/cbutton.hxx b/libnxwidgets/include/cbutton.hxx new file mode 100644 index 000000000..4af39f0ef --- /dev/null +++ b/libnxwidgets/include/cbutton.hxx @@ -0,0 +1,235 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CBUTTON_HXX +#define __INCLUDE_CBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clabel.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + + /** + * Clickable button widget. Displays text within the button. + */ + + class CButton : public CLabel + { + protected: + + /** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + + virtual void drawOutline(CGraphicsPort *port); + + /** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + * @param useClicked Present outline using the 'clicked' style + */ + + void drawOutline(CGraphicsPort *port, bool useClicked); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @param useClicked Present contents using the 'clicked' style + * @see redraw() + */ + + void drawContents(CGraphicsPort *port, bool useClicked); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @param useClicked Present border using the 'clicked' style + * @see redraw() + */ + + void drawBorder(CGraphicsPort *port, bool useClicked); + + /** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CButton(const CButton &button) : CLabel(button) { } + + public: + + /** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CButton(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * CButton Destructor. + */ + + virtual inline ~CButton() { } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CBUTTON_HXX diff --git a/libnxwidgets/include/cbuttonarray.hxx b/libnxwidgets/include/cbuttonarray.hxx new file mode 100644 index 000000000..d5f8be449 --- /dev/null +++ b/libnxwidgets/include/cbuttonarray.hxx @@ -0,0 +1,317 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbuttonarray.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CBUTTONARRAY_HXX +#define __INCLUDE_CBUTTONARRAY_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clabel.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CNxString; + + /** + * Manages a two-dimensional array of buttons as one widget. A two- + * dimensional array of buttons might also be called a "keyboard". + */ + + class CButtonArray : public CNxWidget + { + protected: + uint8_t m_buttonColumns; /**< The number of columns in one row */ + uint8_t m_buttonRows; /**< The number buttons in one column */ + bool m_redrawButton; /**< True: Redraw button; False: redraw all */ + bool m_cursorOn; /**< Cursor on; hightlighted button displayed */ + bool m_cursorChange; /**< True: Redraw cursor button only */ + nxgl_coord_t m_buttonWidth; /**< The width of one button in pixels */ + nxgl_coord_t m_buttonHeight; /**< The height of one button in rows */ + nxgl_coord_t m_clickX; /**< The X position of the last clicked button */ + nxgl_coord_t m_clickY; /**< The Y position of the last clicked button */ + uint8_t m_cursorColumn; /**< The column index of the highlighted button */ + uint8_t m_cursorRow; /**< The row index of the highlighted button */ + CNxString *m_buttonText; /**< Text for each button */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Redraw only one button + * + * @param port The CGraphicsPort to draw to. + * @param column The button column index + * @param row The button row index + * @param useClicked Draw the button using the 'clicked' button style, + * regardless of the actual button state. + * @see onClick() and onRelease() + */ + + virtual void drawButton(CGraphicsPort *port, int column, int row, bool useClicked); + + /** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Convert an X/Y position to a button column/row index + * + * @param x The x position + * @param y The y position + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return false is the position is invalid + */ + + virtual bool posToButton(nxgl_coord_t x, nxgl_coord_t y, int &column, int &row); + + /** + * Updates the GUI after the text has changed. + */ + + virtual void onTextChange(void); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CButtonArray(const CButtonArray &button) : CNxWidget(button) { } + + public: + + /** + * Constructor for an array of buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * CButtonArray Destructor. + */ + + ~CButtonArray(void); + + /** + * Returns the string shown in the label. + * + * @param column The column index of the button of interest + * @param row The row index of the button of interest + * @return The label's text. + */ + + virtual const CNxString &getText(int column, int row) const; + + /** + * Set the text displayed in the label. + * + * @param column The column index of the button to set + * @param row The row index of the button to set + * @param text String to display. + */ + + virtual void setText(int column, int row, const CNxString &text); + + /** + * Return the position of the last clicked button (0,0 will be returned + * the no button has every been clicked). The button at this position + * is currently clicked then, in addition, return true. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if any button in the array is clicked + */ + + virtual bool isButtonClicked(int &column, int &row) const; + + /** + * Check if this specific button in the array is clicked + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is clicked + */ + + virtual bool isThisButtonClicked(int column, int row) const; + + /** + * Control the cursor state. + * + * @param cursorOn True(1), the current cursor position will be highlighted + */ + + virtual void cursor(bool cursorOn); + + /** + * Return the current cursor position (button indices) and an indication + * if the button at the cursor is currently hightlighted. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if the cursor is enabled and the button is highlighted + */ + + virtual bool getCursorPosition(int &column, int &row) const; + + /** + * Set the cursor position (button indices). Note that the cursor + * does not have to be enabled to set the position. + * + * @param column The column index of the button of interest + * @param row The row index of the button of interest + * @return True if the cursor position is valid + */ + + virtual bool setCursorPosition(int column, int row); + + /** + * Check if this specific button in the array is at the cursor position + * and highlighted. + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is at the cursor postion and highlighted. + */ + + virtual bool isCursorPosition(int column, int row) const; + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + + virtual void setFont(CNxFont *font); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CBUTTONARRAY_HXX diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx new file mode 100644 index 000000000..0e0d5de8b --- /dev/null +++ b/libnxwidgets/include/ccallback.hxx @@ -0,0 +1,220 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ccallback.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CCALLBACK_HXX +#define __INCLUDE_CCALLBACK_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crect.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * Callback function proxies. This class receives and dispatches callbacks + * from the NX server. This calls also manages a few lower-level details + * such as keeping track of the reported window handles and window positions + * and sizes. + * + * 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. + + */ + + class CCallback + { + private: + struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ + + // Methods in the callback vtable + + /** + * Re-Draw Callback. The redraw event is handled by CWidgetControl::redrawEvent. + * + * NOTE: This method runs in the context of the NX callback which may + * either be the context of the owning thread or, in the case of multi- + * user NX, the context of the NX event listener thread. + * + * @param hWindow Handle to a specific NX window. + * @param pRect The rectangle that needs to be re-drawn (in window + * relative coordinates). + * @param bMore true: More re-draw requests will follow. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + + static void redraw(NXHANDLE hWindow, FAR const struct nxgl_rect_s *pRect, + bool bMore, FAR void *pvArg); + + /** + * Position Callback. The new positional data is handled by + * CWidgetControl::geometryEvent. + * + * NOTE: This method runs in the context of the NX callback which may + * either be the context of the owning thread or, in the case of multi- + * user NX, the context of the NX event listener thread. + * + * @param hWindow Handle to a specific NX window. + * @param pSize The size of the window. + * @param pPos The position of the upper left hand corner of the window on + * the overall display. + * @param pBounds The bounding rectangle that describes the entire display. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + + static void position(NXHANDLE hWindow, FAR const struct nxgl_size_s *pSize, + FAR const struct nxgl_point_s *pPos, + FAR const struct nxgl_rect_s *pBounds, + FAR void *pvArg); + + /** + * New mouse data is available for the window. The new mouse + * data is handled by CWidgetControl::newMouseEvent. + * + * NOTE: This method runs in the context of the NX callback which may + * either be the context of the NX event listener thread (if multi- + * user NX), or possibly in the connects of device driver or even a + * device driver interrupt. + * + * The GUI thread is probably sleeping a semaphore, waiting to be + * awakened by a mouse or keyboard event. + * + * @param hWindow Handle to a specific NX window. + * @param pPos The (x,y) position of the mouse. + * @param buttons See NX_MOUSE_* definitions. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +#ifdef CONFIG_NX_MOUSE + static void newMouseEvent(NXHANDLE hWindow, FAR const struct nxgl_point_s *pPos, + uint8_t buttons, FAR void *pvArg); +#endif /* CONFIG_NX_MOUSE */ + + /** + * New keyboard/keypad data is available for the window. The new + * keyboard data is handled by CWidgetControl::newKeyboardEvent. + * + * NOTE: This method runs in the context of the NX callback which may + * either be the context of the NX event listener thread (if multi- + * user NX), or possibly in the connects of device driver or even a + * device driver interrupt. + * + * The GUI thread is probably sleeping a semaphore, waiting to be + * awakened by a mouse or keyboard event. + * + * @param hWindow Handle to a specific NX window. + * @param nCh The number of characters that are available in pStr[]. + * @param pStr The array of characters. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +#ifdef CONFIG_NX_KBD + static void newKeyboardEvent(NXHANDLE hWindow, uint8_t nCh, FAR const uint8_t *pStr, + FAR void *pvArg); +#endif // CONFIG_NX_KBD + + public: + + /** + * Constructor. + * + * @param pWidgetControl Control object associated with this window + */ + + CCallback(CWidgetControl *pWidgetControl); + + /** + * Destructor. + */ + + inline ~CCallback(void) {} + + /** + * Get the callback vtable. This is neeed only by the window + * instance that inherits this class. The window instance needs the + * C-callable vtable in order to create the NX window. Once the + * window is created, this class will begin to receive callbacks via + * the C-callable vtable methods. + * + * @return This method returns the C-callable vtable needed for + * NX window creation. + */ + + inline FAR struct nx_callback_s *getCallbackVTable(void) + { + return &m_callbacks; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CCALLBACK_HXX + diff --git a/libnxwidgets/include/ccheckbox.hxx b/libnxwidgets/include/ccheckbox.hxx new file mode 100644 index 000000000..109e7839e --- /dev/null +++ b/libnxwidgets/include/ccheckbox.hxx @@ -0,0 +1,210 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ccheckbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CCHECKBOX_HXX +#define __INCLUDE_CCHECKBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbutton.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * Class representing a checkbox. Like radio buttons, checkboxes + * are tri-state - off, on and "mu". The mu state cannot be enabled by + * a user - it can only be set by the developer. + */ + + class CCheckBox : public CButton + { + public: + + /** + * Enum listing all possible checkbox states. + */ + + enum CheckBoxState + { + CHECK_BOX_STATE_OFF = 0, /**< Checkbox is unticked */ + CHECK_BOX_STATE_ON = 1, /**< Checkbox is ticked */ + CHECK_BOX_STATE_MU = 2 /**< Checkbox is in the third state */ + }; + + protected: + CheckBoxState m_state; /**< The state of the checkbox */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Toggles the state of the checkbox. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CCheckBox(const CCheckBox &checkBox) : CButton(checkBox) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the checkbox, relative to its parent. + * @param y The y coordinate of the checkbox, relative to its parent. + * @param width The width of the checkbox. + * @param height The height of the checkbox. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CCheckBox(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CCheckBox(void) { } + + /** + * Get the current state of the checkbox. + * + * @return The state of the checkbox. + */ + + virtual inline const CheckBoxState getState(void) const + { + return m_state; + } + + /** + * Set the state of the checkbox. + * + * @param state The new checkbox state. + */ + + virtual void setState(CheckBoxState state); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CCHECKBOX_HXX + diff --git a/libnxwidgets/include/ccyclebutton.hxx b/libnxwidgets/include/ccyclebutton.hxx new file mode 100644 index 000000000..5fd9405d8 --- /dev/null +++ b/libnxwidgets/include/ccyclebutton.hxx @@ -0,0 +1,356 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ccyclebutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CCYLEBUTTON_HXX +#define __INCLUDE_CCYLEBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbutton.hxx" +#include "ilistdataeventhandler.hxx" +#include "clistdata.hxx" +#include "clistdataitem.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + + /** + * Cycle button widget. Displays text within the button. Clicking it cycles + * through its available options. + */ + + class CCycleButton : public CButton, public IListDataEventHandler + { + protected: + + CListData m_options; /**< Option storage. */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + + virtual void drawOutline(CGraphicsPort *port); + + /** + * Selects the next option in the list and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Prevents the CButton onResize() method from recalculating the text + * positions by overriding it. + * + * @param width The new width. + * @param height The new height. + */ + + virtual inline void onResize(nxgl_coord_t width, nxgl_coord_t height) { } + + /** + * Override method in Label class to prevent recalculation of text positions. + */ + + virtual inline void calculateTextPosition(void) { } + + /** + * Destructor. + */ + + virtual ~CCycleButton(void) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CCycleButton(const CCycleButton &cycleButton) : CButton(cycleButton) { } + + public: + + /** + * Constructor for cycle buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param style The style that the button should use. If this is not + * specified, the button will use the values stored in the global + * g_defaultWidgetStyle object. The button will copy the properties of + * the style into its own internal style object. + */ + + CCycleButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Add a new option to the widget. + * + * @param text The text of the option. + * @param value The value of the option. + */ + + void addOption(const CNxString &text, const uint32_t value); + + /** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeOption(const int index); + + /** + * Remove all options from the widget. + */ + + virtual void removeAllOptions(void); + + /** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual void selectOption(const int index); + + /** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * option is selected, the index of the first selected option is returned. + * + * @return The selected index. + */ + + virtual const int getSelectedIndex(void) const; + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected options to deselected. + * Redraws the widget and raises a value changed event. + * + * @param index The selected index. + */ + + virtual void setSelectedIndex(const int index); + + /** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual const CListDataItem *getSelectedOption(void) const; + + /** + * Get the value of the current option. + * + * @return Value of the current option. + */ + + inline const uint32_t getValue(void) const + { + return getSelectedOption()->getValue(); + } + + /** + * Get the specified option. + * + * @return The specified option. + */ + + virtual inline const CListDataItem *getOption(const int index) + { + return m_options.getItem(index); + } + + /** + * Sort the options alphabetically by the text of the options. + */ + + virtual void sort(void); + + /** + * Get the total number of options. + * + * @return The number of options. + */ + + virtual inline const int getOptionCount(void) const + { + return m_options.getItemCount(); + } + + /** + * Sets whether or not items added to the list are automatically sorted + * on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual inline void setSortInsertedItems(const bool sortInsertedItems) + { + m_options.setSortInsertedItems(sortInsertedItems); + } + + /** + * Handles list data changed events. + * + * @param e Event arguments. + */ + + virtual void handleListDataChangedEvent(const CListDataEventArgs &e); + + /** + * Handles list selection changed events. + * + * @param e Event arguments. + */ + + virtual void handleListDataSelectionChangedEvent(const CListDataEventArgs &e); + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CCYLEBUTTON_HXX diff --git a/libnxwidgets/include/cglyphbutton.hxx b/libnxwidgets/include/cglyphbutton.hxx new file mode 100644 index 000000000..aad348ca9 --- /dev/null +++ b/libnxwidgets/include/cglyphbutton.hxx @@ -0,0 +1,229 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CGLYPHBUTTON_HXX +#define __INCLUDE_CGLYPHBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + struct SBitmap; + + /** + * Class representing a button that will display a glyph. + * Class representing a clickable button that contains a bitmap image + * instead of text. Displays two bitmaps, one when the button is clicked, + * and one when it isn't. The bitmaps should be the same size. + */ + + class CGlyphButton : public CNxWidget + { + protected: + + FAR const struct SBitmap *m_bitmapNormal; /**< Bitmap when button is not clicked */ + FAR const struct SBitmap *m_bitmapClicked; /**< Bitmap when button is clicked */ + nxgl_coord_t m_bitmapX; /**< X coordinate of the bitmaps */ + nxgl_coord_t m_bitmapY; /**< Y coordinate of the bitmaps */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * + * @param port Graphics port to draw to. + */ + + virtual void drawOutline(CGraphicsPort *port); + + /** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CGlyphButton(const CGlyphButton &button) : CNxWidget(button) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button. + * @param y The y coordinate of the button. + * @param width The width of the button. + * @param height The height of the button. + * @param normalGlyph Glyph to display when unclicked. + * @param clickedGlyph Glyph to display when clicked. + * @param bitmapX The x coordinate at which the bitmaps will be drawn. + * @param bitmapY The y coordinate at which the bitmaps will be drawn. + * @param style The style that the button should use. If this is not + * specified, the button will use the values stored in the global + * g_defaultWidgetStyle object. The button will copy the properties of + * the style into its own internal style object. + */ + + CGlyphButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_coord_t bitmapX, nxgl_coord_t bitmapY, + FAR const struct SBitmap *normalGlyph, + FAR const struct SBitmap *clickedGlyph, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CGlyphButton(void) { } + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CGLYPHBUTTON_HXX diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx new file mode 100644 index 000000000..404fb1d51 --- /dev/null +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -0,0 +1,411 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cgraphicsport.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CGRAPHICSPORT_HXX +#define __INCLUDE_CGRAPHICSPORT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "inxwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxFont; + class CNxString; + class CRect; + struct SBitmap; + + /** + * CGraphicsPort is the interface between a NXwidget and NX layer. + */ + + class CGraphicsPort + { + private: + INxWindow *m_pNxWnd; /**< NX window interface. */ + + public: + /** + * Constructor. + * + * @param pNxWnd An instance of the underlying window type. + */ + + CGraphicsPort(INxWindow *pNxWnd); + + /** + * Destructor. + */ + + virtual ~CGraphicsPort(); + + /** + * Return the absolute x coordinate of the upper left hand corner of the + * underlying window. + * + * @return The x coordinate of the window. + */ + + const nxgl_coord_t getX(void) const; + + /** + * Return the absolute y coordinate of the upper left hand corner of the + * underlying window. + * + * @return The y coordinate of the window. + */ + + const nxgl_coord_t getY(void) const; + + /** + * Draw a pixel into the window. + * + * @param x The window-relative x coordinate of the pixel. + * @param y The window-relative y coordinate of the pixel. + * @param color The color of the pixel. + */ + + void drawPixel(nxgl_coord_t x, nxgl_coord_t y, nxgl_mxpixel_t color); + + /** + * Draw a horizontal line of the specified start position, width, and + * color. + * + * @param x The x coordinate of the line. + * @param y The y coordinate of the top-most end of the line. + * @param width The width of the line in pixels. + * @param color The color of the line. + */ + + void drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_mxpixel_t color); + + /** + * Draw a vertical line of the specified start position, width, and + * color. + * + * @param x The x coordinate of the left-most end of the line. + * @param y The y coordinate of the line. + * @param height The height of the line in rows. + * @param color The color of the line. + */ + + void drawVertLine(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t height, + nxgl_mxpixel_t color); + + /** + * Draw a line of a fixed color in the window. + * + * @param x1 The x coordinate of the start point of the line. + * @param y1 The y coordinate of the start point of the line. + * @param x2 The x coordinate of the end point of the line. + * @param y2 The y coordinate of the end point of the line. + * @param color The color of the line. + */ + + void drawLine(nxgl_coord_t x1, nxgl_coord_t y1, + nxgl_coord_t x2, nxgl_coord_t y2, + nxgl_mxpixel_t color); + + /** + * Draw a filled rectangle of the specified start position, end position, + * width, and color. + * + * @param x The window-relative x coordinate of the rectangle. + * @param y The window-relative y coordinate of the rectangle. + * @param width The width of the rectangle in pixels. + * @param height The height of the rectangle in rows. + * @param color The color of the rectangle. + */ + + void drawFilledRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height, nxgl_mxpixel_t color); + + /** + * Draw an unfilled rectangle to the window + * + * @param x The window-relative x coordinate of the rectangle. + * @param y The window-relative y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param color The color of the rectangle . + */ + + void drawRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height, nxgl_mxpixel_t color); + + /** + * Draw a bevelled rectangle to the window. + * + * @param x The x coordinate of the rectangle. + * @param y The y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param shineColor The color of the top/left sides. + * @param shadowColor The color of the bottom/right sides. + */ + + void drawBevelledRect(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_mxpixel_t shineColor, + nxgl_mxpixel_t shadowColor); + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + inline void drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) + { + (void)m_pNxWnd->drawFilledCircle(center, radius, color); + } + + /** + * Draw a string to the window. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + */ + + void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string); + + /** + * Draw a particular length of a string to the window in a secific color. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param color The color of the string. + */ + + void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string, int startIndex, int length, + nxgl_mxpixel_t color); + + /** + * Draw a portion of a string to the window. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + */ + + void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string, int startIndex, int length); + + /** + * Draw an opaque bitmap to the window. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied + * bitmap to use as the origin. + * @param bitmapY The window-relative y coordinate within the supplied + * bitmap to use as the origin. + */ + + void drawBitmap(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, int bitmapX, int bitmapY); + + /** + * Draw a bitmap to the window, using the supplied transparent + * color as an invisible color. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied bitmap to use as + * the origin. + * @param bitmapY The window-relative y coordinate within the supplied bitmap to use as + * the origin. + * @param transparentColor The transparent color used in the bitmap. + */ + + void drawBitmap(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, int bitmapX, int bitmapY, + nxgl_mxpixel_t transparentColor); + + /** + * Draw a bitmap to the port in greyscale. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied bitmap to use as + * the origin. + * @param bitmapY The window-relative y coordinate within the supplied bitmap to use as + * the origin. + */ + + void drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, int bitmapX, int bitmapY); + + /** + * Copy a rectangular region from the source coordinateinates to the + * destination coordinateinates. + * + * @param sourceX Source x coordinate. + * @param sourceY Source y coordinate. + * @param destX Destination x coordinate. + * @param destY Destination y coordinate. + * @param width Width of the rectangle to copy. + * @param height Height of the rectangle to copy. + */ + + void copy(nxgl_coord_t sourceX, nxgl_coord_t sourceY, + nxgl_coord_t destX, nxgl_coord_t destY, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Move a region by a specified distance in two dimensions. + * + * @param x X coordinate of the source area to move. + * @param y Y coordinate of the source area to move. + * @param deltaX Horizontal distance to move. + * @param deltaY Vertical distance to move. + * @param width Width of the area to move. + * @param height Height of the area to move. + */ + + void move(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t deltaX, nxgl_coord_t deltaY, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Convert the region to greyscale. + * + * @param x X coordinate of the region to change. + * @param y Y coordinate of the region to change. + * @param width Width of the region to change. + * @param height Height of the region to change. + */ + + void greyScale(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Invert colors in a region. NOTE: This allocates an in-memory + * buffer the size of one row in graphic memory. So it may only be + * useful for inverting small regions and its only current use of for + * the inverted cursor text. + * + * @param x X coordinate of the region to change. + * @param y Y coordinate of the region to change. + * @param width Width of the region to change. + * @param height Height of the region to change. + */ + + void invert(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CGRAPHICSPORT_HXX diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx new file mode 100644 index 000000000..fa87b3f9c --- /dev/null +++ b/libnxwidgets/include/cimage.hxx @@ -0,0 +1,199 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cimage.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CIMAGE_HXX +#define __INCLUDE_CIMAGE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class IBitmap; + + /** + * Simple image widget for present static images in the widget framework. + */ + + class CImage : public CNxWidget + { + protected: + FAR IBitmap *m_bitmap; /**< Source bitmap image */ + struct nxgl_point_s m_origin; /**< Origin for offset image display position */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CImage(const CImage &label) : CNxWidget(label) { }; + + public: + + /** + * Constructor for a label containing a string. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the image box, relative to its parent. + * @param y The y coordinate of the image box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param bitmap The source bitmap image. + * @param style The style that the widget should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, FAR IBitmap *bitmap, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CImage() { } + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + + void getPreferredDimensions(CRect &rect) const; + + /** + * Set the horizontal position of the bitmap. Zero is the left edge + * of the bitmap and values >0 will move the bit map to the right. + * This method is useful for horizontal scrolling a large bitmap + * within a smaller window + */ + + void setImageLeft(nxgl_coord_t column); + + /** + * Set the vertical position of the bitmap. Zero is the top edge + * of the bitmap and values >0 will move the bit map down. + * This method is useful for vertical scrolling a large bitmap + * within a smaller window + */ + + void setImageTop(nxgl_coord_t row); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CIMAGE_HXX diff --git a/libnxwidgets/include/ckeypad.hxx b/libnxwidgets/include/ckeypad.hxx new file mode 100644 index 000000000..2f2a754d4 --- /dev/null +++ b/libnxwidgets/include/ckeypad.hxx @@ -0,0 +1,156 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ckeypad.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CKEYPAD_HXX +#define __INCLUDE_CKEYPAD_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbuttonarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CWidgetStyle; + + /** + * Extends the CButtonArray class to support a alphanumeric keypad. + */ + + class CKeypad : public CButtonArray + { + protected: + NXHANDLE m_hNxServer; /**< NX server handle */ + bool m_numeric; /**< True: Numeric keypad, False: Alpha */ + + /** + * Configure the keypad for the currenly selected display mode. + */ + + void configureKeypadMode(void); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CKeypad(const CKeypad &keypad) : CButtonArray(keypad) { } + + public: + + /** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The widget control for the display. + * @param hNxServer The NX server that will receive the keyboard input + * @param x The x coordinate of the keypad, relative to its parent. + * @param y The y coordinate of the keypad, relative to its parent. + * @param width The width of the keypad + * @param height The height of the keypad + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CKeypad(CWidgetControl *pWidgetControl, NXHANDLE hNxServer, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * CKeypad Destructor. + */ + + inline ~CKeypad(void) {} + + /** + * Returns the current keypad display mode + * + * @return True: keypad is in numeric mode. False: alphanumeric. + */ + + inline const bool isNumericKeypad(void) const + { + return m_numeric; + } + + /** + * Returns the current keypad display mode + * + * @param mode True: put keypad in numeric mode. False: in alphanumeric. + */ + + inline void setKeypadMode(bool numeric) + { + m_numeric = numeric; + configureKeypadMode(); + } + + /** + * Catch button clicks. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CKEYPAD_HXX diff --git a/libnxwidgets/include/clabel.hxx b/libnxwidgets/include/clabel.hxx new file mode 100644 index 000000000..62ed1cda7 --- /dev/null +++ b/libnxwidgets/include/clabel.hxx @@ -0,0 +1,355 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clabel.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLABEL_HXX +#define __INCLUDE_CLABEL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CRect; + + /** + * Single-line label widget. Can align text both vertically and + * horizontally in different ways. + */ + + class CLabel : public CNxWidget + { + public: + + /** + * Enum of horizontal alignment options. + */ + + enum TextAlignmentHoriz + { + TEXT_ALIGNMENT_HORIZ_CENTER = 0, /**< Centre the text */ + TEXT_ALIGNMENT_HORIZ_LEFT = 1, /**< Align left */ + TEXT_ALIGNMENT_HORIZ_RIGHT = 2 /**< Align right */ + }; + + /** + * Enum of vertical alignment options. + */ + + enum TextAlignmentVert + { + TEXT_ALIGNMENT_VERT_CENTER = 0, /**< Align to centre of textbox */ + TEXT_ALIGNMENT_VERT_TOP = 1, /**< Align to top of textbox */ + TEXT_ALIGNMENT_VERT_BOTTOM = 2 /**< Align to bottom of textbox */ + }; + + protected: + CNxString m_text; /**< Text that the textbox will display */ + struct nxgl_point_s m_align; /**< X/Y offset for text alignment */ + TextAlignmentHoriz m_hAlignment; /**< Horizontal alignment of the text */ + TextAlignmentVert m_vAlignment; /**< Vertical alignment of the text */ + bool m_textChange; /**< Redraw is due to a text change */ + bool m_highlighted; /**< Label is highlighted */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * @param port The CGraphicsPort to draw to. + * + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Resize the widget to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Calculate the vertical position of the string based on the font + * + * height and the alignment options. + */ + + virtual void calculateTextPositionVertical(void); + + /** + * Calculate the position of the string based on its length and the + * alignment options. + */ + + virtual void calculateTextPositionHorizontal(void); + + /** + * Updates the GUI after the text has changed. + */ + + virtual void onTextChange(void); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CLabel(const CLabel &label) : CNxWidget(label) { }; + + public: + + /** + * Constructor for a label containing a string. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CLabel(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CLabel() { } + + /** + * Set the horizontal alignment of text within the label. + * + * @param alignment The horizontal position of the text. + */ + + virtual void setTextAlignmentHoriz(TextAlignmentHoriz alignment); + + /** + * Set the vertical alignment of text within the label. + * + * @param alignment The vertical position of the text. + */ + + virtual void setTextAlignmentVert(TextAlignmentVert alignment); + + /** + * Set the horizontal alignment of text within the label. + * + * @param alignment The horizontal position of the text. + */ + + inline const TextAlignmentHoriz getTextAlignmentHoriz(void) const + { + return m_hAlignment; + } + + /** + * Set the vertical alignment of text within the label. + * + * @param alignment The vertical position of the text. + */ + + inline const TextAlignmentVert getTextAlignmentVert(void) const + { + return m_vAlignment; + } + + /** + * Returns the string shown in the label. + * + * @return The label's text. + */ + + virtual inline const CNxString &getText(void) const + { + return m_text; + } + + /** + * Set the text displayed in the label. + * + * @param text String to display. + */ + + virtual void setText(const CNxString &text); + + /** + * Append new text to the end of the current text displayed in the + * label. + * + * @param text String to append. + */ + + virtual void appendText(const CNxString &text); + + /** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + + virtual void insertText(const CNxString &text, const int index); + + /** + * Control the highlight state. + * + * @param highlightOn True(1), the label will be highlighted + */ + + virtual void highlight(bool highlightOn); + + /** + * Return the current highlight state. + * + * @return True if the label is highlighted + */ + + virtual inline bool isHighlighted(void) const + { + return m_highlighted; + } + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + + virtual void setFont(CNxFont *font); + + /** + * Is the redraw due to a text-only change? + * + * @return True if the redraw was caused by a text change + */ + + virtual inline bool isTextChange(void) const + { + return m_textChange; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLABEL_HXX diff --git a/libnxwidgets/include/clatchbutton.hxx b/libnxwidgets/include/clatchbutton.hxx new file mode 100644 index 000000000..c0b37d64b --- /dev/null +++ b/libnxwidgets/include/clatchbutton.hxx @@ -0,0 +1,173 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clatchbutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLATCHBUTTON_HXX +#define __INCLUDE_CLATCHBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cstickybutton.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * CButton that latches down when clicked and unlatches when clicked again. + */ + + class CLatchButton : public CStickyButton + { + protected: + /** + * Handles button click events + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CLatchButton(const CLatchButton &button) : CStickyButton(button) { } + + public: + + /** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CLatchButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CLatchButton(void) { } + + /** + * Check if the button is latched + * + * @return True if the button is latched + */ + + inline const bool isLatched(void) const + { + return isStuckDown(); + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLATCHBUTTON_HXX diff --git a/libnxwidgets/include/clatchbuttonarray.hxx b/libnxwidgets/include/clatchbuttonarray.hxx new file mode 100644 index 000000000..bffeb58a1 --- /dev/null +++ b/libnxwidgets/include/clatchbuttonarray.hxx @@ -0,0 +1,170 @@ +/**************************************************************************** + * include/clatchbuttonarray.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CLATCHBUTTONARRAY_HXX +#define __INCLUDE_CLATCHBUTTONARRAY_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cstickybuttonarray.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CNxString; + + /** + * Manages a two-dimensional array of buttons as one widget. When a button + * is clicked is latches (i.e., it stays pushed after the press is released. + * The behavior is then like radio buttons: Pressing each each button in + * the array unlatches the previous button and latches the new button. + * + * Unlike CLatchButton, pressing the same button more than once has no + * effect. + */ + + class CLatchButtonArray : public CStickyButtonArray + { + protected: + /** + * Handles button click events + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CLatchButtonArray(const CLatchButtonArray &button) : CStickyButtonArray(button) { } + + public: + + /** + * Constructor for an array of latch buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CLatchButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * CLatchButtonArray Destructor. + */ + + virtual inline ~CLatchButtonArray(void) { } + + /** + * Return the position of the last latched button (0,0 will be returned + * the no button has every been latched). The button at this position + * is currently latched then, in addition, return true. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if a button in the array is latched + */ + + inline const bool isAnyButtonLatched(int &column, int &row) const + { + return isAnyButtonStuckDown(column, row); + } + + /** + * Check if this specific button in the array is latched + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is clicked + */ + + inline const bool isThisButtonLatched(int column, int row) const + { + return isThisButtonStuckDown(column, row); + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLATCHBUTTONARRAY_HXX diff --git a/libnxwidgets/include/clistbox.hxx b/libnxwidgets/include/clistbox.hxx new file mode 100644 index 000000000..7afa76920 --- /dev/null +++ b/libnxwidgets/include/clistbox.hxx @@ -0,0 +1,431 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTBOX_HXX +#define __INCLUDE_CLISTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cscrollingpanel.hxx" +#include "ilistdataeventhandler.hxx" +#include "clistdata.hxx" +#include "clistboxdataitem.hxx" +#include "cwidgetstyle.hxx" +#include "ilistbox.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class providing a scrollable list of options. The CListBox can be set + * up to only allow one selection or multiple selections. Processes + * double-clicks and raises double-click events, so that a double-click + * on an option can be made to automatically select and close a window/etc. + * The options themselves have user-definable text and background colors + * for their selected and unselected states. + */ + + class CListBox : public IListBox, public CScrollingPanel, + public IListDataEventHandler + { + protected: + CListData m_options; /**< Option storage. */ + uint8_t m_optionPadding; /**< Padding between options. */ + int m_lastSelectedIndex; /**< Index of the last option selected. */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Determines which item was clicked and selects or deselects it as + * appropriate. Also starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Selects the clicked item and deselects all others. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Select or deselect an option by its index. Does not deselect any other + * selected options. Set index to -1 to select nothing. Redraws the widget + * and raises a value changed event. + * + * @param index The index of the option to select. + * @param selected True to select the option, false to deselect it. + */ + + virtual void setOptionSelected(const int index, const bool selected); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CListBox(const CListBox &listBox) : CScrollingPanel(listBox) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CListBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual ~CListBox(void); + + /** + * Add a new option to the widget using default colors. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + + virtual void addOption(const CNxString &text, const uint32_t value); + + /** + * Add an option to the widget. + * + * @param option The option to add. + */ + + virtual void addOption(CListBoxDataItem *option); + + /** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeOption(const int index); + + /** + * Remove all options from the widget. + */ + + virtual void removeAllOptions(void); + + /** + * Add a new option to the widget. + * + * @param text Text to show in the option. + * @param value The value of the option. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + + virtual void addOption(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor); + + /** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual void selectOption(const int index); + + /** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual void deselectOption(const int index); + + /** + * Select all options. Does nothing if the listbox does not allow + * multiple selections. Redraws the widget and raises a value changed + * event. + */ + + virtual void selectAllOptions(void); + + /** + * Deselect all options. + * Redraws the widget and raises a value changed event. + */ + + virtual void deselectAllOptions(void); + + /** + * Get the selected index. Returns -1 if nothing is selected. If + * more than one option is selected, the index of the first selected + * option is returned. + * + * @return The selected index. + */ + + virtual const int getSelectedIndex(void) const; + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected options to deselected. Redraws the widget and raises + * a value changed event. + * + * @param index The selected index. + */ + + virtual void setSelectedIndex(const int index); + + /** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual const CListBoxDataItem *getSelectedOption(void) const; + + /** + * Sets whether multiple selections are possible or not. + * + * @param allowMultipleSelections True to allow multiple selections. + */ + + virtual inline void + setAllowMultipleSelections(const bool allowMultipleSelections) + { + m_options.setAllowMultipleSelections(allowMultipleSelections); + } + + /** + * Sets whether multiple selections are possible or not. + * + * @return True if multiple selections are allowed. + */ + + virtual inline const bool allowsMultipleSelections(void) const + { + return m_options.allowsMultipleSelections(); + } + + /** + * Resize the scrolling canvas to encompass all options. + */ + + virtual void resizeCanvas(void); + + /** + * Get the specified option. + * + * @return The specified option. + */ + + virtual inline const CListBoxDataItem *getOption(const int index) + { + return (const CListBoxDataItem *)m_options.getItem(index); + } + + /** + * Sort the options alphabetically by the text of the options. + */ + + virtual void sort(void); + + /** + * Get the total number of options. + * + * @return The number of options. + */ + + virtual inline const int getOptionCount(void) const + { + return m_options.getItemCount(); + } + + /** + * Get the height of a single option. + * + * @return The height of an option. + */ + + virtual const nxgl_coord_t getOptionHeight(void) const; + + /** + * Sets whether or not items added to the list are automatically sorted on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual inline void setSortInsertedItems(const bool sortInsertedItems) + { + m_options.setSortInsertedItems(sortInsertedItems); + } + + /** + * Handles list data changed events. + * + * @param e Event arguments. + */ + + virtual void handleListDataChangedEvent(const CListDataEventArgs &e); + + /** + * Handles list selection changed events. + * + * @param e Event arguments. + */ + + virtual void handleListDataSelectionChangedEvent(const CListDataEventArgs &e); + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Check if the click is a double-click. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click is a double-click. + */ + + virtual bool isDoubleClick(nxgl_coord_t x, nxgl_coord_t y); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTBOX_HXX + diff --git a/libnxwidgets/include/clistboxdataitem.hxx b/libnxwidgets/include/clistboxdataitem.hxx new file mode 100644 index 000000000..9a1358d39 --- /dev/null +++ b/libnxwidgets/include/clistboxdataitem.hxx @@ -0,0 +1,180 @@ +/**************************************************************************** + * include/clistboxdataitem.hxx + * NxWidgets/libnxwidgets/ + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTBOXDATAITEM_HXX +#define __INCLUDE_CLISTBOXDATAITEM_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clistdataitem.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a data item within a ListBox. + */ + + class CListBoxDataItem : public CListDataItem + { + private: + nxwidget_pixel_t m_normalTextColor; /**< Color used for text when not selected. */ + nxwidget_pixel_t m_normalBackColor; /**< Color used for background when not selected. */ + nxwidget_pixel_t m_selectedTextColor; /**< Color used for text when selected. */ + nxwidget_pixel_t m_selectedBackColor; /**< Color used for background when selected. */ + + public: + + /** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + + CListBoxDataItem(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor); + + /** + * Get the color used for text when the item is unselected. + * + * @return The text color when the item is unselected. + */ + + inline nxwidget_pixel_t getNormalTextColor(void) const + { + return m_normalTextColor; + } + + /** + * Get the color used for the background when the item is unselected. + * + * @return The background color when the item is unselected. + */ + + inline nxwidget_pixel_t getNormalBackColor(void) const + { + return m_normalBackColor; + } + + /** + * Get the color used for text when the item is selected. + * + * @return The text color when the item is selected. + */ + + inline nxwidget_pixel_t getSelectedTextColor(void) const + { + return m_selectedTextColor; + } + + /** + * Get the color used for the background when the item is selected. + * + * @return The background color when the item is selected. + */ + + inline nxwidget_pixel_t getSelectedBackColor(void) const + { + return m_selectedBackColor; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTBOXDATAITEM_HXX + diff --git a/libnxwidgets/include/clistdata.hxx b/libnxwidgets/include/clistdata.hxx new file mode 100644 index 000000000..d88abd9fc --- /dev/null +++ b/libnxwidgets/include/clistdata.hxx @@ -0,0 +1,351 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdata.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATA_HXX +#define __INCLUDE_CLISTDATA_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "tnxarray.hxx" +#include "ilistdataeventhandler.hxx" +#include "clistdataitem.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a list of items. Designed to be used by the + * CListBox class, etc, to store its data. Fires events to notify + * listeners when the list changes or a new selection is made. + */ + + class CListData + { + protected: + TNxArray m_items; /**< Collection of list data items. */ + TNxArray m_listDataEventhandlers; /**< Collection of event handlers. */ + bool m_allowMultipleSelections; /**< If true, multiple options can + be selected. */ + bool m_sortInsertedItems; /**< Automatically sorts items on + insertion if true. */ + + /** + * Quick sort the items using their compareTo() methods. + * + * @param start The index to start sorting at. + * @param end The index to stop sorting at. + */ + + virtual void quickSort(const int start, const int end); + + /** + * Swap the locations of two items in the array. + * + * @param index1 The index of the first item to swap. + * @param index2 The index of the second item to swap. + */ + + virtual void swapItems(const int index1, const int index2); + + /** + * Return the index that an item should be inserted at to maintain a sorted list of data. + * + * @param item The item to insert. + * @return The index that the item should be imserted into at. + */ + + const int getSortedInsertionIndex(const CListDataItem *item) const; + + /** + * Raise a data changed event. + */ + + void raiseDataChangedEvent(void); + + /** + * Raise a selection changed event. + */ + + void raiseSelectionChangedEvent(void); + + public: + + /** + * Constructor. + */ + CListData(void); + + /** + * Destructor. + */ + virtual ~CListData(void); + + /** + * Add a new item. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + + virtual void addItem(const CNxString &text, const uint32_t value); + + /** + * Add an existing item. CListData becomes the owner of the option and will delete it + * when the list is deleted. + * + * @param item The item to add. + */ + + virtual void addItem(CListDataItem *item); + + /** + * Remove an item by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeItem(const int index); + + /** + * Select an item by its index. + * + * @param index The index of the item to select. + */ + + virtual void selectItem(const int index); + + /** + * Deselect an item by its index. + * + * @param index The index of the item to select. + */ + + virtual void deselectItem(const int index); + + /** + * Remove all items. + */ + + virtual void removeAllItems(void); + + /** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * item is selected, the index of the first selected item is returned. + * + * @return The selected index. + */ + + virtual const int getSelectedIndex(void) const; + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected items to deselected. + * + * @param index The selected index. + */ + + virtual void setSelectedIndex(const int index); + + /** + * Get the selected item. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual const CListDataItem *getSelectedItem(void) const; + + /** + * Sets whether multiple selections are possible or not. + * + * @param allowMultipleSelections True to allow multiple selections. + */ + + virtual inline void + setAllowMultipleSelections(const bool allowMultipleSelections) + { + m_allowMultipleSelections = allowMultipleSelections; + } + + /** + * Get the specified item. + * + * @return The specified item. + */ + + virtual inline const CListDataItem *getItem(const int index) const + { + return m_items[index]; + } + + /** + * Sort the items using their compareTo() methods. + */ + + virtual void sort(void); + + /** + * Get the total number of items. + * + * @return The number of items. + */ + + virtual inline const int getItemCount(void) const + { + return m_items.size(); + } + + /** + * Select all items. Does nothing if the list does not allow + * multiple selections. + */ + + virtual void selectAllItems(void); + + /** + * Deselect all items. + */ + + virtual void deselectAllItems(void); + + /** + * Select or deselect an item by its index. Does not deselect any + * other selected items. Set index to -1 to select nothing. + * + * @param index The index of the item to select. + * @param selected True to select the item, false to deselect it. + */ + + virtual void setItemSelected(const int index, const bool selected); + + /** + * Returns whether multiple selections are possible or not. + * + * @return True if multiple selections are allowed. + */ + + virtual inline const bool allowsMultipleSelections(void) const + { + return m_allowMultipleSelections; + } + + /** + * Sets whether or not items added to the list are automatically + * sorted on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual inline void setSortInsertedItems(const bool sortInsertedItems) + { + m_sortInsertedItems = sortInsertedItems; + } + + /** + * Add an event handler. + * + * @param eventHandler The event handler to add. + */ + + inline void addListDataEventHandler(IListDataEventHandler *eventHandler) + { + m_listDataEventhandlers.push_back(eventHandler); + } + + /** + * Remove an event handler. + * + * @param eventHandler The event handler to remove. + */ + + void removeListDataEventHandler(IListDataEventHandler *eventHandler); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATA_HXX diff --git a/libnxwidgets/include/clistdataeventargs.hxx b/libnxwidgets/include/clistdataeventargs.hxx new file mode 100644 index 000000000..57118e238 --- /dev/null +++ b/libnxwidgets/include/clistdataeventargs.hxx @@ -0,0 +1,121 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdataeventargs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAEVENTARGS_HXX +#define __INCLUDE_CLISTDATAEVENTARGS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "teventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CListData; + + /** + * Event arguments passed to listeners when a CListData object raises an + * event. + */ + + class CListDataEventArgs : public TEventArgs + { + public: + + /** + * Constructor. + * + * @param source Pointer to the CListData object that raised the event. + */ + + inline CListDataEventArgs(CListData *source) : TEventArgs(source) + { + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATAEVENTARGS_HXX diff --git a/libnxwidgets/include/clistdataitem.hxx b/libnxwidgets/include/clistdataitem.hxx new file mode 100644 index 000000000..db3bb20a2 --- /dev/null +++ b/libnxwidgets/include/clistdataitem.hxx @@ -0,0 +1,189 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdataitem.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAITEM_HXX +#define __INCLUDE_CLISTDATAITEM_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a data item within a list. Intended for use within + * the CListData class. + */ + + class CListDataItem + { + private: + CNxString m_text; /**< Text to display for option. */ + uint32_t m_value; /**< Option value. */ + bool m_isSelected; /**< True if the option is selected. */ + + public: + + /** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + */ + + CListDataItem(const CNxString &text, const uint32_t value); + + /** + * Destructor. + */ + + virtual ~CListDataItem(void); + + /** + * Get the item's text. + * + * @return The item's text. + */ + + inline const CNxString &getText(void) const + { + return m_text; + } + + /** + * Get the item's value. + * + * @return The item's value. + */ + + inline const uint32_t getValue(void) const + { + return m_value; + } + + /** + * Get the item's selection state. + * + * @return True if the item is selected; false if not. + */ + + inline const bool isSelected(void) const + { + return m_isSelected; + } + + /** + * Set the item's selection state. + * + * @param selected True to select the item; false to deselect it. + */ + + inline void setSelected(bool selected) + { + m_isSelected = selected; + } + + /** + * Compare the item with another. Comparison is based on the text of + * the item. Returns 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + * + * @param item An item to compare this object with. + * @return 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + */ + + virtual int compareTo(const CListDataItem *item) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATAITEM_HXX diff --git a/libnxwidgets/include/cmultilinetextbox.hxx b/libnxwidgets/include/cmultilinetextbox.hxx new file mode 100644 index 000000000..5ed41740b --- /dev/null +++ b/libnxwidgets/include/cmultilinetextbox.hxx @@ -0,0 +1,621 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cmultilinetextbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CMULTILINETEXTBOX_HXX +#define __INCLUDE_CMULTILINETEXTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "cscrollingpanel.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" +#include "ctext.hxx" +#include "cwidgeteventhandler.hxx" +#include "itextbox.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxTimer; + + /** + * Textbox that offers multiple lines of text. Has scrolling + * capability and can be dragged using the mouse. The text + * it contains can be changed or added to. It can remember more + * rows of text than it can display, and these additional + * rows can be scrolled through. + */ + + class CMultiLineTextBox : public ITextBox, public CScrollingPanel, + public CWidgetEventHandler + { + public: + + /** + * Enum of horizontal alignment options. + */ + + enum TextAlignmentHoriz + { + TEXT_ALIGNMENT_HORIZ_CENTER = 0, /**< Centre the text */ + TEXT_ALIGNMENT_HORIZ_LEFT = 1, /**< Align left */ + TEXT_ALIGNMENT_HORIZ_RIGHT = 2 /**< Align right */ + }; + + /** + * Enum of vertical alignment options. + */ + + enum TextAlignmentVert + { + TEXT_ALIGNMENT_VERT_CENTER = 0, /**< Align to centre of textbox */ + TEXT_ALIGNMENT_VERT_TOP = 1, /**< Align to top of textbox */ + TEXT_ALIGNMENT_VERT_BOTTOM = 2 /**< Align to bottom of textbox */ + }; + + protected: + CText *m_text; /**< CText object that manipulates + and wraps the raw text string. */ + uint8_t m_visibleRows; /**< Total number of rows that the + textbox can display at once. */ + nxgl_coord_t m_maxRows; /**< Maximum number of rows that the + textbox should buffer. */ + int32_t m_topRow; /**< Index of the top row of text + currently displayed. */ + TextAlignmentHoriz m_hAlignment; /**< Horizontal alignment of the text. */ + TextAlignmentVert m_vAlignment; /**< Vertical alignment of the text. */ + int m_cursorPos; /**< Position of the cursor within + the string. */ + uint8_t m_showCursor; /**< Cursor visibility. */ + bool m_wrapCursor; /**< True wrap cursor at the ends of the text */ + + /** + * Get the coordinates of the cursor relative to the text. + * + * @param x Will be populated with the x coordinate of the cursor. + * @param y Will be populated with the y coordinate of the cursor. + */ + + virtual void getCursorCoordinates(nxgl_coord_t& x, nxgl_coord_t& y) const; + + /** + * Gets the index of the character at the specified x coordinate in the + * specified row. + * + * @param x X coordinate of the character. + * @param rowIndex Index of the row containing the character. + * @return The index of the character at the specified coordinate. + */ + + virtual int getCharIndexAtCoordinate(nxgl_coord_t x, int rowIndex) const; + + /** + * Get the index of the character at the specified coordinates. + * + * @param x X coordinate of the character. + * @param y Y coordinate of the character. + * @return The index of the character at the specified coordinates. + */ + + virtual unsigned int getCharIndexAtCoordinates(nxgl_coord_t x, nxgl_coord_t y) const; + + /** + * Get the row containing the specified Y coordinate. + * + * @param y Y coordinate to locate. + * @return The index of the row containing the specified Y coordinate. + */ + + int getRowContainingCoordinate(nxgl_coord_t y) const; + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Move cursor one character to the left. + */ + + virtual void moveCursorLeft(void); + + /** + * Move cursor one character to the right. + */ + + virtual void moveCursorRight(void); + + /** + * Move cursor one row upwards. + */ + + virtual void moveCursorUp(void); + + /** + * Move cursor one row downwards. + */ + + virtual void moveCursorDown(void); + + /** + * Ensures that the textbox only contains the maximum allowed + * number of rows by culling any excess rows from the top of + * the text. + * + * @return True if lines were removed from the text; false if not. + */ + + virtual bool cullTopLines(void); + + /** + * Ensures that the canvas height is the height of the widget, + * if the widget exceeds the size of the text, or the height of + * the text if the text exceeds the size of the widget. + */ + + virtual void limitCanvasHeight(void); + + /** + * Ensures that the canvas cannot scroll beyond its height. + */ + + virtual void limitCanvasY(void); + + /** + * Jumps to the cursor coordinates of the text. + */ + + void jumpToCursor(void); + + /** + * Jumps to the bottom of the text. + */ + + void jumpToTextBottom(void); + + /** + * Resize the textbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Opens the keyboard on the bottom display. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + + virtual void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Handles physical button presses. Moves the cursor + * in the direction pressed. + * + * @param key The key that was pressed. + */ + + void processPhysicalKey(nxwidget_char_t key); + + /** + * Handle a keyboard press event. + * + * @param e The event data. + */ + + void handleKeyPressEvent(const CWidgetEventArgs &e); + + /** + * Handle a cursor control event. Replaces CWidgetEventHandler method. + * + * @param e The event data. + */ + + void handleCursorControlEvent(const CWidgetEventArgs &e); + + /** + * Gets the x position of a row of text based on the width of the row and the + * type of horizontal alignment currently set. + * + * @param row The index of the row. + * @return The x coordinate of the row. + */ + + nxgl_coord_t getRowX(int row) const; + + /** + * Gets the y position of the specified row of text based on the type of + * vertical alignment currently set. + * + * @param row The row number to find the y coordinate of. + * @return The y coordinate of the specified row of text. + */ + + nxgl_coord_t getRowY(int row) const; + + /** + * Return true if the cursor is visible + */ + + virtual bool isCursorVisible(void) const; + + /** + * Gets the character under the cursor. + * + * @return The character under the cursor. + */ + + nxwidget_char_t getCursorChar(void) const; + + /** + * Works out the number of visible rows within the textbox. + */ + + void calculateVisibleRows(void); + + /** + * Draws text. + * + * @param port The CGraphicsPort to draw to. + */ + + void drawText(CGraphicsPort *port); + + /** + * Draws the cursor. + * + * @param port The CGraphicsPort to draw to. + */ + + void drawCursor(CGraphicsPort *port); + + /** + * Draws a single line of text. + * + * @param port The CGraphicsPort to draw to. + * @param row The index of the row to draw. + */ + + void drawRow(CGraphicsPort *port, int row); + + /** + * Destructor. + */ + + inline virtual ~CMultiLineTextBox(void) + { + delete m_text; + m_text = (CText *)NULL; + } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CMultiLineTextBox(const CMultiLineTextBox &multiLineTextBox) + : CScrollingPanel(multiLineTextBox) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param flags Standard widget flag options. + * @param maxRows The maximum number of rows the textbox can track. Adding + * text beyond this number will cause rows at the start of the text to be + * forgotten; text is essentially stored as a queue, and adding to the back + * of a full queue causes the front items to be popped off. Setting this to + * 0 will make the textbox track only the visible rows. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CMultiLineTextBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, uint32_t flags, + nxgl_coord_t maxRows = 0, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Set the horizontal alignment of text within the textbox. + * + * @param alignment The horizontal position of the text. + */ + + virtual void setTextAlignmentHoriz(TextAlignmentHoriz alignment); + + /** + * Set the vertical alignment of text within the textbox. + * + * @param alignment The vertical position of the text. + */ + + virtual void setTextAlignmentVert(TextAlignmentVert alignment); + + /** + * Returns the number of "pages" that the text spans. A page + * is defined as the amount of text that can be displayed within + * the textbox at one time. + * + * @return The page count. + */ + + virtual const int getPageCount(void) const; + + /** + * Returns the current page. + * + * @return The current page. + * @see getPageCount(). + */ + + virtual const int getCurrentPage(void) const; + + /** + * Returns a pointer to the CText object that contains the + * wrapped text used in the textbox. It is used as the + * pre-processed data source for the textbox, and should + * not be altered. + * + * @return Pointer to the CText object. + */ + + virtual inline const CText *getText(void) const + { + return m_text; + } + + /** + * Set the text displayed in the textbox. + * + * @param text String to display. + */ + + virtual void setText(const CNxString &text); + + /** + * Append new text to the end of the current text + * displayed in the textbox. + * + * @param text String to append. + */ + + virtual void appendText(const CNxString &text); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + + virtual void removeText(const unsigned int startIndex); + + /** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + + virtual void removeText(const unsigned int startIndex, const unsigned int count); + + /** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + + virtual void setFont(CNxFont *font); + + /** + * Get the length of the text string. + * + * @return The length of the text string. + */ + + virtual const int getTextLength(void) const; + + /** + * Sets the cursor display mode. + * + * @param cursorMode Determines cursor display mode + */ + + virtual void showCursor(EShowCursor cursorMode); + + /** + * Shows the cursor in default mode (only when the TextBox has focus). + */ + + virtual inline void showCursor(void) + { + showCursor(SHOW_CURSOR_ONFOCUS); + } + + /** + * Hides the cursor. + */ + + virtual inline void hideCursor(void) + { + showCursor(SHOW_CURSOR_NEVER); + } + + /** + * Enables/disables cursor wrapping + * + * @param wrap True enables cursor wrapping + */ + + virtual inline void wrapCursor(bool wrap) + { + m_wrapCursor = wrap; + } + + /** + * Move the cursor to the text position specified. 0 indicates the start + * of the string. If position is greater than the length of the string, + * the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + + virtual void moveCursorToPosition(const int position); + + /** + * Get the cursor position. This is the index within the string that + * the cursor is currently positioned over. + * + * @return position The cursor position. + */ + + virtual inline const int getCursorPosition(void) const + { + return m_cursorPos; + } + + /** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + + virtual void insertText(const CNxString &text, + const unsigned int index); + + /** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + + virtual void insertTextAtCursor(const CNxString & ext); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CMULTILINETEXTBOX_HXX diff --git a/libnxwidgets/include/cnxfont.hxx b/libnxwidgets/include/cnxfont.hxx new file mode 100644 index 000000000..33e712291 --- /dev/null +++ b/libnxwidgets/include/cnxfont.hxx @@ -0,0 +1,238 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxfont.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXFONT_HXX +#define __INCLUDE_CNXFONT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxString; + struct SBitmap; + + /** + * Class defining the properties of one font. + */ + + class CNxFont + { + private: + enum nx_fontid_e m_fontId; /**< The font ID. */ + NXHANDLE m_fontHandle; /**< The font handle */ + FAR const struct nx_font_s *m_pFontSet; /** < The font set metrics */ + nxgl_mxpixel_t m_fontColor; /**< Color to draw the font with when rendering. */ + nxgl_mxpixel_t m_transparentColor; /**< Background color that should not be rendered. */ + + public: + + /** + * CNxFont Constructor. + * + * @param fontid The font ID to use. + * @param fontColor The font color to use. + * @param transparentColor The color in the font bitmap used as the + * background color. + */ + + CNxFont(enum nx_fontid_e fontid, nxgl_mxpixel_t fontColor, + nxgl_mxpixel_t transparentColor); + + /** + * CNxFont Destructor. + */ + + ~CNxFont() { } + + /** + * Checks if supplied character is blank in the current font. + * + * @param letter The character to check. + * @return True if the glyph contains any pixels to be drawn. False if + * the glyph is blank. + */ + + const bool isCharBlank(const nxwidget_char_t letter) const; + + /** + * Gets the color currently being used as the drawing color. + * + * @return The current drawing color. + */ + + inline const nxgl_mxpixel_t getColor() const + { + return m_fontColor; + } + + /** + * Sets the color to use as the drawing color. If set, this overrides + * the colors present in a non-monochrome font. + * @param color The new drawing color. + */ + + inline void setColor(const nxgl_mxpixel_t color) + { + m_fontColor = color; + } + + /** + * Get the color currently being used as the transparent background + * color. + * @return The transparent background color. + */ + + inline const nxgl_mxpixel_t getTransparentColor() const + { + return m_transparentColor; + } + + /** + * Sets the transparent background color to a new value. + * @param color The new background color. + */ + + inline void setTransparentColor(const nxgl_mxpixel_t color) + { + m_transparentColor = color; + } + + /** + * Draw an individual character of the font to the specified bitmap. + * + * @param bitmap The bitmap to draw to. + * @param letter The character to output. + */ + + void drawChar(FAR SBitmap *bitmap, nxwidget_char_t letter); + + /** + * Get the width of a string in pixels when drawn with this font. + * + * @param text The string to check. + * @return The width of the string in pixels. + */ + + nxgl_coord_t getStringWidth(const CNxString &text) const; + + /** + * Get the width of a portion of a string in pixels when drawn with this + * font. + * + * @param text The string to check. + * @param startIndex The start point of the substring within the string. + * @param length The length of the substring in chars. + * @return The width of the substring in pixels. + */ + + nxgl_coord_t getStringWidth(const CNxString& text, + int startIndex, int length) const; + + /** + * Gets font metrics for a particular character + * + * + * @param letter The character to get the width of. + * @param metrics The location to return the font metrics + */ + + void getCharMetrics(nxwidget_char_t letter, + FAR struct nx_fontmetric_s *metrics) const; + + /** + * Get the width of an individual character. + * + * @param letter The character to get the width of. + * @return The width of the character in pixels. + */ + + nxgl_coord_t getCharWidth(nxwidget_char_t letter) const; + + /** + * Get the height of an individual character. + * + * @param letter The letter to get the height of. + * @return The height of the character in pixels. + */ + + inline nxgl_coord_t getCharHeight(nxwidget_char_t letter) const; + + /** + * Gets the maximum width of the font. + * + * @return The height of the font. + */ + + inline const uint8_t getMaxWidth(void) const + { + return m_pFontSet->mxwidth; + } + + /** + * Gets the height of the font. + * + * @return The height of the font. + */ + + inline const uint8_t getHeight(void) const + { + return m_pFontSet->mxheight; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXFONT_HXX diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx new file mode 100644 index 000000000..2c79558a0 --- /dev/null +++ b/libnxwidgets/include/cnxserver.hxx @@ -0,0 +1,199 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxserver.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXSERVER_HXX +#define __INCLUDE_CNXSERVER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwindow.hxx" +#include "cbgwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CBgWindow; + + /** + * This class represents the NX server. It includes methods to connect to + * and disconnect form the NX server, methods to manage the background, and + * "factory" methods to create window objects on the NX server. NXWidget + * objects them may be created on the window objects. + */ + + class CNxServer + { + private: +#ifndef CONFIG_NX_MULTIUSER + FAR NX_DRIVERTYPE *m_hDevice; /**< LCD/Framebuffer device handle */ +#endif + NXHANDLE m_hNxServer; /**< NX server handle */ +#ifdef CONFIG_NX_MULTIUSER + voilatile bool m_running; /**< True: The listener thread is running */ + voilatile bool m_connected; /**< True: Connected to the server */ + volatile bool m_stop; /**< True: Waiting for the listener thread to stop */ + sem_t m_connsem; /**< Wait for server connection */ +#endif + static uint8_t m_nServers; /**< The number of NX server instances */ + + /** + * This is the entry point of a thread that listeners for and dispatches + * events from the NX server. + */ + +#ifdef CONFIG_NX_MULTIUSER + static FAR void *listener(FAR void *arg); +#endif + + public: + + /** + * CNXServer constructor. The CNxServer is a normally singleton. However, that + * not enforced: This constructor could run more than one in the situation where + * there are multiple physical displays. However, that configuration has never + * been texted. + */ + + CNxServer(void); + + /** + * CNXServer destructor + */ + + ~CNxServer(void); + + /** + * Connect to the NX Server + */ + + virtual bool connect(void); + + /** + * Disconnect from the NX Server + */ + + virtual void disconnect(void); + + /** + * Get the NX server handle + * + * @return The NX server handler (NULL is not connected) + */ + + inline NXHANDLE getServer(void) + { + return m_hNxServer; + } + + /** + * Test if we are connected to the NX server. + * + * @return True is connected; false is not connected. + */ + + inline bool connected(void) + { +#ifdef CONFIG_NX_MULTIUSER + return m_connected; +#else + return true; +#endif + } + + /** + * Set the background color + */ + + inline bool setBackgroundColor(nxgl_mxpixel_t color) + { + return nx_setbgcolor(m_hNxServer, &color) == OK; + } + + /** + * Get an instance of a raw NX window. + */ + + inline CNxWindow *createRawWindow(CWidgetControl *widgetControl) + { + return new CNxWindow(m_hNxServer, widgetControl); + } + + /** + * Get an instance of the framed NX window. + */ + +#if 0 // Not ready for prime time + inline CFramedWindow *createFramedWindow(CWidgetControl *widgetControl) + { + return new CFramedWindow(m_hNxServer, widgetControl); + } +#endif + + /** + * Get an instance of the background window. + */ + + inline CBgWindow *getBgWindow(CWidgetControl *widgetControl) + { + return new CBgWindow(m_hNxServer, widgetControl); + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXSERVER_HXX diff --git a/libnxwidgets/include/cnxstring.hxx b/libnxwidgets/include/cnxstring.hxx new file mode 100644 index 000000000..91bd253c7 --- /dev/null +++ b/libnxwidgets/include/cnxstring.hxx @@ -0,0 +1,484 @@ +/**************************************************************************** + * include/cnxtring.hxx + * NxWidgets/libnxwidgets/ + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CNXSTRING_HXX +#define __INCLUDE_CNXSTRING_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CStringIterator; + + /** + * Unicode string class. Uses 16-bt wide-character encoding. For optimal + * performance, use the CStringIterator class to iterate over a CNxString + * instance. + * + * Where possible, the string avoids allocating memory each time the + * string grows or shrinks. This means that the string may consume more + * memory than the number of chars would seem to dictate if the object + * previously contained a large string that has subsequently been truncated. + * It also means that increasing the length of such a string is a cheaper + * operation as memory does not need to allocated and copied. + * + * Additionally, the string increases its array size by m_growAmount every + * time it needs to allocate extra memory, potentially reducing the number + * of reallocs needed. + * + * The string is not null-terminated. Instead, it uses a m_stringLength + * member that stores the number of characters in the string. This saves a + * byte and makes calls to getLength() run in O(1) time instead of O(n). + */ + + class CNxString + { + private: + friend class CStringIterator; + + int m_stringLength; /**< Number of characters in the string */ + int m_allocatedSize; /**< Number of bytes allocated for this string */ + int m_growAmount; /**< Number of chars that the string grows by + whenever it needs to get larger */ + + + protected: + FAR nxwidget_char_t *m_text; /**< Raw char array data */ + + /** + * Allocate memory for the string. + * + * @param chars Number of chars to allocate. + * @param preserve If true, the data in the existing memory will be + * preserved if new memory must be allocated + */ + + void allocateMemory(int chars, bool preserve); + + /** + * Check if we've got any string data stored or not. + * + * @return True if the string contains any data; false if no data has + * yet been supplied. + */ + + inline bool hasData(void) const + { + return m_stringLength > 0; + } + + /** + * Get the amount of allocated memory. + * + * @return The number of chars allocated in RAM. + */ + + inline int getAllocatedSize(void) const + { + return m_allocatedSize; + } + + /** + * Returns a pointer to the raw char array data. + * + * @return Pointer to the char array. + */ + + inline FAR const nxwidget_char_t *getCharArray(void) const + { + return m_text; + } + + /** + * Return a pointer to the specified character. + * + * @param index Index of the character to retrieve. + */ + + FAR nxwidget_char_t *getCharPointer(const int index) const; + + public: + + /** + * Constructor to create an empty string object. + */ + + CNxString(); + + /** + * Constructor to create a string from a C character array. + * + * @param text Pointer to a char array to use as the basis of the + * string. + */ + + CNxString(FAR const char *text); + + /** + * Constructor to create a string from a single character. + * + * @param letter Single character to use as the basis of the string. + */ + + CNxString(const nxwidget_char_t letter); + + /** + * Copy constructor. + * @param string CNxString object to create a copy of. + */ + + CNxString(const CNxString &string); + + /** + * Destructor. + */ + + inline ~CNxString() + { + delete[] m_text; + m_text = (FAR nxwidget_char_t *)NULL; + }; + + /** + * Creates and returns a new CStringIterator object that will iterate + * over this string. The object must be manually deleted once it is + * no longer needed. + * + * @return A new CStringIterator object. + */ + + CStringIterator *newStringIterator(void) const; + + /** + * Copy the internal array to the supplied buffer. The buffer must be + * large enough to contain the full text in the string. The + * getByteCount() method can be used to obtain the length of the string. + * Unlike the CNxString class, the char array is null-terminated. + * The buffer must be (getByteCount() + 1) bytes long, in order to + * accommodate the terminator. + * + * @param buffer Buffer to copy the internal char array to. + */ + + void copyToCharArray(FAR nxwidget_char_t *buffer) const; + + /** + * Set the text in the string. + * + * @param text CNxString containing the new data for this string. + */ + + void setText(const CNxString &text); + + /** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + + void setText(FAR const char *text); + + /** + * Set the nxwidget_char_t text in the string. + * + * @param text Char array to use as the new data for this string. + */ + + void setText(FAR const nxwidget_char_t *text, int nchars); + + /** + * Set the 8-bit C-string text in the string. + * + * @param text Character to to use as the new data for this string. + */ + + void setText(const nxwidget_char_t text); + + /** + * Append text to the end of the string. + * + * @param text String to append. + */ + + void append(const CNxString &text); + + /** + * Insert text at the specified character index. + * + * @param text The text to insert. + * @param index The index at which to insert the text. + */ + + void insert(const CNxString &text, const int index); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + + void remove(const int startIndex); + + /** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + + void remove(const int startIndex, const int count); + + /** + * Get the of number of letters (ie. the length) of the string. + * + * @return The length of the string. + */ + + inline const int getLength(void) const + { + return m_stringLength; + }; + + /** + * Get the character at the specified index. This function is useful + * for finding the occasional character at an index, but for iterating + * over strings it is exceptionally slow. The newStringIterator() + * method should be used to retrieve an iterator object that can iterate + * over the string efficiently. + * + * @param index The index of the character to retrieve. + * @return The character at the specified index. + */ + + const nxwidget_char_t getCharAt(int index) const; + + /** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. + * + * @param letter Letter to find. + * @return The index of the letter. + */ + + const int indexOf(nxwidget_char_t letter) const; + + /** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * from "startIndex" until it has examined all subsequent letters. + * @param letter Letter to find. + * + * @param startIndex The index to start searching from. + * @return The index of the letter. + */ + + const int indexOf(nxwidget_char_t letter, int startIndex) const; + + /** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * from "startIndex" until it has examined all letters within the + * range "count". + * + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @param count The number of characters to examine. + * @return The index of the letter. + */ + + const int indexOf(nxwidget_char_t letter, int startIndex, int count) const; + + /** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. + * + * @param letter Letter to find. + * @return The index of the letter. + */ + + const int lastIndexOf(nxwidget_char_t letter) const; + + /** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * backwards from "startIndex" until it has examined all preceding + * letters within the string. + * + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @return The index of the letter. + */ + + const int lastIndexOf(nxwidget_char_t letter, int startIndex) const; + + /** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * backwards from "startIndex" until it has examined all letters within + * the range "count". + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @param count The number of characters to examine. + * @return The index of the letter. + */ + + const int lastIndexOf(nxwidget_char_t letter, int startIndex, int count) const; + + /** + * Get a substring from this string. It is the responsibility of the + * caller to delete the substring when it is no longer required. + * + * @param startIndex The starting point of the substring. + * @return A pointer to a new CNxString object containing the + * substring. + */ + + CNxString *subString(int startIndex) const; + + /** + * Get a substring from this string. It is the responsibility of the + * caller to delete the substring when it is no longer required. + * + * @param startIndex The starting point of the substring. + * @param length The length of the substring. + * @return A pointer to a new CNxString object containing the + * substring. + */ + + CNxString *subString(int startIndex, int length) const; + + /** + * Overloaded assignment operator. Copies the data within the argument + * string to this string. + * + * @param string The string to copy. + * @return This string. + */ + + CNxString &operator=(const CNxString &string); + + /** + * Overloaded assignment operator. Copies the data within the argument + * char array to this string. + * + * @param string The string to copy. + * @return This string. + */ + + CNxString &operator=(const char *string); + + /** + * Overloaded assignment operator. Copies the data from the argument + * char to this string. + * + * @param letter The char to copy. + * @return This string. + */ + + CNxString& operator=(nxwidget_char_t letter); + + /** + * Compares this string to the argument. + * + * @param string String to compare to. + * @return Zero if both strings are equal. A value greater than zero + * indicates that this string is greater than the argument string. A + * value less than zero indicates the opposite. Note that the return + * value indicates the *byte* that does not match, not the *character*. + */ + + int compareTo(const CNxString &string) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXSTRING_HXX diff --git a/libnxwidgets/include/cnxtimer.hxx b/libnxwidgets/include/cnxtimer.hxx new file mode 100644 index 000000000..be6038dac --- /dev/null +++ b/libnxwidgets/include/cnxtimer.hxx @@ -0,0 +1,220 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxtimer.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CNXTIMER_HXX +#define __INCLUDE_CNXTIMER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "cnxwidget.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetcontrol; + + /** + * Timer widget. It can drive time-based events, animations, etc. + * + * Using the timer is simple: + * - Create an instance of the CNxTimer and add it as a child to a widget. + * - Call the instance's "start()" method. + * - Catch the timer's action event and call any code that should run. + */ + + class CNxTimer : public CNxWidget + { + protected: + FAR timer_t m_timerid; /**< POSIX timer */ + uint32_t m_timeout; /**< The timeout value in milliseconds */ + bool m_isRunning; /**< Indicates whether or not the timer is running */ + bool m_isRepeater; /**< Indicates whether or not the timer repeats */ + + /** + * The SIGALM signal handler that will be called when the timer goes off + * + * @param signo The signal number call caused the handler to run (SIGALM) + */ + + static void signalHandler(int signo); + + /** + * Handle an expired timer + */ + + void handleTimerExpiration(void); + + /** + * Convert a timespec to milliseconds + * + * @param tp The pointer to the timespec to convert + * @return The corresponding time in milliseconds + */ + + uint32_t timespecToMilliseconds(FAR const struct timespec *tp); + + /** + * Convert milliseconds to a timespec + * + * @param milliseconds The milliseconds to be converted + * @param tp The pointer to the location to store the converted timespec + */ + + void millisecondsToTimespec(uint32_t milliseconds, FAR struct timespec *tp); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CNxTimer(const CNxTimer &timer) : CNxWidget(timer) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param timeout Time, in milliseconds, before the timer fires an + * EVENT_ACTION event. + * @param repeat If true, the timer will fire multiple events. If false, + * the timer will fire just once and stop. + */ + + CNxTimer(CWidgetControl *pWidgetControl, uint32_t timeout, bool repeat); + + /** + * Destructor. + */ + + ~CNxTimer(void); + + /** + * Return the time remaining on this timer. + * + * @return The number of milliseconds that this timer runs before + * firing an event. Zero is returned if the timer is not running. + */ + + const uint32_t getTimeout(void); + + /** + * Resets the (running) timer to its initial timeout value. This + * call does nothing if the timer is not running. + */ + + void reset(void); + + /** + * Starts the timer. This call does nothing if the timer is already + * running. + */ + + void start(void); + + /** + * Stops the timer. Does nothing if the timer is not running. + */ + + void stop(void); + + /** + * Set the timeout of this timer. This timeout value will not + * take effect until start() or reset() is called. + * + * @param timeout The number of milliseconds that this timer will run + * before firing an event. + */ + + inline void setTimeout(uint32_t timeout) + { + m_timeout = timeout; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXTIMER_HXX diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx new file mode 100644 index 000000000..ed2ecdbd2 --- /dev/null +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -0,0 +1,327 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxtkwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXTKWINDOW_HXX +#define __INCLUDE_CNXTKWINDOW_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include "ccallback.hxx" +#include "inxwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxToolbar; + struct SBitmap; + + /** + * This class defines operations on a framed 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. + */ + + class CNxTkWindow : protected CCallback, public INxWindow + { + protected: + NXHANDLE m_hNxServer; /**< Handle to the NX server. */ + NXTKWINDOW m_hNxTkWindow; /**< Handle to the NX raw window */ + CWidgetControl *m_widgetControl; /**< Controlling widget for the window */ + CNxToolbar *m_toolbar; /**< Child toolbar */ + + public: + + /** + * Constructor. Creates an uninitialized instance of the CNxTkWindow + * object. The open() method must be called to initialize the instance. + * + * The general steps to create any window include: + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. + * 3) The window constructor call CWidgetControl methods to "smarten" + * the CWidgetControl instance with window-specific knowledge. + * 4) Call the open() method on the window to display the window. + * 5) After that, the fully smartend CWidgetControl instance can + * be used to generate additional widgets. + * 6) After that, the fully smartened CWidgetControl instance can + * be used to generate additional widgets by passing it to the + * widget constructor + * + * @param hNxServer Handle to the NX server. + * @param widgetControl Controlling widget for this window. + */ + + CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl); + + /** + * Destructor. + */ + + ~CNxTkWindow(void); + + /** + * Creates a new window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully opened. + */ + + bool open(void); + + /** + * Open a toolbar on the framed window. Toolbar creation is separate + * from object instantion so that errors can be reported + * + * @return True if the toolbar was successfully created. + */ + + CNxToolbar *openToolbar(nxgl_coord_t height); + + /** + * Detach the toolbar. This should *ONLY* be called by the toolbar + * instance itself. If this is called by end-user logic, it will + * screw things up miserably. + */ + + inline void detachToolbar(void) + { + m_toolbar = (CNxToolbar *)NULL; + } + + /** + * 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. + * + * @return True on success, false on any failure. + */ + + bool requestPosition(void); + + /** + * Get the position of the window (as reported by the NX callback). + * + * @return True on success, false on any failure. + */ + + bool getPosition(FAR struct nxgl_point_s *pPos); + + /** + * Get the size of the window (as reported by the NX callback). + * + * @return The size. + */ + + bool getSize(FAR struct nxgl_size_s *pSize); + + /** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on any failure. + */ + + bool setPosition(FAR const struct nxgl_point_s *pPos); + + /** + * Set the size of the selected window. + * + * @param pSize The new size of the window. + * @return True on success, false on any failure. + */ + + bool setSize(FAR const struct nxgl_size_s *pSize); + + /** + * Bring the window to the top of the display. + * + * @return True on success, false on any failure. + */ + + bool raise(void); + + /** + * Lower the window to the bottom of the display. + * + * @return True on success, false on any failure. + */ + + bool lower(void); + + /** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color); + + /** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color); + + /** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + + void getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest); + + /** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color); + + /** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + + bool drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, + nxgl_mxpixel_t color); + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + bool drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color); + + /** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + + bool move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset); + + /** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + + bool bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXTKWINDOW_HXX + diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx new file mode 100644 index 000000000..ff65cf1a9 --- /dev/null +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -0,0 +1,304 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxtoolbar.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXTOOLBAR_HXX +#define __INCLUDE_CNXTOOLBAR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include "ccallback.hxx" +#include "inxwindow.hxx" +#include "cnxtkwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + struct SBitmap; + + /** + * This class defines operations on a the toolbar in a framed 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. + */ + + class CNxToolbar : protected CCallback, public INxWindow + { + private: + CNxTkWindow *m_nxTkWindow; /**< Parent framed window instance. */ + NXTKWINDOW m_hNxTkWindow; /**< Parent framed window handle. */ + CWidgetControl *m_widgetControl; /**< Controlling widget for the toolbar */ + nxgl_coord_t m_height; /**< The toolbar height */ + + public: + + /** + * Constructor. Creates an uninitialized instance of the CNxToolbar + * object. The open() method must be called to initialize the instance. + * + * @param pNxTkWindow Parent framed window instance + * @param hNxTkWindow Parent framed window NX handler + * @param widgetControl Controlling widget for this toolbar. + * @param height The height of the toolbar. + */ + + CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, + CWidgetControl *pWidgetControl, nxgl_coord_t height); + + /** + * Destructor. + */ + + ~CNxToolbar(void); + + /** + * Creates a new toolbar. Toolbar creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the toolbar was successfully created. + */ + + bool open(void); + + /** + * Request the position and size information of the toolbar. 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. + * + * @return True on success, false on any failure. + */ + + bool requestPosition(void); + + /** + * Get the position of the toolbar (as reported by the NX callback). + * + * @return The position. + */ + + bool getPosition(FAR struct nxgl_point_s *pPos); + + /** + * Get the size of the toolbar (as reported by the NX callback). + * + * @return The size. + */ + + bool getSize(FAR struct nxgl_size_s *pSize); + + /** + * Set the position and size of the toolbar. The position of + * the toolbar is fixed at the top of the parent framed window. + * + * @param pPos The new position of the toolbar. + * @return Always returns false. + */ + + bool setPosition(FAR const struct nxgl_point_s *pPos); + + /** + * Set the position and size of the toolbar. The position of + * the toolbar is fixed at the top of the parent framed window. + * + * @param pPos The new position of the toolbar. + * @return Always returns false. + */ + + bool setSize(FAR const struct nxgl_size_s *pSize); + + /** + * Bring the toolbar to the top of the display. The toolbar is + * a component of the containing, parent, framed window. It + * cannot be raised separately. + * + * @return Always returns false. + */ + + bool raise(void); + + /** + * Lower the toolbar to the bottom of the display. The toolbar is + * a component of the containing, parent, framed window. It + * cannot be lowered separately. + * + * @return Always returns false. + */ + + bool lower(void); + + /** + * Set an individual pixel in the toolbar with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color); + + /** + * Fill the specified rectangle in the toolbar with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color); + + /** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + + void getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest); + + /** + * Fill the specified trapezoidal region in the toolbar with the specified + * color. + * + * @param pClip Clipping rectangle relative to toolbar (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color); + + /** + * Fill the specified line in the toolbar with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + + bool drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, + nxgl_mxpixel_t color); + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + bool drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color); + + /** + * Move a rectangular region within the toolbar. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + + bool move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset); + + /** + * Copy a rectangular region of a larger image into the rectangle in the + * specified toolbar. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param pOrigin the pOrigin of the upper, left-most corner of the full + * bitmap. Both pDest and pOrigin are in toolbar coordinates, however, + * pOrigin may lie outside of the display. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + + bool bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXTOOLBAR_HXX + diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx new file mode 100644 index 000000000..eb1b18710 --- /dev/null +++ b/libnxwidgets/include/cnxwidget.hxx @@ -0,0 +1,1627 @@ +/**************************************************************************** + * include/cnxwidget.hxx + * NxWidgets/libnxwidgets/ + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CNXWIDGET_HXX +#define __INCLUDE_CNXWIDGET_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cnxstring.hxx" +#include "cnxfont.hxx" +#include "crect.hxx" +#include "cwidgetstyle.hxx" +#include "cwidgeteventargs.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgeteventhandlerlist.hxx" +#include "tnxarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CGraphicsPort; + class CNxFont; + class CRectCache; + class CWidgetEventHandlerList; + + /** + * Class providing all the basic functionality of a NxWidget. All other + * widgets must must inherit from this class. + */ + + class CNxWidget + { + public: + + /** + * Enum describing the way other widgets should behave when they try to + * close this widget. + */ + + enum CloseType + { + CLOSE_TYPE_CLOSE = 0, /**< Widgets should call the close() method */ + CLOSE_TYPE_HIDE = 1, /**< Widgets should call the hide() method */ + CLOSE_TYPE_SHELVE = 2 /**< Widgets should call the shelve() method */ + }; + + /** + * Enum listing flags that can be set in the constructor's "flags" parameter. + */ + + enum WidgetFlagType + { + WIDGET_BORDERLESS = 0x0001, /**< Widget has no border */ + WIDGET_DRAGGABLE = 0x0002, /**< Widget can be dragged by the user */ + WIDGET_PERMEABLE = 0x0004, /**< Widget's children can exceed this widget's edges */ + WIDGET_DOUBLE_CLICKABLE = 0x0008, /**< Widget can be double-clicked */ + WIDGET_NO_RAISE_EVENTS = 0x0010, /**< Widget does not raise events */ + }; + + /** + * Struct describing some basic properties of a widget. + */ + + typedef struct + { + uint8_t clicked : 1; /**< True if the widget is currently clicked. */ + uint8_t hasFocus : 1; /**< True if the widget has focus. */ + uint8_t dragging : 1; /**< True if the widget is being dragged. */ + uint8_t deleted : 1; /**< True if the widget has been deleted. */ + uint8_t shelved : 1; /**< True if the widget has been shelved. */ + uint8_t borderless : 1; /**< True if the widget is borderless. */ + uint8_t draggable : 1; /**< True if the widget can be dragged. */ + uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */ + uint8_t enabled : 1; /**< True if the widget is enabled. */ + uint8_t permeable : 1; /**< True if the widget's children can exceed its dimensions. */ + uint8_t erased : 1; /**< True if the widget is currently erased from the frame buffer. */ + uint8_t visibleRegionCacheInvalid : 1; /**< True if the region cache is invalid. */ + uint8_t hidden : 1; /**< True if the widget is hidden. */ + uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */ + uint8_t modal : 1; /**< True if the widget is modal. */ + } Flags; + + /** + * Struct describing the size of all four borders of a widget. + */ + + typedef struct + { + uint8_t top; /**< Height of the top border. */ + uint8_t right; /**< Width of the right border. */ + uint8_t bottom; /**< Height of the bottom border. */ + uint8_t left; /**< Width of the left border. */ + } WidgetBorderSize; + + protected: + CWidgetControl *m_widgetControl; /**< The controlling widget for the display */ + CRect m_rect; /**< Rectange bounding the widget. */ + uint32_t m_refcon; /**< Identifying number of the widget. */ + + // Dragging variables + + nxgl_coord_t m_grabPointX; /**< Physical space x coordinate where dragging began. */ + nxgl_coord_t m_grabPointY; /**< Physical space y coordinate where dragging began. */ + nxgl_coord_t m_newX; /**< Physical x coordinate where widget is being dragged to. */ + nxgl_coord_t m_newY; /**< Physical y coordinate where widget is being dragged to. */ + + // Style + + CWidgetStyle m_style; /**< All style information used by a widget. */ + + // Status + + Flags m_flags; /**< Flags struct. */ + + // Event handling + + CWidgetEventHandlerList *m_widgetEventHandlers; /**< List of event handlers. */ + + // Double-clicking + + struct timespec m_lastClickTime; /**< System timer when last clicked. */ + nxgl_coord_t m_lastClickX; /**< X coordinate of last click. */ + nxgl_coord_t m_lastClickY; /**< Y coordinate of last click. */ + int m_doubleClickBounds; /**< Area in which a click is assumed to be a double-click. */ + + // Hierarchy control + + CNxWidget *m_parent; /**< Pointer to the widget's parent. */ + CNxWidget *m_focusedChild; /**< Pointer to the child widget that has focus. */ + TNxArray m_children; /**< List of child widgets. */ + TNxArray m_shelvedWidgets; /**< List of shelved child widgets. */ + + // Visible regions + + CRectCache *m_rectCache; /**< List of the widget's visible regions. */ + CloseType m_closeType; /**< Type of close method that should be called for the widget. */ + WidgetBorderSize m_borderSize; /**< Size of the widget borders. */ + + /** + * Use the provided widget style + */ + + void useWidgetStyle(const CWidgetStyle *style); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw(). + */ + + virtual inline void drawContents(CGraphicsPort* port) { } + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw(). + */ + + virtual void drawBorder(CGraphicsPort* port) { } + + /** + * Checks if the supplied coordinates collide with a portion of this widget + * that is not obscured by its siblings, but that may be obscured by + * its children. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if a collision occurred; false if not. + */ + + bool checkCollisionWithForegroundRects(nxgl_coord_t x, nxgl_coord_t y) const; + + /** + * Draw all visible regions of this widget's children. + */ + + void drawChildren(void); + + /** + * Erase and remove the supplied child widget from this widget and + * send it to the deletion queue. + * + * @param widget The widget to close. + * @see close(). + */ + + void closeChild(CNxWidget *widget); + + /** + * Erase the supplied child widget and move it out of the main child + * list into the shelved list. The widget remains in memory and can + * be restored by calling "unshelve()" on the widget. + * + * @param widget The widget to hide. + */ + + void shelveChild(CNxWidget *widget); + + /** + * Redraws all regions of child widgets that fall within the invalidRects + * regions. + * + * @param invalidRects List of invalid regions that need to be redrawn. + * @param sender Pointer to the widget that initiated the redraw. + */ + + void redrawDirtyChildren(TNxArray* invalidRects, CNxWidget *sender); + + /** + * Get the index of the next visible widget higher up the z-order. + * + * @param startIndex The starting index. + * @return The index of the next highest visible widget. + */ + + const int getHigherVisibleWidget(const int startIndex) const; + + /** + * Get the index of the next visible widget lower down the z-order. + * + * @param startIndex The starting index. + * @return The index of the next lowest visible widget. + */ + + const int getLowerVisibleWidget(const int startIndex) const; + + /** + * Notify this widget that it is being dragged, and set its drag point. + * + * @param x The x coordinate of the drag position relative to this widget. + * @param y The y coordinate of the drag position relative to this widget. + */ + + void startDragging(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Notify this widget that it is no longer being dragged. + */ + + void stopDragging(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CNxWidget(const CNxWidget &widget) { } + + /** + * Called when the widget is clicked. Override this when creating new + * widgets if the widget should exhibit additional behaviour when it is + * clicked. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual inline void onClick(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Called when the widget is double-clicked. Override this when + * creating new widgets if the widget should exhibit additional + * behaviour when it is double-clicked. To change the conditions that + * apply in detecting a double-click, override the isDoubleClicked() + * method. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual inline void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Called when the widget is released. Override this when + * creating new widgets if the widget should exhibit additional + * behaviour when it is released. + * + * @param x The x coordinate of the mouse when released. + * @param y The y coordinate of the mouse when released. + */ + + virtual inline void onRelease(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Called when the widget is released outside of its boundaries. + * Override this when creating new widgets if the widget should exhibit + * additional behaviour when it is released outside of its boundaries. + * + * @param x The x coordinate of the mouse when released. + * @param y The y coordinate of the mouse when released. + */ + + virtual inline void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Called when the widget is dragged. Override this when creating new + * widgets if the widget should exhibit additional behaviour when it is + * dragged. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX X distance dragged. + * @param vY Y distance dragged. + */ + + virtual inline void onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) { } + + /** + * Called when the widget starts being dragged. Override this when + * creating new widgets if the widget should exhibit additional + * behaviour when dragging starts. + */ + + virtual inline void onDragStart(void) { } + + /** + * Called when the widget stops being dragged. Override this when + * creating new widgets if the widget should exhibit additional + * behaviour when dragging stops. + */ + + virtual inline void onDragStop(void) { } + + /** + * Called when the widget gains focus. Override this when creating new + * widgets if the widget should exhibit additional behaviour when + * gaining focus. + */ + + virtual inline void onFocus(void) { } + + /** + * Called when the widget loses focus. Override this when creating new + * widgets if the widget should exhibit additional behaviour when + * losing focus. + */ + + virtual inline void onBlur(void) { } + + /** + * Called when the widget is enabled. Override this when creating new + * widgets if the widget should exhibit additional behaviour when + * enabled. + */ + + virtual inline void onEnable(void) { } + + /** + * Called when the widget is disabled. Override this when creating new + * widgets if the widget should exhibit additional behaviour when + * disabled. + */ + + virtual inline void onDisable(void) { } + + /** + * Called when the widget is resized. Override this when creating new + * widgets if the widget should exhibit additional behaviour when + * resized. + * + * @param width The new width. + * @param height The new height. + */ + + virtual inline void onResize(nxgl_coord_t width, nxgl_coord_t height) { } + + public: + + /** + * CNxWidget constructor. + * + * @param pWidgetControl The controllwing widget for the display + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags Bitmask specifying some set-up values for the widget. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + * @see WidgetFlagType. + */ + + CNxWidget(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, + FAR const CWidgetStyle *style = (FAR const CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual ~CNxWidget(void); + + /** + * Get the x coordinate of the widget in "Widget space". + * + * @return Widget space x coordinate. + */ + + const nxgl_coord_t getX(void) const; + + /** + * Get the y coordinate of the widget in "Widget space". + * + * @return Widget space y coordinate. + */ + + const nxgl_coord_t getY(void) const; + + /** + * Get the x coordinate of the widget relative to its parent. + * + * @return Parent-space x coordinate. + */ + + const nxgl_coord_t getRelativeX(void) const; + + /** + * Get the y coordinate of the widget relative to its parent. + * + * @return Parent-space y coordinate. + */ + + const nxgl_coord_t getRelativeY(void) const; + + /** + * Get the reference constant for this widget. + * @return The reference constant. + */ + + inline const uint32_t getRefcon(void) const + { + return m_refcon; + } + + /** + * Get the type of close routine that should be called by other widgets + * interacting with this widget. + * + * @return The close type of this widget. + */ + + inline const CloseType getCloseType(void) + { + return m_closeType; + } + + /** + * Is the widget active? + * A value of true indicates that this widget has focus or is an ancestor + * of the widget with focus. + * + * @return True if active. + */ + + inline const bool hasFocus(void) const + { + return m_flags.hasFocus; + } + + /** + * Has the widget been marked for deletion? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are not deleted. + * + * Widgets marked for deletion are automatically deleted and should not be + * interacted with. + * + * @return True if marked for deletion. + */ + + const bool isDeleted(void) const; + + /** + * Is the widget allowed to draw? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are visible. + * + * @return True if drawing is enabled. + */ + + const bool isDrawingEnabled(void) const; + + /** + * Is the widget hidden? This function recurses up the widget + * hierarchy and returns true if any of the widgets in the ancestor + * chain are hidden. + * + * @return True if hidden. + */ + + const bool isHidden(void) const; + + /** + * Is the widget enabled? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are enabled. + * + * @return True if enabled. + */ + + const bool isEnabled(void) const; + + /** + * Are the widget's edges permeable or solid? + * Permeable widgets do not enforce their dimensions on the + * coordinates and dimensions of child widgets. + * + * @return True if permeable. + */ + + inline const bool isPermeable(void) const + { + return m_flags.permeable; + } + + /** + * IS the widget double-clickable? + * @return True if the widget watches for double-clicks. + */ + + inline const bool isDoubleClickable(void) const + { + return m_flags.doubleClickable; + } + + /** + * Does the widget have a border? + * + * @return True if the widget does not have a border. + */ + + inline const bool isBorderless(void) const + { + return m_flags.borderless; + } + + /** + * Is the widget clicked? + * + * @return True if the widget is currently clicked. + */ + + inline const bool isClicked(void) const + { + return m_flags.clicked; + } + + /** + * Is the widget being dragged? + * + * @return True if the widget is currently being dragged. + */ + + inline const bool isBeingDragged(void) const + { + return m_flags.dragging; + } + + /** + * Is the widget shelved? + * + * @return True if the widget is shelved. + */ + + inline const bool isShelved(void) const + { + return m_flags.shelved; + } + + /** + * Is the widget modal? Only true if the Widget singleton is also modal. + * + * @return True if the widget is modal. + */ + + const bool isModal(void) const; + + /** + * Get the width of the widget. + * + * @return The widget width. + */ + + inline nxgl_coord_t getWidth(void) const + { + return m_rect.getWidth(); + } + + /** + * Get the height of the widget. + * + * @return The widget height. + */ + + inline nxgl_coord_t getHeight(void) const + { + return m_rect.getHeight(); + } + + /** + * Get the dimensions of the border + * + */ + + inline void getBorderSize(WidgetBorderSize &borderSize) + { + borderSize.top = m_borderSize.top; + borderSize.left = m_borderSize.left; + borderSize.bottom = m_borderSize.bottom; + borderSize.right = m_borderSize.right; + } + + /** + * Get a pointer to this widget's parent. + * + * @return This widget's parent. + */ + + inline CNxWidget *getParent(void) const + { + return m_parent; + } + + /** + * Get a pointer to this widget's focused child. + * + * @return This widget's focused child. + */ + + inline CNxWidget *getFocusedWidget(void) + { + return m_focusedChild; + } + + /** + * Check if this widget raises events or not. + * + * @return True if events are enabled. + */ + + inline const bool raisesEvents(void) const + { + return m_widgetEventHandlers->isEnabled(); + } + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Insert the properties of the space within this widget that is + * available for children into the rect passed in as a parameter. + * All coordinates are relative to this widget. + * + * @param rect Reference to a rect to populate with data. + */ + + void getClientRect(CRect &rect) const; + + /** + * Insert the properties of the space within this widget that is + * available for children into the rect passed in as a parameter. + * Identical to getClientRect() except that all coordinates are + * absolute positions within the window. + * + * @param rect Reference to a rect to populate with data. + */ + + void getRect(CRect &rect) const; + + /** + * Clips the supplied rect to the boundaries defined by this widget and + * this widget's parents. + * + * @param rect Reference to a rect to populate with data. + */ + + void getRectClippedToHierarchy(CRect &rect) const; + + /** + * Gets a pointer to the vector of all of the visible regions of this widget, + * including any covered by children. + * + * @return A pointer to a vector of all visible regions. + */ + + TNxArray *getForegroundRegions(void); + + /** + * Gets a pointer to the widget's font. + * + * @return A pointer to the widget's font. + */ + + inline CNxFont *getFont(void) const + { + return m_style.font; + } + + /** + * Gets the color used for the normal background fill. + * + * @return Background fill color. + */ + + inline const nxgl_mxpixel_t getBackgroundColor(void) const + { + return m_style.colors.background; + } + + /** + * Gets the color used for the background fill when the widget is selected. + * + * @return Dark color. + */ + + inline const nxgl_mxpixel_t getSelectedBackgroundColor(void) const + { + return m_style.colors.selectedBackground; + } + + /** + * Gets the color used as the light edge in bevelled boxes. + * + * @return Shine color. + */ + + inline const nxgl_mxpixel_t getShineEdgeColor(void) const + { + return m_style.colors.shineEdge; + } + + /** + * Gets the color used as the dark edge in bevelled boxes. + * + * @return Shadow color. + */ + + inline const nxgl_mxpixel_t getShadowEdgeColor(void) const + { + return m_style.colors.shadowEdge; + } + + /** + * Gets the color used as the fill in focused window borders. + * + * @return Highlight color. + */ + + inline const nxgl_mxpixel_t getHighlightColor(void) const + { + return m_style.colors.highlight; + } + + /** + * Gets the color used for text in a disabled widget. + * + * @return Disabled text color. + */ + + inline const nxgl_mxpixel_t getDisabledTextColor(void) const + { + return m_style.colors.disabledText; + } + + /** + * Gets the color used for text in a enabled widget. + * + * @return Enabled text color. + */ + + inline const nxgl_mxpixel_t getEnabledTextColor(void) const + { + return m_style.colors.enabledText; + } + + /** + * Gets the color used for text in a clicked widget. + * + * @return Selected text color. + */ + + inline const nxgl_mxpixel_t getSelectedTextColor(void) const + { + return m_style.colors.selectedText; + } + + /** + * Sets this widget's reference constant. This should be unique, + * at least amongst this widget's siblings. + * + * @param refcon The reference constant. + */ + + uint32_t setRefcon(uint32_t refcon); + + /** + * Sets this widget's border state. + * + * @param isBorderless The border state. + */ + + void setBorderless(bool isBorderless); + + /** + * Sets whether or not this widget can be dragged. + * + * @param isDraggable The draggable state. + */ + + inline void setDraggable(const bool isDraggable) + { + m_flags.draggable = isDraggable; + } + + /** + * Sets whether or not child widgets can exceed this widget's dimensions. + * + * @param permeable The permeable state. + */ + + inline void setPermeable(const bool permeable) + { + m_flags.permeable = permeable; + } + + /** + * Sets whether or not the widgets processes double-clicks. + * + * @param doubleClickable The double-clickable state. + */ + + inline void setDoubleClickable(const bool doubleClickable) + { + m_flags.doubleClickable = doubleClickable; + } + + /** + * Adds a widget event handler. The event handler will receive + * all events raised by this widget. + * + * @param eventHandler A pointer to the event handler. + */ + + inline void addWidgetEventHandler(CWidgetEventHandler *eventHandler) + { + m_widgetEventHandlers->addWidgetEventHandler(eventHandler); + } + + /** + * Remove a widget event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + + inline void removeWidgetEventHandler(CWidgetEventHandler* eventHandler) + { + m_widgetEventHandlers->removeWidgetEventHandler(eventHandler); + } + + /** + * Enables or disables event firing for this widget. + * + * @param raises True to enable events, false to disable. + */ + + inline void setRaisesEvents(const bool raises) + { + raises ? m_widgetEventHandlers->enable() : m_widgetEventHandlers->disable(); + } + + /** + * Disabled drawing of this widget. Widgets hidden using this method will still + * be processed. + */ + + inline void disableDrawing(void) + { + m_flags.drawingEnabled = false; + } + + /** + * Enables drawing of this widget. + */ + + inline void enableDrawing(void) + { + m_flags.drawingEnabled = true; + } + + /** + * Sets the normal background color. + * + * @param color The new background color. + */ + + inline void setBackgroundColor(const nxgl_mxpixel_t color) + { + m_style.colors.background = color; + } + + /** + * Sets the background color for a selected widget. + * + * @param color The new selected background color. + */ + + inline void setSelectedBackgroundColor(const nxgl_mxpixel_t color) + { + m_style.colors.selectedBackground = color; + } + + /** + * Sets the shiny edge color. + * + * @param color The new shine edge color. + */ + + inline void setShineEdgeColor(const nxgl_mxpixel_t color) + { + m_style.colors.shineEdge = color; + } + + /** + * Sets the shadow edge color. + * + * @param color The new shadow edge color. + */ + + inline void setShadowEdgeColor(const nxgl_mxpixel_t color) + { + m_style.colors.shadowEdge = color; + } + + /** + * Sets the highlight color. + * + * @param color The new highlight color. + */ + + inline void setHighlightColor(const nxgl_mxpixel_t color) + { + m_style.colors.highlight = color; + } + + /** + * Sets the text color to use when the widget is disabled. + * + * @param color The new text color. + */ + + inline void setDisabledTextColor(const nxgl_mxpixel_t color) + { + m_style.colors.disabledText = color; + } + + /** + * Sets the text color to use when the widget is enabled. + * + * @param color The new text color. + */ + + inline void setEnabledTextColor(const nxgl_mxpixel_t color) + { + m_style.colors.enabledText = color; + } + + /** + * Sets the text color to use when the widget is highlighted or clicked. + * + * @param color The new selected text color. + */ + + inline void setSelectedTextColor(const nxgl_mxpixel_t color) + { + m_style.colors.selectedText = color; + } + + /** + * Sets the close type other widgets should use when closing this widget. + * + * @param closeType The close type to use. + */ + + inline void setCloseType(const CloseType closeType) + { + m_closeType = closeType; + } + + /** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + + virtual void setFont(CNxFont *font); + + /** + * Draws the visible regions of the widget and the widget's child widgets. + */ + + void redraw(void); + + /** + * Erases the visible regions of the widget by redrawing the widgets + * behind it. + */ + + void erase(void); + + /** + * Enables the widget. + * + * @return True if the widget was enabled. + */ + + bool enable(void); + + /** + * Disabled the widget. + * + * @return True if the widget was disabled. + */ + + bool disable(void); + + /** + * Erases the widget, marks it as deleted, and moves it to the CNxWidget + * deletion queue. Widgets are automatically deleted by the framework and + * should not be deleted externally. + */ + + void close(void); + + /** + * Erases the widget, removes it from the main hierarchy and sets it to + * invisible. Widgets hidden in this way will be partioned off from + * other widgets and will no longer be processed. + * + * @return True if the widget was shelved. + * @see unshelve() + */ + + bool shelve(void); + + /** + * Moves the widget back into the hierarchy and redraws it. Widgets shown + * in this way will be unpartioned and will be processed again. + * + * @return True if the widget was unshelved. + * @see shelve() + */ + + bool unshelve(void); + + /** + * Draws the widget and makes it visible. + * Does not steal focus from other widgets. + * + * @return True if the widget was shown. + * @see hide() + */ + + bool show(void); + + /** + * Erases the widget and makes it invisible. + * Does not re-assign focus to another widget. + * + * @return True if the widget was hidden. + * @see show() + */ + + bool hide(void); + + /** + * Click this widget at the supplied coordinates. This should only be + * overridden in subclasses if the default click behaviour needs to be changed. + * If the subclassed widget should just respond to a standard click, + * the onClick() method should be overridden instead. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click was successful. + */ + + bool click(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Check if the click is a double-click. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click is a double-click. + */ + + virtual bool isDoubleClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Double-click this widget at the supplied coordinates. This + * should only be overridden in subclasses if the default + * double-click behaviour needs to be changed. If the subclassed + * widget should just respond to a standard double-click, the + * onDoubleClick() method should be overridden instead. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click was successful. + */ + + bool doubleClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Release this widget at the supplied coordinates. This + * should only be overridden in subclasses if the default + * release behaviour needs to be changed. If the subclassed + * widget should just respond to a standard release, the + * onRelease() method should be overridden instead. + * + * @param x X coordinate of the release. + * @param y Y coordinate of the release. + * @return True if the release was successful. + */ + + bool release(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Drag the widget to the supplied coordinates. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance that the mouse was dragged. + * @param vY The vertical distance that the mouse was dragged. + * @return True if the drag was successful. + */ + + bool drag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Send a keypress to the widget. + * + * @param key The keycode to send to the widget. + * @return True if the keypress was processed. + */ + + bool keyPress(nxwidget_char_t key); + + /** + * Send a cursor control event to the widget. + * + * @param control The cursor control code to send to the widget. + * @return True if the cursor control was processed. + */ + + bool cursorControl(ECursorControl control); + + /** + * Give the widget focus. + * + * @return True if the widget received focus correctly. + */ + + bool focus(void); + + /** + * Remove focus from the widget. + * + * @return True if the widget lost focus correctly. + */ + + bool blur(void); + + /** + * Move the widget to the new coordinates. + * Co-ordinates are relative to the parent widget. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + * @return True if the move was successful. + */ + + bool moveTo(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Resize the widget to the new dimensions. + * + * @param width The new width. + * @param height The new height. + * @return True if the resize was successful. + */ + + bool resize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Resize and move the widget in one operation. + * Only performs one redraw so it is faster than calling the + * two separate functions. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + * @param width The new width. + * @param height The new height. + * @return True if the widget was adjusted successfully. + */ + + bool changeDimensions(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Raises the widget to the top of its parent's widget stack. + * + * @return True if the raise was successful. + */ + + bool raiseToTop(void); + + /** + * Lowers the widget to the bottom of its parent's widget stack. + * + * @return True if the lower was successful. + */ + + bool lowerToBottom(void); + + /** + * Raises the supplied widget to the top of this widget's child stack. + * The supplied widget pointer must be a child of this widget. + * + * @param widget A pointer to the child widget to raise. + * @return True if the raise was successful. + */ + + bool raiseWidgetToTop(CNxWidget *widget); + + /** + * Lowers the supplied widget to the bottom of this widget's child stack. + * The supplied widget pointer must be a child of this widget. + * + * @param widget A pointer to the child widget to lower. + * @return True if the lower was successful. + */ + + bool lowerWidgetToBottom(CNxWidget *widget); + + /** + * Moves the supplied child widget to the deletion queue. + * For framework use only. + * + * @param widget A pointer to the child widget. + */ + + void moveChildToDeleteQueue(CNxWidget *widget); + + /** + * Moves the supplied child widget to the shelved widget list. + * For framework use only. + * + * @param widget A pointer to the child widget. + * @return True if the widget was moved successfully. + * @see moveShelvedToChildList() + * @see hide() + */ + + bool moveChildToShelvedList(CNxWidget *widget); + + /** + * Moves the supplied child widget from the shelved list back + * to the child widget list. + * For framework use only. + * + * @param widget A pointer to the shelved widget. + * @return True if the widget was moved successfully. + * @see moveChildtoShelvedList() + * @see show() + */ + + bool moveShelvedToChildList(CNxWidget *widget); + + /** + * Sets the supplied widget as the focused child. The widget must + * be a child of this widget. + * + * @param widget A pointer to the child widget. + * @see getFocusedWidget() + */ + + void setFocusedWidget(CNxWidget *widget); + + /** + * Checks if the supplied coordinates collide with this widget. + * + * @param x The x coordinate to check. + * @param y The y coordinate to check. + * @return True if a collision occurred. + */ + + bool checkCollision(nxgl_coord_t x, nxgl_coord_t y) const; + + /** + * Checks if the supplied rectangle definition collides with this widget. + * + * @param x The x coordinate of the rectangle to check. + * @param y The y coordinate of the rectangle to check. + * @param width The width of the rectangle to check. + * @param height The height of the rectangle to check. + * @return True if a collision occurred. + */ + + bool checkCollision(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) const; + + /** + * Checks if the supplied widget collides with this widget. + * + * @param widget A pointer to another widget to check for collisions with. + * @return True if a collision occurred. + */ + + bool checkCollision(CNxWidget *widget) const; + + /** + * Invalidate the visible region cache for all widgets below the supplied + * widget in this widget's child stack. This will cause those widgets to + * + * recalculate their visible regions next time they try to draw themselves. + * @param widget A pointer to a child widget. + */ + + void invalidateLowerWidgetsVisibleRectCache(CNxWidget *widget); + + /** + * Adds a widget to this widget's child stack. The widget is added to the + * top of the stack. Note that the widget can only be added if it is not + * already a child of another widget. + * + * @param widget A pointer to the widget to add to the child list. + * @see insertWidget() + */ + + void addWidget(CNxWidget *widget); + + /** + * Inserts a widget into this widget's child stack at the bottom of the + * stack. Note that the widget can only be added if it is not already + * a child of another widget. + * + * @param widget A pointer to the widget to add to the child list. + * @see addWidget() + */ + + void insertWidget(CNxWidget *widget); + + /** + * Set the widget's parent to the widget passed in as a parameter. + * Called automatically when a widget is added as a child. + * + * @param parent A pointer to the parent widget. + */ + + inline void setParent(CNxWidget *parent) + { + m_parent = parent; + } + + /** + * Rebuild the list of this widget's visible regions + */ + + void cacheVisibleRects(void) const; + + /** + * Mark this widget's visible region cache as invalid, and do the same + * to its child widgets. + */ + + void invalidateVisibleRectCache(void); + + /** + * Erase a child widget by drawing the widgets behind it. + * + * @param widget The child widget to erase. + */ + + void eraseWidget(CNxWidget *widget); + + /** + * Redraw any visible regions of this widget that have become corrupted. + * + * @param invalidRects A list of corrupt regions. + * @param sender A pointer to the widget that corrupted the regions. + */ + + void redrawDirty(TNxArray* invalidRects, CNxWidget *sender); + + /** + * Clips a rectangular region to the dimensions of this widget and its ancestors. + * + * @param rect The region that needs to be clipped. + */ + + void clipRectToHierarchy(CRect &rect) const; + + /** + * Swaps the depth of the supplied child widget. + * + * @param widget A pointer to the child widget that needs to swap depths. + * @return True if the swap was successful. + */ + + virtual bool swapWidgetDepth(CNxWidget *widget); + + /** + * Swap the depth of this widget. + * + * @return True if the swap was successful. + */ + + bool swapDepth(void); + + /** + * Delete this widget. This should never be called in user code; widget + * deletion is handled internally. + */ + + inline void destroy(void) + { + delete this; + } + + /** + * Remove this widget from the widget hierarchy. Returns + * responsibility for deleting the widget back to the developer. + * Does not unregister the widget from the VBL system. + * Does not erase the widget from the display. + * + * @return True if the widget was successfully removed. + */ + + bool remove(void); + + /** + * Remove a child widget from the widget hierarchy. Returns + * responsibility for deleting the widget back to the developer. + * Does not unregister the widget from the VBL system. + * Does not erase the widget from the display. + * + * @param widget Pointer to the widget to remove from the hierarchy. + * @return True if the widget was succesfully removed. + */ + + bool removeChild(CNxWidget *widget); + + /** + * Run the widget modally. + */ + + void goModal(void); + + /** + * Stop the widget running modally. + */ + + inline void stopModal(void) + { + m_flags.modal = false; + } + + /** + * Get the index of the specified child widget. + * + * @param widget The widget to get the index of. + * @return The index of the widget. -1 if the widget is not found. + */ + + const int getWidgetIndex(const CNxWidget *widget) const; + + /** + * Get the child widget at the specified index. + * + * @param index Index of the child to retrieve. + * @return Pointer to the child at the specified index. + */ + + const CNxWidget *getChild(int index) const; + + /** + * Get the number of child widgets. + * + * @return The number of child widgets belonging to this widget. + */ + + const int getChildCount(void) const + { + return m_children.size(); + } + + /** + * Get a pointer to the cache of visible rects. + * + * @return A pointer to the cache of visible rects. + */ + + inline CRectCache *getCRectCache(void) const + { + return m_rectCache; + } + + /** + * Sets the border size. The border cannot be drawn over in the + * drawContents() method. + * + * @param borderSize The new border size. + */ + + void setBorderSize(const WidgetBorderSize &borderSize); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXWIDGET_HXX + diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx new file mode 100644 index 000000000..4a371bb27 --- /dev/null +++ b/libnxwidgets/include/cnxwindow.hxx @@ -0,0 +1,307 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnxwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXWINDOW_HXX +#define __INCLUDE_CNXWINDOW_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include + +#include "ccallback.hxx" +#include "inxwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + struct SBitmap; + + /** + * This class defines operations on a basic "raw" NX window. These windows + * are "raw" in the since that they are simply rectangular regions with + * no framing or decoration of any kind + * + * 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. + */ + + class CNxWindow : protected CCallback, public INxWindow + { + private: + NXHANDLE m_hNxServer; /**< Handle to the NX server. */ + NXWINDOW m_hNxWindow; /**< Handle to the NX raw window */ + CWidgetControl *m_widgetControl; /**< The controlling widget for the window */ + + public: + + /** + * Constructor. Creates an uninitialized instance of the CNxWindow + * object. The open() method must be called to initialize the instance. + * + * The general steps to create any window include: + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. + * 3) The window constructor call CWidgetControl methods to "smarten" + * the CWidgetControl instance with window-specific knowledge. + * 4) Call the open() method on the window to display the window. + * 5) After that, the fully smartend CWidgetControl instance can + * be used to generate additional widgets. + * 6) After that, the fully smartened CWidgetControl instance can + * be used to generate additional widgets by passing it to the + * widget constructor + * + * @param hNxServer Handle to the NX server. + * @param widgetControl Controlling widget for this window. + */ + + CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl); + + /** + * Destructor. + */ + + ~CNxWindow(void); + + /** + * Creates a new window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully opened. + */ + + bool open(void); + + /** + * 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. + * + * @return True on success, false on any failure. + */ + + bool requestPosition(void); + + /** + * Get the position of the window (as reported by the NX callback). + * + * @return The position. + */ + + bool getPosition(FAR struct nxgl_point_s *pPos); + + /** + * Get the size of the window (as reported by the NX callback). + * + * @return The size. + */ + + bool getSize(FAR struct nxgl_size_s *pSize); + + /** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on any failure. + */ + + bool setPosition(FAR const struct nxgl_point_s *pPos); + + /** + * Set the size of the selected window. + * + * @param pSize The new size of the window. + * @return True on success, false on any failure. + */ + + bool setSize(FAR const struct nxgl_size_s *pSize); + + /** + * Bring the window to the top of the display. + * + * @return True on success, false on any failure. + */ + + bool raise(void); + + /** + * Lower the window to the bottom of the display. + * + * @return True on success, false on any failure. + */ + + bool lower(void); + + /** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color); + + /** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color); + + /** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + + void getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest); + + /** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + bool fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color); + + /** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + + bool drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, nxgl_mxpixel_t color); + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + bool drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color); + + /** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + + bool move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset); + + /** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + + bool bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXWINDOW_HXX + diff --git a/libnxwidgets/include/cprogressbar.hxx b/libnxwidgets/include/cprogressbar.hxx new file mode 100644 index 000000000..c75d1eee6 --- /dev/null +++ b/libnxwidgets/include/cprogressbar.hxx @@ -0,0 +1,251 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cprogressbar.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CPROGRESSBAR_HXX +#define __INCLUDE_CPROGRESSBAR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + + /** + * Widget providing a horizontal progress bar. + */ + + class CProgressBar : public CNxWidget + { + protected: + int16_t m_minimumValue; /**< Minimum value that the grip can represent. */ + int16_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int16_t m_value; /**< Value of the progress bar. */ + bool m_showPercentageText; /**< If true, completion percentage is drawn + over the bar. */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CProgressBar(const CProgressBar &progressBar) : CNxWidget(progressBar) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the progress bar, relative to its parent. + * @param y The y coordinate of the progress bar, relative to its parent. + * @param width The width of the progress bar. + * @param height The height of the progress bar. + */ + + CProgressBar(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CProgressBar(void) { } + + /** + * Get the smallest value that the progress bar can represent. + * + * @return The smallest value. + */ + + inline const int16_t getMinimumValue(void) const + { + return m_minimumValue; + } + + /** + * Get the largest value that the progress bar can represent. + * + * @return The largest value. + */ + + inline const int16_t getMaximumValue(void) const + { + return m_maximumValue; + } + + /** + * Get the current value of the progress bar. + * return The current progress bar value. + */ + + inline const int16_t getValue(void) const + { + return m_value; + } + + /** + * Set the smallest value that the progress bar can represent. + * + * @param value The smallest value. + */ + + inline void setMinimumValue(const int16_t value) + { + m_minimumValue = value; + } + + /** + * Set the largest value that the progress bar can represent. + * + * @param value The largest value. + */ + + inline void setMaximumValue(const int16_t value) + { + m_maximumValue = value; + } + + /** + * Set the value that of the progress bar. + * + * @param value The new value. + */ + + void setValue(const int16_t value); + + /** + * Shows the percentage text over the bar. + */ + + inline void showPercentageText(void) + { + m_showPercentageText = true; + redraw(); + } + + /** + * Hides the percentage text over the bar. + */ + + inline void hidePercentageText(void) + { + m_showPercentageText = false; + redraw(); + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CPROGRESSBAR_HXX diff --git a/libnxwidgets/include/cradiobutton.hxx b/libnxwidgets/include/cradiobutton.hxx new file mode 100644 index 000000000..4186b8eea --- /dev/null +++ b/libnxwidgets/include/cradiobutton.hxx @@ -0,0 +1,207 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cradiobutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CRADIOBUTTON_HXX +#define __INCLUDE_CRADIOBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "cbutton.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + class CRadioButtonGroup; + + /** + * Represents a radio button. Radio buttons can only exist as part of a + * CRadioButtonGroup class, and should not be instantiated individually. + * Radio buttons are tri-state - off, on and "mu". + * The mu state cannot be enabled by a user - it can only be set by the + * developer. + */ + + class CRadioButton : public CButton + { + public: + + /** + * Enum listing all possible radio button states. + */ + + enum RadioButtonState + { + RADIO_BUTTON_STATE_OFF = 0, /**< Radio button is off */ + RADIO_BUTTON_STATE_ON = 1, /**< Radio button is on */ + RADIO_BUTTON_STATE_MU = 2 /**< Radio button is in the third state */ + }; + + protected: + + RadioButtonState m_state; /**< The state of the radio button */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Sets the radiobutton's state to "on". + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Destructor. + */ + + virtual inline ~CRadioButton() { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CRadioButton(const CRadioButton &radioButton) : CButton(radioButton) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the radio button, relative to its + * parent. + * @param y The y coordinate of the radio button, relative to its + * parent. + * @param width The width of the radio button. + * @param height The height of the radio button. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * defaultCWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CRadioButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Get the current state of the radio button. + * + * @return The state of the radio button. + */ + + virtual inline RadioButtonState getState(void) + { + return m_state; + } + + /** + * Set the state of the radio button. + * + * @param state The new radio button state. + */ + + virtual void setState(RadioButtonState state); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CRADIOBUTTON_HXX diff --git a/libnxwidgets/include/cradiobuttongroup.hxx b/libnxwidgets/include/cradiobuttongroup.hxx new file mode 100644 index 000000000..c37630c61 --- /dev/null +++ b/libnxwidgets/include/cradiobuttongroup.hxx @@ -0,0 +1,253 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cradiobuttongroup.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CRADIOBUTTONGROUP_HXX +#define __INCLUDE_CRADIOBUTTONGROUP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "cnxwidget.hxx" +#include "cbutton.hxx" +#include "cwidgetstyle.hxx" +#include "cwidgeteventhandler.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + class CRadioButton; + + /** + * Container class that holds radio button widgets and tracks their status. + * The group provides an easy way to determine which radio button is + * selected. Note that, in order to set the "mu" state for a radio button, + * it is necessary to set the state via the radio button, not the group. + */ + + class CRadioButtonGroup : public CNxWidget, public CWidgetEventHandler + { + protected: + CWidgetControl *m_pWidgetControl; /**< The controlling widget */ + CRadioButton *m_selectedWidget; /**< Pointer to the currently selected radio button */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort* port); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CRadioButtonGroup(const CRadioButtonGroup &radioButtonGroup) : CNxWidget(radioButtonGroup) { } + + public: + + /** + * Constructor. Note that the group determines its width and height + * from the position and dimensions of its children. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the group. + * @param y The y coordinate of the group. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CRadioButtonGroup(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + ~CRadioButtonGroup(void) { } + + /** + * Simple method for adding a new radio button to the group. + * This should be used in preference to the usual addWidget() method, + * as this method automatically resizes the group. + * + * @param x The x coordinate of the new button, relative to this + * widget. + * @param y The y coordinate of the new button, relative to this + * widget. + * @param width The width of the new button. + * @param height The height of the new button. + */ + + CRadioButton *newRadioButton(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Gets a pointer to the selected widget. + * + * @return Pointer to the selected widget. + */ + + virtual const CRadioButton *getSelectedWidget(void) const; + + /** + * Gets the index of the selected widget. + * + * @return The index of the selected widget. + */ + + virtual const int getSelectedIndex(void) const; + + /** + * Sets the selected radio button to the supplied widget. + * + * @param widget The radio button to select. + */ + + virtual void setSelectedWidget(CRadioButton *widget); + + /** + * Selects the widget at the specified index. + * + * @param index The index of the widget to select. + */ + + virtual void setSelectedIndex(int index); + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. Value is based on the length of the largest string + * in the set of options. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Handle a mouse click event. + * + * @param e The event data. + */ + + virtual void handleClickEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse double-click event. + * + * @param e The event data. + */ + + virtual void handleDoubleClickEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse button release event that occurred within the bounds of + * the source widget. + * @param e The event data. + */ + + virtual void handleReleaseEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse button release event that occurred outside the bounds of + * the source widget. + * + * @param e The event data. + */ + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CRADIOBUTTONGROUP_HXX diff --git a/libnxwidgets/include/crect.hxx b/libnxwidgets/include/crect.hxx new file mode 100644 index 000000000..e3a73a392 --- /dev/null +++ b/libnxwidgets/include/crect.hxx @@ -0,0 +1,424 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbgwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CRECT_HXX +#define __INCLUDE_CRECT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class describing a rectangle. + */ + + class CRect + { + public: + struct nxgl_point_s m_pos; /**< The position of the rectangle in the window */ + struct nxgl_size_s m_size; /**< The size of the rectangle */ + + /** + * Constructor. + */ + + CRect(void); + + /** + * Constructor. + * + * @param x The x coordinate of the rect. + * @param y The y coordinate of the rect. + * @param width The width of the rect. + * @param height The height of the rect. + */ + + CRect(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Constructor. + * + * @param rect Pointer to an NX rectangle + */ + + CRect(FAR const nxgl_rect_s *rect); + + /** + * Copy constructor. + * + * @param rect CRect to copy. + */ + + CRect(const CRect& rect); + + /** + * Create a rect object from the supplied coordinates. + * + * @param x1 The x coordinate of the rect's top-left corner. + * @param y1 The y coordinate of the rect's top-left corner. + * @param x2 The x coordinate of the rect's bottom-right corner. + * @param y2 The y coordinate of the rect's bottom-right corner. + * @return A new rect. + */ + + static CRect fromCoordinates(nxgl_coord_t x1, nxgl_coord_t y1, + nxgl_coord_t x2, nxgl_coord_t y2); + + /** + * Get the rectangle's left x coordinate. + * + * @return The rectangle's x coordinate. + */ + + inline nxgl_coord_t getX(void) const + { + return m_pos.x; + } + + /** + * Get the rectangle's top y coordinate. + * @return The rectangle's y coordinate. + */ + + inline nxgl_coord_t getY(void) const + { + return m_pos.y; + } + + /** + * Get the rectangle's width. + * + * @return The rectangle's width. + */ + + inline nxgl_coord_t getWidth(void) const + { + return m_size.w; + } + + /** + * Get the rectangle's height. + * + * @return The rectangle's height. + */ + + inline nxgl_coord_t getHeight(void) const + { + return m_size.h; + } + + /** + * Get the NX rectangle representation + * + * @param rect Pointer to NX rectangle + */ + + inline void getNxRect(FAR struct nxgl_rect_s *rect) const + { + rect->pt1.x = m_pos.x; + rect->pt1.y = m_pos.y; + rect->pt2.x = m_pos.x + m_size.w - 1; + rect->pt2.y = m_pos.y + m_size.h - 1; + } + + /** + * Set the rectangle's left x coordinate. + * + * @param x The new x coordinate. + */ + + inline void setX(nxgl_coord_t x) + { + m_pos.x = x; + } + + /** + * Set the rectangle's top y coordinate. + * + * @param y The new y coordinate. + */ + + inline void setY(nxgl_coord_t y) + { + m_pos.y = y; + } + + /** + * Set the rect's width. + * + * @param width The new width. + */ + inline void setWidth(nxgl_coord_t width) + { + m_size.w = width; + } + + /** + * Set the rect's height. + * + * @param height The new height. + */ + + inline void setHeight(nxgl_coord_t height) + { + m_size.h = height; + } + + /** + * Get the NX rectangle representation + * + * @param rect Pointer to NX rectangle + */ + + inline void setNxRect(FAR const struct nxgl_rect_s *rect) + { + m_pos.x = rect->pt1.x; + m_pos.y = rect->pt1.y; + m_size.w = rect->pt2.x - rect->pt1.x + 1; + m_size.h = rect->pt2.y - rect->pt1.y + 1; + } + + /** + * Set the x coordinate of the rect's bottom-right corner. If x2 is less + * than the rect's current x coordinate the method automatically adjusts + * the coordinates so that the rect's width is never negative. Changing this + * property will change the width of the rect. + * + * @param x2 The x coordinate of the rect's bottom-right corner. + */ + + void setX2(nxgl_coord_t x2); + + /** + * Set the y coordinate of the rect's bottom-right corner. If y2 is less + * than the rect's current y coordinate the method automatically adjusts + * the coordinates so that the rect's height is never negative. Changing this + * property will change the height of the rect. + * + * @param y2 The y coordinate of the rect's bottom-right corner. + */ + + void setY2(nxgl_coord_t y2); + + /** + * Get the x coordinate of the rectangle's right side. + * + * @return The x coordinate of the rectangle's right side. + */ + + inline nxgl_coord_t getX2(void) const + { + return m_pos.x + m_size.w - 1; + } + + /** + * Get the y coordinate of the rectangle's bottom side. + * + * @return The y coordinate of the rerectangle's bottom side. + */ + + inline nxgl_coord_t getY2(void) const + { + return m_pos.y + m_size.h - 1; + } + + /** + * Offset the rectangle position by the specified dx, dy values. + * + * @param dx X offset value + * @param dy Y offset value + */ + + inline void offset(nxgl_coord_t dx, nxgl_coord_t dy) + { + m_pos.x += dx; + m_pos.y += dy; + } + + /** + * Determines if the rectangle has two dimensions; in other words, does it + * have both height and width? Negative width or height is considered not to + * be valid. + * + * @return True if the rect has height and width; false if not. + */ + + inline bool hasDimensions(void) const + { + return m_size.w > 0 && m_size.h > 0; + } + + /** + * Populates dest with a rectangle representating the intersection + * of this rectangle and rect. + * + * @param rect The rectangle to intersect with this. + * @param dest The destination rectangle. + */ + + void getIntersect(const CRect& rect, CRect& dest) const; + + /** + * Populates dest with a rectangle representating the smallest + * rectangle that contains this rectangle and rect. + * + * @param rect The rectangle to add to this. + * @param dest The destination rectangle. + */ + + void getAddition(const CRect &rect, CRect &dest) const; + + /** + * Clips this rect to the region that intersects the supplied rect. + * + * @param rect CRect to intersect. + */ + + void clipToIntersect(const CRect &rect); + + /** + * Expands this rect so that it includes the area described by the supplied + * rect. + * + * @param rect CRect to include. + */ + + void expandToInclude(const CRect &rect); + + /** + * Check if the supplied rect intersects this. + * + * @param rect CRect to check for intersection with this. + * @return True if the rect intersects this; false if not. + */ + + bool intersects(const CRect &rect) const; + + /** + * Check if the rect contains the supplied point. + * + * @param x X coordinate of the point. + * @param y Y coordinate of the point. + * @return True if the rect contains the point; false if not. + */ + + bool contains(nxgl_coord_t x, nxgl_coord_t y) const; + + /** + * Copy the properties of this rect to the destination rect. + * + * @param dest Destination rect to copy to. + */ + + void copyTo(CRect &dest) const; + + /** + * Overloaded & operator. Returns the intersect of this rectangle and the + * rectangle passed as the "rect" argument". + * + * @param rect The rectangle to intersect with this. + */ + + CRect operator&(const CRect &rect); + + /** + * Overloaded + operator. Returns the smallest rectangle that can contain + * this rectangle and the rectangle passed as the "rect" argument". + * + * @param rect The rectangle to add to this. + */ + + CRect operator+(const CRect &rect); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CRECT_HXX diff --git a/libnxwidgets/include/crectcache.hxx b/libnxwidgets/include/crectcache.hxx new file mode 100644 index 000000000..f38c2313b --- /dev/null +++ b/libnxwidgets/include/crectcache.hxx @@ -0,0 +1,222 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/crectcache.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CRECTCACHE_HXX +#define __INCLUDE_CRECTCACHE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgetstyle.hxx" +#include "tnxarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Maintains a list of foreground (ie. above children) and background (with + * child overlapped-rects removed) rectangles representing the visible portions + * of a widget. + */ + + class CRectCache + { + private: + TNxArray m_foregroundRegions; /**< List of the widget's visible regions */ + TNxArray m_backgroundRegions; /**< List of the widget's visible regions with child rects removed */ + const CNxWidget *m_widget; /**< Owning widget */ + bool m_foregroundInvalid; /**< True if the foreground cache needs refreshing */ + bool m_backgroundInvalid; /**< True if the background cache needs refreshing */ + + /** + * Cache the foreground regions. + */ + + void cacheForegroundRegions(void); + + /** + * Cache the background regions. + */ + + void cacheBackgroundRegions(void); + + public: + + /** + * Constructor. + * + * @param widget Widget that contains the rect cache. + */ + + CRectCache(const CNxWidget *widget); + + /** + * Destructor. + */ + + inline ~CRectCache() { } + + /** + * Rebuild the cache if it is invalid. + */ + + void cache(void); + + /** + * Invalidates the cache. + */ + + inline void invalidate(void) + { + m_foregroundInvalid = true; + m_backgroundInvalid = true; + }; + + /** + * Return the list of background regions. These are regions that are not overlapped by + * child widgets. + * + * @return The list of background regions. + */ + + inline TNxArray *getBackgroundRegions(void) + { + return &m_backgroundRegions; + } + + /** + * Return the list of foreground regions. These are regions that represent the entire + * visible surface of the widget - that is, any regions not overlapped by ancestors or + * sublings of the widget - including any regions that are actually overlapped by + * child widgets. + * + * @return The list of foreground regions. + */ + + inline TNxArray *getForegroundRegions(void) + { + return &m_foregroundRegions; + } + + /** + * Works out which rectangles in the invalidRects list overlap this + * widget, then cuts the rectangles into smaller pieces. The overlapping + * pieces are pushed into validRects, and the non-overlapping pieces are + * pushed back into the invalidRects vector. + * + * @param invalidRects A vector of regions that need to be tested + * for collisions against this widget; they represent regions that need + * to be redrawn. + * @param validRects A vector of regions that represents areas of the + * display that do not need to be redrawn. + * @param sender Pointer to the widget that initiated the split. + */ + + void splitRectangles(TNxArray *invalidRects, + TNxArray *validRects, + FAR const CNxWidget *sender) const; + + /** + * Move any rectangles from the visibleRects list that overlap this widget + * into the invisibleRects list. Used during visible region calculations. + * + * @param visibleRects A vector of regions that are not overlapped. + * @param invisibleRects A vector of regions that are overlapped. + * @param widget The widget that requested the lists. + * @see splitRectangles() + */ + + void removeOverlappedRects(TNxArray *visibleRects, + TNxArray *invisibleRects, + FAR const CNxWidget* widget) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CRECTCACHE_HXX + diff --git a/libnxwidgets/include/crlepalettebitmap.hxx b/libnxwidgets/include/crlepalettebitmap.hxx new file mode 100644 index 000000000..2b1e4f065 --- /dev/null +++ b/libnxwidgets/include/crlepalettebitmap.hxx @@ -0,0 +1,259 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/crlepalettebitmap.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CRLEPALETTBITMAP_HXX +#define __INCLUDE_CRLEPALETTBITMAP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "ibitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * One Run-Length Encoded (RLE) value + */ + + struct SRlePaletteBitmapEntry + { + uint8_t npixels; /**< Number of pixels */ + uint8_t lookup; /**< Pixel RGB lookup index */ + }; + + /** + * Run-Length Encoded (RLE), Paletted Bitmap Structure + */ + + struct SRlePaletteBitmap + { + uint8_t bpp; /**< Bits per pixel */ + uint8_t fmt; /**< Color format */ + uint8_t nlut; /**< Number of colors in the Look-Up Table (LUT) */ + nxgl_coord_t width; /**< Width in pixels */ + nxgl_coord_t height; /**< Height in rows */ + FAR const void *lut; /**< Pointer to the beginning of the Look-Up Table (LUT) */ + + /** + * The pointer to the beginning of the RLE data + */ + + FAR const struct SRlePaletteBitmapEntry *data; + }; + + /** + * Class providing bitmap accessor for a bitmap represented by SRlePaletteBitmap. + */ + + class CRlePaletteBitmap : public IBitmap + { + protected: + /** + * The bitmap that is being managed + */ + + FAR const struct SRlePaletteBitmap *m_bitmap; /**< The bitmap that is being managed */ + + /** + * Accessor state data + */ + + nxgl_coord_t m_row; /**< Logical row number */ + nxgl_coord_t m_col; /**< Logical column number */ + uint8_t m_remaining; /**< Number of bytes remaining in current entry */ + FAR const struct SRlePaletteBitmapEntry *m_rle; /**< RLE entry being processed */ + + /** + * Reset to the beginning of the image + */ + + void startOfImage(void); + + /** + * Advance position data ahead. Called after npixels have + * have been consume. + * + * @param npixels The number of pixels to advance + * @return False if this goes beyond the end of the image + */ + + bool advancePosition(nxgl_coord_t npixels); + + /** + * Seek ahead the specific number of pixels -- discarding + * and advancing. + * + * @param npixels The number of pixels to skip + * @return False if this goes beyond the end of the image + */ + + bool skipPixels(nxgl_coord_t npixels); + + /** Seek to the beginning of the next row + * + * @return False if this was the last row of the image + */ + + bool nextRow(void); + + /** Seek to the beignning specific row + * + * @param row The row number to seek to + * @return False if this goes beyond the end of the image + */ + + bool seekRow(nxgl_coord_t row); + + /** Copy the pixels from the current RLE entry the specified number of times. + * + * @param npixels The number of pixels to copy. Must be less than or equal + * to m_remaining. + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + */ + + void copyColor(nxgl_coord_t npixels, FAR void *data); + + /** Copy pixels from the current position + * + * @param npixels The number of pixels to copy + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @return False if this goes beyond the end of the image + */ + + bool copyPixels(nxgl_coord_t npixels, FAR void *data); + + public: + + /** + * Constructor. + * + * @param bitmap The bitmap structure being wrapped. + */ + + CRlePaletteBitmap(const struct SRlePaletteBitmap *bitmap); + + /** + * Destructor. + */ + + inline ~CRlePaletteBitmap(void) {} + + /** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + + const uint8_t getColorFormat(void) const; + + /** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + + const uint8_t getBitsPerPixel(void) const; + + /** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + + const nxgl_coord_t getWidth(void) const; + + /** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height. + */ + + const nxgl_coord_t getHeight(void) const; + + /** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width. + */ + + const nxgl_coord_t getStride(void) const; + + /** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + + bool getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CRLEPALETTBITMAP_HXX diff --git a/libnxwidgets/include/cscrollbarhorizontal.hxx b/libnxwidgets/include/cscrollbarhorizontal.hxx new file mode 100644 index 000000000..20ba149fa --- /dev/null +++ b/libnxwidgets/include/cscrollbarhorizontal.hxx @@ -0,0 +1,293 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLBARHORIZONTAL_HXX +#define __INCLUDE_CSCROLLBARHORIZONTAL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgetstyle.hxx" +#include "islider.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CSliderHorizontal; + class CGlyphButton; + class CNxTimer; + + /** + * Container class that holds a slider widget and two arrow buttons. + * The interface is presents is virtually identical to the CSliderHorizontal + * widget, which means the two are easily interchangeable. All events + * raised by the internal slider widget are re-raised by this widget + * to this widget's event handler, meaning its events are also identical + * to the CSliderHorizontal's. + */ + + class CScrollbarHorizontal : public ISlider, public CNxWidget, public CWidgetEventHandler + { + protected: + CSliderHorizontal *m_slider; /**< Pointer to the slider widget */ + CGlyphButton *m_leftButton; /**< Pointer to the left button */ + CGlyphButton *m_rightButton; /**< Pointer to the right button */ + nxgl_coord_t m_buttonWidth; /**< Width of the buttons */ + uint8_t m_scrollTimeout; /**< Time until a button triggers + another grip movement */ + CNxTimer *m_timer; /**< Controls slider button repeats */ + + /** + * Resize the scrollbar to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScrollbarHorizontal(const CScrollbarHorizontal &scrollbarHorizontal) + : CNxWidget(scrollbarHorizontal) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScrollbarHorizontal(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CScrollbarHorizontal(void) { } + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + const nxgl_coord_t getMinimumValue(void) const; + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + const nxgl_coord_t getMaximumValue(void) const; + + /** + * Get the current value of the slider. + * + * @return The current slider value. + */ + + const nxgl_coord_t getValue(void) const; + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + const nxgl_coord_t getPageSize(void) const; + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + void setMinimumValue(const nxgl_coord_t value); + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + void setMaximumValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + void setValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + void setValueWithBitshift(const int32_t value); + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + void setPageSize(const nxgl_coord_t pageSize); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleActionEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleClickEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleReleaseEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleValueChangeEvent(const CWidgetEventArgs &e); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLBARHORIZONTAL_HXX + diff --git a/libnxwidgets/include/cscrollbarpanel.hxx b/libnxwidgets/include/cscrollbarpanel.hxx new file mode 100644 index 000000000..08bdb721c --- /dev/null +++ b/libnxwidgets/include/cscrollbarpanel.hxx @@ -0,0 +1,309 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollbarpanel.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLBARPANEL_HXX +#define __INCLUDE_CSCROLLBARPANEL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cscrollingpanel.hxx" +#include "cwidgetstyle.hxx" +#include "cscrollbarvertical.hxx" +#include "cscrollbarhorizontal.hxx" +#include "cwidgeteventhandler.hxx" +#include "iscrollable.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class containing a scrolling panel bordered by scrollbars. + */ + class CScollbarPanel : public CNxWidget, public IScrollable, + public CWidgetEventHandler + { + protected: + CWidgetControl *m_widgetControl; /**< Widget control instance */ + CScrollingPanel *m_panel; /**< Internal panel that + contains children. */ + CScrollbarHorizontal *m_scrollbarHorizontal; /**< Horizontal scrollbar. */ + CScrollbarVertical *m_scrollbarVertical; /**< Vertical scrollbar. */ + uint8_t m_scrollbarWidth; /**< Width of the vertical + scrollbar. */ + uint8_t m_scrollbarHeight; /**< Height of the horizontal + scrollbar. */ + bool m_hasVerticalScrollbar; /**< Indicates the presence of + a vertical scrollbar. */ + bool m_hasHorizontalScrollbar; /**< Indicates the presence of + a horizontal scrollbar. */ + + /** + * Creates the child widgets. + */ + + void buildUI(void); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Destructor. + */ + + virtual ~CScollbarPanel(void) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScollbarPanel(const CScollbarPanel &scrollbarPanel) + : CNxWidget(scrollbarPanel) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags The usual widget flags. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScollbarPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + + virtual void scroll(int32_t dx, int32_t dy); + + /** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + + virtual void jump(int32_t x, int32_t y); + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsVerticalScroll(bool allow); + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsHorizontalScroll(bool allow); + + /** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + + virtual void setCanvasWidth(const int32_t width); + + /** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + + virtual void setCanvasHeight(const int32_t height); + + /** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + + virtual bool allowsVerticalScroll(void) const; + + /** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + + virtual bool allowsHorizontalScroll(void) const; + + /** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasX(void) const; + + /** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasY(void) const; + + /** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + + virtual const int32_t getCanvasWidth(void) const; + + /** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + + virtual const int32_t getCanvasHeight(void) const; + + /** + * Handle a widget scroll event. + * + * @param e The event data. + */ + + void handleScrollEvent(const CWidgetEventArgs &e); + + /** + * Handle a widget value change event. + * + * @param e The event data. + */ + + void handleValueChangeEvent(const CWidgetEventArgs &e); + + /** + * Gets a pointer to the CScrollingPanel widget contained within + * this widget. + * + * @return A pointer to the CScrollingPanel widget. + */ + + inline CScrollingPanel *getPanel(void) + { + return m_panel; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLBARPANEL_HXX + diff --git a/libnxwidgets/include/cscrollbarvertical.hxx b/libnxwidgets/include/cscrollbarvertical.hxx new file mode 100644 index 000000000..974da3378 --- /dev/null +++ b/libnxwidgets/include/cscrollbarvertical.hxx @@ -0,0 +1,291 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollbarvertical.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLBARVERTICAL_HXX +#define __INCLUDE_CSCROLLBARVERTICAL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgetstyle.hxx" +#include "islider.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CSliderVertical; + class CGlyphButton; + class CNxTimer; + + /** + * Container class that holds a slider widget and two arrow buttons. + * The interface is presents is virtually identical to the CSliderVertical + * widget, which means the two are easily interchangeable. All events + * raised by the internal slider widget are re-raised by this widget + * to this widget's event handler, meaning its events are also identical + * to the CSliderVertical's. + */ + class CScrollbarVertical : public ISlider, public CNxWidget, public CWidgetEventHandler { + + protected: + CSliderVertical *m_slider; /**< Pointer to the slider widget */ + CGlyphButton *m_upButton; /**< Pointer to the up button */ + CGlyphButton *m_downButton; /**< Pointer to the down button */ + nxgl_coord_t m_buttonHeight; /**< Height of the buttons */ + uint8_t m_scrollTimeout; /**< Time until a button triggers another grip + movement */ + CNxTimer *m_timer; /**< Controls slider button repeats */ + + /** + * Resize the scrollbar to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScrollbarVertical(const CScrollbarVertical& scrollbarVertical) + : CNxWidget(scrollbarVertical) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScrollbarVertical(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CScrollbarVertical(void) { } + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + const nxgl_coord_t getMinimumValue(void) const; + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + const nxgl_coord_t getMaximumValue(void) const; + + /** + * Get the current value of the slider. + * + * @return The current slider value. + */ + + const nxgl_coord_t getValue(void) const; + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + const nxgl_coord_t getPageSize(void) const; + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + void setMinimumValue(const nxgl_coord_t value); + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + void setMaximumValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + void setValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + void setValueWithBitshift(const int32_t value); + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + void setPageSize(const nxgl_coord_t pageSize); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleActionEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleClickEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleReleaseEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleValueChangeEvent(const CWidgetEventArgs &e); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLBARVERTICAL_HXX diff --git a/libnxwidgets/include/cscrollinglistbox.hxx b/libnxwidgets/include/cscrollinglistbox.hxx new file mode 100644 index 000000000..ba7090b4b --- /dev/null +++ b/libnxwidgets/include/cscrollinglistbox.hxx @@ -0,0 +1,480 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollinglistbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLINGLISTBOX_HXX +#define __INCLUDE_CSCROLLINGLISTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "clistbox.hxx" +#include "cwidgeteventhandler.hxx" +#include "clistdata.hxx" +#include "clistboxdataitem.hxx" +#include "cwidgetstyle.hxx" +#include "ilistbox.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CScrollbarVertical; + class CWidgetControl; + + /** + * Widget containing a CListBox and a vertical scrollbar. Exposed + * methods are more or less identical to the methods exposed by the CListBox + * to ensure that the two are interchangeable. + */ + + class CScrollingListBox : public IListBox, public CNxWidget, + public CWidgetEventHandler + { + protected: + CListBox *m_listbox; /**< Pointer to the list box. */ + CScrollbarVertical *m_scrollbar; /**< Pointer to the scrollbar. */ + uint8_t m_scrollbarWidth; /**< Width of the scrollbar. */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Resize the listbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CScrollingListBox(void) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScrollingListBox(const CScrollingListBox &scrollingListBox) + : CNxWidget(scrollingListBox) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScrollingListBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Add a new option to the widget using default colors. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + + virtual void addOption(const CNxString &text, const uint32_t value); + + /** + * Add an option to the widget. + * + * @param option The option to add. + */ + + virtual void addOption(CListBoxDataItem *option); + + /** + * Add a new option to the widget. + * + * @param text Text to show in the option. + * @param value The value of the option. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + + virtual void addOption(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor); + + /** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeOption(const int index); + + /** + * Remove all options from the widget. + */ + + virtual void removeAllOptions(void); + + /** + * Select an option by its index. Does not deselect any other selected options. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual inline void selectOption(const int index) + { + m_listbox->selectOption(index); + } + + /** + * Select an option by its index. Does not deselect any other selected options. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual inline void deselectOption(const int index) + { + m_listbox->deselectOption(index); + } + + /** + * Select all options. Does nothing if the listbox does not allow multiple selections. + * Redraws the widget and raises a value changed event. + */ + + virtual inline void selectAllOptions(void) + { + m_listbox->selectAllOptions(); + } + + /** + * Deselect all options. + * Redraws the widget and raises a value changed event. + */ + + virtual inline void deselectAllOptions(void) + { + m_listbox->deselectAllOptions(); + } + + /** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * option is selected, the index of the first selected option is returned. + * + * @return The selected index. + */ + + virtual inline const int getSelectedIndex(void) const + { + return m_listbox->getSelectedIndex(); + } + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected items to deselected. + * Redraws the widget and raises a value changed event. + * + * @param index The selected index. + */ + + virtual inline void setSelectedIndex(const int index) + { + m_listbox->setSelectedIndex(index); + } + + /** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual inline const CListBoxDataItem *getSelectedOption(void) const + { + return m_listbox->getSelectedOption(); + } + + /** + * Sets whether multiple selections are possible or not. + * + * @param allowMultipleSelections True to allow multiple selections. + */ + + virtual inline + void setAllowMultipleSelections(const bool allowMultipleSelections) + { + m_listbox->setAllowMultipleSelections(allowMultipleSelections); + } + + /** + * Sets whether multiple selections are possible or not. + * + * @return True if multiple selections are allowed. + */ + + virtual inline const bool allowsMultipleSelections(void) const + { + return m_listbox->allowsMultipleSelections(); + } + + /** + * Resize the scrolling canvas to encompass all options. + */ + + virtual inline void resizeCanvas(void) + { + m_listbox->resizeCanvas(); + } + + /** + * Get the specified option. + * + * @return The specified option. + */ + + virtual inline const CListBoxDataItem *getOption(const int index) + { + return m_listbox->getOption(index); + } + + /** + * Get the selected index. Returns -1 if nothing is selected. + * + * @return The selected index. + */ + + virtual inline const CListBoxDataItem *getOption(const int index) const + { + return m_listbox->getOption(index); + } + + /** + * Sort the options alphabetically by the text of the options. + */ + + virtual inline void sort(void) + { + m_listbox->sort(); + } + + /** + * Get the total number of options. + * + * @return The number of options. + */ + + virtual inline const int getOptionCount(void) const + { + return m_listbox->getOptionCount(); + } + + /** + * Get the height of a single option. + * + * @return The height of an option. + */ + + virtual inline const nxgl_coord_t getOptionHeight(void) const + { + return m_listbox->getOptionHeight(); + } + + /** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + + virtual void handleValueChangeEvent(const CWidgetEventArgs &e); + + /** + * Handle a widget action event. + * + * @param e The event data. + */ + + virtual void handleActionEvent(const CWidgetEventArgs &e); + + /** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + + virtual void handleScrollEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse button click event. + * + * @param e The event data. + */ + + virtual void handleClickEvent(const CWidgetEventArgs &e); + + /** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + + virtual void handleDoubleClickEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse button release event that occurred within the bounds of + * the source widget. + * + * @param e The event data. + */ + + virtual void handleReleaseEvent(const CWidgetEventArgs &e); + + /** + * Handle a mouse button release event that occurred outside the bounds of + * the source widget. + * + * @param e The event data. + */ + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); + + /** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + + virtual void setFont(CNxFont *font); + + /** + * Sets whether or not items added to the list are automatically + * sorted on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual inline void setSortInsertedItems(const bool sortInsertedItems) + { + m_listbox->setSortInsertedItems(sortInsertedItems); + } + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLINGLISTBOX_HXX diff --git a/libnxwidgets/include/cscrollingpanel.hxx b/libnxwidgets/include/cscrollingpanel.hxx new file mode 100644 index 000000000..90dcc1ac9 --- /dev/null +++ b/libnxwidgets/include/cscrollingpanel.hxx @@ -0,0 +1,372 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollingpanel.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLINGPANEL_HXX +#define __INCLUDE_CSCROLLINGPANEL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "iscrollable.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class containing a scrollable region. Responds to mouse movement. Can + * contain sub-widgets which will also be scrolled. + */ + + class CScrollingPanel : public CNxWidget, public IScrollable + { + protected: + CWidgetControl *m_widgetControl; /**< Widget control instance */ + int32_t m_canvasX; /**< X coordinate of the virtual + canvas. */ + int32_t m_canvasY; /**< Y coordinate of the virtual + canvas. */ + int32_t m_canvasWidth; /**< Width of the virtual canvas. */ + int32_t m_canvasHeight; /**< Height of the virtual canvas. */ + bool m_allowVerticalScroll; /**< True if vertical scrolling is + allowed. */ + bool m_allowHorizontalScroll; /**< True if horizontal scrolling is + allowed. */ + bool m_isContentScrolled; /**< True if the content drawn to the + panel is scrolled(ie. everything + drawn in the draw() method); + false if just child objects are scrolled. */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Scrolls the panel to match the drag. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal drag distance. + * @param vY The vertical drag distance. + */ + + virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Scroll all child widgets by the specified amounts. Actually uses + * the widget's moveTo() function to reposition them. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + + void scrollChildren(int32_t dx, int32_t dy); + + /** + * Destructor. + */ + + virtual ~CScrollingPanel(void) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScrollingPanel(const CScrollingPanel &scrollingPanel) + : CNxWidget(scrollingPanel) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags The usual widget flags. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScrollingPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + + virtual void scroll(int32_t dx, int32_t dy); + + /** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + + virtual void jump(int32_t x, int32_t y); + + /** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + + inline bool allowsVerticalScroll(void) const + { + return m_allowVerticalScroll; + } + + /** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + + inline bool allowsHorizontalScroll(void) const + { + return m_allowHorizontalScroll; + } + + /** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + + virtual inline const int32_t getCanvasX(void) const + { + return m_canvasX; + } + + /** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + + virtual inline const int32_t getCanvasY(void) const + { + return m_canvasY; + } + + /** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + + virtual inline const int32_t getCanvasWidth(void) const + { + return m_canvasWidth; + } + + /** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + + virtual inline const int32_t getCanvasHeight(void) const + { + return m_canvasHeight; + } + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + inline void setAllowsVerticalScroll(bool allow) + { + m_allowVerticalScroll = allow; + } + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + inline void setAllowsHorizontalScroll(bool allow) + { + m_allowHorizontalScroll = allow; + } + + /** + * Set whether or not the content of the panel is scrolled. + * Content is anything drawn to the panel in the draw() method. + * This property is disabled by default, which will result in + * faster scrolling of child objects. + * If the panel contains no child objects, just draw() method + * content, consider using a SuperBitmap class instead. + * + * @param scrolled True to enable content scrolling; false to disable it. + */ + + inline void setContentScrolled(bool scrolled) + { + m_isContentScrolled = scrolled; + } + + /** + * Check if the content of the panel, drawn via the draw() method, + * is scrolled. + * + * @return True if the content is scrolled; false if not. + */ + + inline bool IsContentScrolled(void) + { + return m_isContentScrolled; + } + + /** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + + virtual inline void setCanvasWidth(const int32_t width) + { + m_canvasWidth = width; + } + + /** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + + virtual inline void setCanvasHeight(const int32_t height) + { + m_canvasHeight = height; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLINGPANEL_HXX + diff --git a/libnxwidgets/include/cscrollingtextbox.hxx b/libnxwidgets/include/cscrollingtextbox.hxx new file mode 100644 index 000000000..0d2a1a39d --- /dev/null +++ b/libnxwidgets/include/cscrollingtextbox.hxx @@ -0,0 +1,467 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollingtextbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSCROLLINGTEXTBOX_HXX +#define __INCLUDE_CSCROLLINGTEXTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cmultilinetextbox.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" +#include "iscrollable.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CScrollbarVertical; + class CNxFont; + + /** + * Widget containing a CMultiLineTextBox and a vertical scrollbar. Exposed + * methods are more or less identical to the methods exposed by the + * CMultiLineTextBox to ensure that the two are interchangeable. + */ + + class CScrollingTextBox : public ITextBox, public CNxWidget, + public IScrollable, public CWidgetEventHandler + { + protected: + CMultiLineTextBox *m_texbox; /**< Pointer to the textbox */ + CScrollbarVertical *m_scrollbar; /**< Pointer to the scrollbar */ + uint8_t m_scrollbarWidth; /**< Width of the scrollbar */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Resize the textbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CScrollingTextBox(void) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScrollingTextBox(const CScrollingTextBox& scrollingTextBox) + : CNxWidget(scrollingTextBox) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param flags Standard widget flag options. + * @param maxRows The maximum number of rows the textbox can track. Adding + * text beyond this number will cause rows at the start of the text to be + * forgotten; text is essentially stored as a queue, and adding to the back + * of a full queue causes the front items to be popped off. Setting this to + * 0 will make the textbox track only the visible rows. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + + CScrollingTextBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, uint32_t flags, + nxgl_coord_t maxRows = 0, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Set the horizontal alignment of text within the textbox. + * + * @param alignment The horizontal position of the text. + */ + + virtual void setTextAlignmentHoriz(CMultiLineTextBox::TextAlignmentHoriz alignment); + + /** + * Set the vertical alignment of text within the textbox. + * + * @param alignment The vertical position of the text. + */ + + virtual void setTextAlignmentVert(CMultiLineTextBox::TextAlignmentVert alignment); + + /** + * Returns the number of "pages" that the text spans. A page + * is defined as the amount of text that can be displayed within + * the textbox at one time. + * + * @return The page count. + */ + + virtual const uint16_t getPageCount(void) const; + + /** + * Returns the current page. + * + * @return The current page. + * @see getPageCount(). + */ + + virtual const uint16_t getCurrentPage(void) const; + + /** + * Returns a pointer to the Text object that contains the + * wrapped text used in the textbox. It is used as the + * pre-processed data source for the textbox, and should + * not be altered. + * + * @return Pointer to the Text object. + */ + + virtual const CText *getText(void) const; + + /** + * Set the text displayed in the textbox. + * + * @param text String to display. + */ + + virtual void setText(const CNxString &text); + + /** + * Append new text to the end of the current text + * displayed in the textbox. + * + * @param text String to append. + */ + + virtual void appendText(const CNxString &text); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + + virtual void removeText(const unsigned int startIndex); + + /** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + + virtual void removeText(const unsigned int startIndex, const unsigned int count); + + /** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + + virtual void setFont(CNxFont *font); + + /** + * Get the length of the text string. + * + * @return The length of the text string. + */ + + virtual const unsigned int getTextLength(void) const; + + /** + * Sets the cursor display mode. + * + * @param cursorMode Determines cursor display mode + */ + + virtual void showCursor(EShowCursor cursorMode); + + /** + * Shows the cursor in default mode (only when the TextBox has focus). + */ + + inline void showCursor(void) + { + showCursor(SHOW_CURSOR_ONFOCUS); + } + + /** + * Hides the cursor. + */ + + inline void hideCursor(void) + { + showCursor(SHOW_CURSOR_NEVER); + } + + /** + * Enables/disables cursor wrapping + * + * @param wrap True enables cursor wrapping + */ + + virtual void wrapCursor(bool wrap); + + /** + * Move the cursor to the text position specified. 0 indicates the start + * of the string. If position is greater than the length of the string, + * the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + + virtual void moveCursorToPosition(const int32_t position); + + /** + * Get the cursor position. This is the index within the string that + * the cursor is currently positioned over. + * + * @return position The cursor position. + */ + + virtual const int32_t getCursorPosition(void) const; + + /** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + + virtual void insertText(const CNxString &text, const unsigned int index); + + /** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + + virtual void insertTextAtCursor(const CNxString &text); + + /** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + + virtual void handleValueChangeEvent(const CWidgetEventArgs &e); + + /** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + + virtual void handleScrollEvent(const CWidgetEventArgs &e); + + /** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasX(void) const; + + /** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasY(void) const; + + /** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + + virtual const int32_t getCanvasWidth(void) const; + + /** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + + virtual const int32_t getCanvasHeight(void) const; + + /** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + + virtual void scroll(int32_t dx, int32_t dy); + + /** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + + virtual void jump(int32_t x, int32_t y); + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsVerticalScroll(bool allow); + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsHorizontalScroll(bool allow); + + /** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + + virtual void setCanvasWidth(const int32_t width); + + /** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + + virtual void setCanvasHeight(const int32_t height); + + /** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + + virtual bool allowsVerticalScroll(void) const; + + /** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + + virtual bool allowsHorizontalScroll(void) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCROLLINGTEXTBOX_HXX + diff --git a/libnxwidgets/include/csliderhorizontal.hxx b/libnxwidgets/include/csliderhorizontal.hxx new file mode 100644 index 000000000..f732a1731 --- /dev/null +++ b/libnxwidgets/include/csliderhorizontal.hxx @@ -0,0 +1,344 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/csliderhorizontal.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSLIDERHORIZONTAL_HXX +#define __INCLUDE_CSLIDERHORIZONTAL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "islider.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CSliderHorizontalGrip; + class CWidgetControl; + + /** + * Widget providing a sliding "grip" that can be moved left and + * right in the "gutter". Essentially a scrollbar, but more + * generic. + */ + + class CSliderHorizontal : public ISlider, public CNxWidget, public CWidgetEventHandler + { + protected: + CSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ + nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ + nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int32_t m_value; /**< Current value of the slider. */ + nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ + nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking + the gutter. */ + int32_t m_gutterWidth; /**< Width of the gutter, taking into account + any adjustments made to the width of the grip. */ + uint32_t m_contentSize; /**< Number of values in the min/max range. */ + + /** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + + int32_t getPhysicalMaximumValueWithBitshift(void) const; + + /** + * Get the value represented by the top of the grip. + * return The value represented by the top of the grip. + */ + + const int32_t getGripValue(void) const; + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CSliderHorizontal(const CSliderHorizontal& sliderHorizontal) + : CNxWidget(sliderHorizontal) { } + + /** + * Resize and redraw the grip. + */ + + void resizeGrip(void); + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + + CSliderHorizontal(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CSliderHorizontal(void) { } + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + inline const nxgl_coord_t getMinimumValue(void) const + { + return m_minimumValue; + } + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + inline const nxgl_coord_t getMaximumValue(void) const + { + return m_maximumValue; + } + + /** + * Get the current value of the slider. + * + * return The current slider value. + */ + + inline const nxgl_coord_t getValue(void) const + { + return m_value >> 16; + } + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + inline const nxgl_coord_t getPageSize(void) const + { + return m_pageSize; + } + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + inline void setMinimumValue(const nxgl_coord_t value) + { + m_minimumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + resizeGrip(); + }; + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + inline void setMaximumValue(const nxgl_coord_t value) + { + m_maximumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + resizeGrip(); + }; + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + void setValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + void setValueWithBitshift(const int32_t value); + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + inline void setPageSize(const nxgl_coord_t pageSize) + { + m_pageSize = pageSize; + resizeGrip(); + }; + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleDragEvent(const CWidgetEventArgs &e); + + /** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + + nxgl_coord_t getMinimumStep(void) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSLIDERHORIZONTAL_HXX + diff --git a/libnxwidgets/include/csliderhorizontalgrip.hxx b/libnxwidgets/include/csliderhorizontalgrip.hxx new file mode 100644 index 000000000..71f10f62c --- /dev/null +++ b/libnxwidgets/include/csliderhorizontalgrip.hxx @@ -0,0 +1,203 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/csliderhorizontalgrip.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSLIDERHORIZONTALGRIP_HXX +#define __INCLUDE_CSLIDERHORIZONTALGRIP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * Class representing the grip, or draggable button, with a horizontal + * slider. + */ + + class CSliderHorizontalGrip : public CNxWidget + { + protected: + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + + virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CSliderHorizontalGrip(const CSliderHorizontalGrip &sliderHorizontalGrip) + : CNxWidget(sliderHorizontalGrip) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + + CSliderHorizontalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + + /** + * Destructor. + */ + + virtual inline ~CSliderHorizontalGrip(void) { } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSLIDERHORIZONTALGRIP_HXX + diff --git a/libnxwidgets/include/cslidervertical.hxx b/libnxwidgets/include/cslidervertical.hxx new file mode 100644 index 000000000..a1b8651f9 --- /dev/null +++ b/libnxwidgets/include/cslidervertical.hxx @@ -0,0 +1,344 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cslidervertical.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSLIDERVERTICAL_HXX +#define __INCLUDE_CSLIDERVERTICAL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "islider.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CSliderVerticalGrip; + class CWidgetControl; + + /** + * Widget providing a sliding "grip" that can be moved up and + * down the "gutter". Essentially a scrollbar, but more + * generic. + */ + + class CSliderVertical : public ISlider, public CNxWidget, public CWidgetEventHandler + { + protected: + CSliderVerticalGrip* m_grip; /**< Pointer to the grip. */ + nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ + nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int32_t m_value; /**< Current value of the slider. */ + nxgl_coord_t m_minimumGripHeight; /**< Smallest height that the grip can become. */ + nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking + the gutter */ + int32_t m_gutterHeight; /**< Height of the gutter, taking into account + any adjustments made to the height of the grip. */ + uint32_t m_contentSize; /**< Number of values in the min/max range. */ + + /** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + + int32_t getPhysicalMaximumValueWithBitshift(void) const; + + /** + * Get the value represented by the top of the grip. The value is + * bitshifted left 16 places for accuracy. + * return The value represented by the top of the grip. + */ + + const int32_t getGripValue(void) const; + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CSliderVertical(const CSliderVertical &sliderVertical) + : CNxWidget(sliderVertical) { } + + /** + * Resize and redraw the grip. + */ + + void resizeGrip(); + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + + CSliderVertical(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CSliderVertical(void) { } + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + inline const nxgl_coord_t getMinimumValue(void) const + { + return m_minimumValue; + } + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + inline const nxgl_coord_t getMaximumValue(void) const + { + return m_maximumValue; + } + + /** + * Get the current value of the slider. + * return The current slider value. + */ + + inline const nxgl_coord_t getValue(void) const + { + return m_value >> 16; + } + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + inline const nxgl_coord_t getPageSize(void) const + { + return m_pageSize; + } + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + inline void setMinimumValue(const nxgl_coord_t value) + { + m_minimumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + resizeGrip(); + } + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + inline void setMaximumValue(const nxgl_coord_t value) + { + m_maximumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + resizeGrip(); + } + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + void setValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + void setValueWithBitshift(const int32_t value); + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + inline void setPageSize(const nxgl_coord_t pageSize) + { + m_pageSize = pageSize; + resizeGrip(); + } + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleDragEvent(const CWidgetEventArgs &e); + + /** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + + nxgl_coord_t getMinimumStep(void) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSLIDERVERTICAL_HXX + diff --git a/libnxwidgets/include/csliderverticalgrip.hxx b/libnxwidgets/include/csliderverticalgrip.hxx new file mode 100644 index 000000000..3ac7fb360 --- /dev/null +++ b/libnxwidgets/include/csliderverticalgrip.hxx @@ -0,0 +1,202 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cslidervertical.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSLIDERVERTICALGRIP_HXX +#define __INCLUDE_CSLIDERVERTICALGRIP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * Class representing the grip, or draggable button, with a vertical + * slider. + */ + + class CSliderVerticalGrip : public CNxWidget + { + protected: + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + + virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CSliderVerticalGrip(const CSliderVerticalGrip &sliderVerticalGrip) + : CNxWidget(sliderVerticalGrip) { } + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + + CSliderVerticalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height); + + /** + * Destructor. + */ + + virtual inline ~CSliderVerticalGrip(void) { } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSLIDERVERTICALGRIP_HXX + diff --git a/libnxwidgets/include/cstickybutton.hxx b/libnxwidgets/include/cstickybutton.hxx new file mode 100644 index 000000000..c51976ec0 --- /dev/null +++ b/libnxwidgets/include/cstickybutton.hxx @@ -0,0 +1,237 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cstickybutton.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSTICKYBUTTON_HXX +#define __INCLUDE_CSTICKYBUTTON_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbutton.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * CButton that sticks down when clicked. + */ + + class CStickyButton : public CButton + { + protected: + bool m_isStuckDown; /**< True if the key is stuck down */ + + /** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + + virtual void drawOutline(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Don't redraw on button press events. The button display is + * completely controlled by the externally controlled stuck state. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y) {} + + /** + * Don't redraw on button release events. The button display is + * completely controlled by the externally controlled stuck state. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Don't redraw on button release events. The button display is + * completely controlled by the externally controlled stuck state. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Copy constructor is protected to prevent usage. The button display is + * completely controlled by the externally controlled stuck state. + */ + + inline CStickyButton(const CStickyButton &button) : CButton(button) { } + + public: + + /** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CStickyButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CStickyButton(void) { } + + /** + * Sets the key's stuck down state. If this is true, the key has a + * inwards-bevelled border when drawn. If it is false, the key has + * an outwards-bevelled border. + * + * @param stuckDown The new stuck down state. + */ + + void setStuckDown(bool stuckDown); + + /** + * Toggles the key's stuck down state. + */ + + inline void toggleStuckDown(void) + { + setStuckDown(!m_isStuckDown); + } + + /** + * Returns the stuck down state. + * + * @return True is the button is in the stuck down state. + */ + + inline const bool isStuckDown(void) const + { + return m_isStuckDown; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSTICKYBUTTON_HXX diff --git a/libnxwidgets/include/cstickybuttonarray.hxx b/libnxwidgets/include/cstickybuttonarray.hxx new file mode 100644 index 000000000..5854c51f0 --- /dev/null +++ b/libnxwidgets/include/cstickybuttonarray.hxx @@ -0,0 +1,174 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cstickybuttonarray.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CSTICKYBUTTONARRAY_HXX +#define __INCLUDE_CSTICKYBUTTONARRAY_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbuttonarray.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CNxString; + + /** + * Manages a two-dimensional array of buttons as one widget. A two- + * dimensional array of buttons might also be called a "keyboard". + */ + + class CStickyButtonArray : public CButtonArray + { + protected: + bool m_isStuckDown; /**< True if one key in the array stuck down */ + bool m_stickDown; /**< True there is a change in a sticky button state */ + uint8_t m_stickyRow; /**< The row index of the stuck button */ + uint8_t m_stickyColumn; /**< The column index of the stuck button */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CStickyButtonArray(const CStickyButtonArray &button) : CButtonArray(button) { } + + public: + + /** + * Constructor for an array of sticky buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CStickyButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * CStickyButtonArray Destructor. + */ + + virtual inline ~CStickyButtonArray(void) { } + + /** + * Return the position of the last stuck down button (0,0 will be returned + * the no button has every been stuck down). The button at this position + * is currently stuck down then, in addition, return true. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if a button in the array is clicked + */ + + virtual bool isAnyButtonStuckDown(int &column, int &row) const; + + /** + * Check if this specific button in the array is stuck down + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is stuck down + */ + + virtual bool isThisButtonStuckDown(int column, int row) const; + + /** + * Force the button at this position into the stuck down state + * + * @param column The column containing the button to stick down + * @param row The rowtcontaining the button to stick down + * @return False(0) is returned if the indices are out of range. + */ + + virtual bool stickDown(int column, int row); + + /** + * Unstick all buttons + */ + + virtual void unstick(void); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSTICKYBUTTONARRAY_HXX diff --git a/libnxwidgets/include/cstringiterator.hxx b/libnxwidgets/include/cstringiterator.hxx new file mode 100644 index 000000000..648d12633 --- /dev/null +++ b/libnxwidgets/include/cstringiterator.hxx @@ -0,0 +1,192 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cstringiterator.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CSTRINGITERATOR_HXX +#define __INCLUDE_CSTRINGITERATOR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxString; + + /** + * Class used to efficiently iterate over the characters in a CNxString + * object. The CNxString is a Unicode string that uses the fixed-width + * 16-bit encoding to represent its characters. + */ + + class CStringIterator + { + private: + const CNxString *m_pString; /**< String being iterated over. */ + const nxwidget_char_t *m_pCurrentChar; /**< Pointer to the current position of the iterator. */ + int m_currentIndex; /**< Iterator's current index within the string. */ + + public: + + /** + * Constructor. Moves the iterator to the first character in the string. + * + * @param string Pointer to the string that will be iterated over. + */ + + CStringIterator(FAR const CNxString* string); + + /** + * Destructor. + */ + + inline ~CStringIterator(void) { } + + /** + * Moves the iterator to the first character in the string. + * + * @param Returns false if the string is empty + */ + + bool moveToFirst(void); + + /** + * Moves the iterator to the last character in the string. + * + * @param Returns false if the string is empty + */ + + bool moveToLast(void); + + /** + * Move the iterator to the next character in the string. + * + * @return True if the iterator moved; false if not (indicates end of string). + */ + + bool moveToNext(void); + + /** + * Move the iterator to the previous character in the string. + * + * @return True if the iterator moved; false if not (indicates start of string). + */ + + bool moveToPrevious(void); + + /** + * Move the iterator to the specified index. + * + * @param index The index to move to. + * @return True if the iterator moved; false if not (indicates end of string). + */ + + bool moveTo(int index); + + /** + * Get the current position of the iterator within the string. + * + * @return The current character index of the iterator. + */ + + inline int getIndex(void) const + { + return m_currentIndex; + } + + /** + * Get the letter in the string at the iterator's current point. + * + * @return The current character in the string. + */ + + inline nxwidget_char_t getChar(void) const + { + return *m_pCurrentChar; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSTRINGITERATOR_HXX diff --git a/libnxwidgets/include/ctext.hxx b/libnxwidgets/include/ctext.hxx new file mode 100644 index 000000000..8f8ee5783 --- /dev/null +++ b/libnxwidgets/include/ctext.hxx @@ -0,0 +1,386 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ctext.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CTEXT_HXX +#define __INCLUDE_CTEXT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cnxfont.hxx" +#include "tnxarray.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * This class functions as a wrapper around a char array offering + * more advanced functionality - it can wrap text, calculate its + * height in pixels, calculate the width of a row, etc. + */ + + class CText : public CNxString + { + private: + + /** + * Struct defining the position and length of a longest line within + * the m_linePositions array. + */ + + typedef struct + { + int index; + uint8_t width; + } LongestLine; + + CNxFont *m_font; /**< Font to be used for output */ + TNxArray m_linePositions; /**< Array containing start indexes + of each wrapped line */ + TNxArray m_longestLines; /**< Array containing data describing + successively longer wrapped + lines */ + uint8_t m_lineSpacing; /**< Spacing between lines of text */ + int32_t m_textPixelHeight; /**< Total height of the wrapped + text in pixels */ + uint8_t m_textPixelWidth; /**< Total width of the wrapped text + in pixels */ + nxgl_coord_t m_width; /**< Width in pixels available t + the text */ + + public: + + /** + * Constructor. + * + * @param font The font to use for this text object. + * @param text A string that this text object should wrap around. + * @param width The pixel width at which the text should wrap. + */ + + CText(CNxFont *font, const CNxString &text, nxgl_coord_t width); + + /** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + + virtual void setText(const CNxString &text); + + /** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + + virtual void setText(FAR const char *text); + + /** + * Set the text in the string. + * + * @param text Character to to use as the new data for this string. + */ + + virtual void setText(const nxwidget_char_t text); + + /** + * Append text to the end of the string. + * + * @param text String to append. + */ + + virtual void append(const CNxString &text); + + /** + * Insert text at the specified character index. + * + * @param text The text to insert. + * @param index The char index to insert at. + */ + + virtual void insert(const CNxString &text, const int index); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex The char index to start removing from. + */ + + virtual void remove(const int startIndex); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex The char index to start removing from. + * @param count The number of chars to remove. + */ + + virtual void remove(const int startIndex, const int count); + + /** + * Set the vertical spacing between rows of text. + * + * @param lineSpacing The line spacing. + */ + + void setLineSpacing(uint8_t lineSpacing); + + /** + * Sets the pixel width of the text; text wider than + * this will automatically wrap. + * + * @param width Maximum pixel width of the text. + */ + + void setWidth(nxgl_coord_t width); + + /** + * Set the font to use. + * + * @param font Pointer to the new font. + */ + + void setFont(CNxFont *font); + + /** + * Get the number of characters in the specified line number. + * + * @param lineNumber The line number to check. + * @return The number of characters in the line. + */ + + const int getLineLength(const int lineNumber) const; + + /** + * Get the number of characters in the specified line number, + * ignoring any trailing blank characters. + * + * @param lineNumber The line number to check. + * @return The number of characters in the line. + */ + + const int getLineTrimmedLength(const int lineNumber) const; + + /** + * Get the width in pixels of the specified line number. + * + * @param lineNumber The line number to check. + * @return The pixel width of the line. + */ + + const nxgl_coord_t getLinePixelLength(const int lineNumber) const; + + /** + * Get the width in pixels of the specified line number, + * ignoring any trailing blank characters. + * + * @param lineNumber The line number to check. + * @return The pixel width of the line. + */ + + const nxgl_coord_t getLineTrimmedPixelLength(const int lineNumber) const; + + /** + * Get the total height of the text in pixels. + * + * @return The total height of the text. + */ + + inline const int32_t getPixelHeight(void) const + { + return m_textPixelHeight; + } + + /** + * Get the width of the longest line in pixels. + * + * @return The width of the longest line. + */ + + inline const uint8_t getPixelWidth(void) const + { + return m_textPixelWidth; + } + + /** + * Get the pixel spacing between each line of text. + * + * @return The line spacing. + */ + + inline const uint8_t getLineSpacing(void) const + { + return m_lineSpacing; + } + + /** + * Get the height in pixels of a line, given as the + * height of the font plus the line spacing. + * + * @return The height of a line. + */ + + inline const uint8_t getLineHeight(void) const + { + return m_font->getHeight() + m_lineSpacing; + } + + /** + * Get the total number of lines in the text. + * + * @return The line count. + */ + + inline const int getLineCount(void) const + { + return m_linePositions.size() - 1; + } + + /** + * Get a pointer to the CText object's font. + * + * @return Pointer to the font. + */ + + CNxFont *getFont(void) const; + + /** + * Removes lines of text from the start of the text buffer. + * + * @param lines Number of lines to remove + */ + + void stripTopLines(const int lines); + + /** + * Wrap all of the text. + */ + + void wrap(void); + + /** + * Wrap the text from the line containing the specified char index onwards. + * + * @param charIndex The index of the char to start wrapping from; note + * that the wrapping function will re-wrap that entire line of text. + */ + + void wrap(int charIndex); + + /** + * Get the index of the line of text that contains the specified index + * within the raw char array. + * + * @param index The index to locate within the wrapped lines of text. + * @return The number of the line of wrapped text that contains the + * specified index. + */ + + const int getLineContainingCharIndex(const int index) const; + + /** + * Gets the index within the char array that represents the start of the line of + * text indicated by the line parameter. + * + * @param line The line number to locate within the char array. + * @return The index within the char array of the start of the supplied line. + */ + + const int getLineStartIndex(const int line) const + { + return m_linePositions[line]; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CTEXT_HXX + diff --git a/libnxwidgets/include/ctextbox.hxx b/libnxwidgets/include/ctextbox.hxx new file mode 100644 index 000000000..32a0ab69f --- /dev/null +++ b/libnxwidgets/include/ctextbox.hxx @@ -0,0 +1,375 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ctextbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CTEXTBOX_HXX +#define __INCLUDE_CTEXTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clabel.hxx" +#include "cnxstring.hxx" +#include "cwidgetstyle.hxx" +#include "cwidgeteventargs.hxx" +#include "itextbox.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references. + */ + + class CWidgetControl; + class CNxTimer; + class CNxString; + + /** + * Single-line textbox widget. Can align text both vertically and + * horizontally in different ways. The widget gains this functionality by + * inheriting from the CLabel class. However, if the amount of text exceeds + * the dimensions of the widget, the widget will ignore its horizontal + * alignment settings and switch to left-aligned instead. This ensures that + * moving the cursor over the text will scroll through it correctly. + */ + + class CTextBox : public ITextBox, public CLabel, public CWidgetEventHandler + { + protected: + int m_cursorPos; /**< Position of the cursor within the string. */ + uint8_t m_showCursor; /**< Controls cursor visibility. */ + bool m_wrapCursor; /**< True wrap cursor at the ends of the text */ + + /** + * Redraws the widget + */ + + inline void onBlur(void); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Moves the cursor without redrawing. + * + * @param position New cursor position. + * @return True if the cursor position changed + */ + + virtual bool repositionCursor(const int position); + + /** + * Move the cursor to the specified coordinates. The coordinates + * are expected to be the result of a click, and therefore in + * world-space rather than widget-space. + */ + + void moveCursorToClickLocation(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Moves the cursor to the clicked coordinates. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Does nothing. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + + virtual void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Return true if the cursor is visible + */ + + virtual bool isCursorVisible(void) const; + + /** + * Get the x coordinate of the cursor in pixels relative + * to the left-hand edge of the client rect. + * + * @return The x coordinate of the cursor in pixels. + */ + + virtual const nxgl_coord_t getCursorXPos(void) const; + + /** + * Get the width of the cursor in pixels. + * + * @return The width of the cursor in pixels. + */ + + virtual nxgl_coord_t getCursorWidth(void) const; + + /** + * Calculate the horizontal position of the string based on its length + * and the alignment options. Alignment options are overridden if the + * width of the string exceeds the width of the textbox. + */ + + virtual void calculateTextPositionHorizontal(void); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CTextBox(const CTextBox& textbox) : CLabel(textbox) { }; + + public: + + /** + * Constructor for a textbox containing a string. + * + * @param pWidgetControl The controlling widget for the window + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CTextBox(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Sets the cursor display mode. + * + * @param cursorMode Determines cursor display mode + */ + + virtual void showCursor(EShowCursor cursorMode); + + /** + * Shows the cursor in default mode (only when the TextBox has focus). + */ + + virtual inline void showCursor(void) + { + showCursor(SHOW_CURSOR_ONFOCUS); + } + + /** + * Hides the cursor. + */ + + virtual inline void hideCursor(void) + { + showCursor(SHOW_CURSOR_NEVER); + } + + /** + * Enables/disables cursor wrapping + * + * @param wrap True enables cursor wrapping + */ + + virtual inline void wrapCursor(bool wrap) + { + m_wrapCursor = wrap; + } + + /** + * Set the text displayed in the label. + * + * @param text String to display. + */ + + virtual void setText(const CNxString &text); + + /** + * Append new text to the end of the current text displayed in the + * label. + * + * @param text String to append. + */ + + virtual void appendText(const CNxString &text); + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + + virtual void removeText(const unsigned int startIndex); + + /** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + + virtual void removeText(const unsigned int startIndex, const unsigned int count); + + /** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + + virtual void insertText(const CNxString &text, const unsigned int index); + + /** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + + virtual void insertTextAtCursor(const CNxString &text); + + /** + * Move the cursor to the text position specified. 0 indicates the + * start of the string. If position is greater than the length of the + * string, the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + + virtual void moveCursorToPosition(const int position); + + /** + * Get the cursor position. This is the index within the string that + * the cursor is currently positioned over. + * + * @return position The cursor position. + */ + + virtual inline const int getCursorPosition(void) const + { + return m_cursorPos; + } + + /** + * Handle a keyboard press event. Replaces CWidgetEventHandler method. + * + * @param e The event data. + */ + + void handleKeyPressEvent(const CWidgetEventArgs &e); + + /** + * Handle a cursor control event. Replaces CWidgetEventHandler method. + * + * @param e The event data. + */ + + void handleCursorControlEvent(const CWidgetEventArgs &e); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CTEXTBOX_HXX diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx new file mode 100644 index 000000000..9fedd4618 --- /dev/null +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -0,0 +1,641 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CWIDGETCONTROLT_HXX +#define __INCLUDE_CWIDGETCONTROLT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include "nxconfig.hxx" +#include "cgraphicsport.hxx" +#include "cnxwidget.hxx" +#include "crect.hxx" +#include "cwidgetstyle.hxx" +#include "tnxarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class INxWindow; + class CNxWidget; + + /** + * Class providing a top-level widget and an interface to the CWidgetControl + * widget hierarchy. + * + * 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. + */ + + class CWidgetControl + { + protected: + /** + * Structure holding the status of the Mouse or Touchscreen. There must + * be one instance of this structure per window instance. The + * content of this structure is update by the CGraphicsPort on each + * NX mouse callback + */ + + struct SMouse + { +#if 0 // Center and right buttons are not used + uint16_t leftPressed : 1; /**< Left button pressed (or + touchscreen contact) */ + uint16_t centerPressed : 1; /**< Center button pressed (not + used with touchscreen) */ + uint16_t rightPressed : 1; /**< Right button pressed (not + used with touchscreen) */ + uint16_t leftHeld : 1; /**< Left button held down (or + touchscreen contact) */ + uint16_t centerHeld : 1; /**< Center button held down + (not used with touchscreen) */ + uint16_t rightHeld : 1; /**< Right button held down + (not used with touchscreen) */ + uint16_t leftDrag : 1; /**< Left button held down (or + touchscreen contact) */ + uint16_t centerDrag : 1; /**< Center button held down (or + touchscreen contact) */ + uint16_t rightDrag : 1; /**< Right button held down (or + touchscreen contact) */ + uint16_t leftReleased : 1; /**< Left button release (or + loss of touchscreen contact) */ + uint16_t centerReleased : 1; /**< Center button release (or + loss of touchscreen contact) */ + uint16_t rightReleased : 1; /**< Right button release (or + loss of touchscreen contact) */ + uint16_t doubleClick : 1; /**< Left button double click */ + uint16_t unused : 3; /**< Padding bits */ +#else + uint8_t leftPressed : 1; /**< Left button pressed (or + touchscreen contact) */ + uint8_t leftHeld : 1; /**< Left button held down (or + touchscreen contact) */ + uint8_t leftDrag : 1; /**< Left button held down (or + touchscreen contact) */ + uint8_t leftReleased : 1; /**< Left button release (or + loss of touchscreen contact) */ + uint8_t doubleClick : 1; /**< Left button double click */ + uint8_t unused : 3; /**< Padding bits */ +#endif + nxgl_coord_t x; /**< Current X coordinate of + the mouse/touch */ + nxgl_coord_t y; /**< Current Y coordinate of + the mouse/touch */ + nxgl_coord_t lastX; /**< X coordinate of the mouse + at the previous poll */ + nxgl_coord_t lastY; /**< Y coordinate of the mouse + at the previous poll */ + struct timespec leftPressTime; /**< Time the left button was + pressed */ + struct timespec leftReleaseTime; /**< Time the left button was + released */ + }; + + /** + * State data + */ + + CGraphicsPort *m_port; /**< The graphics port + that is used for + drawing on this window */ + TNxArray m_deleteQueue; /**< Array of widgets + awaiting deletion. */ + TNxArray m_widgets; /**< List of controlled + widgets. */ + bool m_modal; /**< True: in modal loop */ + sem_t m_modalsem; /**< Modal loops waits for + events on this semaphore */ + /** + * I/O + */ + + struct SMouse m_mouse; /**< Current pointer + device state */ + CNxWidget *m_clickedWidget; /**< Pointer to the widget + that is clicked. */ + CNxWidget *m_focusedWidget; /**< Pointer to the widget + that received keyboard + input. */ + uint8_t m_kbdbuf[CONFIG_NXWIDGETS_KBDBUFFER_SIZE]; + uint8_t m_nCh; /**< Number of buffered + keyboard characters */ + uint8_t m_controls[CONFIG_NXWIDGETS_CURSORCONTROL_SIZE]; + uint8_t m_nCc; /**< Number of buffered + cursor controls */ + /** + * The following were picked off from the position callback. + */ + + NXHANDLE m_hWindow; /**< Handle to the NX window */ + struct nxgl_size_s m_size; /**< Size of the window */ + struct nxgl_point_s m_pos; /**< Position in display space */ + struct nxgl_rect_s m_bounds; /**< Size of the display */ + + /** + * Style + */ + + CWidgetStyle m_style; /**< Default style used by all + widgets in the window. */ + + /** + * Copy a widget style + * + * @param dest The destination style + * @param src The source to use + */ + + void copyWidgetStyle(CWidgetStyle *dest, const CWidgetStyle *src); + + /** + * Return the elapsed time in millisconds + * + * @param startTime A time in the past from which to compute the elapsed time. + * @return The elapsed time since startTime + */ + + uint32_t elapsedTime(FAR const struct timespec *startTime); + + /** + * Pass clicks to the widget hierarchy. Closes the context menu if + * the clicked widget is not the context menu. If a single widget + * is supplied, only that widget is sent the click. That widget + * should be running modally. + * + * @param x Click xcoordinate. + * @param y Click ycoordinate. + * @param widget Pointer to a modally-running widget or NULL. + */ + + void handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget* widget); + + /** + * Get the index of the specified controlled widget. + * + * @param widget The widget to get the index of. + * @return The index of the widget. -1 if the widget is not found. + */ + + const int getWidgetIndex(const CNxWidget *widget) const; + + /** + * Delete any widgets in the deletion queue. + */ + + void processDeleteQueue(void); + + /** + * Process mouse/touchscreen events and send throughout the hierarchy. + * + * @param widget to process, used for modal widgets; omit this parameter + * to run the whole system. + * @return True means a mouse event occurred + */ + + bool pollMouseEvents(CNxWidget* widget); + + /** + * Process keypad events and send throughout the hierarchy. + * + * @return True means a keyboard event occurred + */ + + bool pollKeyboardEvents(void); + + /** + * Process cursor control events and send throughout the hierarchy. + * + * @return True means a cursor control event was processes + */ + + bool pollCursorControlEvents(void); + + /** + * Wake up the modal loop + */ + + void wakeupModalLoop(void); + + /** + * Clear all mouse events + */ + + void clearMouseEvents(void); + + public: + + /** + * Constructor + * + * @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. + */ + + CWidgetControl(FAR const CWidgetStyle *style = (const CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + ~CWidgetControl(void); + + /** + * Run the widget modally. This will run the CWidgetControl + * application until stopModal() is called. + */ + + void goModal(void); + + /** + * Wait for an interesting modal event to occur (like a mouse or keyboard event) + */ + + void waitForModalEvent(void); + + /** + * Is the widget modal? Only true if the Widget singleton is also modal. + * + * @return True if the widget is modal. + */ + + inline const bool isModal(void) const + { + return m_modal; + } + + /** + * Stop the widget running modally. + */ + + void stopModal(void); + + /** + * Run all code that needs to take place on a periodic basis. + * This is normally called from and is the main body of goModal() + * with widget == NULL. + * + * @param widget Sub-widget to run, used for modal widgets; omit + * this parameter to run the whole system. + * @return True means some interesting event occurred + */ + + bool pollEvents(CNxWidget *widget = (CNxWidget *)NULL); + + /** + * Swaps the depth of the supplied widget. + * This function presumes that all child widgets are screens. + * + * @param widget The widget to be depth-swapped. + * @return True if the depth swap occurred. + */ + + bool swapWidgetDepth(CNxWidget *widget); + + /** + * Redraws any dirty regions within the supplied region. + * + * @param rect The region to redraw + */ + + void eraseRect(CRect rect); + + /** + * Add another widget to be managed by this control instance + * + * @param widget The widget to be controlled. + */ + + inline void addControlledWidget(CNxWidget* widget) + { + m_widgets.push_back(widget); + } + + /** + * Remove a controlled widget + * + * @param widget The widget to be removed + */ + + void removeControlledWidget(CNxWidget* widget); + + /** + * Get the number of controlled widgets. + * + * @return The number of child widgets belonging to this widget. + */ + + inline const int getControlledWidgetCount(void) const + { + return m_widgets.size(); + } + + /** + * Add a widget to the list of widgets to be deleted. + * Must never be called by anything other than the framework itself. + * + * @param widget The widget to add to the delete queue. + */ + + void addToDeleteQueue(CNxWidget *widget); + + /** + * Set the clicked widget pointer. Note that this should not be + * called by code other than within the CWidgetControl library itself. + * + * @param widget The new clicked widget. + */ + + void setClickedWidget(CNxWidget *widget); + + /** + * Get the clicked widget pointer. + * + * @return Pointer to the clicked widget. + */ + + inline CNxWidget *getClickedWidget(void) + { + return m_clickedWidget; + } + + /** + * Set the focused widget that will receive keyboard input. + * + * @param widget The new focused widget. + */ + + void setFocusedWidget(CNxWidget *widget); + + /** + * Reset the focused widget so that it will no longer receive keyboard input. + * + * @param widget The new focused widget. + */ + + void clearFocusedWidget(CNxWidget *widget) + { + if (widget == m_focusedWidget) + { + m_focusedWidget = (CNxWidget *)NULL; + } + } + + /** + * Get the focused widget pointer. + * + * @return Pointer to the focused widget. + */ + + inline CNxWidget *getFocusedWidget(void) + { + return m_focusedWidget; + } + + /** + * Check for the occurrence of a double click. + * + * @return Pointer to the clicked widget. + */ + + inline bool doubleClick(void) + { + return (bool)m_mouse.doubleClick; + } + + /** + * Get the default widget style for this window. + * + * @return Pointer to the clicked widget. + */ + + inline void getWidgetStyle(CWidgetStyle *style) + { + copyWidgetStyle(style, &m_style); + } + + /** + * These remaining methods are used by the CCallback instance to + * provide notifications of certain events. + */ + + /** + * This event will occur when the position or size of the underlying + * window occurs. + * + * @param hWindow The window handle that should be used to communicate + * with the window + * @param pos The position of the window in the physical device space. + * @param size The size of the window. + * @param bounds The size of the underlying display (pixels x rows) + */ + + void geometryEvent(NXHANDLE hWindow, + const struct nxgl_size_s *size, + const struct nxgl_point_s *pos, + const struct nxgl_rect_s *bounds); + + /** + * This event will occur when the a portion of the window that was + * previously obscured is now exposed. + * + * @param nxRect The region in the window that must be redrawn. + * @param more True means that more re-draw requests will follow + */ + + void redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more); + + /** + * This event means that new mouse data is available for the window. + * + * @param pPos The (x,y) position of the mouse. + * @param buttons See NX_MOUSE_* definitions. + */ + + void newMouseEvent(FAR const struct nxgl_point_s *pPos, uint8_t buttons); + + /** + * This event means that keyboard/keypad data is available for the window. + * + * @param nCh The number of characters that are available in pStr[]. + * @param pStr The array of characters. + */ + + void newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr); + + /** + * This event means that cursor control data is available for the window. + * + * @param cursorControl The cursor control code received. + */ + + void newCursorControlEvent(ECursorControl cursorControl); + + /** + * Get the window handle reported on the first position callback. + * + * @return This function returns the window handle. + */ + + inline NXHANDLE getWindowHandle(void) + { + return m_hWindow; + } + + /** + * Get the window bounding box in physical display coordinated. + * + * @return This function returns the window handle. + */ + + inline CRect getWindowBoundingBox(void) + { + return CRect(&m_bounds); + } + + /** + * Get the position of the window (as reported by the last NX callback). + * + * @return The position. + */ + + inline bool getWindowPosition(FAR struct nxgl_point_s *pPos) + { + pPos->x = m_pos.x; + pPos->x = m_pos.y; + return true; + } + + /** + * Get the size of the window (as reported by the last NX callback). + * + * @return The size. + */ + + inline bool getWindowSize(FAR struct nxgl_size_s *pSize) + { + pSize->h = m_size.h; + pSize->w = m_size.w; + return true; + } + + /** + * Get the width of the window (as reported by the last NX callback). + * + * @return The size. + */ + + inline nxgl_coord_t getWindowWidth(void) + { + return m_size.w; + } + + /** + * Get the height of the window (as reported by the last NX callback). + * + * @return The size. + */ + + inline nxgl_coord_t getWindowHeight(void) + { + return m_size.h; + } + + /** + * The creation sequence is: + * + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. + * 3) The call this method with the static_cast to INxWindow to, + * finally, create the CGraphicsPort for this window. + * 4) After that, the fully smartend CWidgetControl instance can + * be used to generate additional widgets. + * + * @param window The instance of INxWindow needed to construct the + * CGraphicsPort instance + */ + + inline bool createGraphicsPort(INxWindow *window) + { + m_port = new CGraphicsPort(window); + return m_port != (CGraphicsPort *)NULL; + } + + /** + * Get the CGraphicsPort instance for drawing on this window + */ + + inline CGraphicsPort *getGraphicsPort(void) + { + return m_port; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETCONTROLT_HXX diff --git a/libnxwidgets/include/cwidgeteventargs.hxx b/libnxwidgets/include/cwidgeteventargs.hxx new file mode 100644 index 000000000..9aacafa74 --- /dev/null +++ b/libnxwidgets/include/cwidgeteventargs.hxx @@ -0,0 +1,237 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgeteventargs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETEVENTARGS_HXX +#define __INCLUDE_CWIDGETEVENTARGS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "teventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* Interesting Key events ***************************************************/ + +#define KEY_CODE_NONE ((nxwidget_char_t)0x00) /**< No key (NUL) */ +#define KEY_CODE_BACKSPACE ((nxwidget_char_t)0x08) /**< Backspace key */ +#define KEY_CODE_DELETE ((nxwidget_char_t)0x7f) /**< Delete key */ +#define KEY_CODE_ENTER ((nxwidget_char_t)0x0d) /**< Enter key (carriage return) */ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxWidget; + + /** + * Cursor control events + */ + + typedef enum + { + CURSOR_HOME = 1, // Set the cursor to the beginning + CURSOR_END, // Set the cursor to the end + CURSOR_UP, // Set the cursor up one row + CURSOR_DOWN, // Set the cursor down one row + CURSOR_LEFT, // Move the cursor left one column + CURSOR_RIGHT, // Move the cursor right one column + CURSOR_PAGEUP, // Move the cursor up one page + CURSOR_PAGEDOWN, // Move the cursor down one page + } ECursorControl; + + /** + * Event arguments passed to listeners when a CNxWidget object raises an event. + */ + + class CWidgetEventArgs : public TEventArgs + { + private: + nxgl_coord_t m_x; /**< X coordinateinate of the event. */ + nxgl_coord_t m_y; /**< Y coordinateinate of the event. */ + nxgl_coord_t m_vX; /**< X distance moved during event, for dragging. */ + nxgl_coord_t m_vY; /**< Y distance moved during event, for dragging. */ + nxwidget_char_t m_key; /**< The key code / cursor code that raised the event. */ + + public: + + /** + * Constructor. + * + * @param source Pointer to the CNxWidget object that raised the event. + * @param x The x coordinate of the event. + * @param y The y coordinate of the event. + * @param vX The x distance of the event. + * @param vY The y distance of the event. + * @param keyCode The keycode of the event. + */ + + CWidgetEventArgs(CNxWidget *source, const nxgl_coord_t x, const nxgl_coord_t y, + const nxgl_coord_t vX, const nxgl_coord_t vY, + const nxwidget_char_t key) + : TEventArgs(source) + { + m_x = x; + m_y = y; + m_vX = vX; + m_vY = vY; + m_key = key; + } + + /** + * Get the x coordinate of the mouse event. Applies only to the following + * events: mouse click, mouse double click, mouse drag, mouse release + * + * @return The x coordinate of the event. + */ + + inline const nxgl_coord_t getX(void) const + { + return m_x; + } + + /** + * Get the y coordinate of the mouse event. Applies only to the following + * events: mouse click, mouse double click, mouse drag, mouse release + * + * @return The y coordinate of the event. + */ + + inline const nxgl_coord_t getY(void) const + { + return m_y; + } + + /** + * Get the x-axis mouse move distance of the mouse event. Applies + * only to the mouse drag event. + * + * @return The x-axis mouse move distance of the event. + */ + + inline const nxgl_coord_t getVX(void) const + { + return m_vX; + } + + /** + * Get the y-axis mouse move distance of the event. Applies + * only to the mouse drag event. + * + * @return The y-axis mouse move distance of the event. + */ + + inline const nxgl_coord_t getVY(void) const + { + return m_vY; + } + + /** + * Get the key press that generated the event. Applies only to + * the key press event. + * + * @return The key that generated the event. + */ + + inline const nxwidget_char_t getKey(void) const + { + return m_key; + } + + /** + * Get the cursor control that generated the event. Applies only + * to the curso control event. + * + * @return The cursor control that generated the event. + */ + + inline const ECursorControl getCursorControl(void) const + { + return (ECursorControl)m_key; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETEVENTARGS_HXX diff --git a/libnxwidgets/include/cwidgeteventhandler.hxx b/libnxwidgets/include/cwidgeteventhandler.hxx new file mode 100644 index 000000000..965b29f0f --- /dev/null +++ b/libnxwidgets/include/cwidgeteventhandler.hxx @@ -0,0 +1,316 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgeteventhandler.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETEVENTHANDLER_HXX +#define __INCLUDE_CWIDGETEVENTHANDLER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgeteventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxWidget; + + /** + * Base CWidgetEventHandler class, intended to be subclassed. Any class that + * needs to listen for widget events should inherit from this class. + */ + + class CWidgetEventHandler + { + public: + /** + * Constructor. + */ + + inline CWidgetEventHandler() { } + + /** + * Destructor. + */ + + virtual inline ~CWidgetEventHandler() { } + + /** + * Handle a mouse button click event. + * + * @param e The event data. + */ + + virtual void handleClickEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a mouse button drag event. + * + * @param e The event data. + */ + + virtual void handleDragEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a drop event, triggered when the widget has been dragged-and-dropped. + * + * @param e The event data. + */ + + virtual void handleDropEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a mouse button release event that occurred within the bounds of + * the source widget. + * + * @param e The event data. + */ + + virtual void handleReleaseEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a mouse button release event that occurred outside the bounds of + * the source widget. + * + * @param e The event data. + */ + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a key press event. + * + * @param e The event data. + */ + + virtual void handleKeyPressEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a cursor control event. + * + * @param e The event data. + */ + + virtual void handleCursorControlEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a key repeat event. + * + * @param e The event data. + */ + + virtual void handleFocusEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget blur event. + * + * @param e The event data. + */ + + virtual void handleBlurEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget close event. + * + * @param e The event data. + */ + + virtual void handleCloseEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget hide event. + * + * @param e The event data. + */ + + virtual void handleHideEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget show event. + * + * @param e The event data. + */ + + virtual void handleShowEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget enable event. + * + * @param e The event data. + */ + + virtual void handleEnableEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget disable event. + * + * @param e The event data. + */ + + virtual void handleDisableEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget value change event. + * + * @param e The event data. + */ + + virtual void handleValueChangeEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget resize event. + * + * @param e The event data. + */ + + virtual void handleResizeEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget move event. + * + * @param e The event data. + */ + + virtual void handleMoveEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget scroll event. + * + * @param e The event data. + */ + + virtual void handleScrollEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget double-click event. + * + * @param e The event data. + */ + + virtual void handleDoubleClickEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget shelve event. + * + * @param e The event data. + */ + + virtual void handleShelveEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget unshelve event. + * + * @param e The event data. + */ + + virtual void handleUnshelveEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget action event. + * + * @param e The event data. + */ + + virtual void handleActionEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget move forward event. + * + * @param e The event data. + */ + + virtual void handleMoveForwardEvent(const CWidgetEventArgs &e) { } + + /** + * Handle a widget move backward event. + * + * @param e The event data. + */ + + virtual void handleMoveBackwardEvent(const CWidgetEventArgs &e) { } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETEVENTHANDLER_HXX diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx new file mode 100644 index 000000000..45e304554 --- /dev/null +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -0,0 +1,382 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgeteventhandlerlist.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETEVENTHANDLERLIST_HXX +#define __INCLUDE_CWIDGETEVENTHANDLERLIST_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cwidgeteventhandler.hxx" +#include "tnxarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxWidget; + class CListDataItem; + + /** + * List of widget event handlers. + */ + class CWidgetEventHandlerList + { + protected: + TNxArray m_widgetEventHandlers; /**< List of event handlers */ + CNxWidget *m_widget; /**< Owning widget */ + bool m_isEnabled; /**< Indicates if events are active */ + + public: + + /** + * Constructor. + * + * @param widget The owning widget. + */ + + CWidgetEventHandlerList(CNxWidget *widget); + + /** + * Destructor. + */ + + ~CWidgetEventHandlerList(void) { } + + /** + * Check if the object raises events or not. + * + * @return True if events are enabled. + */ + + const bool isEnabled(void) const; + + /** + * Get the event handler at the specified index. + * + * @param index The index of the event handler. + * @return The event handler at the specified index. + */ + + inline CWidgetEventHandler *at(const int index) const + { + return m_widgetEventHandlers.at(index); + } + + /** + * Get the size of the array. + * + * @return The size of the array. + */ + + inline const nxgl_coord_t size(void) const + { + return m_widgetEventHandlers.size(); + } + + /** + * Adds a widget event handler. The event handler will receive + * all events raised by this object. + * @param eventHandler A pointer to the event handler. + */ + + void addWidgetEventHandler(CWidgetEventHandler *eventHandler); + + /** + * Remove a widget event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + + void removeWidgetEventHandler(CWidgetEventHandler *eventHandler); + + /** + * Enables event raising. + */ + + inline void enable(void) + { + m_isEnabled = true; + } + + /** + * Disables event raising. + */ + + inline void disable(void) + { + m_isEnabled = false; + } + + /** + * Raise a click event to the event handler. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + void raiseClickEvent(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raise a double-click event to the event handler. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + void raiseDoubleClickEvent(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raise a mouse release event to the event handler. + * + * @param x The x coordinate of the release. + * @param y The y coordinate of the release. + */ + + void raiseReleaseEvent(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raise a mouse release-outside event to the event handler. + * + * @param x The x coordinate of the release. + * @param y The y coordinate of the release. + */ + + void raiseReleaseOutsideEvent(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raise a mouse drag event to the event handler. + * + * @param x The x coordinate of the mouse when the drag started. + * @param y The y coordinate of the mouse when the drag started. + * @param vX The horizontal distance dragged. + * @param vY The vertical distance dragged. + */ + + void raiseDragEvent(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Raise a widget drop event to the event handler. + * + * @param x The x coordinate of the mouse when the drop occurred. + * @param y The y coordinate of the mouse when the drop occurred. + */ + + void raiseDropEvent(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raise a move forward event to the event handler. + */ + + void raiseMoveForwardEvent(void); + + /** + * Raise a move backward event to the event handler. + */ + + void raiseMoveBackwardEvent(void); + + /** + * Raise a key press event to the event handler. + * + * @param key The character code of the key that caused the event. + */ + + void raiseKeyPressEvent(nxwidget_char_t key); + + /** + * Raise a cursor control event to the event handler. + * + * @param cursorControl The cursor control code that caused the event. + */ + + void raiseCursorControlEvent(ECursorControl cursorControl); + + /** + * Raise a focus event to the event handler. + */ + + void raiseFocusEvent(void); + + /** + * Raise a blur event to the event handler. + */ + + void raiseBlurEvent(void); + + /** + * Raise a close event to the event handler. + */ + + void raiseCloseEvent(void); + + /** + * Raise a hide event to the event handler. + */ + + void raiseHideEvent(void); + + /** + * Raise a show event to the event handler. + */ + + void raiseShowEvent(void); + + /** + * Raise a shelve event to the event handler. + */ + + void raiseShelveEvent(void); + + /** + * Raise a unshelve event to the event handler. + */ + + void raiseUnshelveEvent(void); + + /** + * Raise an enable event to the event handler. + */ + + void raiseEnableEvent(void); + + /** + * Raise a disable event to the event handler. + */ + + void raiseDisableEvent(void); + + /** + * Raise a value change event to the event handler. + */ + + void raiseValueChangeEvent(void); + + /** + * Raise a resize event to the event handler. + * + * @param width The new width of the widget. + * @param height The new height of the widget. + */ + + void raiseResizeEvent(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Raise a move event to the event handler. + * + * @param x The new x coordinate of the widget. + * @param y The new y coordinate of the widget. + * @param vX The horizontal distance moved. + * @param vY The vertical distance moved. + */ + + void raiseMoveEvent(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + /** + * Raise an action event to the event handler. This should be called + * when a widget's purpose has been fulfilled. For example, in the case + * of a button, this event is raised when the button is released within + * its boundaries. The button has produced a valid click, and thus + * fulfilled its purpose, so it needs to raise an "action" event. + */ + + void raiseActionEvent(void); + + /** + * Raises a scroll event. Fired when the panel scrolls. + * + * @param vX Horizontal distance scrolled. + * @param vY Vertical distance scrolled. + */ + + void raiseScrollEvent(nxgl_coord_t vX, nxgl_coord_t vY); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETEVENTHANDLERLIST_HXX diff --git a/libnxwidgets/include/cwidgetstyle.hxx b/libnxwidgets/include/cwidgetstyle.hxx new file mode 100644 index 000000000..8fe5e2c32 --- /dev/null +++ b/libnxwidgets/include/cwidgetstyle.hxx @@ -0,0 +1,135 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgetstyle.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETSTYLE_HXX +#define __INCLUDE_CWIDGETSTYLE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxFont; + + /** + * Class containing all colors that a widget depends on. + */ + + class CWidgetColors + { + public: + nxgl_mxpixel_t background; /**< Color used for a normal background */ + nxgl_mxpixel_t selectedBackground; /**< Color used for a selected background */ + nxgl_mxpixel_t shineEdge; /**< Color used as light bevel edge */ + nxgl_mxpixel_t shadowEdge; /**< Color used as dark bevel edge */ + nxgl_mxpixel_t highlight; /**< Color used as highlighted elements */ + nxgl_mxpixel_t disabledText; /**< Color used for text in a disabled widget */ + nxgl_mxpixel_t enabledText; /**< Color used for text in a enabled widget */ + nxgl_mxpixel_t selectedText; /**< Color used for text in a clicked widget */ + }; + + /** + * Class providing the default colors and fonts for all widgets. This + * information is copied into the widgets when they are constructed, so you + * will need to change these values *before* creating any widgets if you + * want those widgets to use the altered colors. + * + * If the font objects are set, NXWidgets will use them in preference to the + * default system fonts. + */ + + class CWidgetStyle + { + public: + CWidgetColors colors; /**< Default widget colors */ + CNxFont *font; /**< Default font */ + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETSTYLE_HXX diff --git a/libnxwidgets/include/glyphs.hxx b/libnxwidgets/include/glyphs.hxx new file mode 100644 index 000000000..afd6cc7a0 --- /dev/null +++ b/libnxwidgets/include/glyphs.hxx @@ -0,0 +1,131 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/glyphs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_GLYPHS_HXX +#define __INCLUDE_GLYPHS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Bitmap Glyph References + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + struct SBitmap; + + // Global RLE Paletted Bitmaps + + extern const struct SRlePaletteBitmap g_nuttxBitmap; + + // Global Simple Bitmaps + + extern const struct SBitmap g_screenDepthUp; + extern const struct SBitmap g_screenDepthDown; + extern const struct SBitmap g_windowClose; + extern const struct SBitmap g_windowDepthUp; + extern const struct SBitmap g_windowDepthDown; + extern const struct SBitmap g_radioButtonOn; + extern const struct SBitmap g_radioButtonOff; + extern const struct SBitmap g_radioButtonMu; + extern const struct SBitmap g_checkBoxOff; + extern const struct SBitmap g_checkBoxOn; + extern const struct SBitmap g_checkBoxMu; + extern const struct SBitmap g_screenFlipUp; + extern const struct SBitmap g_screenFlipDown; + extern const struct SBitmap g_arrowUp; + extern const struct SBitmap g_arrowDown; + extern const struct SBitmap g_arrowLeft; + extern const struct SBitmap g_arrowRight; + extern const struct SBitmap g_cycle; + extern const struct SBitmap g_backspace; + extern const struct SBitmap g_return; + extern const struct SBitmap g_shift; + extern const struct SBitmap g_capslock; + extern const struct SBitmap g_control; +} + +#endif // __cplusplus + +#endif // __INCLUDE_GLYPHS_HXX diff --git a/libnxwidgets/include/ibitmap.hxx b/libnxwidgets/include/ibitmap.hxx new file mode 100644 index 000000000..c4bb3b5ac --- /dev/null +++ b/libnxwidgets/include/ibitmap.hxx @@ -0,0 +1,165 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ibitmap.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_IBITMAP_HXX +#define __INCLUDE_IBITMAP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Abstract class defining the basic properties of a source bitmap. The + * primary intent of this class is two support a variety of sources of + * bitmap data with various kinds of compression. + */ + + class IBitmap + { + public: + /** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + + virtual const uint8_t getColorFormat(void) const = 0; + + /** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + + virtual const uint8_t getBitsPerPixel(void) const = 0; + + /** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + + virtual const nxgl_coord_t getWidth(void) const = 0; + + /** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height. + */ + + virtual const nxgl_coord_t getHeight(void) const = 0; + + /** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width. + */ + + virtual const nxgl_coord_t getStride(void) const = 0; + + /** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + + virtual bool getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_IBITMAP_HXX diff --git a/libnxwidgets/include/ilistbox.hxx b/libnxwidgets/include/ilistbox.hxx new file mode 100644 index 000000000..9184f23c8 --- /dev/null +++ b/libnxwidgets/include/ilistbox.hxx @@ -0,0 +1,273 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ilistbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_ILISTBOX_HXX +#define __INCLUDE_ILISTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clistboxdataitem.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Defines the interface for ListBox classes. + */ + + class IListBox + { + public: + + /** + * Add a new option to the widget using default colors. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + + virtual void addOption(const CNxString &text, const uint32_t value) = 0; + + /** + * Add an option to the widget. + * + * @param option The option to add. + */ + + virtual void addOption(CListBoxDataItem *option) = 0; + + /** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeOption(const int index) = 0; + + /** + * Remove all options from the widget. + */ + + virtual void removeAllOptions(void) = 0; + + /** + * Add a new option to the widget. + * + * @param text Text to show in the option. + * @param value The value of the option. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + + virtual void addOption(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor) = 0; + + /** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual void selectOption(const int index) = 0; + + /** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + + virtual void deselectOption(const int index) = 0; + + /** + * Select all options. Does nothing if the listbox does not allow + * multiple selections. Redraws the widget and raises a value + * changed event. + */ + + virtual void selectAllOptions(void) = 0; + + /** + * Deselect all options. + * Redraws the widget and raises a value changed event. + */ + + virtual void deselectAllOptions(void) = 0; + + /** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * option is selected, the index of the first selected option is returned. + * + * @return The selected index. + */ + + virtual const int getSelectedIndex(void) const = 0; + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected options to deselected. + * Redraws the widget and raises a value changed event. + * + * @param index The selected index. + */ + + virtual void setSelectedIndex(const int index) = 0; + + /** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual const CListBoxDataItem *getSelectedOption(void) const = 0; + + /** + * Sets whether multiple selections are possible or not. + * + * @param allowMultipleSelections True to allow multiple selections. + */ + + virtual void setAllowMultipleSelections(const bool allowMultipleSelections) = 0; + + /** + * Sets whether multiple selections are possible or not. + * + * @return True if multiple selections are allowed. + */ + + virtual const bool allowsMultipleSelections(void) const = 0; + + /** + * Get the specified option. + * + * @return The specified option. + */ + + virtual const CListBoxDataItem *getOption(const int index) = 0; + + /** + * Sort the options alphabetically by the text of the options. + */ + + virtual void sort(void) = 0; + + /** + * Get the total number of options. + * + * @return The number of options. + */ + + virtual const int getOptionCount(void) const = 0; + + /** + * Get the height of a single option. + * + * @return The height of an option. + */ + + virtual const nxgl_coord_t getOptionHeight(void) const = 0; + + /** + * Sets whether or not items added to the list are automatically sorted on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual void setSortInsertedItems(const bool sortInsertedItems) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_ILISTBOX_HXX + diff --git a/libnxwidgets/include/ilistdataeventhandler.hxx b/libnxwidgets/include/ilistdataeventhandler.hxx new file mode 100644 index 000000000..b6119a2ae --- /dev/null +++ b/libnxwidgets/include/ilistdataeventhandler.hxx @@ -0,0 +1,127 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ilistdataeventhandler.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_ILISTDATAEVENTHANDLERR_HXX +#define __INCLUDE_ILISTDATAEVENTHANDLERR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "clistdataeventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class ListData; + + /** + * Base IListDataEventHandler class, intended to be subclassed. Any class + * that needs to listen for CListData events should inherit from this class. + */ + + class IListDataEventHandler + { + public: + /** + * Handle data changes. + * + * @param e Event arguments. + */ + + virtual void handleListDataChangedEvent(const CListDataEventArgs &e) = 0; + + /** + * Handle data changes. + * + * @param e Event arguments. + */ + + virtual void + handleListDataSelectionChangedEvent(const CListDataEventArgs &e) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_ILISTDATAEVENTHANDLERR_HXX diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx new file mode 100644 index 000000000..0c372ee0d --- /dev/null +++ b/libnxwidgets/include/inxwindow.hxx @@ -0,0 +1,268 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/inxwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_INXWINDOW_HXX +#define __INCLUDE_INXWINDOW_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Pure Virtual Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + struct SBitmap; + + /** + * 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. + */ + + class INxWindow + { + public: + + /** + * Creates a new window. Window creation is separate from + * object instantiation so that window creation failures can + * be properly reported. + * + * @return True if the window was successfully created. + */ + + virtual bool open(void) = 0; + + /** + * 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. + * + * @return OK on success; ERROR on failure with errno set appropriately. + */ + + virtual bool requestPosition(void) = 0; + + /** + * Get the position of the window (as reported by the NX callback). + * + * @return The position. + */ + + virtual bool getPosition(FAR struct nxgl_point_s *pPos) = 0; + + /** + * Get the size of the window (as reported by the NX callback). + * + * @return The size. + */ + + virtual bool getSize(FAR struct nxgl_size_s *pSize) = 0; + + /** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on failure. + */ + + virtual bool setPosition(FAR const struct nxgl_point_s *pPos) = 0; + + /** + * Set the size of the selected window. + * + * @param pSize The new size of the window. + * @return OK on success; ERROR on failure with errno set appropriately. + */ + + virtual bool setSize(FAR const struct nxgl_size_s *pSize) = 0; + + /** + * Bring the window to the top of the display. + * + * @return OK on success; ERROR on failure with errno set appropriately. + */ + + virtual bool raise(void) = 0; + + /** + * Lower the window to the bottom of the display. + * + * @return OK on success; ERROR on failure with errno set appropriately. + */ + + virtual bool lower(void) = 0; + + /** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + virtual bool setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color) = 0; + + /** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + virtual bool fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color) = 0; + + /** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + + virtual void getRectangle(FAR const struct nxgl_rect_s *rect, + struct SBitmap *dest) = 0; + + /** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + + virtual bool fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color) = 0; + + /** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + + virtual bool drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, + nxgl_mxpixel_t color) = 0; + + /** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + + virtual bool drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) = 0; + + /** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + + virtual bool move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset) = 0; + + /** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. The source image is treated as an opaque image. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + + 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; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_INXWINDOW_HXX + diff --git a/libnxwidgets/include/iscrollable.hxx b/libnxwidgets/include/iscrollable.hxx new file mode 100644 index 000000000..21a69e487 --- /dev/null +++ b/libnxwidgets/include/iscrollable.hxx @@ -0,0 +1,208 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/iscrollable.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_ISCROLLABLE_HXX +#define __INCLUDE_ISCROLLABLE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Abstract class defining basic functionality of scrolling widgets. + * Scrolling regions are modelled as a virtual "canvas", or rectangular + * region, with height/width dimensions and x/y coordinates. + */ + + class IScrollable + { + public: + /** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasX(void) const = 0; + + /** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + + virtual const int32_t getCanvasY(void) const = 0; + + /** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + + virtual const int32_t getCanvasWidth(void) const = 0; + + /** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + + virtual const int32_t getCanvasHeight(void) const = 0; + + /** + * Scrolls the virtual canvas by the specified amounts. + * + * @param dx Distance to scroll horizontally. + * @param dy Distance to scroll vertically. + */ + + virtual void scroll(int32_t dx, int32_t dy) = 0; + + /** + * Repositions the virtual canvas to the specified coordinates. + * + * @param x New x coordinate of the virtual canvas. + * @param y New y coordinate of the virtual canvas. + */ + + virtual void jump(int32_t x, int32_t y) = 0; + + /** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + + virtual bool allowsVerticalScroll(void) const = 0; + + /** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + + virtual bool allowsHorizontalScroll(void) const = 0; + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsVerticalScroll(bool allow) = 0; + + /** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + + virtual void setAllowsHorizontalScroll(bool allow) = 0; + + /** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + + virtual void setCanvasWidth(const int32_t width) = 0; + + /** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + + virtual void setCanvasHeight(const int32_t height) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_ISCROLLABLE_HXX + diff --git a/libnxwidgets/include/islider.hxx b/libnxwidgets/include/islider.hxx new file mode 100644 index 000000000..5ea821e42 --- /dev/null +++ b/libnxwidgets/include/islider.hxx @@ -0,0 +1,188 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/islider.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_ISLIDER_HXX +#define __INCLUDE_ISLIDER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Defines the interface for slider widgets. + */ + class ISlider + { + public: + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + virtual const nxgl_coord_t getMinimumValue(void) const = 0; + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + virtual const nxgl_coord_t getMaximumValue(void) const = 0; + + /** + * Get the current value of the slider. + * + * return The current slider value. + */ + + virtual const nxgl_coord_t getValue(void) const = 0; + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + virtual const nxgl_coord_t getPageSize(void) const = 0; + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + virtual void setMinimumValue(const nxgl_coord_t value) = 0; + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + virtual void setMaximumValue(const nxgl_coord_t value) = 0; + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + virtual void setValue(const nxgl_coord_t value) = 0; + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + virtual void setValueWithBitshift(const int32_t value) = 0; + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + virtual void setPageSize(const nxgl_coord_t pageSize) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_ISLIDER_HXX + diff --git a/libnxwidgets/include/itextbox.hxx b/libnxwidgets/include/itextbox.hxx new file mode 100644 index 000000000..78de7e502 --- /dev/null +++ b/libnxwidgets/include/itextbox.hxx @@ -0,0 +1,209 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/itextbox.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_ITEXTBOX_HXX +#define __INCLUDE_ITEXTBOX_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxstring.hxx" +#include "cwidgetstyle.hxx" +#include "cwidgeteventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Cursor display options. + */ + + typedef enum + { + SHOW_CURSOR_ONFOCUS = 0, /**< Show the cursor only if the widget has focus */ + SHOW_CURSOR_NEVER, /**< The cursor is never displayed */ + SHOW_CURSOR_ALWAYS /**< Always show the cursor */ + } EShowCursor; + + /** + * Defines the interface that textbox-like classes should implement. + */ + + class ITextBox + { + public: + + /** + * Sets the cursor display mode. + * + *@param cursorMode Determines cursor display mode + */ + + virtual void showCursor(EShowCursor cursorMode) = 0; + + /** + * Enables/disables cursor wrapping + * + * @param wrap True enables cursor wrapping + */ + + virtual void wrapCursor(bool wrap) = 0; + + /** + * Set the text displayed in the label. + * + * @param text String to display. + */ + + virtual void setText(const CNxString &text) = 0; + + /** + * Append new text to the end of the current text displayed in the + * label. + * + * @param text String to append. + */ + + virtual void appendText(const CNxString &text) = 0; + + /** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + + virtual void removeText(const unsigned int startIndex) = 0; + + /** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + + virtual void removeText(const unsigned int startIndex, const unsigned int count) = 0; + + /** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + + virtual void insertText(const CNxString &text, const unsigned int index) = 0; + + /** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + + virtual void insertTextAtCursor(const CNxString &text) = 0; + + /** + * Move the cursor to the text position specified. 0 indicates the + * start of the string. If position is greater than the length of the + * string, the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + + virtual void moveCursorToPosition(const int position) = 0; + + /** + * Get the cursor position. This is the index within the string that + * the cursor is currently positioned over. + * @return position The cursor position. + */ + + virtual const int getCursorPosition(void) const = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_ITEXTBOX_HXX diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx new file mode 100644 index 000000000..2f38c7c26 --- /dev/null +++ b/libnxwidgets/include/nxconfig.hxx @@ -0,0 +1,444 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/nxconfig.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_NXCONFIG_HXX +#define __INCLUDE_NXCONFIG_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/* NX Configuration *********************************************************/ + +/** + * Required to enabled NX graphics support + */ + +#ifndef CONFIG_NX +# error "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" +#endif + +/** + * Required to enabled NX mouse/touchscreen support + */ + +#ifndef CONFIG_NX_MOUSE +# warning "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" +#endif + +/** + * Required to enabled NX keyboard support + */ + +#ifndef CONFIG_NX_KBD +# warning "NX keyboard support is required (CONFIG_NX_KBD)" +#endif + +/** + * Only a single video plane is supported + */ + +#ifndef CONFIG_NX_NPLANES +# define CONFIG_NX_NPLANES 1 +#endif + +#if CONFIG_NX_NPLANES != 1 +# error "Only a single color plane is supported (CONFIG_NX_NPLANES)" +#endif + +/* NX Server/Device Configuration *******************************************/ + +/** + * LCD device number (in case there are more than one LCDs connected) + */ + +#ifndef CONFIG_NXWIDGETS_DEVNO +# define CONFIG_NXWIDGETS_DEVNO 0 +#endif + +/** + * Only a single video plane is supported + */ + +#ifndef CONFIG_NXWIDGETS_VPLANE +# define CONFIG_NXWIDGETS_VPLANE 0 +#endif + +/** + * Priority of the NX server (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_SERVERPRIO +# define CONFIG_NXWIDGETS_SERVERPRIO 50 +#endif + +/** + * Priority of the NX event listener thread (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_LISTENERPRIO +# define CONFIG_NXWIDGETS_LISTENERPRIO 50 +#endif + +/** + * NX server/listener thread stack size (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_STACKSIZE +# define CONFIG_NXWIDGETS_STACKSIZE 4096 +#endif + +/* NXWidget Configuration ***************************************************/ +/* NX Server/Device Configuration + * + * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than + * one LCDs connected. Default: 0 + * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 + * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode). + * Default: 50 + * CONFIG_NXWIDGETS_SERVERPRIO + * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in + * multi-user mode). Default: 50 + * CONFIG_NXWIDGETS_STACKSIZE - Priority of the NX server/listener thread + * stack size (in multi-user mode). Default: 4096 + * + * NXWidget Configuration + * + * CONFIG_NXWIDGETS_BPP - Supported bits-per-pixel {8, 16, 24, 32}. Default: + * The smallest BPP configuration supported by NX. + * CONFIG_NXWIDGETS_SIZEOFCHAR - Size of character {1 or 2 bytes}. Default + * Determined by CONFIG_NXWIDGETS_SIZEOFCHAR + * + * NXWidget Default Values + * + * CONFIG_NXWIDGETS_DEFAULT_FONTID - Default font ID. Default: NXFONT_DEFAULT + * CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE, CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT - + * Default dynamic array parameters. Default: 16, 8 + * + * CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default: + * MKRGB(160,160,160) + * CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR - Default selected background + * color. Default: MKRGB(120,192,192) + * CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR - Shiny side boarder color. Default + * MKRGB(248,248,248) + * CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR - Shadowed side border color. + * Default: MKRGB(0,0,0) + * CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR - Highlight color. Default: + * MKRGB(192,192,192) + * CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - Text color on a disabled widget: + * Default: MKRGB(192,192,192) + * CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR - Text color on a enabled widget: + * Default: MKRGB(248,248,248) + * CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - Text color on a selected widget: + * Default: MKRGB(0,0,0) + * CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR - Default font color: Default: + * MKRGB(255,255,255) + * CONFIG_NXWIDGETS_TRANSPARENT_COLOR - Transparent color: Default: MKRGB(0,0,0) + * + * Keypad behavior + * + * CONFIG_NXWIDGETS_FIRST_REPEAT_TIME - Time taken before a key starts + * repeating (in milliseconds). Default: 500 + * CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME - Time taken before a repeating key + * repeats again (in milliseconds). Default: 200 + * CONFIG_NXWIDGETS_DOUBLECLICK_TIME - Left button release-press time for + * double click (in milliseconds). Default: 350 + * CONFIG_NXWIDGETS_KBDBUFFER_SIZE - Size of incoming character buffer, i.e., + * the maximum number of characters that can be entered between NX polling + * cycles without losing data. + * CONFIG_NXWIDGETS_CURSORCONTROL_SIZE - Size of incoming cursor control + * buffer, i.e., the maximum number of cursor controls that can between + * entered by NX polling cycles without losing data. Default: 4 + */ + +/** + * Bits per pixel + */ + +#ifndef CONFIG_NXWIDGETS_BPP +# if !defined(CONFIG_NX_DISABLE_8BPP) +# warning "Assuming 8-bits per pixel, RGB 3:3:2" +# define CONFIG_NXWIDGETS_BPP 8 +# elif !defined(CONFIG_NX_DISABLE_16BPP) +# warning "Assuming 16-bits per pixel, RGB 5:6:5" +# define CONFIG_NXWIDGETS_BPP 16 +# elif !defined(CONFIG_NX_DISABLE_24BPP) +# warning "Assuming 24-bits per pixel, RGB 8:8:8" +# define CONFIG_NXWIDGETS_BPP 24 +# elif !defined(CONFIG_NX_DISABLE_32BPP) +# warning "Assuming 32-bits per pixel, RGB 8:8:8" +# define CONFIG_NXWIDGETS_BPP 32 +# else +# error "No supported pixel depth is enabled" +# endif +#endif + +#if CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NX_DISABLE_8BPP +# error "NX 8-bit support is disabled (CONFIG_NX_DISABLE_8BPP)" +# endif +# define CONFIG_NXWIDGETS_FMT FB_FMT_RGB8_332 +# define MKRGB RGBTO8 +# define RGB2RED RBG8RED +# define RGB2GREEN RBG8GREEN +# define RGB2BLUE RBG8BLUE +# define FONT_RENDERER nxf_convert_8bpp +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef CONFIG_NX_DISABLE_16BPP +# error "NX 16-bit support is disabled (CONFIG_NX_DISABLE_16BPP)" +# endif +# define CONFIG_NXWIDGETS_FMT FB_FMT_RGB16_565 +# define MKRGB RGBTO16 +# define RGB2RED RBG16RED +# define RGB2GREEN RBG16GREEN +# define RGB2BLUE RBG16BLUE +# define FONT_RENDERER nxf_convert_16bpp +#elif CONFIG_NXWIDGETS_BPP == 24 +# ifdef CONFIG_NX_DISABLE_24BPP +# error "NX 24-bit support is disabled (CONFIG_NX_DISABLE_24BPP)" +# endif +# define CONFIG_NXWIDGETS_FMT FB_FMT_RGB24 +# define MKRGB RGBTO24 +# define RGB2RED RBG24RED +# define RGB2GREEN RBG24GREEN +# define RGB2BLUE RBG24BLUE +# define FONT_RENDERER nxf_convert_24bpp +#elif CONFIG_NXWIDGETS_BPP == 32 +# ifdef CONFIG_NX_DISABLE_32BPP +# error "NX 32-bit support is disabled (CONFIG_NX_DISABLE_32BPP)" +# endif +# define CONFIG_NXWIDGETS_FMT FB_FMT_RGB32 +# define MKRGB RGBTO24 +# define RGB2RED RBG24RED +# define RGB2GREEN RBG24GREEN +# define RGB2BLUE RBG24BLUE +# define FONT_RENDERER nxf_convert_32bpp +#else +# error "Pixel depth not supported (CONFIG_NXWIDGETS_BPP)" +#endif + +/* Size of a character */ + +#ifndef CONFIG_NXWIDGETS_SIZEOFCHAR +# if CONFIG_NXFONTS_CHARBITS <= 8 +# define CONFIG_NXWIDGETS_SIZEOFCHAR 1 +# else +# define CONFIG_NXWIDGETS_SIZEOFCHAR 2 +# endif +#endif + +#if CONFIG_NXWIDGETS_SIZEOFCHAR != 1 && CONFIG_NXWIDGETS_SIZEOFCHAR != 2 +# error "Unsupported character width (CONFIG_NXWIDGETS_SIZEOFCHAR)" +#endif + +/* NXWidget Default Values **************************************************/ + +/** + * Default font ID + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_FONTID +# define CONFIG_NXWIDGETS_DEFAULT_FONTID NXFONT_DEFAULT +#endif + +/** + * Default dynamic array parameters + */ + +#ifndef CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE +# define CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE 16 +#endif + +#ifndef CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT +# define CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT 8 +#endif + +/** + * Normal background color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160) +#endif + +/** + * Default selected background color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192) +#endif + +/** + * Shiny side border color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR +# define CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR MKRGB(248,248,248) +#endif + +/** + * Shadowed side border color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR +# define CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR MKRGB(0,0,0) +#endif + +/** + * Highlight color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR MKRGB(192,192,192) +#endif + +/* Text colors */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR MKRGB(192,192,192) +#endif + +#ifndef CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR MKRGB(248,248,248) +#endif + +#ifndef CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR MKRGB(0,0,0) +#endif + +/** + * Default font color + */ + +#ifndef CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR +# define CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR MKRGB(255,255,255) +#endif + +/** + * Transparent color + */ + +#ifndef CONFIG_NXWIDGETS_TRANSPARENT_COLOR +# define CONFIG_NXWIDGETS_TRANSPARENT_COLOR MKRGB(0,0,0) +#endif + +/* Keypad behavior **********************************************************/ + +/** + * Time taken before a key starts repeating (in milliseconds). + */ + +#ifndef CONFIG_NXWIDGETS_FIRST_REPEAT_TIME +# define CONFIG_NXWIDGETS_FIRST_REPEAT_TIME 500 +#endif + +/** + * Time taken before a repeating key repeats again (in milliseconds). + */ + +#ifndef CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME +# define CONFIG_NXWIDGETS_CONTINUE_REPEAT_TIME 200 +#endif + +/** + * Left button release-press time for double click (in milliseconds). + */ + +#ifndef CONFIG_NXWIDGETS_DOUBLECLICK_TIME +# define CONFIG_NXWIDGETS_DOUBLECLICK_TIME 350 +#endif + +/** + * Size of incoming character buffer, i.e., the maximum number of characters + * that can be entered between NX polling cycles without losing data. + */ + +#ifndef CONFIG_NXWIDGETS_KBDBUFFER_SIZE +# define CONFIG_NXWIDGETS_KBDBUFFER_SIZE 8 +#endif + +/** + * Size of incoming cursor control buffer, i.e., the maximum number of cursor + * controls that can between entered by NX polling cycles without losing data. + */ + +#ifndef CONFIG_NXWIDGETS_CURSORCONTROL_SIZE +# define CONFIG_NXWIDGETS_CURSORCONTROL_SIZE 4 +#endif + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +namespace NXWidgets +{ +#if CONFIG_NXWIDGETS_BPP == 8 + typedef uint8_t nxwidget_pixel_t; +#elif CONFIG_NXWIDGETS_BPP == 16 + typedef uint16_t nxwidget_pixel_t; +#elif CONFIG_NXWIDGETS_BPP == 24 + typedef uint32_t nxwidget_pixel_t; +#elif CONFIG_NXWIDGETS_BPP == 32 + typedef uint32_t nxwidget_pixel_t; +#else +# error "Pixel depth is unknown" +#endif + +#if CONFIG_NXWIDGETS_SIZEOFCHAR == 2 + typedef uint16_t nxwidget_char_t; +#elif CONFIG_NXWIDGETS_SIZEOFCHAR == 1 + typedef uint8_t nxwidget_char_t; +#else +# error "Character width is unknown" +#endif +} + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#endif // __INCLUDE_NXCONFIG_HXX diff --git a/libnxwidgets/include/singletons.hxx b/libnxwidgets/include/singletons.hxx new file mode 100644 index 000000000..094808939 --- /dev/null +++ b/libnxwidgets/include/singletons.hxx @@ -0,0 +1,136 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/singletons.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_SINGLETONS_HXX +#define __INCLUDE_SINGLETONS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward References + */ + + class CWidgetStyle; + class CNxString; + + /** + * Global singleton instances + */ + + extern CWidgetStyle *g_defaultWidgetStyle; /**< The default widget style */ + extern CNxString *g_nullString; /**< The reusable empty string */ + extern TNxArray *g_nxTimers; /**< An array of all timers */ + + /** + * Setup misc singleton instances. + * + * Q: Why is there here? + * A: Because it needs to be done one time before any widgets are created. + * Q: So why isn't it just the default style just a statically constructed class? + * A: Because not all platforms will support static class constructions. + * Q: Why isn't it part of CNxServer? + * A: Because the singletons may be needed before the server is started. + */ + + void instantiateSingletons(void); + + /** + * Free the singleton instances when the last NX server is destroyed. + * + * Q: Why is there here is it is only called as part of the CNxServer destructor? + * A: Just for symmetry with instantiateSingletons(). + */ + + void freeSingletons(void); +} + +#endif // __cplusplus + +#endif // __INCLUDE_SINGLETONS_HXX diff --git a/libnxwidgets/include/teventargs.hxx b/libnxwidgets/include/teventargs.hxx new file mode 100644 index 000000000..c1371be92 --- /dev/null +++ b/libnxwidgets/include/teventargs.hxx @@ -0,0 +1,136 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/teventargs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_TEVENTARGS_HXX +#define __INCLUDE_TEVENTARGS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Base template class for all events within the NxWidgets system. + * All event types should inherit from this class. + */ + + template + class TEventArgs + { + private: + T m_source; /**< The object that raised the event */ + + public: + + /** + * Constructor. + * @param source The object that raised the event. + */ + + inline TEventArgs(const T& source) + { + m_source = source; + } + + /** + * Destructor. + */ + + virtual inline ~TEventArgs() { } + + /** + * Get the source object that raised the event. + */ + + inline const T& getSource(void) const + { + return m_source; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_TEVENTARGS_HXX diff --git a/libnxwidgets/include/tnxarray.hxx b/libnxwidgets/include/tnxarray.hxx new file mode 100644 index 000000000..44cb537ad --- /dev/null +++ b/libnxwidgets/include/tnxarray.hxx @@ -0,0 +1,437 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/tnxarray.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_TNXARRAY_HXX +#define __INCLUDE_TNXARRAY_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +/** + * Class providing a dynamic array; that is, an array that will automatically + * grow to accommodate new data. It provides a fast way to randomly access + * a list of data. Essentially, it provides the most important functionality + * of the STL vector class without any of the overhead of including an STL + * class. + * + * If the data to be stored will store a lot of data that will predominantly + * be read sequentially, consider using the LinkedList class instead. Resizing + * the list is an expensive operation that will occur frequently when filling + * the array with large amounts of data. Adding new data to the linked list is + * very inexpensive. + */ + +template +class TNxArray +{ +private: + T *m_data; /**< Internal array of data items */ + int m_size; /**< Number of items in the array */ + int m_reservedSize; /**< Total size of the array including unpopulated slots */ + + /** + * Re-allocate the array to this size; + */ + + void reallocate(const int newSize); + + /** + * Resize the array if it is full. + */ + + void resize(void); + +public: + + /** + * Constructor. Creates an un-allocated array. The array will + * be allocated when items are added to it or when preallocate() + * is called. + */ + + inline TNxArray(); + + /** + * Constructor. Creates an allocated array. + * + *@param initialSize The initial size of the array. + */ + + inline TNxArray(int initialSize); + + /** + * Destructor. + */ + + inline ~TNxArray(); + + /** + * Set the initial size of the array. Normally, the array is + * unallocated until the first data is pushed into the array. + * That works great for stacks and lists. But if you want a + * array of unitialized elements, then this method will + * preallocate the array for you. + * + * @return The size of the array. + */ + + void preallocate(void); + + /** + * Get the size of the array. + * + * @return The size of the array. + */ + + inline const int size(void) const; + + /** + * Add a value to the end of the array. + * + * @param value The value to add to the array. + */ + + void push_back(const T &value); + + /** + * Insert a value into the array. + * + * @param index The index to insert into. + * @param value The value to insert. + */ + + void insert(const int index, const T &value); + + /** + * Remove the last element from the array. + */ + + void pop_back(void); + + /** + * Erase a single value at the specified index + */ + + void erase(const int index); + + /** + * Get a value at the specified location. Does not perform bounds checking. + * @param index The index of the desired value. + * @return The value at the specified index. + */ + + inline T &at(const int index) const; + + /** + * Check if the array has any data. + * @return True if the array is empty. + */ + + inline bool empty(void) const; + + /** + * Remove all data. + */ + + void clear(); + + /** + * Overload the [] operator to allow array-style access. + * @param index The index to retrieve. + * @return The value at the specified index. + */ + + T& operator[](const int index) const; +}; + +template +TNxArray::TNxArray() +{ + // Don't allocate anything until the first data is added to + // the array + + m_size = 0; // Number of data items in use + m_reservedSize = 0; // Number of data items allocated + m_data = (T *)0; // Allocated memory for data items +} + +template +TNxArray::TNxArray(int initialSize) +{ + m_size = 0; // Number of data items in use + m_reservedSize = 0; // Number of data items allocated + m_data = (T *)0; // Allocated memory for data items + preallocate(initialSize); // Allocate the initial array +} + +template +TNxArray::~TNxArray() +{ + if (m_data) + { + delete [] m_data; + } +} + +template +const int TNxArray::size(void) const +{ + return m_size; +} + +template +void TNxArray::push_back(const T &value) +{ + // Ensure the array is large enough to hold one more data item + + resize(); + + // Add data to array + + m_data[m_size] = value; + + // Remember we've filled a slot + + m_size++; +} + +template +void TNxArray::pop_back(void) +{ + if (m_size >= 1) + { + // We can just reduce the used size of the array, as the value + // will get overwritten automatically + + m_size--; + } +} + +template +void TNxArray::insert(const int index, const T &value) +{ + // Bounds check + + if ((index >= m_size) || (m_size == 0)) + { + push_back(value); + return; + } + + // Ensure the array is large enough to hold one more data item + + resize(); + + // Shift all of the data back one place to make a space for the new data + + for (int i = m_size; i > index; i--) + { + m_data[i] = m_data[i - 1]; + } + + // Add data to array + + m_data[index] = value; + + // Remember we've filled a slot + + m_size++; +} + +template +void TNxArray::erase(const int index) +{ + // Bounds check + + if (index >= m_size) + { + return; + } + + // Shift all of the data back one place and overwrite the value + + for (int i = index; i < m_size - 1; i++) + { + m_data[i] = m_data[i + 1]; + } + + // Remember we've removed a slot + + m_size--; +} + +template +void TNxArray::reallocate(const int newSize) +{ + // Do we need to redim the array? + + if (m_reservedSize < newSize) + { + // Create the new array + + T *newData = new T[newSize]; + + // Copy old array contents to new the new array + + for (int i = 0; i < m_reservedSize; i++) + { + newData[i] = m_data[i]; + } + + // Delete the old array (if there was one) + + if (m_data) + { + delete [] m_data; + } + + // Update values + + m_data = newData; + m_reservedSize = newSize; + } +} + +template +void TNxArray::resize(void) +{ + // Do we need to redim the array in order to add one more entry? + + if (m_reservedSize == m_size) + { + // We have filled the array, so resize it + + int newSize = m_reservedSize; +#if CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE != CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT + newSize += m_reservedSize ? + CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT : + CONFIG_NXWIDGETS_TNXARRAY_INITIALSIZE; +#else + newSize += CONFIG_NXWIDGETS_TNXARRAY_SIZEINCREMENT; +#endif + + // Re-allocate the array + + reallocate(newSize); + } +} + +template +T& TNxArray::at(const int index) const +{ + // What if this is called with index > m_reservedSize? What if + // this is called before m_data is allocated? Don't do that! + + return m_data[index]; +} + +template +bool TNxArray::empty() const +{ + return (m_size == 0); +} + +template +T& TNxArray::operator[](const int index) const +{ + // What if this is called with index > m_reservedSize? What if + // this is called before m_data is allocated? Don't do that! + + return m_data[index]; +} + +template +void TNxArray::clear() +{ + // All we need to do is reset the size value + + m_size = 0; +} + +#endif // __cplusplus + +#endif // __INCLUDE_TNXARRAY_HXX diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx new file mode 100644 index 000000000..08ae584b8 --- /dev/null +++ b/libnxwidgets/src/cbgwindow.cxx @@ -0,0 +1,364 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cbgwindow.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cbgwindow.hxx" +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. Obtains the background window from server and wraps + * the window as CBgWindow. + * + * @param hNxServer Handle to the NX server. + * @param widgetControl Controlling widget for this window. + */ + +CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) + : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hWindow(0), + m_widgetControl(pWidgetControl) +{ + // Create the CGraphicsPort instance for this window + + m_widgetControl->createGraphicsPort(static_cast(this)); +} + +/** + * Destructor. Returns the background window to the server. + */ + +CBgWindow::~CBgWindow(void) +{ + // Release the background. We do not release the widget control + // instance. The lifetime of that instance is owned by he-who- + // constructed-us. + + (void)nx_releasebkgd(m_hWindow); +} + +/** + * Creates a new window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully opened. + */ + +bool CBgWindow::open(void) +{ + // Get the C-callable callback vtable + + FAR struct nx_callback_s *vtable = getCallbackVTable(); + + // Request the background the window + + int ret = nx_requestbkgd(m_hNxServer, vtable, (FAR void *)m_widgetControl); + if (ret < 0) + { + return false; + } + + // Window handle (picked off by the callback logic) + + m_hWindow = m_widgetControl->getWindowHandle(); + return true; +} + +/** + * 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. + * + * @return Always returns true. + */ + +bool CBgWindow::requestPosition(void) +{ + // The background window is always at {0,0} and the size never changes. + + return true; +} + +/** + * Get the position of the window (as reported by the NX callback). NOTE: + * The background window is always positioned at {0,0} + * + * @return The position. + */ + +bool CBgWindow::getPosition(FAR struct nxgl_point_s *pPos) +{ + // The background window is always at {0,0} + + pPos->x = 0; + pPos->y = 0; + return true; +} + +/** + * Get the size of the window (as reported by the NX callback). NOTE: + * The size of the background window is always the entire display. + * + * @return The size. + */ + +bool CBgWindow::getSize(FAR struct nxgl_size_s *pSize) +{ + // The size is always the full size of the display + + return m_widgetControl->getWindowSize(pSize); +} + +/** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return Always returns false. + */ + +bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos) +{ + // The position of the background cannot be changed + + return false; +} + +/** + * Set the size of the selected window. NOTE: The size of the + * background window is always the entire display and cannot be + * changed. + * + * @param pSize The new size of the window. + * @return Always returns false. + */ + +bool CBgWindow::setSize(FAR const struct nxgl_size_s *pSize) +{ + // The position of the background cannot be changed + + return false; +} + +/** + * Bring the window to the top of the display. NOTE: The background + * window cannot be raised. + * + * @return Always returns false. + */ + +bool CBgWindow::raise(void) +{ + // The background cannot be raised + + return false; +} + +/** + * Lower the window to the bottom of the display. NOTE: The background + * window is always at the bottom of the window hierarchy. + * + * @return Always returns false. + */ + +bool CBgWindow::lower(void) +{ + // The background cannot be lowered + + return false; +} + +/** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CBgWindow::setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color) +{ + // Set an individual pixel to the specified color + + return nx_setpixel(m_hWindow, pPos, &color) == OK; +} + +/** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CBgWindow::fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color) +{ + // Fill a rectangular region with a solid color + + return nx_fill(m_hWindow, pRect, &color) == OK; +} + +/** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + +void CBgWindow::getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest) +{ + // Get a rectangule region from the window + + (void)nx_getrectangle(m_hWindow, rect, 0, (FAR uint8_t*)dest->data, dest->stride); +} + +/** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CBgWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color) +{ + // Fill a trapezoidal region with a solid color + + return nx_filltrapezoid(m_hWindow, pClip, pTrap, &color) == OK; +} + +/** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + +bool CBgWindow::drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, nxgl_mxpixel_t color) +{ + // Draw a line with the specified color + + return nx_drawline(m_hWindow, vector, width, &color) == OK; +} + +/** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + +bool CBgWindow::drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) +{ + return nx_fillcircle(m_hWindow, center, radius, &color) == OK; +} + +/** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + +bool CBgWindow::move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset) +{ + // Move a rectangular region of the display + + return nx_move(m_hWindow, pRect, pOffset) == OK; +} + +/** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. The source image is treated as an opaque image. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + +bool CBgWindow::bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride) +{ + // Copy a rectangular bitmap image in a region on the display + + return nx_bitmap(m_hWindow, pDest, &pSrc, pOrigin, stride) == OK; +} diff --git a/libnxwidgets/src/cbitmap.cxx b/libnxwidgets/src/cbitmap.cxx new file mode 100644 index 000000000..875e6daaa --- /dev/null +++ b/libnxwidgets/src/cbitmap.cxx @@ -0,0 +1,197 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cbitmap.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param bitmap The bitmap structure being wrapped. + */ + +CBitmap::CBitmap(const struct SBitmap *bitmap) : m_bitmap(bitmap) {} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + +const uint8_t CBitmap::getColorFormat(void) const +{ + return m_bitmap->fmt; +} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + +const uint8_t CBitmap::getBitsPerPixel(void) const +{ + return m_bitmap->bpp; +} + +/** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + +const nxgl_coord_t CBitmap::getWidth(void) const +{ + return m_bitmap->width; +} + +/** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height. + */ + +const nxgl_coord_t CBitmap::getHeight(void) const +{ + return m_bitmap->height; +} + +/** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width. + */ + +const nxgl_coord_t CBitmap::getStride(void) const +{ + return m_bitmap->stride; +} + +/** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + +bool CBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data) +{ + // Check ranges. Casts to unsigned int are ugly but permit one-sided comparisons + + if (((unsigned int)x < (unsigned int)width) && + ((unsigned int)(x + width) <= (unsigned int)m_bitmap->width) && + ((unsigned int)y < (unsigned int)m_bitmap->height)) + { + // Get starting position of the copy (this will only work if bpp + // is an even multiple of bytes). + + FAR uint8_t *start = (FAR uint8_t*)m_bitmap->data + + y * m_bitmap->stride + + ((x * m_bitmap->bpp) >> 3); + + // Get the number of bytes to copy. + + unsigned int length = (width * m_bitmap->bpp) >> 3; + + // And do the copy + + memcpy(data, start, length); + return true; + } + + return false; +} diff --git a/libnxwidgets/src/cbutton.cxx b/libnxwidgets/src/cbutton.cxx new file mode 100644 index 000000000..66ad3f2c7 --- /dev/null +++ b/libnxwidgets/src/cbutton.cxx @@ -0,0 +1,300 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cbutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cbutton.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the values stored in the global + * g_defaultWidgetStyle object. The button will copy the properties of + * the style into its own internal style object. + */ + +CButton::CButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height, const CNxString &text, CWidgetStyle *style) +: CLabel(pWidgetControl, x, y, width, height, text, style) +{ +} + +/** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + +void CButton::drawOutline(CGraphicsPort *port) +{ + drawOutline(port, isClicked()); +} + +/** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + * @param useClicked Present outline using the 'clicked' style + */ + +void CButton::drawOutline(CGraphicsPort *port, bool useClicked) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (isBorderless()) + { + return; + } + + // Work out which colors to use + + nxgl_coord_t color1; + nxgl_coord_t color2; + + if (useClicked) + { + // Bevelled into the screen + + color1 = getShadowEdgeColor(); + color2 = getShineEdgeColor(); + } + else + { + // Bevelled out of the screen + + color1 = getShineEdgeColor(); + color2 = getShadowEdgeColor(); + } + + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CButton::drawContents(CGraphicsPort *port) +{ + drawContents(port, isClicked()); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @param useClicked Present contents using the 'clicked' style + * @see redraw() + */ + +void CButton::drawContents(CGraphicsPort *port, bool useClicked) + +{ + // Get the draw region (excluding any borders) + + CRect rect; + getRect(rect); + + // Get the X/Y position of the text within the button + + struct nxgl_point_s pos; + pos.x = rect.getX() + m_align.x; + pos.y = rect.getY() + m_align.y; + + // Pick the text color + + nxgl_mxpixel_t textColor; + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + } + else if (useClicked) + { + textColor = getSelectedTextColor(); + } + else + { + textColor = getEnabledTextColor(); + } + + // And draw the button text + + port->drawText(&pos, &rect, getFont(), m_text, 0, m_text.getLength(), textColor); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CButton::drawBorder(CGraphicsPort *port) +{ + drawBorder(port, isClicked()); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @param useClicked Present border using the 'clicked' style + * @see redraw() + */ + +void CButton::drawBorder(CGraphicsPort *port, bool useClicked) +{ + // Determine the background color + + nxgl_mxpixel_t backColor; + + if (useClicked || m_highlighted) + { + backColor = getSelectedBackgroundColor(); + } + else + { + backColor = getBackgroundColor(); + } + + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), backColor); + drawOutline(port); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CButton::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); + redraw(); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButton::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} diff --git a/libnxwidgets/src/cbuttonarray.cxx b/libnxwidgets/src/cbuttonarray.cxx new file mode 100644 index 000000000..263a16ce4 --- /dev/null +++ b/libnxwidgets/src/cbuttonarray.cxx @@ -0,0 +1,608 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cbuttonarray.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cbuttonarray.hxx" +#include "cgraphicsport.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButtonArray Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for an array of buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CButtonArray::CButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, + buttonColumns * buttonWidth + 2, buttonRows * buttonHeight + 2, + 0, style) +{ + // Save configuration + + m_buttonRows = buttonRows; + m_buttonColumns = buttonColumns; + m_buttonWidth = buttonWidth; + m_buttonHeight = buttonHeight; + + // Make sure the the positional data is valid. + + m_clickX = x; + m_clickY = y; + m_cursorColumn = 0; + m_cursorRow = 0; + + // Default behavior is to redraw the entire button array + + m_redrawButton = false; + + // No hightlighted buttons + + m_cursorOn = false; + m_cursorChange = false; + + // At present, There is no border on the array itself + + m_flags.borderless = true; + + // Make sure that the full size of the text array is allocated + + m_buttonText = new CNxString[m_buttonRows * m_buttonColumns]; +} + +/** + * CButtonArray Destructor. + */ + +CButtonArray::~CButtonArray(void) +{ + // Delete the array of CNxString instances + + delete [] m_buttonText; +} + +/** + * Returns the string shown in the label. + * + * @param column The column index of the button of interest +* @param row The row index of the button of interest + * @return The label's text. + */ + +const CNxString &CButtonArray::getText(int column, int row) const +{ + return m_buttonText[row * m_buttonColumns + column]; +} + +/** + * Set the text displayed in the label. + * + * @param column The column index of the button to set + * @param row The row index of the button to set + * @param text String to display. + */ + +void CButtonArray::setText(int column, int row, const CNxString &text) +{ + m_buttonText[row * m_buttonColumns + column] = text; + onTextChange(); +} + +/** + * Return the position of the last clicked button (0,0 will be returned + * the no button has every been clicked). The button at this position + * is currently clicked then, in addition, return true. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if a button in the array is clicked + */ + +bool CButtonArray::isButtonClicked(int &column, int &row) const +{ + // Return the last clicked position + + column = (m_clickX - getX()) / m_buttonWidth; + + // Calculate and return the button row index + + row = (m_clickY - getY()) / m_buttonHeight; + + // Return true if the button is currently clicked + + return isClicked(); +} + +/** + * Check if this specific button in the array is clicked + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is clicked + */ + +bool CButtonArray::isThisButtonClicked(int column, int row) const +{ + // The upper left X/Y position of the button at these indices + + nxgl_coord_t x = getX() + column * m_buttonWidth; + nxgl_coord_t y = getY() + row * m_buttonHeight; + + // Was the last click on this button? + + if ((m_clickX >= x && m_clickX < x + m_buttonWidth) && + (m_clickY >= y && m_clickY < y + m_buttonHeight)) + { + // Yes.. return true if the button is clicked + + return isClicked(); + } + else + { + // No.. then it can't be clicked + + return false; + } +} + +/** + * Control the cursor state. + * + * @param cursorOn True(1), the current cursor position will be highlighted + */ + +void CButtonArray::cursor(bool cursorOn) +{ + if (cursorOn != m_cursorOn) + { + // Set the state cursor state + + m_cursorOn = cursorOn; + + // Update only the effected button + + m_cursorChange = true; + redraw(); + m_cursorChange = false; + } +} + +/** + * Return the current cursor position (button indices) and an indication + * if the button at the cursor is currently hightlighted. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if the cursor is enabled and the button is highlighted + */ + +bool CButtonArray::getCursorPosition(int &column, int &row) const +{ + column = m_cursorColumn; + row = m_cursorRow; + return m_cursorOn; +} + +/** + * Set the cursor position (button indices). Note that the cursor + * does not have to be enabled to set the position. + * + * @param column The column index of the button of interest + * @param row The row index of the button of interest + * @return True if the cursor position is valid + */ + +bool CButtonArray::setCursorPosition(int column, int row) +{ + // Verify that the cursor position is within range + + if ((unsigned)column < m_buttonColumns && (unsigned)row < m_buttonRows) + { + // Verify that the now position is different from the old position + + if (column != m_cursorColumn || row != m_cursorRow) + { + m_cursorChange = true; + + // Is the cursor on now? + + bool redrawCursor = m_cursorOn; + if (redrawCursor) + { + // Yes.. clear the old cursor highlight + + m_cursorOn = false; + redraw(); + } + + // Set the new cursor position + + m_cursorColumn = column; + m_cursorRow = row; + + // Do we need to turn the cursor back on? + + if (redrawCursor) + { + // Yes.. Set the new cursor hightlight + + m_cursorOn = true; + redraw(); + } + + m_cursorChange = false; + } + + return true; + } + + return false; +} + +/** + * Check if this specific button in the array is at the cursor position + * and highlighted. + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is at the cursor postion and highlighted. + */ + +bool CButtonArray::isCursorPosition(int column, int row) const +{ + if (column == m_cursorColumn && row == m_cursorRow) + { + return m_cursorOn; + } + + return false; +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + +void CButtonArray::getPreferredDimensions(CRect &rect) const +{ + return getRect(rect); +} + +/** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + +void CButtonArray::setFont(CNxFont *font) +{ + m_style.font = font; + redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CButtonArray::drawContents(CGraphicsPort *port) +{ + // Do we draw just the clicked/unclicked button? + + if (m_redrawButton) + { + int column; + int row; + + // Just one. Get the row/column indices from the last click + + (void)posToButton(m_clickX, m_clickY, column, row); + + // And draw that button + + drawButton(port, column, row, isClicked()); + } + + // Do we just draw the hightlighted button? + + else if (m_cursorChange) + { + // Do nothing if the highlighted button is also the clicked button + + if (!isThisButtonClicked(m_cursorColumn, m_cursorRow)) + { + drawButton(port, m_cursorColumn, m_cursorRow, false); + } + } + + // Draw all buttons + + else + { + // Visit each column + + for (int column = 0; column < m_buttonColumns; column++) + { + // Visit each row + + for (int row = 0; row < m_buttonRows; row++) + { + // Draw each button + + drawButton(port, column, row, isThisButtonClicked(column, row)); + } + } + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CButtonArray::drawBorder(CGraphicsPort *port) +{ + // This doesn't do anything anymore +} + +/** + * Redraw only one button + * + * @param port The CGraphicsPort to draw to. + * @param column The button column index + * @param row The button row index + * @param useClicked Draw the button using the 'clicked' button style, + * regardless of the actual button state. + * @see onClick() and onRelease() + */ + +void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool useClicked) +{ + // The X/Y position of the button + + nxgl_coord_t x = getX() + column * m_buttonWidth; + nxgl_coord_t y = getY() + row * m_buttonHeight; + + // Determine which colors to use + + nxwidget_pixel_t borderColor1; + nxwidget_pixel_t borderColor2; + nxwidget_pixel_t backColor; + nxwidget_pixel_t textColor; + + // Pick the background and test colors. Should we use the 'clicked' backgound style? + + if (useClicked || isCursorPosition(column, row)) + { + // "Selected" text color on unique "Selected" background color + + backColor = getSelectedBackgroundColor(); + textColor = getSelectedTextColor(); + } + else + { + // Normal background color and "Enabled" text color + + backColor = getBackgroundColor(); + textColor = getEnabledTextColor(); + } + + // Pick the border colors. Should we use the 'clicked' button style? + + if (useClicked) + { + // Yes.. Bevelled into the screen + + borderColor1 = getShadowEdgeColor(); + borderColor2 = getShineEdgeColor(); + } + else + { + // No.. Bevelled out of the screen + + borderColor1 = getShineEdgeColor(); + borderColor2 = getShadowEdgeColor(); + } + + // Use a special text color if the widget is not enabled + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + } + + // Draw the background + + port->drawFilledRect(x, y, m_buttonWidth, m_buttonHeight, backColor); + + // Draw the button outline + + port->drawBevelledRect(x, y, m_buttonWidth, m_buttonHeight, borderColor1, borderColor2); + + // Get the text for this button + + CNxString *text = &m_buttonText[row * m_buttonColumns + column]; + + // Get the text drawing region + + CRect rect; + rect.setX(x + 1); + rect.setY(y + 1); + rect.setWidth(m_buttonWidth - 2); + rect.setHeight(m_buttonHeight - 2); + + // Get the centered text alignment + + nxgl_coord_t alignY = (m_buttonHeight - getFont()->getHeight() - 2) >> 1; + nxgl_coord_t alignX = (m_buttonWidth - getFont()->getStringWidth(*text) - 2) >> 1; + + // Get the text display position + + struct nxgl_point_s pos; + pos.x = x + alignX; + pos.y = y + alignY; + + // And draw the button text + + port->drawText(&pos, &rect, getFont(), *text, 0, text->getLength(), textColor); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CButtonArray::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Click X,Y is in raw window coordinates + + m_clickX = x; + m_clickY = y; + + // Redraw only the button that was clicked + + m_redrawButton = true; + redraw(); + m_redrawButton = false; +} + +/** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButtonArray::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); + + // Redraw only the button that was released + + m_redrawButton = true; + redraw(); + m_redrawButton = false; +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButtonArray::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Convert an X/Y position to a button column/row index + * + * @param x The x position + * @param y The y position + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return false is the position is invalid + */ + +bool CButtonArray::posToButton(nxgl_coord_t x, nxgl_coord_t y, int &column, int &row) +{ + // Get the row/column indices matching the x/y position + + column = (x - getX()) / m_buttonWidth; + row = (y - getY()) / m_buttonHeight; + return ((unsigned)column < m_buttonColumns && (unsigned)row < m_buttonRows); +} + +/** + * Updates the GUI after the text has changed. + */ + +void CButtonArray::onTextChange(void) +{ + redraw(); + m_widgetEventHandlers->raiseValueChangeEvent(); +} + diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx new file mode 100644 index 000000000..25cb228b3 --- /dev/null +++ b/libnxwidgets/src/ccallback.cxx @@ -0,0 +1,195 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ccallback.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + + /** + * Constructor. + * + * @param pWidgetControl Control object associated with this window + */ + +CCallback::CCallback(CWidgetControl *pWidgetControl) +{ + // Initialize the callback vtable + + m_callbacks.redraw = redraw; + m_callbacks.position = position; + m_callbacks.mousein = newMouseEvent; + m_callbacks.kbdin = newKeyboardEvent; +} + + /** + * ReDraw Callback. The redraw action is handled by CWidgetControl:redrawEvent. + * + * @param hWindow Handle to a specific NX window. + * @param pRect The rectangle that needs to be re-drawn (in window + * relative coordinates). + * @param bMore true: More re-draw requests will follow. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +void CCallback::redraw(NXHANDLE hWindow, + FAR const struct nxgl_rect_s *pRect, + bool bMore, FAR void *pvArg) +{ + gvdbg("hWindow=%p pRect={(%d,%d),(%d,%d)} bMore=%s\n", + hWindow, + pRect->pt1.x, pRect->pt1.y, pRect->pt2.x, pRect->pt2.y, + bMore ? "true" : "false"); + + // The argument must be the CWidgetControl instance + + CWidgetControl *This = (CWidgetControl *)pvArg; + + // Just forward the callback to the CWidgetControl::redrawEvent method + + This->redrawEvent(pRect, bMore); +} + + /** + * Position Callback. The new positional data is handled by + * CWidgetControl::geometryEvent. + * + * @param hWindow Handle to a specific NX window. + * @param pSize The size of the window. + * @param pPos The position of the upper left hand corner of the window on + * the overall display. + * @param pBounds The bounding rectangle that describes the entire display. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +void CCallback::position(NXHANDLE hWindow, + FAR const struct nxgl_size_s *pSize, + FAR const struct nxgl_point_s *pPos, + FAR const struct nxgl_rect_s *pBounds, + FAR void *pvArg) +{ + gvdbg("hWindow=%p pSize=(%d,%d) pPos=(%d,%d) pBounds={(%d,%d),(%d,%d)} pvArg=%p\n", + hWindow, pSize->w, pSize->h, pPos->x, pPos->y, + pBounds->pt1.x, pBounds->pt1.y, pBounds->pt2.x, pBounds->pt2.y, + pvArg); + + + // The argument must be the CWidgetControl instance + + CWidgetControl *This = (CWidgetControl *)pvArg; + + // Just forward the callback to the CWidgetControl::geometry method + + This->geometryEvent(hWindow, pSize, pPos, pBounds); +} + + /** + * New mouse data is available for the window. The new mouse data is + * handled by CWidgetControl::newMouseEvent. + * + * @param hWindow Handle to a specific NX window. + * @param pPos The (x,y) position of the mouse. + * @param buttons See NX_MOUSE_* definitions. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +#ifdef CONFIG_NX_MOUSE +void CCallback::newMouseEvent(NXHANDLE hWindow, + FAR const struct nxgl_point_s *pPos, + uint8_t buttons, FAR void *pvArg) +{ + gvdbg("hWindow=%p pPos=(%d,%d) buttons=%02x pvArg=%p\n", + hWindow, pPos->x, pPos->y, buttons, pvArg); + + // The argument must be the CWidgetControl instance + + CWidgetControl *This = (CWidgetControl *)pvArg; + + // Just forward the callback to the CWidgetControl::newMouseEvent method + + This->newMouseEvent(pPos, buttons); +} +#endif /* CONFIG_NX_MOUSE */ + +/** + * New keyboard/keypad data is available for the window. The new keyboard + * data is handled by CWidgetControl::newKeyboardEvent. + * + * @param hWindow Handle to a specific NX window. + * @param nCh The number of characters that are available in pStr[]. + * @param pStr The array of characters. + * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * nxtk_openwindow, or nxtk_opentoolbar). + */ + +#ifdef CONFIG_NX_KBD +void CCallback::newKeyboardEvent(NXHANDLE hWindow, uint8_t nCh, + FAR const uint8_t *pStr, + FAR void *pvArg) +{ + gvdbg("hWindow=%p nCh=%d pvArg=%p\n", + hWindow, nCh, pvArg); + + // The argument must be the CWidgetControl instance + + CWidgetControl *This = (CWidgetControl *)pvArg; + + // Just forward the callback to the CWidgetControl::newKeyboardEvent method + + This->newKeyboardEvent(nCh, pStr); +} +#endif // CONFIG_NX_KBD diff --git a/libnxwidgets/src/ccheckbox.cxx b/libnxwidgets/src/ccheckbox.cxx new file mode 100644 index 000000000..a6cc9400a --- /dev/null +++ b/libnxwidgets/src/ccheckbox.cxx @@ -0,0 +1,265 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ccheckbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccheckbox.hxx" +#include "cgraphicsport.hxx" +#include "cbitmap.hxx" +#include "singletons.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the checkbox, relative to its parent. + * @param y The y coordinate of the checkbox, relative to its parent. + * @param width The width of the checkbox. + * @param height The height of the checkbox. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CCheckBox::CCheckBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CButton(pWidgetControl, x, y, width, height, *NXWidgets::g_nullString, style) +{ + m_state = CHECK_BOX_STATE_OFF; + m_flags.borderless = false; + + // Border width is one line + + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; +} + +/** + * Set the state of the checkbox. + * + * @param state The new checkbox state. + */ + +void CCheckBox::setState(CCheckBox::CheckBoxState state) +{ + if (m_state != state) + { + m_state = state; + m_widgetEventHandlers->raiseValueChangeEvent(); + redraw(); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CCheckBox::drawContents(CGraphicsPort *port) +{ + // Get the X/Y position of the drawable region within the CheckBox + + nxgl_coord_t x = getX(); + nxgl_coord_t y = getY(); + + nxgl_coord_t width = getWidth(); + nxgl_coord_t height = getHeight(); + + // Include and offset for the border + + if (!m_flags.borderless) + { + x += m_borderSize.left; + y += m_borderSize.top; + + width -= (m_borderSize.left + m_borderSize.right); + height -= (m_borderSize.top + m_borderSize.bottom); + } + + // Decide which glyph to draw + + const struct SBitmap *glyph; + + switch (m_state) + { + default: + case CHECK_BOX_STATE_ON: + glyph = &g_checkBoxOn; + break; + + case CHECK_BOX_STATE_OFF: + glyph = &g_checkBoxOff; + break; + + case CHECK_BOX_STATE_MU: + glyph = &g_checkBoxMu; + break; + } + + // Don't exceed the size of the glyph + + if (width > glyph->width) + { + width = glyph->width; + } + + if (height > glyph->height) + { + height = glyph->height; + } + + // Draw the checkbox + + port->drawBitmap(x, y, width, height, glyph, 0, 0, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CCheckBox::drawBorder(CGraphicsPort *port) +{ + // Determine the background color + + nxgl_mxpixel_t backColor; + + if (m_highlighted) + { + backColor = getSelectedBackgroundColor(); + } + else + { + backColor = getBackgroundColor(); + } + + // Draw the background (excluding the border) + + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), + backColor); + + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShineEdgeColor(), getShadowEdgeColor()); + } +} + +/** + * Toggles the state of the checkbox. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CCheckBox::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + if (m_state == CHECK_BOX_STATE_ON) + { + setState(CHECK_BOX_STATE_OFF); + } + else + { + setState(CHECK_BOX_STATE_ON); + } +} diff --git a/libnxwidgets/src/ccyclebutton.cxx b/libnxwidgets/src/ccyclebutton.cxx new file mode 100644 index 000000000..b5f96683d --- /dev/null +++ b/libnxwidgets/src/ccyclebutton.cxx @@ -0,0 +1,482 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ccyclebutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "ccyclebutton.hxx" +#include "cgraphicsport.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for cycle buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param style The style that the button should use. If this is not + * specified, the button will use the values stored in the global + * g_defaultWidgetStyle object. The button will copy the properties of + * the style into its own internal style object. + */ + +CCycleButton::CCycleButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CButton(pWidgetControl, x, y, width, height, "", style) +{ + // Force text to align left + + nxgl_coord_t glyphSpace = m_borderSize.left - 1; + + // Text x coordinate is width of cycle glyph plus a space plus width + // of the spacer line (2px) plus a space + + m_align.x = g_cycle.width + 2 + (glyphSpace << 1); + + m_options.addListDataEventHandler(this); + m_options.setAllowMultipleSelections(false); +} + +/** + * Add a new option to the widget. + * + * @param text The text of the option. + * @param value The value of the option. + */ + +void CCycleButton::addOption(const CNxString &text, const uint32_t value) +{ + m_options.addItem(new CListDataItem(text, value)); + + // Select the option if this is the first option added + + if (m_options.getItemCount() == 1) + { + selectOption(0); + } +} + +/** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + +void CCycleButton::removeOption(const int index) +{ + m_options.removeItem(index); +} + +/** + * Remove all options from the widget. + */ + +void CCycleButton::removeAllOptions(void) +{ + m_options.removeAllItems(); +} + +/** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + +void CCycleButton::selectOption(const int index) +{ + m_options.setItemSelected(index, true); +} + +/** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * option is selected, the index of the first selected option is returned. + * + * @return The selected index. + */ + +const int CCycleButton::getSelectedIndex(void) const +{ + return m_options.getSelectedIndex(); +} + +/** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected options to deselected. + * Redraws the widget and raises a value changed event. + * + * @param index The selected index. + */ + +void CCycleButton::setSelectedIndex(const int index) +{ + m_options.setItemSelected(index, true); +} + +/** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + +const CListDataItem *CCycleButton::getSelectedOption(void) const +{ + return m_options.getSelectedItem(); +} + +/** + * Sort the options alphabetically by the text of the options. + */ + +void CCycleButton::sort(void) +{ + m_options.sort(); +} + +/** + * Handles list data changed events. + * + * @param e Event arguments. + */ + +void CCycleButton::handleListDataChangedEvent(const CListDataEventArgs &e) +{ + redraw(); +} + +/** + * Handles list selection changed events. + * + * @param e Event arguments. + */ + +void CCycleButton::handleListDataSelectionChangedEvent(const CListDataEventArgs &e) +{ + redraw(); + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + +void CCycleButton::getPreferredDimensions(CRect &rect) const +{ + nxgl_coord_t width = 0; + nxgl_coord_t height = getFont()->getHeight(); + + // Locate longest string in options + + for (int i = 0; i < m_options.getItemCount(); ++i) + { + nxgl_coord_t optionWidth = + getFont()->getStringWidth(m_options.getItem(i)->getText()); + + if (optionWidth > width) + { + width = optionWidth; + } + } + + // Add the border width + + if (!m_flags.borderless) + { + width += (m_borderSize.left + m_borderSize.right); + height += (m_borderSize.top + m_borderSize.bottom); + } + + // Add text alignment + + width += m_align.x; + height += m_align.y; + + // And returned this preferred size + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width); + rect.setHeight(height); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CCycleButton::drawContents(CGraphicsPort *port) +{ + // Get the drawing region (excluding any border) + + CRect rect; + getRect(rect); + + nxgl_coord_t glyphSpace = m_borderSize.left - 1; + nxgl_coord_t glyphYOffset = (rect.getHeight() - g_cycle.height) >> 1; + + nxwidget_pixel_t textColor; + nxwidget_pixel_t separatorLeftColor; + nxwidget_pixel_t separatorRightColor; + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + separatorLeftColor = getShadowEdgeColor(); + separatorRightColor = getShineEdgeColor(); + } + else if (!isClicked()) + { + textColor = getEnabledTextColor(); + separatorLeftColor = getShadowEdgeColor(); + separatorRightColor = getShineEdgeColor(); + } + else + { + textColor = getSelectedTextColor(); + separatorLeftColor = getShineEdgeColor(); + separatorRightColor = getShadowEdgeColor(); + } + + // Draw cycle glyph + + port->drawBitmap(rect.getX(), rect.getY() + glyphYOffset, + g_cycle.width, g_cycle.height, &g_cycle, + 0, 0, CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + // Draw separator + + nxgl_coord_t x = getX() + glyphSpace + g_cycle.width; + nxgl_coord_t y = getY(); + nxgl_coord_t w = glyphSpace + g_cycle.width; + nxgl_coord_t h = rect.getHeight() - 1; + + port->drawLine(x, y, w, h, separatorLeftColor); + port->drawLine(x+1, y, w+1, h, separatorRightColor); + + // Only draw text if option is selected + + if (m_options.getSelectedItem() != NULL) + { + struct nxgl_point_s pos; + pos.x = getX() + m_align.x; + pos.y = getY() + m_align.y; + + port->drawText(&pos, &rect, getFont(), + m_options.getSelectedItem()->getText(), 0, + m_options.getSelectedItem()->getText().getLength(), + textColor); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CCycleButton::drawBorder(CGraphicsPort *port) +{ + // Determine the background color + + nxwidget_pixel_t backColor; + + if (isClicked() || m_highlighted) + { + backColor = getSelectedBackgroundColor(); + } + else + { + backColor = getBackgroundColor(); + } + + // Draw the background (excluding the border) + + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), backColor); + + // Then add the border. + + drawOutline(port); +} + +/** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + +void CCycleButton::drawOutline(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (isBorderless()) + { + return; + } + + // Work out which colors to use + + nxgl_coord_t color1; + nxgl_coord_t color2; + + if (isClicked()) + { + // Bevelled into the screen + + color1 = getShadowEdgeColor(); + color2 = getShineEdgeColor(); + } + else + { + // Bevelled out of the screen + + color1 = getShineEdgeColor(); + color2 = getShadowEdgeColor(); + } + + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); +} + +/** + * Selects the next option in the list and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CCycleButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + // Choose next option + + if (m_options.getItemCount() > 1) + { + int selectedIndex = m_options.getSelectedIndex(); + + if (selectedIndex < m_options.getItemCount() - 1) + { + // Move to next option + + selectOption(selectedIndex + 1); + } + else + { + // Wrap around as there are no more options + + selectOption(0); + } + } + + redraw(); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CCycleButton::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + diff --git a/libnxwidgets/src/cglyphbutton.cxx b/libnxwidgets/src/cglyphbutton.cxx new file mode 100644 index 000000000..f24b5c943 --- /dev/null +++ b/libnxwidgets/src/cglyphbutton.cxx @@ -0,0 +1,297 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cglyphbutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cglyphbutton.hxx" +#include "cgraphicsport.hxx" +#include "cbitmap.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button. + * @param y The y coordinate of the button. + * @param width The width of the button. + * @param height The height of the button. + * @param normalGlyph Glyph to display when unclicked. + * @param clickedGlyph Glyph to display when clicked. + * @param bitmapX The x coordinate at which the bitmaps will be drawn. + * @param bitmapY The y coordinate at which the bitmaps will be drawn. + * @param style The style that the button should use. If this is not + * specified, the button will use the values stored in the global + * g_defaultWidgetStyle object. The button will copy the properties of + * the style into its own internal style object. + */ + +CGlyphButton::CGlyphButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_coord_t bitmapX, nxgl_coord_t bitmapY, + FAR const struct SBitmap *normalGlyph, + FAR const struct SBitmap *clickedGlyph, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + // The border should be set to the minimum so that the bitmap + // image can extend all the way to the border. + + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; + + // Save the bitmap state data + + m_bitmapX = bitmapX; + m_bitmapY = bitmapY; + m_bitmapNormal = normalGlyph; + m_bitmapClicked = clickedGlyph; +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. + * @param rect Reference to a rect to populate with data. + */ + +void CGlyphButton::getPreferredDimensions(CRect &rect) const +{ + nxgl_coord_t width = m_bitmapNormal->width; + nxgl_coord_t height = m_bitmapNormal->height; + + if (!m_flags.borderless) + { + width = m_borderSize.left + m_borderSize.right; + height = m_borderSize.top + m_borderSize.bottom; + } + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width); + rect.setHeight(height); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CGlyphButton::drawContents(CGraphicsPort *port) +{ + // Get the drawable region within the Label + + CRect rect; + getRect(rect); + + // Pick the glyph to show + + FAR const struct SBitmap *bitmap; + if (m_flags.clicked) + { + bitmap = m_bitmapClicked; + } + else + { + bitmap = m_bitmapNormal; + } + + // Then draw it -- in greyscale if not enabled + + if (isEnabled()) + { + port->drawBitmap(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + bitmap, m_bitmapX, m_bitmapY, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + } + else + { + port->drawBitmapGreyScale(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + bitmap, m_bitmapX, m_bitmapY); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CGlyphButton::drawBorder(CGraphicsPort *port) +{ + port->drawFilledRect(getX(), getY(), getWidth(), + getHeight(), getBackgroundColor()); + drawOutline(port); +} + +/** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + +void CGlyphButton::drawOutline(CGraphicsPort *port) +{ + // Don't draw if the widget indicates it should not have an outline + + if (!isBorderless()) + { + // Determine which colors to use + + nxgl_coord_t color1; + nxgl_coord_t color2; + + if (isClicked()) + { + // Bevelled into the screen + + color1 = getShadowEdgeColor(); + color2 = getShineEdgeColor(); + } + else + { + // Bevelled out of the screen + + color1 = getShineEdgeColor(); + color2 = getShadowEdgeColor(); + } + + port->drawBevelledRect(getX(), getY(), + getWidth(), getHeight(), + color1, color2); + } +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CGlyphButton::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CGlyphButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseReleaseEvent(x, y); + redraw(); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CGlyphButton::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx new file mode 100644 index 000000000..43076e240 --- /dev/null +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -0,0 +1,988 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cgraphicsport.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "inxwindow.hxx" +#include "cnxstring.hxx" +#include "crect.hxx" +#include "cnxfont.hxx" +#include "cgraphicsport.hxx" +#include "cwidgetstyle.hxx" +#include "cbitmap.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pNxWnd An instance of the underlying window type. + */ + +CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd) +{ + m_pNxWnd = pNxWnd; +} + +/** + * Destructor. + */ + +CGraphicsPort::~CGraphicsPort(void) +{ + // m_pNxWnd is not deleted. This is an abstract base class and + // the caller of the CGraphicsPort instance is responsible for + // the window destruction. +}; + +/** + * Return the absolute x coordinate of the upper left hand corner of the + * underlying window. + * + * @return The x coordinate of the underlying window. + */ + +const nxgl_coord_t CGraphicsPort::getX(void) const +{ + struct nxgl_point_s pos; + (void)m_pNxWnd->getPosition(&pos); + return pos.x; +}; + +/** + * Return the absolute y coordinate of the upper left hand corner of the + * underlying window. + * + * @return The y coordinate of the underlying window. + */ + +const nxgl_coord_t CGraphicsPort::getY(void) const +{ + struct nxgl_point_s pos; + (void)m_pNxWnd->getPosition(&pos); + return pos.y; +}; + +/** + * Draw a pixel into the window. + * + * @param x The window-relative x coordinate of the pixel. + * @param y The window-relative y coordinate of the pixel. + * @param color The color of the pixel. + */ + +void CGraphicsPort::drawPixel(nxgl_coord_t x, nxgl_coord_t y, + nxgl_mxpixel_t color) +{ + struct nxgl_point_s pos; + pos.x = x; + pos.y = y; + m_pNxWnd->setPixel(&pos, color); +} + +/** + * Draw a horizontal line of the specified start position, width, and color. + * + * @param x The x coordinate of the line. + * @param y The y coordinate of the top-most end of the line. + * @param width The width of the line in pixels. + * @param color The color of the line. + */ + +void CGraphicsPort::drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_mxpixel_t color) +{ + FAR struct nxgl_rect_s dest; + nxgl_coord_t halfwidth; + + // Express the line as a rectangle + + halfwidth = width >> 1; + + dest.pt1.x = x; + dest.pt1.y = y; + dest.pt2.x = x + width - 1; + dest.pt2.y = y; + + // Draw the line + + if (!m_pNxWnd->fill(&dest, color)) + { + gdbg("INxWindow::fill failed\n"); + } +} + +/** + * Draw a vertical line of the specified start position, width, and + * color. + * + * @param x The x coordinate of the left-most end of the line. + * @param y The y coordinate of the line. + * @param height The height of the line in rows. + * @param color The color of the line. + */ + +void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t height, nxgl_mxpixel_t color) +{ + FAR struct nxgl_rect_s dest; + + // Express the line as a rectangle + + dest.pt1.x = x; + dest.pt1.y = y; + dest.pt2.x = x; + dest.pt2.y = y + height - 1; + + // Draw the line + + if (!m_pNxWnd->fill(&dest, color)) + { + gdbg("INxWindow::fill failed\n"); + } +} + +/** + * Draw a line of a fixed color in the window. + * + * @param x1 The x coordinate of the start point of the line. + * @param y1 The y coordinate of the start point of the line. + * @param x2 The x coordinate of the end point of the line. + * @param y2 The y coordinate of the end point of the line. + * @param color The color of the line. + */ + +void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, + nxgl_coord_t x2, nxgl_coord_t y2, + nxgl_mxpixel_t color) +{ + struct nxgl_vector_s vector; + + vector.pt1.x = x1; + vector.pt1.y = y1; + vector.pt2.x = x2; + vector.pt2.y = y2; + + if (!m_pNxWnd->drawLine(&vector, 1, color)) + { + gdbg("INxWindow::drawLine failed\n"); + } +} + +/** + * Draw a filled rectangle to the bitmap. + * + * @param x The window-relative x coordinate of the rectangle. + * @param y The window-relative y coordinate of the rectangle. + * @param width The width of the rectangle in pixels. + * @param height The height of the rectangle in rows. + * @param color The color of the rectangle. + */ + +void CGraphicsPort::drawFilledRect(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_mxpixel_t color) +{ + struct nxgl_rect_s rect; + rect.pt1.x = x; + rect.pt1.y = y; + rect.pt2.x = x + width - 1; + rect.pt2.y = y + height - 1; + m_pNxWnd->fill(&rect, color); +} + +/** + * Draw an unfilled rectangle to the window + * + * @param x The window-relative x coordinate of the rectangle. + * @param y The window-relative y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param color The color of the rectangle outline. + */ + +void CGraphicsPort::drawRect(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_mxpixel_t color) +{ + drawHorizLine(x, y, width, color); + drawHorizLine(x, y + height - 1, width, color); + drawVertLine(x, y, height, color); + drawVertLine(x + width -1, y, height, color); +} + +/** + * Draw a bevelled rectangle to the window. + * + * @param x The x coordinate of the rectangle. + * @param y The y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @param shineColor The color of the top/left sides. + * @param shadowColor The color of the bottom/right sides. + */ + +void CGraphicsPort::drawBevelledRect(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_mxpixel_t shineColor, + nxgl_mxpixel_t shadowColor) +{ + drawHorizLine(x, y, width, shineColor); // Top + drawHorizLine(x, y + height - 1, width, shadowColor); // Bottom + drawVertLine(x, y + 1, height - 2, shineColor); // Left + drawVertLine(x + width - 1, y + 1, height - 2, shadowColor); // Right +} + +/** + * Draw an opaque bitmap to the window. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied + * bitmap to use as the origin. + * @param bitmapY The window-relative y coordinate within the supplied + * bitmap to use as the origin. + */ + +void CGraphicsPort::drawBitmap(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, + int bitmapX, int bitmapY) +{ + // origin - The origin of the upper, left-most corner of the full bitmap. + // Both dest and origin are in window coordinates, however, origin + // may lie outside of the display. + + struct nxgl_point_s origin; + origin.x = x - bitmapX; + origin.y = y - bitmapY; + + // dest - Describes the rectangular on the display that will receive the + // the bit map. + + struct nxgl_rect_s dest; + dest.pt1.x = x; + dest.pt1.y = y; + dest.pt2.x = x + width - 1; + dest.pt2.y = y + height - 1; + + // Blit the bitmap + + (void)m_pNxWnd->bitmap(&dest, (FAR const void *)bitmap->data, &origin, bitmap->stride); +} + +/** + * Draw a bitmap to the window, using the supplied transparent + * color as an invisible color. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied bitmap to use as + * the origin. + * @param bitmapY The window-relative y coordinate within the supplied bitmap to use as + * the origin. + * @param transparentColor The transparent color used in the bitmap. + */ + +void CGraphicsPort::drawBitmap(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, + int bitmapX, int bitmapY, + nxgl_mxpixel_t transparentColor) +{ + // Get the starting position in the image, offset by bitmapX and bitmapY into the image. + + FAR uint8_t *srcLine = (uint8_t *)bitmap->data + + bitmapY * bitmap->stride + + ((bitmapX * bitmap->bpp + 7) >> 3); + FAR nxwidget_pixel_t *srcPtr = (nxwidget_pixel_t *)srcLine; + + // Loop until all rows have been displayed + + nxgl_coord_t firstX = x; + nxgl_coord_t lastX = x + width; + nxgl_coord_t lastY = y + height; + + while (y < lastY) + { + // Search for the next non-transparent pixel in the source image + + while (*srcPtr == transparentColor) + { + // The pixel is transparent. Move to the next column + + if (++x >= lastX) + { + // We are at the end of the row. Reset to the next row + + x = firstX; + y++; + + // Was that the last row: + + if (y >= lastY) + { + // Yes, then we are finished + + return; + } + + // Update the source data pointers to the beginning of the next + // row + + srcLine += bitmap->stride; + srcPtr = (nxwidget_pixel_t *)srcLine; + } + else + { + // This is another transparent pixel on the same row + + srcPtr++; + } + } + + // srcPtr points to the next non-transparent color. Save this + // as the start of a run that has length of at least one + + FAR nxwidget_pixel_t *runPtr = srcPtr; + nxgl_coord_t runX = x; + nxgl_coord_t runWidth = 0; + + // Now search for the next transparent pixel on the same row. + // This will determine the length of the run + + do + { + // This is another non-transparent pixel on the same row + + runWidth++; + srcPtr++; + + // Move to the next column + + if (++x >= lastX) + { + // We are at the end of the row. Reset to the next row + + x = firstX; + y++; + + // Update the source data pointers to the beginning of the next + // row + + srcLine += bitmap->stride; + srcPtr = (nxwidget_pixel_t *)srcLine; + + // And break out of this loop + + break; + } + } + while (*srcPtr != transparentColor); + + // When we come out of the above loop, either (1) srcPtr points to the + // next transparent pixel on the same row, or (2) srcPtr points to the + // first pixel in the next row. + + // origin - The origin of the upper, left-most corner of the full bitmap. + // Both dest and origin are in window coordinates, however, origin + // may lie outside of the display. + + struct nxgl_point_s origin; + origin.x = runX; + origin.y = y; + + // dest - Describes the rectangular on the display that will receive the + // the bit map. + + struct nxgl_rect_s dest; + dest.pt1.x = runX; + dest.pt1.y = y; + dest.pt2.x = runX + runWidth - 1; + dest.pt2.y = y; + + // Blit the bitmap + + (void)m_pNxWnd->bitmap(&dest, (FAR const void *)runPtr, &origin, bitmap->stride); + } +} + +/** + * Draw a bitmap to the port in greyscale. + * + * @param x The window-relative x coordinate to draw the bitmap to. + * @param y The window-relative y coordinate to draw the bitmap to. + * @param width The width of the bitmap to draw. + * @param height The height of the bitmap to draw. + * @param bitmap Pointer to the bitmap to draw. + * @param bitmapX The window-relative x coordinate within the supplied bitmap to use as + * the origin. + * @param bitmapY The window-relative y coordinate within the supplied bitmap to use as + * the origin. + */ + +void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const struct SBitmap *bitmap, + int bitmapX, int bitmapY) +{ + // Working buffer. Holds one converted row from the bitmap + + FAR nxwidget_pixel_t *run = new nxwidget_pixel_t[width]; + + // Pointer to the beginning of the first source row + + FAR uint8_t *src = (FAR uint8_t *)bitmap->data + bitmapY * bitmap->stride + bitmapX; + + // Setup non-changing blit parameters + + struct nxgl_point_s origin; + origin.x = 0; + origin.y = 0; + + struct nxgl_rect_s dest; + dest.pt1.x = x; + dest.pt1.y = y; + dest.pt2.x = x + width - 1; + dest.pt2.y = y; + + // Convert each row to greyscale and send it to the display + + for (int row = 0; row < height; row++) + { + // Convert the next row + + FAR nxwidget_pixel_t *runSrc = (FAR nxwidget_pixel_t *)src; + FAR nxwidget_pixel_t *runDest = run; + + for (int col = 0; col < width; col++) + { + // Get the next RGB pixel and break out the individual components + + nxwidget_pixel_t rgb = *runSrc++; + nxwidget_pixel_t r = RGB2RED(rgb); + nxwidget_pixel_t g = RGB2GREEN(rgb); + nxwidget_pixel_t b = RGB2BLUE(rgb); + + // A truly accurate greyscale conversion would be complex. Let's + // just average. + + nxwidget_pixel_t avg = (r + g + b) / 3; + *runDest++ = MKRGB(avg, avg, avg); + } + + // Now blit the single row + + (void)m_pNxWnd->bitmap(&dest, (FAR void *)bitmap->data, &origin, bitmap->stride); + + // Setup for the next source row + + y++; + dest.pt1.y = y; + dest.pt2.y = y; + + src += bitmap->stride; + } + + delete run; +} + +/** + * Draw a string to the window. + * + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + */ + +void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string) +{ + drawText(pos, bound, font, string, 0, string.getLength()); +} + +/** + * Draw a particular length of a string to the window in a secific color. + * + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param color The color of the string. + */ + +void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string, + int startIndex, int length, + nxgl_mxpixel_t color) +{ + // Temporarily change the font color + + nxgl_mxpixel_t savedColor = font->getColor(); + font->setColor(color); + + // Draw the string with this new color + + drawText(pos, bound, font, string, startIndex, length); + + // Restore the font color + + font->setColor(savedColor); +} + +/** + * Draw a portion of a string to the window. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + */ + +void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string, + int startIndex, int length) +{ + // Verify index and length + + int stringLength = string.getLength(); + if (startIndex >= stringLength) + { + return; + } + + int endIndex = startIndex + length; + if (endIndex > stringLength) + { + endIndex = stringLength; + } + + // Allocate a bit of memory to hold the largest rendered font + + unsigned int bmWidth = ((unsigned int)font->getMaxWidth() * CONFIG_NXWIDGETS_BPP + 7) >> 3; + unsigned int bmHeight = (unsigned int)font->getHeight(); + + unsigned int glyphSize = bmWidth * bmHeight; + FAR uint8_t *glyph = new uint8_t[glyphSize]; + + // Get the bounding rectangle in NX form + + struct nxgl_rect_s boundingBox; + bound->getNxRect(&boundingBox); + + // Loop setup + +#if 0 + nxwidget_pixel_t backcolor = g_defaultWidgetStyle->colors.back; +#endif + + struct SBitmap bitmap; + bitmap.bpp = CONFIG_NXWIDGETS_BPP; + bitmap.fmt = CONFIG_NXWIDGETS_FMT; + bitmap.data = (FAR const nxgl_mxpixel_t*)glyph; + + // Loop for each letter in the sub-string + + for (int i = startIndex; i < endIndex; i++) + { + // Get the next letter in the string + + const nxwidget_char_t letter = string.getCharAt(i); + + // Get the font metrics for this letter + + struct nx_fontmetric_s metrics; + font->getCharMetrics(letter, &metrics); + + // Get the width of the font (in pixels) + + nxgl_coord_t fontWidth = (nxgl_coord_t)(metrics.width + metrics.xoffset); + + // Does the letter have height? Spaces have width, but no height + + if (metrics.height > 0) + { + // Get the height of the font + + nxgl_coord_t fontHeight = (nxgl_coord_t)(metrics.height + metrics.yoffset); + + // Set the current, effective size of the bitmap + + bitmap.width = fontWidth; + bitmap.height = fontHeight; + bitmap.stride = (fontWidth * bitmap.bpp + 7) >> 3; + + // Describe the destination of the font as a bounding box + + struct nxgl_rect_s dest; + dest.pt1.x = pos->x; + dest.pt1.y = pos->y; + dest.pt2.x = pos->x + fontWidth - 1; + dest.pt2.y = pos->y + fontHeight - 1; + + // Get the interection of the font box and the bounding box + + struct nxgl_rect_s intersection; + nxgl_rectintersect(&intersection, &dest, &boundingBox); + + // Skip to the next character if this one is completely outside + // the bounding box. + + if (!nxgl_nullrect(&intersection)) + { + // Initialize the bitmap memory by reading from the display. The + // font renderer always renders the fonts on a transparent background. + // Sometimes a solid background works, sometimes not. But reading + // from graphics memory always works. + +#if 0 + // Set the glyph memory to the background color + + nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data; + unsigned int npixels = fontWidth * fontHeight; + for (unsigned int j = 0; j < npixels; j++) + { + *bmPtr++ = backcolor; + } +#else + // Read the current contents of the destination into the glyph memory + + m_pNxWnd->getRectangle(&dest, &bitmap); +#endif + // Render the font into the initialized bitmap + + font->drawChar(&bitmap, letter); + + // Then put the font on the display + + if (!m_pNxWnd->bitmap(&intersection, (FAR const void *)bitmap.data, + pos, bitmap.stride)) + { + gvdbg("nx_bitmapwindow failed: %d\n", errno); + } + } + } + + // Adjust the X position for the next character in the string + + pos->x += fontWidth; + } + + delete glyph; +} + +/** + * Copy a rectangular region from the source coordinates to the + * destination coordinates. + * + * @param sourceX Source x coordinate. + * @param sourceY Source y coordinate. + * @param destX Destination x coordinate. + * @param destY Destination y coordinate. + * @param width Width of the rectangle to copy. + * @param height Height of the rectangle to copy. + */ + +void CGraphicsPort::copy(nxgl_coord_t sourceX, nxgl_coord_t sourceY, + nxgl_coord_t destX, nxgl_coord_t destY, + nxgl_coord_t width, nxgl_coord_t height) +{ + struct nxgl_rect_s rect; + struct nxgl_point_s offset; + + rect.pt1.x = sourceX; + rect.pt1.y = sourceY; + rect.pt1.x = sourceX + width - 1; + rect.pt1.y = sourceY + height - 1; + + offset.x = destX - sourceX; + offset.y = destY - sourceY; + + (void)m_pNxWnd->move(&rect, &offset); +} + +/** + * Move a region by a specified distance in two dimensions. + * + * @param x X coordinate of the source area to move. + * @param y Y coordinate of the source area to move. + * @param deltaX Horizontal distance to move. + * @param deltaY Vertical distance to move. + * @param width Width of the area to move. + * @param height Height of the area to move. + */ + +void CGraphicsPort::move(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t deltaX, nxgl_coord_t deltaY, + nxgl_coord_t width, nxgl_coord_t height) +{ + struct nxgl_rect_s rect; + rect.pt1.x = x; + rect.pt1.y = y; + rect.pt2.x = x + width - 1; + rect.pt2.y = y = height -1; + + struct nxgl_point_s offset; + offset.x = deltaX; + offset.y = deltaY; + + (void)m_pNxWnd->move(&rect, &offset); +} + +/** + * Convert the region to greyscale. + * + * @param x X coordinate of the region to change. + * @param y Y coordinate of the region to change. + * @param width Width of the region to change. + * @param height Height of the region to change. + */ + +void CGraphicsPort::greyScale(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +{ + // Allocate memory to hold one row of graphics data + + unsigned int stride = ((unsigned int)width * CONFIG_NXWIDGETS_BPP + 7) >> 3; + FAR uint8_t *rowBuffer = new uint8_t[height * stride]; + if (!rowBuffer) + { + return; + } + + // Describe the receiving bitmap memory + + SBitmap rowBitmap; + rowBitmap.bpp = CONFIG_NXWIDGETS_BPP; + rowBitmap.fmt = CONFIG_NXWIDGETS_FMT; + rowBitmap.width = width; + rowBitmap.height = 1; + rowBitmap.stride = stride; + rowBitmap.data = (FAR const nxgl_mxpixel_t *)rowBuffer; + + // Partially describe the source rectangle + + struct nxgl_rect_s rect; + rect.pt1.x = x; + rect.pt2.x = x + width - 1; + + // Partially setup the graphics origin + + struct nxgl_point_s origin; + origin.x = x; + + // Loop for each row in the region to be inverted + + for (int row = 0; row < height; row++) + { + // Read the graphic memory corresponding to the row + + rect.pt1.y = rect.pt2.y = y + row; + m_pNxWnd->getRectangle(&rect, &rowBitmap); + + // Convert each bit to each bit + + nxwidget_pixel_t *ptr = (nxwidget_pixel_t *)rowBuffer; + for (int col = 0; col < width; col++) + { + // Get the next RGB pixel and break out the individual components + + nxwidget_pixel_t color = *ptr; + uint8_t red = RGB2RED(color); + uint8_t green = RGB2GREEN(color); + uint8_t blue = RGB2BLUE(color); + + // A truly accurate greyscale conversion would be complex. Let's + // just average. + + nxwidget_pixel_t avg = (red + green + blue) / 3; + *ptr++ = MKRGB(avg, avg, avg); + } + + // Then write the row back to graphics memory + + origin.y = rect.pt1.y; + m_pNxWnd->bitmap(&rect, (FAR const void *)rowBitmap.data, + &origin, rowBitmap.stride) ; + } + + delete rowBuffer; +} + +/** + * Invert colors in a region. NOTE: This allocates an in-memory + * buffer the size of one row in graphic memory. So it may only be + * useful for inverting small regions and its only current use of for + * the inverted cursor text. + * + * @param x X coordinate of the region to change. + * @param y Y coordinate of the region to change. + * @param width Width of the region to change. + * @param height Height of the region to change. + */ + +void CGraphicsPort::invert(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +{ + // Allocate memory to hold one row of graphics data + + unsigned int stride = ((unsigned int)width * CONFIG_NXWIDGETS_BPP + 7) >> 3; + FAR uint8_t *rowBuffer = new uint8_t[height * stride]; + if (!rowBuffer) + { + return; + } + + // Describe the receiving bitmap memory + + SBitmap rowBitmap; + rowBitmap.bpp = CONFIG_NXWIDGETS_BPP; + rowBitmap.fmt = CONFIG_NXWIDGETS_FMT; + rowBitmap.width = width; + rowBitmap.height = 1; + rowBitmap.stride = stride; + rowBitmap.data = (FAR const nxgl_mxpixel_t *)rowBuffer; + + // Partially describe the source rectangle + + struct nxgl_rect_s rect; + rect.pt1.x = x; + rect.pt2.x = x + width - 1; + + // Partially setup the graphics origin + + struct nxgl_point_s origin; + origin.x = x; + + // Loop for each row in the region to be inverted + + for (int row = 0; row < height; row++) + { + // Read the graphic memory corresponding to the row + + rect.pt1.y = rect.pt2.y = y + row; + m_pNxWnd->getRectangle(&rect, &rowBitmap); + + // Invert each bit + + nxwidget_pixel_t *ptr = (nxwidget_pixel_t *)rowBuffer; + for (int col = 0; col < width; col++) + { + nxwidget_pixel_t color = *ptr; + uint8_t red = RGB2RED(color); + uint8_t green = RGB2GREEN(color); + uint8_t blue = RGB2BLUE(color); + *ptr++ = MKRGB(~red, ~green, ~blue); + } + + // Then write the row back to graphics memory + + origin.y = rect.pt1.y; + m_pNxWnd->bitmap(&rect, (FAR const void *)rowBitmap.data, + &origin, rowBitmap.stride) ; + } + + delete rowBuffer; +}; + diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx new file mode 100644 index 000000000..b57857e66 --- /dev/null +++ b/libnxwidgets/src/cimage.cxx @@ -0,0 +1,343 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cimage.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cgraphicsport.hxx" +#include "ibitmap.hxx" +#include "cbitmap.hxx" +#include "cimage.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for a label containing a string. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the image box, relative to its parent. + * @param y The y coordinate of the image box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param bitmap The source bitmap image. + * @param style The style that the widget should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CImage::CImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, FAR IBitmap *bitmap, + CWidgetStyle *style) + : CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + // Save the IBitmap instance + + m_bitmap = bitmap; + + // Position the top/lef corner of the bitmap in the top/left corner of the display + + m_origin.x = 0; + m_origin.y = 0; +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + +void CImage::getPreferredDimensions(CRect &rect) const +{ + nxgl_coord_t width = m_bitmap->getWidth(); + nxgl_coord_t height = m_bitmap->getHeight(); + + if (!m_flags.borderless) + { + width += (m_borderSize.left + m_borderSize.right); + height += (m_borderSize.top + m_borderSize.bottom); + } + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width); + rect.setHeight(height); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CImage::drawContents(CGraphicsPort *port) +{ + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Allocate a working buffer that will hold one row of the bitmap + + FAR nxwidget_pixel_t *buffer = new nxwidget_pixel_t[rect.getWidth()]; + + // Set up a simple bitmap structure to describe on row + + struct SBitmap bitmap; + bitmap.bpp = m_bitmap->getBitsPerPixel(); + bitmap.fmt = m_bitmap->getColorFormat(); + bitmap.width = rect.getWidth(); + bitmap.height = 1; + bitmap.stride = (rect.getWidth() * m_bitmap->getBitsPerPixel()) >> 3; + bitmap.data = buffer; + + // This is the number of rows that we can draw at the top of the display + + nxgl_coord_t nTopRows = m_bitmap->getHeight() - m_origin.y; + if (nTopRows > rect.getHeight()) + { + nTopRows = rect.getHeight(); + } + else if (nTopRows < 0) + { + nTopRows = 0; + } + + // This the starting row in the bitmap image where we will begin drawing. + + nxgl_coord_t imageRow = m_origin.y; + + // This the starting row in the display image where we will begin drawing. + + nxgl_coord_t displayRow = rect.getY(); + + // Are we going to draw any rows at the top of the display? + + if (nTopRows > 0) + { + // This is the number of columns that we can draw on the left side of + // the display + + nxgl_coord_t nLeftPixels = m_bitmap->getWidth() - m_origin.x; + + // This is the number of rows that we have to pad on the right if the display + // width is wider than the image width + + nxgl_coord_t nRightPad; + if (nLeftPixels >= rect.getWidth()) + { + nRightPad = 0; + } + else + { + nRightPad = rect.getWidth() - nLeftPixels; + } + + // Apply the padding to the right hand side + + FAR nxwidget_pixel_t *ptr = &buffer[nLeftPixels]; + nxwidget_pixel_t backColor = getBackgroundColor(); + + for (int column = nLeftPixels; column < rect.getWidth(); column++) + { + *ptr++ = backColor; + } + + // The is the row number of the first row that we cannot draw into + + nxgl_coord_t lastTopRow = nTopRows + m_origin.y; + + // Now draw the rows from the offset position + + for (; imageRow < lastTopRow; imageRow++, displayRow++) + { + // Get the graphics data for the right hand side of this row + + if (!m_bitmap->getRun(m_origin.x, imageRow, nLeftPixels, buffer)) + { + gvdbg("IBitmap::getRun failed at image row\n", imageRow); + delete buffer; + return; + } + + // Replace any transparent pixels with the background color. + // Then we can use the faster opaque drawBitmap() function. + + ptr = buffer; + for (int i = 0; i < nLeftPixels; i++, ptr++) + { + if (*ptr == CONFIG_NXWIDGETS_TRANSPARENT_COLOR) + { + *ptr = backColor; + } + } + + // And put these on the display + + port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, + &bitmap, 0, 0); + } + } + + // Are we going to draw any rows at the top of the display? + + if (nTopRows < rect.getHeight()) + { + // Pad the entire row + + FAR nxwidget_pixel_t *ptr = buffer; + nxwidget_pixel_t backColor = getBackgroundColor(); + + for (int column = 0; column < rect.getWidth(); column++) + { + *ptr++ = backColor; + } + + // Now draw the rows from the offset position + + for (; displayRow < rect.getHeight(); displayRow++) + { + // Put the padded row on the display + + port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, + &bitmap, 0, 0); + } + } + + delete buffer; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CImage::drawBorder(CGraphicsPort *port) +{ + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Set the horizontal position of the bitmap. Zero is the left edge + * of the bitmap and values >0 will move the bit map to the right. + * This method is useful for horizontal scrolling a large bitmap + * within a smaller window + */ + +void CImage::setImageLeft(nxgl_coord_t column) +{ + if (column > 0 && column <= m_bitmap->getWidth()) + { + m_origin.x = column; + } +} + +/** + * Set the vertical position of the bitmap. Zero is the top edge + * of the bitmap and values >0 will move the bit map down. + * This method is useful for vertical scrolling a large bitmap + * within a smaller window + */ + +void CImage::setImageTop(nxgl_coord_t row) +{ + if (row > 0 && row <= m_bitmap->getHeight()) + { + m_origin.x = row; + } +} + diff --git a/libnxwidgets/src/ckeypad.cxx b/libnxwidgets/src/ckeypad.cxx new file mode 100644 index 000000000..898885c62 --- /dev/null +++ b/libnxwidgets/src/ckeypad.cxx @@ -0,0 +1,214 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ckeypad.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cwidgetstyle.hxx" +#include "ckeypad.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +// The geometry of the button array + +#define BUTTONARRAY_NCOLUMNS 4 +#define BUTTONARRAY_NROWS 7 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +using namespace NXWidgets; + +static FAR const char *g_alphaLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { + "=>", "A", "B", "", "0", "1", "newCursorControlEvent(CURSOR_RIGHT); + return; + } + + // The backspace at (3,0) is a special case + + else if (column == 3 && row == 0) + { + ch = KEY_CODE_BACKSPACE; + } + + // Otherwise, just grab the character for the arrays + + else + { + int index = row * BUTTONARRAY_NCOLUMNS + column; + FAR const char *ptr; + if (m_numeric) + { + ptr = g_numLabels[index]; + } + else + { + ptr = g_alphaLabels[index]; + } + + ch = ptr[0]; + } + + // Then inject the keyboard input into the NX server. The NX + // server will determine which window receives the input. + // The ultimate recipient will be the widget in the top window + // that has focus. + + (void)nx_kbdchin(m_hNxServer, (uint8_t)ch); + } +} + +/** + * Configure the keypad for the currenly selected display mode. + */ + +void CKeypad::configureKeypadMode(void) +{ + // Add the labels to each button. Each call to setText would + // cause a text change event and, hence, redrawing of the + + FAR const char **ptr = m_numeric ? g_numLabels : g_alphaLabels; + for (int j = 0; j < BUTTONARRAY_NROWS; j++) + { + for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) + { + // setText does this. But each call to setText would + // cause a text change even and, hence, redrawing of + // the whole keypad. So we access the protected data + // directly and redraw only once. + + CNxString string = *ptr++; + m_buttonText[j * m_buttonColumns + i] = string; + } + } + + // Then redraw the display + + onTextChange(); +} + diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx new file mode 100644 index 000000000..4c7ea3554 --- /dev/null +++ b/libnxwidgets/src/clabel.cxx @@ -0,0 +1,426 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clabel.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "clabel.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CLabel Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for a label containing a string. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CLabel::CLabel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, CWidgetStyle *style) + : CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + // Default is centered text + + m_hAlignment = TEXT_ALIGNMENT_HORIZ_CENTER; + m_vAlignment = TEXT_ALIGNMENT_VERT_CENTER; + + // The border thickness is 1 pixel + + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; + + m_align.x = 0; + m_align.y = 0; + + m_textChange = false; + m_highlighted = false; + setText(text); + + calculateTextPositionHorizontal(); + calculateTextPositionVertical(); +} + +/** + * Set the horizontal alignment of text within the label. + * + * @param alignment The horizontal position of the text. + */ + +void CLabel::setTextAlignmentHoriz(TextAlignmentHoriz alignment) +{ + m_hAlignment = alignment; + calculateTextPositionHorizontal(); + redraw(); +} + +/** + * Set the vertical alignment of text within the label. + * + * @param alignment The vertical position of the text. + */ + +void CLabel::setTextAlignmentVert(TextAlignmentVert alignment) +{ + m_vAlignment = alignment; + calculateTextPositionVertical(); + redraw(); +} + +/** + * Set the text displayed in the label. + * + * @param text String to display. + */ + +void CLabel::setText(const CNxString &text) +{ + m_text = text; + onTextChange(); +} + +/** + * Append new text to the end of the current text displayed in the + * label. + * + * @param text String to append. + */ + +void CLabel::appendText(const CNxString &text) +{ + m_text.append(text); + onTextChange(); +} + +/** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + +void CLabel::insertText(const CNxString &text, const int index) +{ + m_text.insert(text, index); + onTextChange(); +} + +/** + * Control the highlight state. + * + * @param highlightOn True(1), the label will be highlighted + */ + +void CLabel::highlight(bool highlightOn) +{ + if (highlightOn != m_highlighted) + { + m_highlighted = highlightOn; + redraw(); + } +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + +void CLabel::getPreferredDimensions(CRect &rect) const +{ + nxgl_coord_t width; + nxgl_coord_t height; + + if (!m_flags.borderless) + { + width = m_borderSize.left + m_borderSize.right; + height = m_borderSize.top + m_borderSize.bottom; + } + else + { + width = 0; + height = 0; + } + + width += getFont()->getStringWidth(m_text); + height += getFont()->getHeight(); + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width); + rect.setHeight(height); +} + +/** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + +void CLabel::setFont(CNxFont *font) +{ + m_style.font = font; + + // Need to recalculate the text position as the font may have changed size + + calculateTextPositionHorizontal(); + calculateTextPositionVertical(); + redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * @param port The CGraphicsPort to draw to. + * + * @see redraw() + */ + +void CLabel::drawContents(CGraphicsPort *port) +{ + // Get the drawing area (excluding the border) + + CRect rect; + getRect(rect); + + // Pick the text and background colors + + nxgl_mxpixel_t textColor; + nxgl_mxpixel_t backColor; + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + backColor = getBackgroundColor(); + } + else if (m_highlighted) + { + textColor = getSelectedTextColor(); + backColor = getSelectedBackgroundColor(); + } + else + { + textColor = getEnabledTextColor(); + backColor = getBackgroundColor(); + } + + // Draw the background (excluding the border) + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), backColor); + + // Get the X/Y position of the text within the Label + + struct nxgl_point_s pos; + pos.x = rect.getX() + m_align.x; + pos.y = rect.getY() + m_align.y; + + // Add the text using the selected color + + port->drawText(&pos, &rect, getFont(), m_text, 0, m_text.getLength(), + textColor); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CLabel::drawBorder(CGraphicsPort *port) +{ + // Check if the widget indicates it should have an outline: That + // the outline is enabled and the this is not just a text-only + // redraw + + if (!isBorderless() && !isTextChange()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Resize the widget to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CLabel::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + calculateTextPositionHorizontal(); + calculateTextPositionVertical(); +} + +/** + * Calculate the vertical position of the string based on the font + * + * height and the alignment options. + */ + +void CLabel::calculateTextPositionVertical(void) +{ + CRect rect; + getClientRect(rect); + + nxgl_coord_t height = rect.getHeight(); + + switch (m_vAlignment) + { + case TEXT_ALIGNMENT_VERT_CENTER: + m_align.y = (height - getFont()->getHeight()) >> 1; + break; + + case TEXT_ALIGNMENT_VERT_TOP: + m_align.y = 0; + break; + + case TEXT_ALIGNMENT_VERT_BOTTOM: + m_align.y = height - getFont()->getHeight(); + break; + } +} + +/** + * Calculate the position of the string based on its length and the + * alignment options. + */ + +void CLabel::calculateTextPositionHorizontal(void) +{ + CRect rect; + getClientRect(rect); + + nxgl_coord_t width = rect.getWidth(); + + switch (m_hAlignment) + { + case TEXT_ALIGNMENT_HORIZ_CENTER: + m_align.x = (width - getFont()->getStringWidth(m_text)) >> 1; + break; + + case TEXT_ALIGNMENT_HORIZ_LEFT: + m_align.x = 0; + break; + + case TEXT_ALIGNMENT_HORIZ_RIGHT: + m_align.x = width - getFont()->getStringWidth(m_text); + break; + } +} + +/** + * Updates the GUI after the text has changed. + */ + +void CLabel::onTextChange(void) +{ + calculateTextPositionHorizontal(); + calculateTextPositionVertical(); + m_textChange = true; + redraw(); + m_textChange = false; + m_widgetEventHandlers->raiseValueChangeEvent(); +} + + diff --git a/libnxwidgets/src/clatchbutton.cxx b/libnxwidgets/src/clatchbutton.cxx new file mode 100644 index 000000000..673d50319 --- /dev/null +++ b/libnxwidgets/src/clatchbutton.cxx @@ -0,0 +1,131 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clatchbutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cstickybutton.hxx" +#include "clatchbutton.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CLatchButton::CLatchButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, + CWidgetStyle *style) +: CStickyButton(pWidgetControl, x, y, width, height, text, style) +{ +} + +/** + * Handles button click events + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CLatchButton::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + /* On each press event, toggle the button stuck down state */ + + toggleStuckDown(); +} diff --git a/libnxwidgets/src/clatchbuttonarray.cxx b/libnxwidgets/src/clatchbuttonarray.cxx new file mode 100644 index 000000000..d8292941b --- /dev/null +++ b/libnxwidgets/src/clatchbuttonarray.cxx @@ -0,0 +1,116 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clatchbuttonarray.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cstickybuttonarray.hxx" +#include "clatchbuttonarray.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for an array of latch buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CLatchButtonArray::CLatchButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style) +: CStickyButtonArray(pWidgetControl, x, y, buttonColumns, buttonRows, buttonWidth, buttonHeight, style) +{ +} + +/** + * Handles button click events + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CLatchButtonArray::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // We need to save the button position so that when CButtonArray + // gets the release, it will have the correct position. This would + // look nicer if we just called CButtonArray::onClock() but that + // would cause duplicate redraw() + + m_clickX = x; + m_clickY = y; + + // Convert the new key press to row/columin indices + + int column; + int row; + + if (posToButton(x, y, column, row)) + { + // Change the stuck down button on each in-range button press + // NOTE that normally button click events are not processed (but + // button release events will be processed). + + stickDown(column, row); + } +} diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx new file mode 100644 index 000000000..a8d3db0a6 --- /dev/null +++ b/libnxwidgets/src/clistbox.cxx @@ -0,0 +1,661 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "clistbox.hxx" +#include "cgraphicsport.hxx" +#include "cnxfont.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CListBox::CListBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CScrollingPanel(pWidgetControl, x, y, width, height, 0, style) +{ + m_flags.draggable = true; + m_flags.doubleClickable = true; + m_optionPadding = 2; + m_options.addListDataEventHandler(this); + m_lastSelectedIndex = -1; + + // Disallow horizontal scrolling + + setAllowsHorizontalScroll(false); +} + +/** + * Destructor. + */ + +CListBox::~CListBox(void) +{ + m_options.removeListDataEventHandler(this); +} + + +/** + * Add a new option to the widget using default colors. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + +void CListBox::addOption(const CNxString &text, const uint32_t value) +{ + addOption(text, value, + getShadowEdgeColor(), getBackgroundColor(), + getShadowEdgeColor(), getHighlightColor()); +} + +/** + * Add an option to the widget. + * + * @param option The option to add. + */ + +void CListBox::addOption(CListBoxDataItem *option) +{ + m_options.addItem(option); +} + +/** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + +void CListBox::removeOption(const int index) +{ + m_options.removeItem(index); +} + +/** + * Remove all options from the widget. + */ + +void CListBox::removeAllOptions(void) +{ + m_options.removeAllItems(); +} + +/** + * Add a new option to the widget. + * + * @param text Text to show in the option. + * @param value The value of the option. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + +void CListBox::addOption(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor) +{ + addOption(new CListBoxDataItem(text, value, + normalTextColor, normalBackColor, + selectedTextColor, selectedBackColor)); +} + +/** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + +void CListBox::selectOption(const int index) +{ + setOptionSelected(index, true); +} + +/** + * Select an option by its index. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + */ + +void CListBox::deselectOption(const int index) +{ + setOptionSelected(index, false); +} + +/** + * Select all options. Does nothing if the listbox does not allow + * multiple selections. Redraws the widget and raises a value changed + * event. + */ + +void CListBox::selectAllOptions(void) +{ + m_options.selectAllItems(); +} + +/** + * Deselect all options. + * Redraws the widget and raises a value changed event. + */ + +void CListBox::deselectAllOptions(void) +{ + m_options.deselectAllItems(); +} + +/** + * Get the selected index. Returns -1 if nothing is selected. If + * more than one option is selected, the index of the first selected + * option is returned. + * + * @return The selected index. + */ + +const int CListBox::getSelectedIndex(void) const +{ + return m_options.getSelectedIndex(); +} + +/** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected options to deselected. Redraws the widget and raises + * a value changed event. + * + * @param index The selected index. + */ + +void CListBox::setSelectedIndex(const int index) +{ + setOptionSelected(index, true); +} + +/** + * Get the selected option. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + +const CListBoxDataItem *CListBox::getSelectedOption(void) const +{ + return (const CListBoxDataItem*)m_options.getSelectedItem(); +} + +/** + * Resize the scrolling canvas to encompass all options. + */ + +void CListBox::resizeCanvas(void) +{ + // Get client area + + CRect rect; + getClientRect(rect); + + int oldCanvasHeight = m_canvasHeight; + + // Resize the canvas + + m_canvasHeight = (m_options.getItemCount() * getOptionHeight()); + + // Ensure canvas is at least as tall as the widget + + m_canvasHeight = m_canvasHeight < rect.getHeight() ? rect.getHeight() : m_canvasHeight; + + // If resize has left scroll position beyond end of canvas, adjust + // to compensate + + if (m_canvasY + (m_canvasHeight - getHeight()) < 0) + { + scroll(0, -(oldCanvasHeight - (m_canvasHeight - getHeight()))); + } +} + +/** + * Sort the options alphabetically by the text of the options. + */ + +void CListBox::sort(void) +{ + m_options.sort(); +} + +/** + * Get the height of a single option. + * + * @return The height of an option. + */ + +const nxgl_coord_t CListBox::getOptionHeight(void) const +{ + return getFont()->getHeight() + (m_optionPadding << 1); +} + +/** + * Handles list data changed events. + * + * @param e Event arguments. + */ + +void CListBox::handleListDataChangedEvent(const CListDataEventArgs &e) +{ + // Forget the last selected item as it may have changed + + m_lastSelectedIndex = -1; + resizeCanvas(); + redraw(); +} + +/** + * Handles list selection changed events. + * + * @param e Event arguments. + */ + +void CListBox::handleListDataSelectionChangedEvent(const CListDataEventArgs &e) +{ + redraw(); + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + +void CListBox::getPreferredDimensions(CRect &rect) const +{ + nxgl_coord_t width; + nxgl_coord_t height; + + if (!m_flags.borderless) + { + width = m_borderSize.left + m_borderSize.right; + height = m_borderSize.top + m_borderSize.bottom; + } + else + { + width = 0; + height = 0; + } + + nxgl_coord_t maxWidth = 0; + nxgl_coord_t optionWidth = 0; + + // Locate longest string in options + + for (int i = 0; i < m_options.getItemCount(); ++i) + { + optionWidth = getFont()->getStringWidth(m_options.getItem(i)->getText()); + + if (optionWidth > maxWidth) + { + maxWidth = optionWidth; + } + } + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width + (m_optionPadding << 1) + maxWidth); + rect.setHeight(height + getOptionHeight() * 3); +} + +/** + * Check if the click is a double-click. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click is a double-click. + */ + +bool CListBox::isDoubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ + if (CNxWidget::isDoubleClick(x, y)) + { + // Calculate which option was clicked + + int selectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); + + // Has the same option been clicked twice? Ignore double-clicks that + // occur on different items + + if (selectedIndex == m_lastSelectedIndex) + { + // Process click as a double-click + + return true; + } + } + + return false; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CListBox::drawContents(CGraphicsPort *port) +{ + // Get the drawing region (excluding the borders) + + CRect rect; + getRect(rect); + + // Draw background + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + getBackgroundColor()); + + // Calculate clipping values + + nxgl_coord_t clipX = rect.getX(); + nxgl_coord_t clipY = rect.getY(); + nxgl_coord_t clipHeight = rect.getHeight(); + + // Precalc values for option draw loop + + nxgl_coord_t optionHeight = getOptionHeight(); + + // Ensure that we subtract 1 from topOption to ensure that the option + // above is drawn if it is partially visible + + int topOption = ((clipY - m_canvasY) / optionHeight) - 1; + + // Ensure that we add 2 to the bottom option to ensure that the option + // below is draw if it is partially visible - subbing 1 from topOption + // means we need to add an additional 1 to compensate + + int bottomOption = topOption + (clipHeight / optionHeight) + 2; + + // Ensure top options is not negative + + if (topOption < 0) + { + topOption = 0; + } + + // Ensure bottom option does not exceed number of options + + if (bottomOption >= m_options.getItemCount()) + { + bottomOption = m_options.getItemCount() - 1; + } + + // Calculate values for loop + + int y = m_canvasY + (topOption * optionHeight); + int i = topOption; + + const CListBoxDataItem *item = (CListBoxDataItem *)NULL; + + // Loop through all options drawing each ones + + while (i <= bottomOption) + { + item = (const CListBoxDataItem*)m_options.getItem(i); + + // Is the option selected? + + if (item->isSelected()) + { + // Draw background + + if (item->getSelectedBackColor() != getBackgroundColor()) + { + port->drawFilledRect(rect.getX(), rect.getY() + y, + rect.getWidth(), optionHeight, + item->getSelectedBackColor()); + } + + // Draw text + + struct nxgl_point_s pos; + pos.x = rect.getX() + m_optionPadding; + pos.y = rect.getY() + y + m_optionPadding; + + if (isEnabled()) + { + port->drawText(&pos, &rect, getFont(), item->getText(), 0, + item->getText().getLength(), + item->getSelectedTextColor()); + } + else + { + port->drawText(&pos, &rect, getFont(), item->getText(), 0, + item->getText().getLength(), + getDisabledTextColor()); + } + } + else + { + // Draw background + + if (item->getNormalBackColor() != getBackgroundColor()) + { + port->drawFilledRect(clipX, y, getWidth(), optionHeight, + item->getNormalBackColor()); + } + + // Draw text + + struct nxgl_point_s pos; + pos.x = rect.getX() + m_optionPadding; + pos.y = rect.getY() + y + m_optionPadding; + + if (isEnabled()) + { + port->drawText(&pos, &rect, getFont(), item->getText(), 0, + item->getText().getLength(), + item->getNormalTextColor()); + } + else + { + port->drawText(&pos, &rect, getFont(), item->getText(), 0, + item->getText().getLength(), + getDisabledTextColor()); + } + } + + i++; + y += optionHeight; + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CListBox::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(0, 0, getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Determines which item was clicked and selects or deselects it as + * appropriate. Also starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Calculate which option was clicked + + m_lastSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); + + const CListBoxDataItem *item = + (const CListBoxDataItem*)m_options.getItem(m_lastSelectedIndex); + + // Are we setting or unsetting? + + if (item->isSelected()) + { + // Deselecting + + m_options.deselectItem(m_lastSelectedIndex); + } + else + { + // Selecting + + m_options.selectItem(m_lastSelectedIndex); + } + + startDragging(x, y); + redraw(); +} + +/** + * Selects the clicked item and deselects all others. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CListBox::onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Calculate which option was clicked + + int newSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); + + // Double-click - select the item exclusively + + deselectAllOptions(); + setSelectedIndex(newSelectedIndex); + m_widgetEventHandlers->raiseActionEvent(); +} + +/** + * Select or deselect an option by its index. Does not deselect any other selected options. + * Set index to -1 to select nothing. + * Redraws the widget and raises a value changed event. + * + * @param index The index of the option to select. + * @param selected True to select the option, false to deselect it. + */ + +void CListBox::setOptionSelected(const int index, bool selected) +{ + m_options.setItemSelected(index, selected); +} diff --git a/libnxwidgets/src/clistboxdataitem.cxx b/libnxwidgets/src/clistboxdataitem.cxx new file mode 100644 index 000000000..0ef1b2d25 --- /dev/null +++ b/libnxwidgets/src/clistboxdataitem.cxx @@ -0,0 +1,114 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistboxdataitem.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "clistboxdataitem.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + +CListBoxDataItem::CListBoxDataItem(const CNxString& text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor) +: CListDataItem(text, value) +{ + m_normalTextColor = normalTextColor; + m_normalBackColor = normalBackColor; + m_selectedTextColor = selectedTextColor; + m_selectedBackColor = selectedBackColor; +} diff --git a/libnxwidgets/src/clistdata.cxx b/libnxwidgets/src/clistdata.cxx new file mode 100644 index 000000000..3b9601fc0 --- /dev/null +++ b/libnxwidgets/src/clistdata.cxx @@ -0,0 +1,462 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistdata.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "clistdata.hxx" +#include "ilistdataeventhandler.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + */ + +CListData::CListData(void) +{ + m_allowMultipleSelections = true; + m_sortInsertedItems = false; +} + +/** + * Destructor. + */ + +CListData::~CListData(void) +{ + removeAllItems(); +} + +/** + * Add a new item. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + +void CListData::addItem(const CNxString &text, const uint32_t value) +{ + // Create new option + + addItem(new CListDataItem(text, value)); +} + +/** + * Add an existing item. CListData becomes the owner of the option and will delete it + * when the list is deleted. + * + * @param item The item to add. + */ + +void CListData::addItem(CListDataItem *item) +{ + // Determine insert type + + if (m_sortInsertedItems) + { + // Sorted insert + + m_items.insert(getSortedInsertionIndex(item), item); + } + else + { + // Append + + m_items.push_back(item); + } + + raiseDataChangedEvent(); +} + +/** + * Remove an item by its index. + * + * @param index The index of the option to remove. + */ + +void CListData::removeItem(const int index) +{ + // Bounds check + + if (index < m_items.size()) + { + // Delete the option + + delete m_items[index]; + + // Erase the option from the list + + m_items.erase(index); + raiseDataChangedEvent(); + } +} + +/** + * Select an item by its index. + * + * @param index The index of the item to select. + */ + +void CListData::selectItem(const int index) +{ + setItemSelected(index, true); +} + +/** + * Deselect an item by its index. + * + * @param index The index of the item to select. + */ + +void CListData::deselectItem(const int index) +{ + setItemSelected(index, false); +} + +/** + * Remove all items. + */ + +void CListData::removeAllItems(void) +{ + // Delete all option data + + for (int i = 0; i < m_items.size(); i++) + { + delete m_items[i]; + } + + m_items.clear(); + raiseDataChangedEvent(); +} + +/** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * item is selected, the index of the first selected item is returned. + * + * @return The selected index. + */ + +const int CListData::getSelectedIndex(void) const +{ + // Get the first selected index + + for (int i = 0; i < m_items.size(); i++) + { + if (m_items[i]->isSelected()) + { + return i; + } + } + + return -1; +} + +/** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected items to deselected. + * + * @param index The selected index. + */ + +void CListData::setSelectedIndex(const int index) +{ + setItemSelected(index, true); +} + +/** + * Get the selected item. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + +const CListDataItem *CListData::getSelectedItem(void) const +{ + // Get the first selected option + + int index = getSelectedIndex(); + if (index > -1) + { + return m_items[index]; + } + return (CListDataItem *)NULL; +} + +/** + * Sort the items using their compareTo() methods. + */ + +void CListData::sort(void) +{ + quickSort(0, m_items.size() - 1); + raiseDataChangedEvent(); +} + +/** + * Select all items. Does nothing if the list does not allow + * multiple selections. + */ + +void CListData::selectAllItems(void) +{ + if (m_allowMultipleSelections) + { + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(true); + } + + raiseSelectionChangedEvent(); + } +} + +/** + * Deselect all items. + */ + +void CListData::deselectAllItems(void) +{ + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(false); + } + + raiseSelectionChangedEvent(); +} + +/** + * Select or deselect an item by its index. Does not deselect any + * other selected items. Set index to -1 to select nothing. + * + * @param index The index of the item to select. + * @param selected True to select the item, false to deselect it. + */ + +void CListData::setItemSelected(const int index, bool selected) +{ + // Deselect old options if we're making an option selected and + // we're not a multiple list + + if (((!m_allowMultipleSelections) || (index == -1)) && (selected)) + { + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(false); + } + } + + // Select or deselect the new option + + if ((index > -1) && (index < m_items.size())) + { + m_items[index]->setSelected(selected); + } + + raiseSelectionChangedEvent(); +} + +/** + * Remove an event handler. + * + * @param eventHandler The event handler to remove. + */ + +void CListData::removeListDataEventHandler(IListDataEventHandler *eventHandler) +{ + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + if (m_listDataEventhandlers.at(i) == eventHandler) + { + m_listDataEventhandlers.erase(i); + return; + } + } +} + +/** + * Quick sort the items using their compareTo() methods. + * + * @param start The index to start sorting at. + * @param end The index to stop sorting at. + */ + +void CListData::quickSort(const int start, const int end) +{ + if (end > start) + { + int left = start; + int right = end; + + CListDataItem *pivot = m_items[(start + end) >> 1]; + + do + { + while ((pivot->compareTo(m_items[left]) > 0) && (left < end)) + { + left++; + } + + while ((pivot->compareTo(m_items[right]) < 0) && (right > start)) + { + right--; + } + + if (left > right) + { + break; + } + + swapItems(left, right); + left++; + right--; + } + while (left <= right); + + quickSort(start, right); + quickSort(left, end); + } +} + +/** + * Swap the locations of two items in the array. + * + * @param index1 The index of the first item to swap. + * @param index2 The index of the second item to swap. + */ + +void CListData::swapItems(const int index1, const int index2) +{ + CListDataItem *tmp = m_items[index1]; + m_items[index1] = m_items[index2]; + m_items[index2] = tmp; +} + +/** + * Return the index that an item should be inserted at to maintain a sorted list of data. + * + * @param item The item to insert. + * @return The index that the item should be imserted into at. + */ + +const int CListData::getSortedInsertionIndex(const CListDataItem *item) const +{ + int i = 0; + + // Locate slot where new option should go + + while ((i < m_items.size()) && (item->compareTo(m_items[i]) > 0)) + { + i++; + } + return i; +} + +/** + * Raise a data changed event. + */ + +void CListData::raiseDataChangedEvent(void) +{ + CListDataEventArgs eventArgs(this); + + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + m_listDataEventhandlers.at(i)->handleListDataChangedEvent(eventArgs); + } +} + +/** + * Raise a selection changed event. + */ + +void CListData::raiseSelectionChangedEvent(void) +{ + CListDataEventArgs eventArgs(this); + + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + m_listDataEventhandlers.at(i)->handleListDataSelectionChangedEvent(eventArgs); + } +} diff --git a/libnxwidgets/src/clistdataitem.cxx b/libnxwidgets/src/clistdataitem.cxx new file mode 100644 index 000000000..036cea61e --- /dev/null +++ b/libnxwidgets/src/clistdataitem.cxx @@ -0,0 +1,128 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistdataitem.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "clistdataitem.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; +/** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + */ + +CListDataItem::CListDataItem(const CNxString &text, const uint32_t value) +{ + m_text = text; + m_value = value; + m_isSelected = false; +} + +/** + * Destructor. + */ + +CListDataItem::~CListDataItem(void) +{ +} + +/** + * Compare the item with another. Comparison is based on the text of + * the item. Returns 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + * + * @param item An item to compare this object with. + * @return 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + */ + +int CListDataItem::compareTo(const CListDataItem *item) const +{ + return m_text.compareTo(item->getText()); +} diff --git a/libnxwidgets/src/cmultilinetextbox.cxx b/libnxwidgets/src/cmultilinetextbox.cxx new file mode 100644 index 000000000..94caac5fd --- /dev/null +++ b/libnxwidgets/src/cmultilinetextbox.cxx @@ -0,0 +1,1284 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cmultilinetextbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cnxfont.hxx" +#include "ctext.hxx" +#include "cgraphicsport.hxx" +#include "singletons.hxx" +#include "cstringiterator.hxx" +#include "cnxtimer.hxx" +#include "cmultilinetextbox.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param flags Standard widget flag options. + * @param maxRows The maximum number of rows the textbox can track. Adding + * text beyond this number will cause rows at the start of the text to be + * forgotten; text is essentially stored as a queue, and adding to the back + * of a full queue causes the front items to be popped off. Setting this to + * 0 will make the textbox track only the visible rows. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CMultiLineTextBox::CMultiLineTextBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, uint32_t flags, + nxgl_coord_t maxRows, CWidgetStyle *style) +: CScrollingPanel(pWidgetControl, x, y, width, height, flags, style) +{ + m_hAlignment = TEXT_ALIGNMENT_HORIZ_CENTER; + m_vAlignment = TEXT_ALIGNMENT_VERT_CENTER; + m_topRow = 0; + + // The border is one line thick + + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; + + CRect rect; + getClientRect(rect); + m_text = new CText(getFont(), "", rect.getWidth()); + m_canvasWidth = rect.getWidth(); + + m_flags.draggable = true; + m_flags.doubleClickable = true; + m_maxRows = maxRows; + + calculateVisibleRows(); + + // Set maximum rows if value not set + + if (m_maxRows == 0) + { + m_maxRows = m_visibleRows + 1; + } + + m_cursorPos = 0; + m_showCursor = SHOW_CURSOR_NEVER; + m_wrapCursor = false; + + setText(text); +} + +/** + * Set the horizontal alignment of text within the textbox. + * + * @param alignment The horizontal position of the text. + */ + +void CMultiLineTextBox::setTextAlignmentHoriz(TextAlignmentHoriz alignment) +{ + m_hAlignment = alignment; + redraw(); +} + +/** + * Set the vertical alignment of text within the textbox. + * + * @param alignment The vertical position of the text. + */ + +void CMultiLineTextBox::setTextAlignmentVert(TextAlignmentVert alignment) +{ + m_vAlignment = alignment; + redraw(); +} + +/** + * Returns the number of "pages" that the text spans. A page + * is defined as the amount of text that can be displayed within + * the textbox at one time. + * + * @return The page count. + */ + +const int CMultiLineTextBox::getPageCount(void) const +{ + if (m_visibleRows > 0) + { + return (m_text->getLineCount() / m_visibleRows) + 1; + } + else + { + return 1; + } +} + +/** + * Returns the current page. + * + * @return The current page. + * @see getPageCount(). + */ + +const int CMultiLineTextBox::getCurrentPage(void) const +{ + // Calculate the top line of text + + int topRow = -m_canvasY / m_text->getLineHeight(); + + // Return the page on which the top row falls + + if (m_visibleRows > 0) + { + return topRow / m_visibleRows; + } + else + { + return 1; + } +} + +/** + * Set the text displayed in the textbox. + * + * @param text String to display. + */ + +void CMultiLineTextBox::setText(const CNxString &text) +{ + bool drawingEnabled = m_flags.drawingEnabled; + disableDrawing(); + + m_text->setText(text); + + cullTopLines(); + limitCanvasHeight(); + jumpToTextBottom(); + + if (drawingEnabled) + { + enableDrawing(); + } + redraw(); + + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Append new text to the end of the current text + * displayed in the textbox. + * + * @param text String to append. + */ + +void CMultiLineTextBox::appendText(const CNxString &text) +{ + bool drawingEnabled = m_flags.drawingEnabled; + disableDrawing(); + + m_text->append(text); + + cullTopLines(); + limitCanvasHeight(); + jumpToTextBottom(); + + if (drawingEnabled) + { + enableDrawing(); + } + redraw(); + + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + +void CMultiLineTextBox::removeText(const unsigned int startIndex) +{ + removeText(startIndex, m_text->getLength() - startIndex); +} + +/** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + +void CMultiLineTextBox::removeText(const unsigned int startIndex, + const unsigned int count) +{ + bool drawingEnabled = m_flags.drawingEnabled; + disableDrawing(); + + m_text->remove(startIndex, count); + + limitCanvasHeight(); + limitCanvasY(); + + moveCursorToPosition(startIndex); + + if (drawingEnabled) + { + enableDrawing(); + } + redraw(); + + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + +void CMultiLineTextBox::setFont(CNxFont *font) +{ + bool drawingEnabled = m_flags.drawingEnabled; + disableDrawing(); + + m_style.font = font; + m_text->setFont(font); + + cullTopLines(); + limitCanvasHeight(); + limitCanvasY(); + + if (drawingEnabled) + { + enableDrawing(); + } + redraw(); + + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Get the length of the text string. + * + * @return The length of the text string. + */ + +const int CMultiLineTextBox::getTextLength(void) const +{ + return m_text->getLength(); +} + +/** + * Sets the cursor display mode. + * + * @param cursorMode Determines cursor display mode + */ + +void CMultiLineTextBox::showCursor(EShowCursor cursorMode) +{ + if (m_showCursor != cursorMode) + { + m_showCursor = (uint8_t)cursorMode; + redraw(); + } +} + +/** + * Move the cursor to the text position specified. 0 indicates the start + * of the string. If position is greater than the length of the string, + * the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + +void CMultiLineTextBox::moveCursorToPosition(const int position) +{ + CGraphicsPort *port = m_widgetControl->getGraphicsPort(); + + // Erase existing cursor + + drawCursor(port); + + // Force position to within confines of string + + if (position < 0) + { + m_cursorPos = 0; + } + else + { + int len = (int)m_text->getLength(); + m_cursorPos = len > position ? position : len; + } + + // Draw cursor in new position + + drawCursor(port); +} + +/** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + +void CMultiLineTextBox::insertText(const CNxString &text, + const unsigned int index) +{ + bool drawingEnabled = m_flags.drawingEnabled; + disableDrawing(); + + m_text->insert(text, index); + + cullTopLines(); + limitCanvasHeight(); + + moveCursorToPosition(index + text.getLength()); + + if (drawingEnabled) + { + enableDrawing(); + } + redraw(); + + m_widgetEventHandlers->raiseValueChangeEvent(); +} + +/** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + +void CMultiLineTextBox::insertTextAtCursor(const CNxString &text) +{ + insertText(text, getCursorPosition()); +} + +/** + * Handle a keyboard press event. + * + * @param e The event data. + */ + +void CMultiLineTextBox::handleKeyPressEvent(const CWidgetEventArgs &e) +{ + nxwidget_char_t key = e.getKey(); + + if (key == KEY_CODE_BACKSPACE) + { + // Delete character in front of cursor + + if (m_cursorPos > 0) + { + removeText(m_cursorPos - 1, 1); + } + } + else if (key != KEY_CODE_NONE) + { + // Not modifier; append value + + insertTextAtCursor(key); + } +} + +/** + * Get the coordinates of the cursor relative to the text. + * + * @param x Will be populated with the x coordinate of the cursor. + * @param y Will be populated with the y coordinate of the cursor. + */ + +void CMultiLineTextBox::getCursorCoordinates(nxgl_coord_t &x, nxgl_coord_t &y) const +{ + unsigned int cursorRow = 0; + + x = 0; + y = 0; + + // Only calculate the cursor position if the cursor isn't at the start + // of the text + + if (m_cursorPos > 0) + { + // Calculate the row in which the cursor appears + + cursorRow = m_text->getLineContainingCharIndex(m_cursorPos); + + // Cursor line offset gives us the distance of the cursor from the + // start of the line + + uint8_t cursorLineOffset = m_cursorPos - m_text->getLineStartIndex(cursorRow); + + CStringIterator *iterator = m_text->newStringIterator(); + iterator->moveTo(m_text->getLineStartIndex(cursorRow)); + + // Sum the width of each char in the row to find the x coordinate + + for (int i = 0; i < cursorLineOffset; ++i) + { + x += getFont()->getCharWidth(iterator->getChar()); + iterator->moveToNext(); + } + + delete iterator; + } + + // Add offset of row to calculated value + + x += getRowX(cursorRow); + + // Calculate y coordinate of the cursor + + y = getRowY(cursorRow); +} + +/** + * Gets the index of the character at the specified x coordinate in the + * specified row. + * + * @param x X coordinate of the character. + * @param rowIndex Index of the row containing the character. + * @return The index of the character at the specified coordinate. + */ + +int CMultiLineTextBox::getCharIndexAtCoordinate(nxgl_coord_t x, int rowIndex) const +{ + // Locate the character within the row + + int startIndex = m_text->getLineStartIndex(rowIndex); + int stopIndex = m_text->getLineLength(rowIndex); + int width = getRowX(rowIndex); + int index = -1; + + CStringIterator *iterator = m_text->newStringIterator(); + iterator->moveTo(startIndex); + + width += m_text->getFont()->getCharWidth(iterator->getChar()); + + for (int i = 0; i < stopIndex; ++i) + { + if (width > x) + { + if (i == 0) + { + // If the coordinate is on the left of the text, we add nothing + // to the index + + index = startIndex; + } + else + { + // Character within the row. + // This is the character that contains the coordinate. + + index = startIndex + i; + } + break; + } + + iterator->moveToNext(); + width += m_text->getFont()->getCharWidth(iterator->getChar()); + } + + delete iterator; + + // If the coordinate is past the last character, index will still be -1. + // We need to set it to the last character + + if (index == -1) + { + if (rowIndex == m_text->getLineCount() - 1) + { + // Index past the end point of the text, so return an index + // just past the text + + index = startIndex + stopIndex; + } + else + { + // Index at the end of a row, so return the last index of the + // row + + index = startIndex + stopIndex - 1; + } + } + + return index; +} + +/** + * Get the index of the character at the specified coordinates. + * + * @param x X coordinate of the character. + * @param y Y coordinate of the character. + * @return The index of the character at the specified coordinates. + */ + +unsigned int +CMultiLineTextBox::getCharIndexAtCoordinates(nxgl_coord_t x, nxgl_coord_t y) const +{ + int rowIndex = getRowContainingCoordinate(y); + return getCharIndexAtCoordinate(x, rowIndex); +} + +/** + * Get the row containing the specified Y coordinate. + * + * @param y Y coordinate to locate. + * @return The index of the row containing the specified Y coordinate. + */ + +int CMultiLineTextBox::getRowContainingCoordinate(nxgl_coord_t y) const +{ + int row = -1; + + // Locate the row containing the character + + for (int i = 0; i < m_text->getLineCount(); ++i) + { + // Abort search if we've found the row below the y coordinate + + if (getRowY(i) > y) + { + if (i == 0) + { + // If the coordinate is above the text, we return the top + // row + + row = 0; + } + else + { + // Row within the text, so return the previous row - this is + // the row that contains the coordinate. + + row = i - 1; + } + + break; + } + } + + // If the coordinate is below the text, row will still be -1. + // We need to set it to the last row + + if (row == -1) + { + row = m_text->getLineCount() - 1; + } + + return row; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CMultiLineTextBox::drawContents(CGraphicsPort *port) +{ + drawText(port); + + // Draw the cursor + + drawCursor(port); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CMultiLineTextBox::drawBorder(CGraphicsPort *port) +{ + port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); + + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(0, 0, getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Move cursor one character to the left. + */ + +void CMultiLineTextBox::moveCursorLeft(void) +{ + if (m_cursorPos > 0) + { + moveCursorToPosition(m_cursorPos - 1); + } + + jumpToCursor(); +} + +/** + * Move cursor one character to the right. + */ + +void CMultiLineTextBox::moveCursorRight(void) +{ + if (m_cursorPos < (int)m_text->getLength()) + { + moveCursorToPosition(m_cursorPos + 1); + } + + jumpToCursor(); +} + +/** + * Move cursor one row upwards. + */ + +void CMultiLineTextBox::moveCursorUp(void) +{ + nxgl_coord_t cursorX = 0; + nxgl_coord_t cursorY = 0; + + getCursorCoordinates(cursorX, cursorY); + + // Get the midpoint of the cursor. We use the midpoint to ensure that + // the cursor does not drift off to the left as it moves up the text, which + // is a problem when we use the left edge as the reference point when the + // font is proportional + + cursorX += m_text->getFont()->getCharWidth(m_text->getCharAt(m_cursorPos)) >> 1; + + // Locate the character above the midpoint + + int index = getCharIndexAtCoordinates(cursorX, cursorY + m_text->getLineHeight()); + moveCursorToPosition(index); + jumpToCursor(); +} + +/** + * Move cursor one row downwards. + */ + +void CMultiLineTextBox::moveCursorDown(void) +{ + nxgl_coord_t cursorX = 0; + nxgl_coord_t cursorY = 0; + + getCursorCoordinates(cursorX, cursorY); + + // Get the midpoint of the cursor. We use the midpoint to ensure that + // the cursor does not drift off to the left as it moves up the text, which + // is a problem when we use the left edge as the reference point when the + // font is proportional + + cursorX += m_text->getFont()->getCharWidth(m_text->getCharAt(m_cursorPos)) >> 1; + + // Locate the character above the midpoint + + int index = getCharIndexAtCoordinates(cursorX, cursorY - m_text->getLineHeight()); + moveCursorToPosition(index); + jumpToCursor(); +} + +/** + * Ensures that the textbox only contains the maximum allowed + * number of rows by culling any excess rows from the top of + * the text. + * + * @return True if lines were removed from the text; false if not. + */ + +bool CMultiLineTextBox::cullTopLines(void) +{ + // Ensure that we have the correct number of rows + + if (m_text->getLineCount() > m_maxRows) + { + m_text->stripTopLines(m_text->getLineCount() - m_maxRows); + return true; + } + + return false; +} + +/** + * Ensures that the canvas height is the height of the widget, + * if the widget exceeds the size of the text, or the height of + * the text if the text exceeds the size of the widget. + */ + +void CMultiLineTextBox::limitCanvasHeight(void) +{ + m_canvasHeight = m_text->getPixelHeight(); + + CRect rect; + getClientRect(rect); + if (m_canvasHeight < rect.getHeight()) + { + m_canvasHeight = rect.getHeight(); + } +} + +/** + * Ensures that the canvas cannot scroll beyond its height. + */ + +void CMultiLineTextBox::limitCanvasY(void) +{ + CRect rect; + getClientRect(rect); + + // Ensure that the visible portion of the canvas is not less than the + // height of the viewer window + + if (m_canvasY + m_canvasHeight < rect.getHeight()) + { + jumpToTextBottom(); + } +} + +/** + * Jumps to the cursor coordinates of the text. + */ + +void CMultiLineTextBox::jumpToCursor(void) +{ + // Get the co-odinates of the cursor + + nxgl_coord_t cursorX; + nxgl_coord_t cursorY; + + getCursorCoordinates(cursorX, cursorY); + + // Work out which row the cursor falls within + + int cursorRow = m_text->getLineContainingCharIndex(m_cursorPos); + nxgl_coord_t rowY = getRowY(cursorRow); + + // If the cursor is outside the visible portion of the canvas, jump to it + + CRect rect; + getClientRect(rect); + + if (rowY + m_text->getLineHeight() + m_canvasY > rect.getHeight()) + { + // Cursor is below the visible portion of the canvas, so + // jump down so that the cursor's row is the bottom row of + // text + + jump(0, -(rowY + m_text->getLineHeight() - rect.getHeight())); + } + else if (rowY + m_canvasY < 0) + { + // Cursor is above the visible portion of the canvas, so + // jump up so that the cursor's row is the top row of text + + jump(0, -cursorY); + } +} + +/** + * Jumps to the bottom of the text. + */ + +void CMultiLineTextBox::jumpToTextBottom(void) +{ + CRect rect; + getClientRect(rect); + jump(0, -(m_canvasHeight - rect.getHeight())); +} + +/** + * Resize the textbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CMultiLineTextBox::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Ensure the base class resize method is called + + CScrollingPanel::onResize(width, height); + + // Resize the canvas' width + + CRect rect; + getClientRect(rect); + + m_canvasWidth = rect.getWidth(); + m_canvasHeight = rect.getHeight(); + m_canvasX = 0; + m_canvasY = 0; + + calculateVisibleRows(); + + // Re-wrap the text + + m_text->setWidth(getWidth()); + m_text->wrap(); + + bool raiseEvent = cullTopLines(); + limitCanvasHeight(); + limitCanvasY(); + + if (raiseEvent) + { + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CMultiLineTextBox::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + startDragging(x, y); + + // Move cursor to clicked coordinates + + CRect rect; + getClientRect(rect); + + // Adjust x and y from screen coordinates to canvas coordinates + + nxgl_coord_t canvasRelativeX = x - getX() - rect.getX() - m_canvasX; + nxgl_coord_t canvasRelativeY = y - getY() - rect.getY() - m_canvasY; + + moveCursorToPosition(getCharIndexAtCoordinates(canvasRelativeX, canvasRelativeY)); +} + +/** + * Opens the keyboard on the bottom display. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + +void CMultiLineTextBox::onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ +} + +/** + * Handles cursor control events. Moves the cursor + * in the direction selected. + * + * @param key The key that was pressed. + */ + +void CMultiLineTextBox::handleCursorControlEvent(const CWidgetEventArgs &e) +{ + ECursorControl control = e.getCursorControl(); + + switch (control) + { + case CURSOR_LEFT: + moveCursorLeft(); + break; + + case CURSOR_RIGHT: + moveCursorRight(); + break; + + case CURSOR_UP: + moveCursorDown(); + break; + + case CURSOR_DOWN: + moveCursorUp(); + break; + + default: + // Not interested in other controls + + break; + } +} + +/** + * Handle a keyboard press event. + * + * @param e The event data. + */ + + void handleKeyPressEvent(const CWidgetEventArgs &e); + +/** + * Gets the x position of a row of text based on the width of the row and the + * type of horizontal alignment currently set. + * + * @param row The index of the row. + * @return The x coordinate of the row. + */ + +nxgl_coord_t CMultiLineTextBox::getRowX(int row) const +{ + CRect rect; + getClientRect(rect); + + uint8_t rowLength = m_text->getLineTrimmedLength(row); + uint8_t rowPixelWidth = m_text->getFont()->getStringWidth(*m_text, m_text->getLineStartIndex(row), rowLength); + + // Calculate horizontal position + + switch (m_hAlignment) + { + case TEXT_ALIGNMENT_HORIZ_CENTER: + return (rect.getWidth() - rowPixelWidth) >> 1; + + case TEXT_ALIGNMENT_HORIZ_LEFT: + return 0; + + case TEXT_ALIGNMENT_HORIZ_RIGHT: + return rect.getWidth() - rowPixelWidth; + } + + // Will never be reached + + return 0; +} + +/** + * Gets the y position of the specified row of text based on the type of + * vertical alignment currently set. + * + * @param row The row number to find the y coordinate of. + * @return The y coordinate of the specified row of text. + */ + +nxgl_coord_t CMultiLineTextBox::getRowY(int row) const +{ + // If the amount of text exceeds the size of the widget, force + // the text to be top-aligned + + if (m_visibleRows <= m_text->getLineCount()) + { + return row * m_text->getLineHeight(); + } + + // All text falls within the textbox, so obey the alignment + // options + + nxgl_coord_t textY = 0; + nxgl_coord_t startPos = 0; + + int canvasRows = 0; + int textRows = 0; + + CRect rect; + getClientRect(rect); + + // Calculate vertical position + + switch (m_vAlignment) + { + case TEXT_ALIGNMENT_VERT_CENTER: + + // Calculate the maximum number of rows + + canvasRows = m_canvasHeight / m_text->getLineHeight(); + textY = row * m_text->getLineHeight(); + + // Get the number of rows of text + + textRows = m_text->getLineCount(); + + // Ensure there's always one row + + if (textRows == 0) + { + textRows = 1; + } + + // Calculate the start position of the block of text + + startPos = ((canvasRows - textRows) * m_text->getLineHeight()) >> 1; + + // Calculate the row Y coordinate + + textY = startPos + textY; + break; + + case TEXT_ALIGNMENT_VERT_TOP: + textY = row * m_text->getLineHeight(); + break; + + case TEXT_ALIGNMENT_VERT_BOTTOM: + textY = rect.getHeight() - (((m_text->getLineCount() - row) * m_text->getLineHeight())); + break; + } + + return textY; +} + +/** + * Return true if the cursor is visible + */ + +bool CMultiLineTextBox::isCursorVisible(void) const +{ + return (m_showCursor == SHOW_CURSOR_ALWAYS || + (m_showCursor == SHOW_CURSOR_ONFOCUS && hasFocus())); +} + +/** + * Gets the character under the cursor. + * + * @return The character under the cursor. + */ + +nxwidget_char_t CMultiLineTextBox::getCursorChar(void) const +{ + if (m_cursorPos < m_text->getLength()) + { + return m_text->getCharAt(m_cursorPos); + } + else + { + return ' '; + } +} + +/** + * Works out the number of visible rows within the textbox. + */ + +void CMultiLineTextBox::calculateVisibleRows(void) +{ + CRect rect; + getClientRect(rect); + + m_visibleRows = rect.getHeight() / m_text->getLineHeight(); +} + +/** + * Draws text. + * + * @param port The CGraphicsPort to draw to. + */ + +void CMultiLineTextBox::drawText(CGraphicsPort *port) +{ + // Early exit if there is no text to display + + if (m_text->getLineCount() == 0) + { + return; + } + + // Determine the top and bottom rows within the graphicsport's clip rect. + // We only draw these rows in order to increase the speed of the routine. + + int regionY = -m_canvasY + m_rect.getY(); // Y coord of canvas visible region + int topRow = getRowContainingCoordinate(regionY); + int bottomRow = getRowContainingCoordinate(regionY + m_rect.getHeight()); + + // Early exit checks + + if ((topRow < 0) && (bottomRow < 0)) + { + return; + } + + if ((bottomRow >= m_text->getLineCount()) && (topRow >= m_text->getLineCount())) + { + return; + } + + // Prevent overflows + + if (topRow < 0) + { + topRow = 0; + } + + if (bottomRow >= m_text->getLineCount()) + { + bottomRow = m_text->getLineCount() - 1; + } + + // Draw lines of text + + int currentRow = topRow; + + // Draw all rows in this region + + while (currentRow <= bottomRow) + { + drawRow(port, currentRow); + currentRow++; + } +} + +/** + * Draws the cursor. + * + * @param port The CGraphicsPort to draw to. + */ + +void CMultiLineTextBox::drawCursor(CGraphicsPort *port) +{ + // Get the cursor coordinates + + if (isCursorVisible()) + { + nxgl_coord_t cursorX = 0; + nxgl_coord_t cursorY = 0; + + getCursorCoordinates(cursorX, cursorY); + + // Adjust for canvas offsets + + cursorX += m_canvasX; + cursorY += m_canvasY; + + // Draw cursor + + port->invert(cursorX, cursorY, + m_text->getFont()->getCharWidth( getCursorChar()), + m_text->getFont()->getHeight()); + } +} + +/** + * Draws a single line of text. + * + * @param port The CGraphicsPort to draw to. + * @param row The index of the row to draw. + */ + +void CMultiLineTextBox::drawRow(CGraphicsPort *port, int row) +{ + // Get the drawing region + + CRect rect; + getRect(rect); + + uint8_t rowLength = m_text->getLineTrimmedLength(row); + + struct nxgl_point_s pos; + pos.x = getRowX(row) + m_canvasX; + pos.y = getRowY(row) + m_canvasY; + + // Determine the background and text color + + nxgl_mxpixel_t textColor; + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + } + else + { + textColor = getEnabledTextColor(); + } + + // And draw the text using the selected color + + port->drawText(&pos, &rect, m_text->getFont(), *m_text, + m_text->getLineStartIndex(row), rowLength, textColor); +} diff --git a/libnxwidgets/src/cnxfont.cxx b/libnxwidgets/src/cnxfont.cxx new file mode 100644 index 000000000..189cfb9e0 --- /dev/null +++ b/libnxwidgets/src/cnxfont.cxx @@ -0,0 +1,276 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxfont.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cnxstring.hxx" +#include "cstringiterator.hxx" +#include "cnxfont.hxx" +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CNxFont Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * CNxFont Constructor. + * + * @param fontid The font ID to use. + * @param fontColor The font color to use. + * @param transparentColor The color in the font bitmap used as the + * background color. + */ + +CNxFont::CNxFont(enum nx_fontid_e fontid, nxgl_mxpixel_t fontColor, + nxgl_mxpixel_t transparentColor) +{ + m_fontId = fontid; + m_fontHandle = nxf_getfonthandle(fontid); + m_pFontSet = nxf_getfontset(m_fontHandle); + m_fontColor = fontColor; + m_transparentColor = transparentColor; +} + +/** + * Checks if supplied character is blank in the current font. + * + * @param letter The character to check. + * @return True if the glyph contains any pixels to be drawn. False if + * the glyph is blank. + */ + +const bool CNxFont::isCharBlank(const nxwidget_char_t letter) const +{ + FAR const struct nx_fontbitmap_s *fbm; + + /* Get the bitmap associated with the character */ + + fbm = nxf_getbitmap(m_fontHandle, (uint16_t)letter); + return (fbm == NULL); +} + +/** + * Draw an individual character of the font to the specified bitmap. + * + * @param bitmap The bitmap to draw use. The caller should use + * the getFontMetrics method to assure that the buffer will hold + * the font. + * @param letter The character to output. + * + * @return The width of the string in pixels. + */ + +void CNxFont::drawChar(FAR SBitmap *bitmap, nxwidget_char_t letter) +{ + // Get the NX bitmap associated with the font + + FAR const struct nx_fontbitmap_s *fbm; + fbm = nxf_getbitmap(m_fontHandle, letter); + if (fbm) + { + // Get information about the font bitmap + + uint8_t fwidth = fbm->metric.width + fbm->metric.xoffset; + uint8_t fheight = fbm->metric.height + fbm->metric.yoffset; + uint8_t fstride = (fwidth * bitmap->bpp + 7) >> 3; + + // Then render the glyph into the bitmap memory + + (void)FONT_RENDERER((FAR nxgl_mxpixel_t*)bitmap->data, fheight, + fwidth, fstride, fbm, m_fontColor); + } +} + +/** + * Get the width of a string in pixels when drawn with this font. + * + * @param text The string to check. + * @return The width of the string in pixels. + */ + +nxgl_coord_t CNxFont::getStringWidth(const CNxString &text) const +{ + CStringIterator *iter = text.newStringIterator(); + + // Get the width of the string of characters + // Move to the first character + + unsigned int width = 0; + if (iter->moveToFirst()) + { + // moveToFirst returns true if there is at least one character + + do + { + // Add the width of the font bitmap for this character and + // move the the next character + + nxwidget_char_t ch = iter->getChar(); + + width += getCharWidth(ch); + } + while (iter->moveToNext()); + } + + // Return the total width + + delete iter; + return width; +} + +/** + * Get the width of a portion of a string in pixels when drawn with this + * font. + * + * @param text The string to check. + * @param startIndex The start point of the substring within the string. + * @param length The length of the substring in chars. + * @return The width of the substring in pixels. + */ + +nxgl_coord_t CNxFont::getStringWidth(const CNxString &text, + int startIndex, int length) const +{ + CStringIterator *iter = text.newStringIterator(); + + // Get the width of the string of characters + + iter->moveTo(startIndex); + unsigned int width = 0; + + while (length-- > 0) + { + // Add the width of the font bitmap for this character + + nxwidget_char_t ch = iter->getChar(); + width += getCharWidth(ch); + + // Position to the next character in the string + + if (!iter->moveToNext()) + { + break; + } + } + + // Return the total width + + delete iter; + return width; +} + +/** + * Gets font metrics for a particular character + * + * @param letter The character to get the width of. + * @param metrics The location to return the font metrics + */ + +void CNxFont::getCharMetrics(nxwidget_char_t letter, + FAR struct nx_fontmetric_s *metrics) const +{ + FAR const struct nx_fontbitmap_s *fbm; + + // Get the font bitmap for this character + + fbm = nxf_getbitmap(m_fontHandle, letter); + if (fbm) + { + // Return the metrics of the font + + memcpy(metrics, &fbm->metric, sizeof(struct nx_fontmetric_s)); + } + else + { + // Use the metrics of a space which has no width and no height + // but an xoffset equal to the standard width of a space. + + metrics->stride = (m_pFontSet->spwidth * CONFIG_NXWIDGETS_BPP + 7) >> 3; + metrics->width = 0; + metrics->height = 0; + metrics->xoffset = m_pFontSet->spwidth; + metrics->yoffset = 0; + } +} + +/** + * Get the width of an individual character. + * + * @param letter The character to get the width of. + * @return The width of the character in pixels. + */ + +nxgl_coord_t CNxFont::getCharWidth(nxwidget_char_t letter) const +{ + FAR const struct nx_fontbitmap_s *fbm; + nxgl_coord_t width; + + /* Get the font bitmap for this character */ + + fbm = nxf_getbitmap(m_fontHandle, letter); + if (fbm) + { + /* Return the width of the font -- including the X offset */ + + width = fbm->metric.width + fbm->metric.xoffset; + } + else + { + /* Use the width of a space */ + + width = m_pFontSet->spwidth; + } + + return width; +} diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx new file mode 100644 index 000000000..2f36b0f2d --- /dev/null +++ b/libnxwidgets/src/cnxserver.cxx @@ -0,0 +1,386 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxserver.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#ifdef CONFIG_NX_MULTIUSER +# include +# include +#endif + +#include "nxconfig.hxx" +#include "singletons.hxx" +#include "cnxserver.hxx" + +/**************************************************************************** + * Static Data Members + ****************************************************************************/ + +using namespace NXWidgets; + +uint8_t CNxServer::m_nServers; /**< The number of NX server instances */ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +/** + * CNXServer constructor + */ + +CNxServer::CNxServer(void) +{ + // Initialize server instance state data + + m_hDevice = (FAR NX_DRIVERTYPE *)NULL; // LCD/Framebuffer device handle + m_hNxServer = (NXHANDLE)NULL; // NX server handle +#ifdef CONFIG_NX_MULTIUSER + m_connected = false; // True: Connected to the server + sem_init(&m_connsem, 0, 0); // Wait for server connection +#endif + + // Increment the global count of NX servers. Normally there is only one + // but we don't want to preclude the case where there might be multiple + // displays, each with its own NX server instance + + m_nServers++; + + // Create miscellaneous singleton instances. Why is this done here? + // Because this needs to be done once before any widgets are created and we + // don't want to rely on static constructors. + + instantiateSingletons(); +} + +/** + * CNXServer destructor + */ + +CNxServer::~CNxServer(void) +{ + // Disconnect from the server + + disconnect(); + + // Decrement the count of NX servers. When that count goes to zero, + // delete all of the fake static instances + + if (--m_nServers == 0) + { + freeSingletons(); + } +} + +/** + * Connect to the NX Server -- Single user version + */ + +#ifndef CONFIG_NX_MULTIUSER +bool CNxServer::connect(void) +{ +#if defined(SCREENS_EXTERNINIT) + // Use external graphics driver initialization + + m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); + if (!m_hDevice) + { + gdbg("up_nxdrvinit failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + return false; + } + +#elif defined(CONFIG_NX_LCDDRIVER) + int ret; + + // Initialize the LCD device + + ret = up_lcdinitialize(); + if (ret < 0) + { + gdbg("up_lcdinitialize failed: %d\n", -ret); + return false; + } + + // Get the device instance + + m_hDevice = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO); + if (!m_hDevice) + { + gdbg("up_lcdgetdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + return false; + } + + // Turn the LCD on at 75% power + + (void)m_hDevice->setpower(m_hDevice, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); +#else + int ret; + + // Initialize the frame buffer device + + ret = up_fbinitialize(); + if (ret < 0) + { + gdbg("up_fbinitialize failed: %d\n", -ret); + return false; + } + + m_hDevice = up_fbgetvplane(CONFIG_NXWIDGETS_VPLANE); + if (!m_hDevice) + { + gdbg("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", + CONFIG_NXWIDGETS_VPLANE); + return false; + } +#endif + + // Then open NX + + m_hNxServer = nx_open(m_hDevice); + if (!m_hNxServer) + { + gdbg("CNxServer::connect: nx_open failed: %d\n", errno); + return false; + } + + return true; +} +#endif + +/** + * Connect to the NX Server -- Multi user version + */ + +#ifdef CONFIG_NX_MULTIUSER +bool CNxServer::connect(void) +{ + struct sched_param param; + pthread_t thread; + pid_t serverId; + int ret; + + // Set the client task priority + + param.sched_priority = CONFIG_NXWIDGETS_CLIENTPRIO; + ret = sched_setparam(0, ¶m); + if (ret < 0) + { + gdbg("CNxServer::connect: sched_setparam failed: %d\n" , ret); + return false; + } + + // Start the server task + + message("NxServer::connect: Starting nx_servertask task\n"); + serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, + CONFIG_NXWIDGETS_STACKSIZE, nx_servertask, NULL); + if (serverId < 0) + { + message("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + return false; + } + + // Wait a bit to let the server get started + + sleep(1); + + // Connect to the server + + m_hNxServer = nx_connect(); + if (m_hNxServer) + { + pthread_attr_t attr; + + // Start a separate thread to listen for server events. This is probably + // the least efficient way to do this, but it makes this logic flow more + // smoothly. + + (void)pthread_attr_init(&attr); + param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; + (void)pthread_attr_setschedparam(&attr, ¶m); + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_STACKSIZE); + + m_stop = false; + m_running = true; + + ret = pthread_create(&thread, &attr, listener, (FAR void *)this); + if (ret != 0) + { + printf("NxServer::connect: pthread_create failed: %d\n", ret); + m_running = false; + disconnect(); + return false; + } + + // Don't return until we are connected to the server + + while (!m_connected && m_running) + { + // Wait for the listener thread to wake us up when we really + // are connected. + + (void)sem_wait(&m_connsem); + } + + // In the successful case, the listener is still running (m_running) + // and the server is connected (m_connected). Anything else is a failure. + + if (!m_connected !! !m_running) + { + disconnect(); + return false; + } + } + else + { + gdbg("NxServer::connect: nx_connect failed: %d\n", errno); + return false; + } + + return true; +} +#endif + +/** + * Disconnect to the NX Server -- Single user version + */ + +#ifndef CONFIG_NX_MULTIUSER +void CNxServer::disconnect(void) +{ + /* Close the server */ + + if (m_hNxServer) + { + nx_close(m_hNxServer); + m_hNxServer = NULL; + } +} +#endif + +/** + * Disconnect to the NX Server -- Single user version + */ + +#ifdef CONFIG_NX_MULTIUSER +void CNxServer::disconnect(void) +{ + // Is the listener running? + // Hmm.. won't this hang is the listener is in a blocking call? + + while (m_running) + { + // Yes.. stop the listener thread + + m_stop = true; + while (m_running) + { + // Wait for the listener thread to stop + + (void)sem_wait(&m_connsem); + } + } + + /* Disconnect from the server */ + + if (m_hNxServer) + { + nx_disconnect(m_hNxServer); + m_hNxServer = NULL; + } +} +#endif + +/** + * This is the entry point of a thread that listeners for and dispatches + * events from the NX server. + */ + +#ifdef CONFIG_NX_MULTIUSER +FAR void *CNxServer::listener(FAR void *arg) +{ + // The argument must be the CNxServer instance + + CNxServer *This = (CNxServer*)pvArg; + + // Process events forever + + while (!This->m_stop) + { + // Handle the next event. If we were configured blocking, then + // we will stay right here until the next event is received. Since + // we have dedicated a while thread to servicing events, it would + // be most natural to also select CONFIG_NX_BLOCKING -- if not, the + // following would be a tight infinite loop (unless we added addition + // logic with nx_eventnotify and sigwait to pace it). + + int ret = nx_eventhandler(This->m_hNxServer); + if (ret < 0) + { + // An error occurred... assume that we have lost connection with + // the server. + + gdbg("CNxServer::listener: Lost server connection: %d\n", errno); + break; + } + + /* If we received a message, we must be connected */ + + if (!This->m_connected) + { + This->m_connected = true; + sem_post(&This->m_connsem); + gdbg("CNxServer::listener: Connected\n"); + } + } + + // We fall out of the loop when either (1) the server has died or + // we have been requested to stop + + This->m_running = false; + This->m_connected = false; + sem_post(&This->m_connsem); + return NULL; +} +#endif diff --git a/libnxwidgets/src/cnxstring.cxx b/libnxwidgets/src/cnxstring.cxx new file mode 100644 index 000000000..3ad3855b9 --- /dev/null +++ b/libnxwidgets/src/cnxstring.cxx @@ -0,0 +1,799 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxstring.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include "cnxstring.hxx" +#include "cstringiterator.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CNxString Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor to create an empty string object. + */ + +CNxString::CNxString() +{ + m_text = (FAR nxwidget_char_t *)NULL; + m_stringLength = 0; + m_allocatedSize = 0; + m_growAmount = 16; +} + +/** + * Constructor to create a string from a C character array. + * + * @param text Pointer to a char array to use as the basis of the + * string. + */ + +CNxString::CNxString(FAR const char *text) +{ + m_text = (FAR nxwidget_char_t *)NULL; + m_stringLength = 0; + m_allocatedSize = 0; + m_growAmount = 16; + + setText(text); +} + +/** + * Constructor to create a string from a single character. + * @param letter Single character to use as the basis of the string. + */ + +CNxString::CNxString(const nxwidget_char_t text) +{ + m_text = (FAR nxwidget_char_t *)NULL; + m_stringLength = 0; + m_allocatedSize = 0; + m_growAmount = 16; + + setText(text); +} + +CNxString::CNxString(const CNxString &string) +{ + m_text = (FAR nxwidget_char_t *)NULL; + m_stringLength = 0; + m_allocatedSize = 0; + m_growAmount = 16; + + setText(string); +} + +/** + * Creates and returns a new CCStringIterator object that will iterate + * over this string. The object must be manually deleted once it is + * no longer needed. + * + * @return A new CCStringIterator object. + */ + +CStringIterator *CNxString::newStringIterator() const +{ + return new CStringIterator(this); +} + +/** + * Copy the internal array to the supplied buffer. The buffer must be + * large enough to contain the full text in the string. The + * getByteCount() method can be used to obtain the length of the string. + * Unlike the CNxString class, the char array is null-terminated. + * The buffer must be (getByteCount() + 2) bytes long, in order to + * accommodate the terminator. + * + * @param buffer Buffer to copy the internal char array to. + */ + +void CNxString::copyToCharArray(FAR nxwidget_char_t *buffer) const +{ + unsigned int dataLength = sizeof(nxwidget_char_t) * m_stringLength; + memcpy(buffer, m_text, dataLength); + buffer[dataLength] = '\0'; +} + +/** + * Set the text in the string. + * + * @param text CNxString containing the new data for this string. + */ + +void CNxString::setText(const CNxString &text) +{ + // Ensure we've got enough memory available + + allocateMemory(text.getLength(), false); + + // Copy the text into the internal array + + memcpy(m_text, text.getCharArray(), sizeof(nxwidget_char_t) * text.getLength()); + + // Save size (in characters) of the string + + m_stringLength = text.getLength(); +} + +/** + * Set the 8-bit C-string text in the string. + * + * @param text Char array to use as the new data for this string. + */ + +void CNxString::setText(FAR const char *text) +{ + int length = strlen(text); + + // Ensure we've got enough memory available + + allocateMemory(length, false); + + // Copy characters into m_text, converting from 8- to 16-bit characters + // (if necessary) and cache the length + + for (int i = 0; i < length; i++) + { + m_text[i] = (nxwidget_char_t)text[i]; + } + + m_stringLength = length; +} + +/** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + +void CNxString::setText(FAR const nxwidget_char_t *text, int nchars) +{ + // Ensure we've got enough memory available + + allocateMemory(nchars, false); + + // Copy characters into m_text and cache the length + + m_stringLength = nchars; + memcpy(m_text, text, sizeof(nxwidget_char_t) * nchars); +} + +/** + * Set the text in the string. + * + * @param text Character to to use as the new data for this string. + */ + +void CNxString::setText(const nxwidget_char_t letter) +{ + // Ensure we've got enough memory available + + allocateMemory(1, false); + + // Copy the valid character into m_text and cache the length + + *m_text = letter; + m_stringLength = 1; +} + +/** + * Append text to the end of the string. + * + * @param text String to append. + */ + +void CNxString::append(const CNxString &text) +{ + // Ensure we've got enough memory available + + allocateMemory(m_stringLength + text.getLength(), true); + + // Append the new string to the end of the array + + FAR nxwidget_char_t *dest = &m_text[m_stringLength]; + FAR const nxwidget_char_t *src = text.getCharArray(); + for (int i = 0; i < text.getLength(); i++) + { + *dest++ = *src++; + } + + // Update the size in characters and the size in bytes + + m_stringLength += text.getLength(); +} + +/** + * Insert text at the specified character index. + * + * @param text The text to insert. + * @param index The index at which to insert the text. + */ + +void CNxString::insert(const CNxString &text, int index) +{ + // Early exit if the string is empty + + if (!hasData()) + { + CNxString::setText(text); + return; + } + + // Early exit if we're just appending + + if (index >= m_stringLength) + { + CNxString::append(text); + return; + } + + // Get the total size of the string that we need + + int newLength = m_stringLength + text.getLength(); + int newSize = newLength * sizeof(nxwidget_char_t); + + // Reallocate memory if the existing memory isn't large enough + + if (m_allocatedSize < newSize) + { + int allocLength = newLength + m_growAmount; + + // Allocate new string large enough to contain additional data + + FAR nxwidget_char_t *newText = new nxwidget_char_t[allocLength]; + + // Copy the start of the existing text to the newly allocated string + + FAR nxwidget_char_t *dest = newText; + FAR const nxwidget_char_t *src = m_text; + for (int i = 0; i < index; i++) + { + *dest++ = *src++; + } + + // Insert the additional text into the new string + + src = text.getCharArray(); + for (int i = 0; i < text.getLength(); i++) + { + *dest++ = *src++; + } + + // Copy the end of the existing text the the newly allocated string + + src = &m_text[index]; + for (int i = index; i < m_stringLength; i++) + { + *dest++ = *src++; + } + + m_allocatedSize = allocLength * sizeof(nxwidget_char_t); + + // Delete existing string + + delete[] m_text; + + // Swap pointers + + m_stringLength = newLength; + m_text = newText; + } + else + { + // Existing size is large enough, so make space in string for insert + + FAR nxwidget_char_t *dest = &m_text[newLength - 1]; + FAR const nxwidget_char_t *src = &m_text[m_stringLength - 1]; + for (int i = 0; i < m_stringLength - index; i++) + { + *dest-- = *src--; + } + + // Insert the additional text into the new string + + dest = &m_text[index]; + src = text.getCharArray(); + for (int i = 0; i < text.getLength(); i++) + { + *dest++ = *src++; + } + + m_stringLength = newLength; + } +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + +void CNxString::remove(const int startIndex) +{ + // Reject if requested operation makes no sense + + if (!hasData() || startIndex >= m_stringLength) + { + return; + } + + // Removing characters from the end of the string is trivial - simply + // decrease the length + + m_stringLength = startIndex; +} + +/** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + +void CNxString::remove(const int startIndex, const int count) +{ + // Reject if requested operation makes no sense + + if (!hasData() || startIndex >= m_stringLength) + { + return; + } + + // Don't remove in this way if the count includes the end of the string + + int endIndex = startIndex + count; + if (endIndex > m_stringLength) + { + remove(startIndex); + return; + } + + // Copy characters from a point after the area to be deleted into the space created + // by the deletion + + FAR nxwidget_char_t *dest = &m_text[startIndex]; + FAR const nxwidget_char_t *src = &m_text[endIndex]; + for (int i = m_stringLength - endIndex; i > 0; i--) + { + *dest++ = *src++; + } + + // Decrease length + + m_stringLength -= count; + +} + +/** + * Get the character at the specified index. This function is useful + * for finding the occasional character at an index, but for iterating + * over strings it is exceptionally slow. The newStringIterator() + * method should be used to retrieve an iterator object that can iterate + * over the string efficiently. + * + * @param index The index of the character to retrieve. + * @return The character at the specified index. + */ + +const nxwidget_char_t CNxString::getCharAt(int index) const +{ + return *getCharPointer(index); +} + +/** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. + * + * @param letter Letter to find. + * @return The index of the letter. + */ + +const int CNxString::indexOf(nxwidget_char_t letter) const +{ + return indexOf(letter, 0, getLength()); +} + +/** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * from "startIndex" until it has examined all subsequent letters. + * + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @return The index of the letter. + */ + +const int CNxString::indexOf(nxwidget_char_t letter, int startIndex) const +{ + return indexOf(letter, startIndex, getLength() - startIndex); +} + +/** + * Returns the first index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * from "startIndex" until it has examined all letters within the + * range "count". + * + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @param count The number of characters to examine. + * @return The index of the letter. + */ + +const int CNxString::indexOf(nxwidget_char_t letter, int startIndex, int count) const +{ + // Exit if no data available + + if (!hasData()) + { + return -1; + } + + int index = -1; + int charsExamined = 0; + + CStringIterator *iterator = new CStringIterator(this); + if (!iterator->moveTo(startIndex)) + { + delete iterator; + return -1; + } + + do + { + if (iterator->getChar() == letter) + { + index = iterator->getIndex(); + break; + } + + charsExamined++; + } + while (iterator->moveToNext() && (charsExamined < count)); + + delete iterator; + return index; +} + +/** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. + * + * @param letter Letter to find. + * @return The index of the letter. + */ + +const int CNxString::lastIndexOf(nxwidget_char_t letter) const +{ + return lastIndexOf(letter, getLength() - 1, getLength()); +} + +/** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * backwards from "startIndex" until it has examined all preceding + * letters within the string. + * + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @return The index of the letter. + */ + +const int CNxString::lastIndexOf(nxwidget_char_t letter, int startIndex) const +{ + return lastIndexOf(letter, startIndex, getLength() - (getLength() - startIndex)); +} + +/** + * Returns the last index of the specified letter within the string. + * Will return -1 if the letter is not found. Scans through the string + * backwards from "startIndex" until it has examined all letters within + * the range "count". + * @param letter Letter to find. + * @param startIndex The index to start searching from. + * @param count The number of characters to examine. + * @return The index of the letter. + */ + +const int CNxString::lastIndexOf(nxwidget_char_t letter, int startIndex, int count) const +{ + // Exit if no data available + + if (!hasData()) + { + return -1; + } + + int index = -1; + int charsExamined = 0; + + CStringIterator *iterator = new CStringIterator(this); + if (!iterator->moveTo(startIndex)) + { + delete iterator; + return -1; + } + + do + { + if (iterator->getChar() == letter) + { + index = iterator->getIndex(); + break; + } + + charsExamined++; + } + while (iterator->moveToPrevious() && (charsExamined <= count)); + + delete iterator; + return index; +} + +/** + * Get a substring from this string. It is the responsibility of the + * caller to delete the substring when it is no longer required. + * + * @param startIndex The starting point of the substring. + * @return A pointer to a new CNxString object containing the + * substring. + */ + +CNxString* CNxString::subString(int startIndex) const +{ + return subString(startIndex, getLength() - startIndex); +} + +/** + * Get a substring from this string. It is the responsibility of the + * caller to delete the substring when it is no longer required. + * + * @param startIndex The starting point of the substring. + * @param length The length of the substring. + * @return A pointer to a new CNxString object containing the + * substring. +*/ + +CNxString *CNxString::subString(int startIndex, int length) const +{ + CNxString *newString = new CNxString(); + CStringIterator *iterator = new CStringIterator(this); + + if (!iterator->moveTo(startIndex)) + { + delete iterator; + return (CNxString *)0; + } + + // Build up the string character by character. We could do a memcpy + // here and improve performance. + + int count = 0; + while (count < length) + { + newString->append(iterator->getChar()); + iterator->moveToNext(); + count++; + } + + delete iterator; + return newString; +} + +/** + * Overloaded assignment operator. Copies the data within the argument + * string to this string. + * + * @param string The string to copy. + * @return This string. + */ + +CNxString& CNxString::operator=(const CNxString &string) +{ + if (&string != this) + { + setText(string); + } + return *this; +} + +/** + * Overloaded assignment operator. Copies the data within the argument + * char array to this string. + * + * @param string The string to copy. + * @return This string. + */ + +CNxString& CNxString::operator=(const char *string) +{ + setText(string); + return *this; +} + +/** + * Overloaded assignment operator. Copies the data from the argument + * char to this string. + * + * @param letter The char to copy. + * @return This string. + */ + +CNxString& CNxString::operator=(const nxwidget_char_t letter) +{ + setText(letter); + return *this; +} + +/** + * Compares this string to the argument. + * + * @param string String to compare to. + * @return Zero if both strings are equal. A value greater than zero + * indicates that this string is greater than the argument string. A + * value less than zero indicates the opposite. Note that the return + * value indicates the *byte* that does not match, not the *character*. + */ + +int CNxString::compareTo(const CNxString &string) const +{ + return memcmp((FAR const char*)m_text, + (FAR const char*)string.getCharArray(), + getLength()); +} + +/** + * Allocate memory for the string. + * + * @param chars Number nxwidget_char_t size characters to allocate. + * @param preserve If true, the data in the existing memory will be + * preserved if new memory must be allocated + */ + +void CNxString::allocateMemory(int nChars, bool preserve) +{ + // This is the size of the allocation that we need + + int nBytesNeeded = nChars * sizeof(nxwidget_char_t); + + // Do we already have enough memory allocated to contain this new size? + // If so, we can avoid deallocating and allocating new memory by re-using the old + + if (nBytesNeeded > m_allocatedSize) + { + // Not enough space in existing memory; allocate new memory + + int allocChars = nChars + m_growAmount; + nxwidget_char_t *newText = new nxwidget_char_t[allocChars]; + + // Free old memory if necessary + + if (m_text != NULL) + { + // Preserve existing data if required + + if (preserve) + { + memcpy(newText, m_text, sizeof(nxwidget_char_t) * m_stringLength); + } + + delete[] m_text; + } + + // Set pointer to new memory + + m_text = newText; + + // Remember how much memory we've allocated. + + m_allocatedSize = allocChars * sizeof(nxwidget_char_t); + } +} + +/** + * Return a pointer to the specified characters. + * + * @param index Index of the character to retrieve. + */ + +FAR nxwidget_char_t *CNxString::getCharPointer(const int index) const +{ + // Early exit if the string is empty + + if (!hasData()) + { + return (FAR nxwidget_char_t*)NULL; + } + + // Early exit if the index is greater than the length of the string + + if (index >= m_stringLength) + { + return (FAR nxwidget_char_t*)NULL; + } + + return &m_text[index]; +} diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx new file mode 100644 index 000000000..e351d2357 --- /dev/null +++ b/libnxwidgets/src/cnxtimer.cxx @@ -0,0 +1,382 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxtimer.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include + +#include "cnxtimer.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Static Data Members + ****************************************************************************/ + +using namespace NXWidgets; + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param timeout Time, in milliseconds, before the timer fires an + * EVENT_ACTION event. + * @param repeat If true, the timer will fire multiple events. If false, + * the timer will fire just once and stop. + */ + +CNxTimer::CNxTimer(CWidgetControl *pWidgetControl, uint32_t timeout, bool repeat) +: CNxWidget(pWidgetControl, 0, 0, 0, 0, 0, 0) +{ + // Remember the timer configuration + + m_timeout = timeout; + m_isRepeater = repeat; + m_isRunning = false; + + // Create a POSIX timer (We can't do anything about failures here) + + int ret = timer_create(CLOCK_REALTIME, (FAR struct sigevent *)NULL, &m_timerid); + if (ret < 0) + { + gdbg("timer_create() failed\n"); + return; + } + + // If we are the first timer created in the whole system, then create + // the timer list and attach the SIGALRM timer handler. + + if (!g_nxTimers) + { + if (!g_nxTimers) + { + gdbg("Failed to create the timer list\n"); + return; + } + + // Attach the SIGALM signal handler (no harm if this is done multiple times) + + struct sigaction sigact; + sigact.sa_handler = signalHandler; + sigact.sa_flags = 0; + sigemptyset(&sigact.sa_mask); + + ret = sigaction(SIGALRM, &sigact, (FAR struct sigaction *)NULL); + if (ret < 0) + { + gdbg("sigaction() failed\n"); + return; + } + } + + // Add ourself onto the array of timers +#warning "Need to disable SIGALRM here" + g_nxTimers->push_back(this); +} + +/** + * Destructor. + */ + +CNxTimer::~CNxTimer(void) +{ + // Locate ourself in the list of timers and remove ourselves + +#warning "Need to disable SIGALRM here" + for (int i = 0; i < g_nxTimers->size(); i++) + { + CNxTimer *timer = g_nxTimers->at(i); + if (timer == this) + { + g_nxTimers->erase(i); + break; + } + } + + // Destroy the timer + + (void)timer_delete(m_timerid); +} + +/** + * Return the timeout of this timer. + * + * @return The number of milliseconds that this timer will run before firing + * an event. + */ + +const uint32_t CNxTimer::getTimeout(void) +{ + // If the timer is not running, then just return the timeout value + + if (!m_isRunning) + { + return m_timeout; + } + else + { + // Get the time remaining on the POSIX timer. Of course, there + // are race conditions here.. the timer could expire at anytime + + struct itimerspec remaining; + int ret = timer_gettime(m_timerid, &remaining); + if (ret < 0) + { + gdbg("timer_gettime() failed\n"); + return 0; + } + + return timespecToMilliseconds(&remaining.it_value); + } +} + +/** + * Resets the millisecond timer. + */ + +void CNxTimer::reset(void) +{ + // It does not make sense to reset the timer if the timer is not running + + if (m_isRunning) + { + // If the specified timer was already armed when timer_settime() is + // called, this call will reset the time until next expiration to the + // value specified. + + m_isRunning = false; + start(); + } +} + +/** + * Starts the timer. + */ + +void CNxTimer::start(void) +{ + // If the timer is running, reset should be used to restart it + + if (!m_isRunning) + { + // If the specified timer was already armed when timer_settime() is + // called, this call will reset the time until next expiration to the + // value specified. + + struct itimerspec timerspec; + millisecondsToTimespec(m_timeout, &timerspec.it_value); + timerspec.it_interval.tv_sec = 0; + timerspec.it_interval.tv_nsec = 0; + + int ret = timer_settime(m_timerid, 0, &timerspec, + (FAR struct itimerspec *)NULL); + if (ret < 0) + { + gdbg("timer_settime() failed\n"); + } + + // The timer is now running + + m_isRunning = true; + } +} + +/** + * Stops the timer + */ + +void CNxTimer::stop(void) +{ + if (m_isRunning) + { + // If the it_value member of value is zero, the timer will be disarmed. + // The effect of disarming or resetting a timer with pending expiration + // notifications is unspecified. + + struct itimerspec nullTime; + memset(&nullTime, 0, sizeof(struct itimerspec)); + + int ret = timer_settime(m_timerid, 0, &nullTime, + (FAR struct itimerspec *)NULL); + if (ret < 0) + { + gdbg("timer_settime failed\n"); + } + + // The time is no longer running + + m_isRunning = false; + } +} + +/** + * The SIGALM signal handler that will be called when the timer goes off + * + * @param signo The signal number call caused the handler to run (SIGALM) + */ + +void CNxTimer::signalHandler(int signo) +{ + // Call handlerTimerExpiration on every timer instance + + for (int i = 0; i < g_nxTimers->size(); i++) + { + CNxTimer *timer = g_nxTimers->at(i); + timer->handleTimerExpiration(); + } +} + +/** + * Handle an expired timer + */ + +void CNxTimer::handleTimerExpiration(void) +{ + // Do we think our timer is running? + + if (m_isRunning) + { + // Is it running? It the timer is not running, it will return an + // it_value of zero. + + struct itimerspec status; + int ret = timer_gettime(m_timerid, &status); + if (ret < 0) + { + gdbg("timer_gettime() failed\n"); + return; + } + + // it_value == 0 means that timer is not running + + if (status.it_value.tv_sec == 0 && status.it_value.tv_nsec == 0) + { + // It has expired + + m_isRunning = false; + + // Raise the action event. Hmmm.. are there any issues with + // doing this from a signal handler? We'll find out + + m_widgetEventHandlers->raiseActionEvent(); + + // Restart the timer if this is a repeating timer + + if (m_isRepeater) + { + start(); + } + } + } +} + +/** + * Convert a timespec to milliseconds + * + * @param tp The pointer to the timespec to convert + * @return The corresponding time in milliseconds + */ + +uint32_t CNxTimer::timespecToMilliseconds(FAR const struct timespec *tp) +{ + return (uint32_t)tp->tv_sec * 1000 + (uint32_t)tp->tv_nsec / 10000000; +} + +/** + * Convert milliseconds to a timespec + * + * @param milliseconds The milliseconds to be converted + * @param tp The pointer to the location to store the converted timespec + */ + + void CNxTimer::millisecondsToTimespec(uint32_t milliseconds, + FAR struct timespec *tp) + { + tp->tv_sec = milliseconds / 1000; + uint32_t remainder = milliseconds - (uint32_t)tp->tv_sec * 1000; + tp->tv_nsec = remainder * 1000000; + } + + diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx new file mode 100644 index 000000000..36b07dce5 --- /dev/null +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -0,0 +1,387 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxtkwindow.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cnxtkwindow.hxx" +#include "cnxtoolbar.hxx" +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param hNxServer Handle to the NX server. + * @param widgetControl Controlling widget for this window. + */ + +CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) + : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hNxTkWindow(0), + m_widgetControl(pWidgetControl) +{ + // Create the CGraphicsPort instance for this window + + m_widgetControl->createGraphicsPort(static_cast(this)); +} + +/** + * Destructor. + */ + +CNxTkWindow::~CNxTkWindow(void) +{ + // It would be a disaster if toolbar instance persists beyond + // the window! + + DEBUGASSERT(!m_toolbar); + + // Release the window. We do not release the widget control + // instance. The lifetime of that instance is owned by he-who- + // constructed-us. + + (void)nxtk_closewindow(m_hNxTkWindow); +} + +/** + * Creates a new framed window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the framed window was successfully created. + */ + +bool CNxTkWindow::open(void) +{ + // Get the C-callable callback vtable + + FAR struct nx_callback_s *vtable = getCallbackVTable(); + + // Create the window + + m_hNxTkWindow = nxtk_openwindow(m_hNxServer, vtable, (FAR void *)m_widgetControl); + return m_hNxTkWindow != NULL; +} + +/** + * Open a toolbar on the framed window + * + * @param height Height of the toolbar + */ + +CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) +{ + if (m_hNxTkWindow && !m_toolbar) + { + // Get current window style from the widget control + + CWidgetStyle style; + m_widgetControl->getWidgetStyle(&style); + + // Create a new controlling widget for the window + + CWidgetControl *widgetControl = new CWidgetControl(&style); + + // And create the toolcar + + m_toolbar = new CNxToolbar(this, m_hNxTkWindow, + widgetControl, height); + if (!m_toolbar) + { + delete widgetControl; + } + } + return m_toolbar; +} + +/** + * 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. + * + * @return True on success, false on any failure. + */ + +bool CNxTkWindow::requestPosition(void) +{ + // Request the window position + + return nxtk_getposition(m_hNxTkWindow) == OK; +} + +/** + * Get the position of the window in the physical display coordinates + * (as reported by the NX callback). + * + * @return The position. + */ + +bool CNxTkWindow::getPosition(FAR struct nxgl_point_s *pPos) +{ + return m_widgetControl->getWindowPosition(pPos); +} + +/** + * Get the size of the window (as reported by the NX callback). + * + * @return The size. + */ + +bool CNxTkWindow::getSize(FAR struct nxgl_size_s *pSize) +{ + return m_widgetControl->getWindowSize(pSize); +} + +/** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on any failure. + */ + +bool CNxTkWindow::setPosition(FAR const struct nxgl_point_s *pPos) +{ + // Set the window size and position + + return nxtk_setposition(m_hNxTkWindow, pPos) == OK; +} + +/** + * Set the size of the selected window. + * + * @param pSize The new size of the window. + * @return True on success, false on any failure. + */ + +bool CNxTkWindow::setSize(FAR const struct nxgl_size_s *pSize) +{ + // Set the window size + + return nxtk_setsize(m_hNxTkWindow, pSize) == OK; +} + +/** + * Bring the window to the top of the display. + * + * @return True on success, false on any failure. + */ + +bool CNxTkWindow::raise(void) +{ + // Raise the window to the top of the display + + return nxtk_raise(m_hNxTkWindow) == OK; +} + +/** + * Lower the window to the bottom of the display. + * + * @return True on success, false on any failure. + */ + +bool CNxTkWindow::lower(void) +{ + // Lower the window to the bottom of the display + + return nxtk_lower(m_hNxTkWindow) == OK; +} + +/** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color) +{ +#if 0 + // Set an individual pixel to the specified color + + return nxtk_setpixel(m_hNxTkWindow, pPos, &color) == OK; +#else +# warning "Revisit" + return false; +#endif +} + +/** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color) +{ + // Fill a rectangular region with a solid color + + return nxtk_fillwindow(m_hNxTkWindow, pRect, &color) == OK; +} + +/** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + +void CNxTkWindow::getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest) +{ + // Get a rectangule region from the window + + (void)nxtk_getwindow(m_hNxTkWindow, rect, 0, (FAR uint8_t*)dest->data, dest->stride); +} + +/** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color) +{ + // Fill a trapezoidal region with a solid color + + return nxtk_filltrapwindow(m_hNxTkWindow, pTrap, &color) == OK; +} + +/** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, nxgl_mxpixel_t color) +{ + // Draw a line with the specified color + + return nxtk_drawlinewindow(m_hNxTkWindow, vector, width, &color) == OK; +} + +/** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + +bool CNxTkWindow::drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) +{ + return nxtk_fillcirclewindow(m_hNxTkWindow, center, radius, &color) == OK; +} + +/** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset) +{ + // Move a rectangular region of the display + + return nxtk_movewindow(m_hNxTkWindow, pRect, pOffset) == OK; +} + +/** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. The source image is treated as an opaque image. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + +bool CNxTkWindow::bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride) +{ + // Copy a rectangular bitmap image in a region on the display + + return nxtk_bitmapwindow(m_hNxTkWindow, pDest, &pSrc, pOrigin, stride) == OK; +} diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx new file mode 100644 index 000000000..5911c731d --- /dev/null +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -0,0 +1,364 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxtoolbar.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cnxtoolbar.hxx" +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pNxTkWindow Parent framed window instance + * @param hNxTkWindow Parent framed window NX handler + * @param widgetControl Controlling widget for this toolbar. + * @param height The height of the toolbar. + */ + +CNxToolbar::CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, + CWidgetControl *pWidgetControl, nxgl_coord_t height) + : CCallback(pWidgetControl) +{ + m_nxTkWindow = pNxTkWindow; + m_hNxTkWindow = hNxTkWindow; + m_widgetControl = pWidgetControl; + m_height = height; +} + +/** + * Destructor. + */ + +CNxToolbar::~CNxToolbar(void) +{ + // Inform the parent window instance that the toolbar is gone + + m_nxTkWindow->detachToolbar(); + + // Release the widget control instance. Normally the lifetime + // of the widget control instance is managed by logic outside + // of the window instance. But here, as in the real world, + // our parent expects us to clean up after ourselves. + + delete m_widgetControl; + + // Release the toolbar. + + (void)nxtk_closetoolbar(m_hNxTkWindow); +} + +/** + * Creates a new toolbar. Toolbar creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the toolbar was successfully created. + */ + +bool CNxToolbar::open(void) +{ + // Get the C-callable callback vtable + + FAR struct nx_callback_s *vtable = getCallbackVTable(); + + // Create the toolbar + + int ret = nxtk_opentoolbar(m_hNxTkWindow, m_height, vtable, + (FAR void *)m_widgetControl); + return ret == OK; +} + +/** + * Request the position and size information of the toolbar. 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. + * + * @return True on success, false on any failure. + */ + +bool CNxToolbar::requestPosition(void) +{ + // Request the position of the entire framed window containing the + // toolbar. The NXTK callback will route toolbar specific + // information back to us. + + nxtk_getposition(m_hNxTkWindow); + return false; +} + +/** + * Get the position of the toolbar in the physical display coordinates + * (as reported by the NX callback). + * + * @return The position. + */ + +bool CNxToolbar::getPosition(FAR struct nxgl_point_s *pPos) +{ + return m_widgetControl->getWindowPosition(pPos); +} + +/** + * Get the size of the toolbar (as reported by the NX callback). + * + * @return The size. + */ + +bool CNxToolbar::getSize(FAR struct nxgl_size_s *pSize) +{ + return m_widgetControl->getWindowSize(pSize); +} + +/** + * Set the position and size of the toolbar. The position of + * the toolbar is fixed at the top of the parent framed window. + * + * @param pPos The new position of the toolbar. + * @return Always returns false. + */ + +bool CNxToolbar::setPosition(FAR const struct nxgl_point_s *pPos) +{ + return false; +} + +/** + * Set the size of the selected toolbar. The only variable dimension + * is the height of the toolbar, but that cannot be changed once + * it is created. + * + * @param pSize The new size of the toolbar. + * @return Always returns false. + */ + +bool CNxToolbar::setSize(FAR const struct nxgl_size_s *pSize) +{ + return false; +} + +/** + * Bring the toolbar to the top of the display. The toolbar is + * a component of the containing, parent, framed window. It + * cannot be raised separately. + * + * @return Always returns false. + */ + +bool CNxToolbar::raise(void) +{ + return false; +} + +/** + * Lower the toolbar to the bottom of the display. The toolbar is + * a component of the containing, parent, framed window. It + * cannot be raised separately. + * + * @return Always returns false. + */ + +bool CNxToolbar::lower(void) +{ + return false; +} + +/** + * Set an individual pixel in the toolbar with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color) +{ +#if 0 + // Set an individual pixel to the specified color + + return nxtk_setpixel(m_hNxTkWindow, pPos, &color) == OK; +#else +# warning "Revisit" + return false; +#endif +} + +/** + * Fill the specified rectangle in the toolbar with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color) +{ + // Fill a rectangular region with a solid color + + return nxtk_filltoolbar(m_hNxTkWindow, pRect, &color) == OK; +} + +/** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + +void CNxToolbar::getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest) +{ + // Get a rectangule region from the toolbar + + (void)nxtk_gettoolbar(m_hNxTkWindow, rect, 0, (FAR uint8_t*)dest->data, dest->stride); +} + +/** + * Fill the specified trapezoidal region in the toolbar with the specified + * color. + * + * @param pClip Clipping rectangle relative to toolbar (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color) +{ + // Fill a trapezoidal region with a solid color + + return nxtk_filltraptoolbar(m_hNxTkWindow, pTrap, &color) == OK; +} + +/** + * Fill the specified line in the toolbar with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, nxgl_mxpixel_t color) +{ + // Draw a line with the specified color + + return nxtk_drawlinetoolbar(m_hNxTkWindow, vector, width, &color) == OK; +} + +/** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + +bool CNxToolbar::drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) +{ + return nxtk_fillcircletoolbar(m_hNxTkWindow, center, radius, &color) == OK; +} + +/** + * Move a rectangular region within the toolbar. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset) +{ + // Move a rectangular region of the display + + return nxtk_movetoolbar(m_hNxTkWindow, pRect, pOffset) == OK; +} + +/** + * Copy a rectangular region of a larger image into the rectangle in the + * specified toolbar. The source image is treated as an opaque image. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param pOrigin the pOrigin of the upper, left-most corner of the full + * bitmap. Both pDest and pOrigin are in toolbar coordinates, however, + * pOrigin may lie outside of the display. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + +bool CNxToolbar::bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride) +{ + // Copy a rectangular bitmap image in a region on the display + + return nxtk_bitmaptoolbar(m_hNxTkWindow, pDest, &pSrc, pOrigin, stride) == OK; +} diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx new file mode 100644 index 000000000..de84f1393 --- /dev/null +++ b/libnxwidgets/src/cnxwidget.cxx @@ -0,0 +1,2424 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxwidget.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cnxwidget.hxx" +#include "cgraphicsport.hxx" +#include "cwidgeteventhandler.hxx" +#include "cnxfont.hxx" +#include "cwidgetstyle.hxx" +#include "cwidgeteventargs.hxx" +#include "crectcache.hxx" +#include "cwidgetcontrol.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +#define DOUBLE_CLICK_BOUNDS 10 + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controllwing widget for the display + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags Bitmask specifying some set-up values for the widget. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + * @see WidgetFlagType. + */ + +CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, const CWidgetStyle *style) +{ + // Save the controlling widget + + m_widgetControl = pWidgetControl; + + // Set properties from parameters. If this is a child widget, then + // this coordinates are relative to the parent widget. + + m_rect.setX(x); + m_rect.setY(y); + m_rect.setWidth(width); + m_rect.setHeight(height); + + // Do we need to fetch the default style? + + if (style == (CWidgetStyle *)NULL) + { + // Get the style from the controlling widget. This allows different + // widgets within a window to have the same style, unique to the window. + + pWidgetControl->getWidgetStyle(&m_style); + } + else + { + // Use specified style + + useWidgetStyle(style); + } + + // Add ourself to the list of controlled widgets + + pWidgetControl->addControlledWidget(this); + + // Mask flags against bitmasks and logical NOT twice to obtain boolean values + + m_flags.borderless = (!(!(flags & WIDGET_BORDERLESS))); + m_flags.draggable = (!(!(flags & WIDGET_DRAGGABLE))); + m_flags.permeable = (!(!(flags & WIDGET_PERMEABLE))); + m_flags.doubleClickable = (!(!(flags & WIDGET_DOUBLE_CLICKABLE))); + + // Dragging values + + m_grabPointX = 0; + m_grabPointY = 0; + m_newX = 0; + m_newY = 0; + + // Set initial flag values + + m_flags.clicked = false; + m_flags.dragging = false; + m_flags.hasFocus = false; + m_flags.deleted = false; + m_flags.drawingEnabled = false; + m_flags.enabled = true; + m_flags.erased = true; + m_flags.shelved = false; + m_flags.visibleRegionCacheInvalid = true; + m_flags.hidden = false; + m_flags.modal = false; + + // Set hierarchy pointers + + m_parent = (CNxWidget *)NULL; + m_focusedChild = (CNxWidget *)NULL; + + // Double-click + + clock_gettime(CLOCK_REALTIME, &m_lastClickTime); + m_lastClickX = 0; + m_lastClickY = 0; + m_doubleClickBounds = DOUBLE_CLICK_BOUNDS; + + // Set other default values + + m_refcon = 0; + + // Set border size to 1 line + + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; + + m_closeType = CLOSE_TYPE_CLOSE; + m_rectCache = new CRectCache(this); + m_widgetEventHandlers = new CWidgetEventHandlerList(this); +} + +/** + * Destructor. + */ + +CNxWidget::~CNxWidget(void) +{ + if (!m_flags.deleted) + { + m_flags.deleted = true; + + // Unset the clicked pointer if necessary + + if (m_widgetControl->getClickedWidget() == this) + { + m_widgetControl->setClickedWidget((CNxWidget *)NULL); + } + } + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->removeChild(this); + } + + // Delete children + + while (m_children.size() > 0) + { + m_children[0]->destroy(); + } + + // Delete shelved children + + while (m_shelvedWidgets.size() > 0) + { + m_shelvedWidgets[0]->destroy(); + } + + // Remove ourselve from the controlled widget list + + m_widgetControl->removeControlledWidget(this); + + // Delete instances. NOTE that we do not delete the controlling + // widget. It persists until the window is closed. + + delete m_rectCache; + delete m_widgetEventHandlers; +} + +/** + * Get the x coordinate of the widget in "Widget space". + * + * @return Widget space x coordinate. + */ + +const nxgl_coord_t CNxWidget::getX(void) const +{ + if (m_parent != (CNxWidget *)NULL) + { + return m_parent->getX() + m_rect.getX(); + } + + return m_rect.getX(); +} + +/** + * Get the y coordinate of the widget in "Widget space". + * + * @return Widget space y coordinate. + */ + +const nxgl_coord_t CNxWidget::getY(void) const +{ + if (m_parent != (CNxWidget *)NULL) + { + return m_parent->getY() + m_rect.getY(); + } + + return m_rect.getY(); +} + +/** + * Get the x coordinate of the widget relative to its parent. + * + * @return Parent-space x coordinate. + */ + +const nxgl_coord_t CNxWidget::getRelativeX(void) const +{ + return m_rect.getX(); +} + +/** + * Get the y coordinate of the widget relative to its parent. + * + * @return Parent-space y coordinate. + */ + +const nxgl_coord_t CNxWidget::getRelativeY(void) const +{ + return m_rect.getY(); +} + +/** + * Has the widget been marked for deletion? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are not deleted. + * + * Widgets marked for deletion are automatically deleted and should not be + * interacted with. + * + * @return True if marked for deletion. + */ + +const bool CNxWidget::isDeleted(void) const +{ + if (m_parent != (CNxWidget *)NULL) + { + if (m_parent->isDeleted()) + { + return true; + } + } + + return m_flags.deleted; +} + +/** + * Is the widget allowed to draw? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are visible. + * + * @return True if drawing is enabled. + */ + +const bool CNxWidget::isDrawingEnabled(void) const +{ + if (m_parent != (CNxWidget *)NULL) + { + if (m_parent->isDrawingEnabled()) + { + // Drawing is enabled if the widget is drawable, not deleted, and not shelved + + return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + } + } + else + { + return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + } + + return false; +} + +/** + * Is the widget hidden? This function recurses up the widget + * hierarchy and returns true if any of the widgets in the ancestor + * chain are hidden. + * + * @return True if hidden. + */ + +const bool CNxWidget::isHidden(void) const +{ + if (m_parent != (CNxWidget *)NULL) + { + if (!m_parent->isHidden()) + { + // Hidden if the widget is deleted, shelved or hidden + + return (m_flags.deleted || m_flags.shelved || m_flags.hidden); + } + } + else + { + return (m_flags.deleted || m_flags.shelved || m_flags.hidden); + } + + return true; +} + +/** + * Is the widget enabled? This function recurses up the widget + * hierarchy and only returns true if all of the widgets in the ancestor + * chain are enabled. + * + * @return True if enabled. + */ + +const bool CNxWidget::isEnabled() const +{ + if (m_parent != (CNxWidget *)NULL) + { + if (m_parent->isEnabled()) + { + // Enabled if the widget is enabled, not deleted, not shelved and not hidden + + return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + } + } + else + { + return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + } + + return false; +} + +/** + * Is the widget modal? Only true if the Widget singleton is also modal. + * + * @return True if the widget is modal. + */ + +const bool CNxWidget::isModal(void) const +{ + return m_widgetControl->isModal() & m_flags.modal; +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. + * + * @param rect Reference to a rect to populate with data. + */ + +void CNxWidget::getPreferredDimensions(CRect &rect) const +{ + rect = m_rect; +} + +/** + * Insert the properties of the space within this widget that is available + * for children into the rect passed in as a parameter. + * All coordinates are relative to this widget. + * + * @param rect Reference to a rect to populate with data. + */ + +void CNxWidget::getClientRect(CRect &rect) const +{ + if (m_flags.borderless) + { + rect.setX(0); + rect.setY(0); + rect.setWidth(getWidth()); + rect.setHeight(getHeight()); + } + else + { + rect.setX(m_borderSize.left); + rect.setY(m_borderSize.top); + rect.setWidth(getWidth() - (m_borderSize.left + m_borderSize.right)); + rect.setHeight(getHeight() - (m_borderSize.top + m_borderSize.bottom)); + } +} + +/** + * Insert the properties of the space within this widget that is + * available for children into the rect passed in as a parameter. + * Identical to getClientRect() except that all coordinates are + * absolute positions within the window. + * + * @param rect Reference to a rect to populate with data. + */ + +void CNxWidget::getRect(CRect &rect) const +{ + getClientRect(rect); + rect.setX(rect.getX() + getX()); + rect.setY(rect.getY() + getY()); +} + +/** + * Clips the supplied rect to the boundaries defined by this widget and + * this widget's parents. + * + * @param rect Reference to a rect to populate with data. + */ + +void CNxWidget::getRectClippedToHierarchy(CRect &rect) const +{ + // Copy the widget's properties into the rect. NOTE that if this is + // a child widget, getX() and getY() will return the actual X and Y + // positions (and not the parent-relative X and Y positions). + + rect.setX(getX()); + rect.setY(getY()); + rect.setWidth(getWidth()); + rect.setHeight(getHeight()); + + // And clip it + + clipRectToHierarchy(rect); +} + +/** + * Gets a pointer to the vector of all of the visible regions of this widget, + * including any covered by children. + * + * @return A pointer to a vector of all visible regions. + */ + +TNxArray *CNxWidget::getForegroundRegions(void) +{ + return m_rectCache->getForegroundRegions(); +} + +/** + * Sets this widget's reference constant. This should be unique, + * at least amongst this widget's siblings. + * + * @param refcon The reference constant. + */ + +uint32_t CNxWidget::setRefcon(uint32_t refcon) +{ + uint32_t old = m_refcon; + m_refcon = refcon; + return old; +} + +/** + * Sets this widget's border state. + * + * @param isBorderless The border state. + */ + +void CNxWidget::setBorderless(bool borderless) +{ + m_flags.borderless = borderless; + invalidateVisibleRectCache(); +} + +/** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + +void CNxWidget::setFont(CNxFont *font) +{ + m_style.font = font; +} + +/** + * Draws the visible regions of the widget and the widget's child widgets. + */ + +void CNxWidget::redraw(void) +{ + if (isDrawingEnabled()) + { + cacheVisibleRects(); + + if (m_rectCache->getBackgroundRegions()->size() > 0) + { + // Get the graphics port for drawing in this window + + CGraphicsPort *port = m_widgetControl->getGraphicsPort(); + + // Draw all visible rectangles + + for (int i = 0; i < m_rectCache->getBackgroundRegions()->size(); i++) + { + drawBorder(port); + drawContents(port); + } + } + + // Remember that the widget is no longer erased + + m_flags.erased = false; + drawChildren(); + } +} + +/** + * Erases the visible regions of the widget by redrawing the widgets + * behind it. + */ + +void CNxWidget::erase(void) +{ + if (!m_flags.erased) + { + cacheVisibleRects(); + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->eraseWidget(this); + } + + // Remember that the widget has been erased + + m_flags.erased = true; + invalidateVisibleRectCache(); + } +} + +/** + * Enables the widget. + * + * @return True if the widget was enabled. + */ + +bool CNxWidget::enable(void) +{ + if (!m_flags.enabled) + { + m_flags.enabled = true; + onEnable(); + redraw(); + m_widgetEventHandlers->raiseEnableEvent(); + return true; + } + + return false; +} + +/** + * Disabled the widget. + * + * @return True if the widget was disabled. + */ + +bool CNxWidget::disable(void) +{ + if (m_flags.enabled) + { + m_flags.enabled = false; + onDisable(); + redraw(); + m_widgetEventHandlers->raiseDisableEvent(); + return true; + } + + return false; +} + +/** + * Erases the widget, marks it as deleted, and moves it to the CNxWidget + * deletion queue. Widgets are automatically deleted by the framework and + * should not be deleted externally. + */ + +void CNxWidget::close(void) +{ + if (!m_flags.deleted) + { + m_widgetEventHandlers->raiseCloseEvent(); + m_widgetEventHandlers->disable(); + + m_flags.deleted = true; + m_flags.drawingEnabled = false; + + // Unset clicked widget if necessary + + CNxWidget *clickedWidget = m_widgetControl->getClickedWidget(); + if (clickedWidget == this) + { + release(clickedWidget->getX(), clickedWidget->getY()); + } + + // Ensure the widget isn't running modally + + stopModal(); + erase(); + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->closeChild(this); + } + } +} + +/** + * Erases the widget, removes it from the main hierarchy and sets it to + * invisible. Widgets hidden in this way will be partioned off from + * other widgets and will no longer be processed. + * + * @return True if the widget was shelved. + * @see unshelve() + */ + +bool CNxWidget::shelve(void) +{ + if (!m_flags.shelved) + { + m_widgetEventHandlers->raiseShelveEvent(); + m_widgetEventHandlers->disable(); + + m_flags.shelved = true; + m_flags.drawingEnabled = false; + + // Unset clicked widget if necessary + + CNxWidget *clickedWidget = m_widgetControl->getClickedWidget(); + if (clickedWidget == this) + { + release(clickedWidget->getX(), clickedWidget->getY()); + } + + // Ensure the widget isn't running modally + + stopModal(); + erase(); + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->shelveChild(this); + } + return true; + } + + return false; +} + +/** + * Moves the widget back into the hierarchy and redraws it. Widgets shown + * in this way will be unpartioned and will be processed again. + * + * @return True if the widget was unshelved. + * @see shelve() + */ + +bool CNxWidget::unshelve(void) +{ + if (m_flags.shelved) + { + m_widgetEventHandlers->enable(); + m_widgetEventHandlers->raiseUnshelveEvent(); + + m_flags.drawingEnabled = true; + m_flags.shelved = false; + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->moveShelvedToChildList(this); + m_parent->invalidateVisibleRectCache(); + } + + redraw(); + return true; + } + + return false; +} + +/** + * Draws the widget and makes it visible. + * Does not steal focus from other widgets. + * + * @return True if the widget was shown. + * @see hide() + */ + +bool CNxWidget::show(void) +{ + if (m_flags.hidden) + { + m_flags.hidden = false; + + // Ensure that widgets behind this do not draw over the + // top of the newly-visible widget + + m_parent->invalidateLowerWidgetsVisibleRectCache(this); + m_widgetEventHandlers->raiseShowEvent(); + redraw(); + return true; + } + + return false; +} + +/** + * Erases the widget and makes it invisible. + * Does not re-assign focus to another widget. + * + * @return True if the widget was hidden. + * @see show() + */ + +bool CNxWidget::hide(void) +{ + if (!m_flags.hidden) + { + m_flags.hidden = true; + + // Ensure the widget isn't running modally + + stopModal(); + m_widgetEventHandlers->raiseHideEvent(); + erase(); + return true; + } + + return false; +} + +/** + * Click this widget at the supplied coordinates. This should only be + * overridden in subclasses if the default click behaviour needs to be changed. + * If the subclassed widget should just respond to a standard click, + * the onClick() method should be overridden instead. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click was successful. + */ + +bool CNxWidget::click(nxgl_coord_t x, nxgl_coord_t y) +{ + if (!isEnabled() || !checkCollision(x, y)) + { + return false; + } + + // Check for a double-click + + if (isDoubleClick(x, y)) + { + return doubleClick(x, y); + } + + // Work out which child was clicked + + for (int i = m_children.size() - 1; i > -1; i--) + { + if (m_children[i]->click(x, y)) + { + return true; + } + } + + // Ensure that the click has occurred on a region of this widget + // not obscured by its siblings + + if (!checkCollisionWithForegroundRects(x, y)) + { + return false; + } + + // Handle clicks on this + + m_flags.clicked = true; + + // Record data for double-click + + clock_gettime(CLOCK_REALTIME, &m_lastClickTime); + m_lastClickX = x; + m_lastClickY = y; + + // Take focus away from child widgets + + setFocusedWidget((CNxWidget *)NULL); + + // Tell controlling widget that the clicked widget has changed + + m_widgetControl->setClickedWidget(this); + + // Run any code in the inherited class + + onClick(x, y); + m_widgetEventHandlers->raiseClickEvent(x, y); + return true; +} + +/** + * Check if the click is a double-click. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click is a double-click. + */ + +bool CNxWidget::isDoubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Check for a double-click + + if (m_flags.doubleClickable && hasFocus() && m_widgetControl->doubleClick()) + { + // Within the allowed region? + + if ((m_lastClickX > x - m_doubleClickBounds) && (m_lastClickX < x + m_doubleClickBounds)) + { + if ((m_lastClickY > y - m_doubleClickBounds) && (m_lastClickY < y + m_doubleClickBounds)) + { + return true; + } + } + } + + return false; +} + +/** + * Double-click this widget at the supplied coordinates. This + * should only be overridden in subclasses if the default + * double-click behaviour needs to be changed. If the subclassed + * widget should just respond to a standard double-click, the + * onDoubleClick() method should be overridden instead. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if the click was successful. + */ + +bool CNxWidget::doubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ + if (!isEnabled() || !checkCollision(x, y)) + { + return false; + } + + // Work out which child was clicked. Allow the + // child to determine if it has been double-clicked or not + // in case the second click has fallen on a different + // child to the first. + + for (int i = m_children.size() - 1; i > -1; i--) + { + if (m_children[i]->click(x, y)) + { + return true; + } + } + + // Ensure that the click has occurred on a region of this widget + // not obscured by its siblings + + if (!checkCollisionWithForegroundRects(x, y)) + { + return false; + } + + m_flags.clicked = true; + + // Record data for double-click + + clock_gettime(CLOCK_REALTIME, &m_lastClickTime); + m_lastClickX = x; + m_lastClickY = y; + + // Take focus away from child widgets + + setFocusedWidget((CNxWidget *)NULL); + + // Tell controlling widget that the clicked widget has changed + + m_widgetControl->setClickedWidget(this); + + onDoubleClick(x, y); + m_widgetEventHandlers->raiseDoubleClickEvent(x, y); + return true; +} + +/** + * Release this widget at the supplied coordinates. This should only be + * overridden in subclasses if the default release behaviour needs to be + * changed. If the subclassed widget should just respond to a standard + * release, the onRelease() method should be overridden instead. + * + * @param x X coordinate of the release. + * @param y Y coordinate of the release. + * @return True if the release was successful. + */ + +bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) +{ + if (!m_flags.clicked) + { + return false; + } + + m_flags.clicked = false; + stopDragging(x, y); + + if (m_widgetControl->getClickedWidget() == this) + { + m_widgetControl->setClickedWidget((CNxWidget *)NULL); + } + + // Determine which release event to fire + + if (checkCollision(x, y)) + { + onRelease(x, y); + + // Release occurred within widget; raise release + + m_widgetEventHandlers->raiseReleaseEvent(x, y); + } + else + { + onReleaseOutside(x, y); + + // Release occurred outside widget; raise release + + m_widgetEventHandlers->raiseReleaseOutsideEvent(x, y); + } + + return true; +} + +/** + * Drag the widget to the supplied coordinates. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance that the mouse was dragged. + * @param vY The vertical distance that the mouse was dragged. + * @return True if the drag was successful. + */ + +bool CNxWidget::drag(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) +{ + if ((isEnabled()) && (m_flags.dragging)) + { + if ((vX != 0) || (vY != 0)) + { + onDrag(x, y, vX, vY); + m_widgetEventHandlers->raiseDragEvent(x, y, vX, vY); + } + + return true; + } + + return false; +} + +/** + * Send a keypress to the widget. + * + * @param key The keycode to send to the widget. + * @return True if the keypress was processed. + */ + +bool CNxWidget::keyPress(nxwidget_char_t key) +{ + if (!isEnabled()) + { + return false; + } + + // Raise keypress for this widget + + m_widgetEventHandlers->raiseKeyPressEvent(key); + + // Handle active child + + if (m_focusedChild != NULL) + { + m_focusedChild->keyPress(key); + } + + return true; +} + +/** + * Send a cursor control event to the widget. + * + * @param cursorControl The cursor control code o send to the widget. + * @return True if the cursor control was processed. + */ + +bool CNxWidget::cursorControl(ECursorControl control) +{ + if (!isEnabled()) + { + return false; + } + + // Raise cursor control for this widget + + m_widgetEventHandlers->raiseCursorControlEvent(control); + + // Handle active child + + if (m_focusedChild != NULL) + { + m_focusedChild->cursorControl(control); + } + + return true; +} + +/** + * Give the widget focus. + * + * @return True if the widget received focus correctly. + */ + +bool CNxWidget::focus(void) +{ + if (!isEnabled()) + { + return false; + } + + // Remember if the widget has focus + + bool hadFocus = m_flags.hasFocus; + m_flags.hasFocus = true; + + // Notify parent that this widget has focus + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->setFocusedWidget(this); + } + + // Raise an event only if the widget did not have focus + + if (!hadFocus) + { + onFocus(); + + m_widgetEventHandlers->raiseFocusEvent(); + return true; + } + + return false; +} + +/** + * Remove focus from the widget. + * + * @return True if the widget lost focus correctly. + */ + +bool CNxWidget::blur(void) +{ + // Remember if the widget had focus + + bool hadFocus = m_flags.hasFocus; + + m_flags.hasFocus = false; + + // Take focus away from child widgets + + if (m_focusedChild != (CNxWidget *)NULL) + { + m_focusedChild->blur(); + m_focusedChild = (CNxWidget *)NULL; + m_widgetControl->clearFocusedWidget(this); + } + + // Raise an event only if the widget had focus + + if (hadFocus) + { + onBlur(); + + m_widgetEventHandlers->raiseBlurEvent(); + return true; + } + + return false; +} + +/** + * Move the widget to the new coordinates. + * Co-ordinates are relative to the parent widget. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + * @return True if the move was successful. + */ + +bool CNxWidget::moveTo(nxgl_coord_t x, nxgl_coord_t y) +{ + // Enforce widget to stay within parent confines if necessary + + if (m_parent != (CNxWidget *)NULL) + { + if (!m_parent->isPermeable()) + { + CRect parentRect; + m_parent->getClientRect(parentRect); + + // Check x coordinate + + if (x < parentRect.getX()) + { + x = parentRect.getX(); + + // Check width against new value + + if (x + getWidth() > parentRect.getX2() + 1) + { + return false; + } + } + else if (x + getWidth() > parentRect.getX2() + 1) + { + x = (parentRect.getX() + parentRect.getX()) - getWidth(); + + // Check new x value + + if (x < parentRect.getX()) + { + return false; + } + } + + // Check y coordinate + + if (y < parentRect.getY()) + { + y = parentRect.getY(); + + // Check height against new value + + if (y + getHeight() > parentRect.getY2() + 1) + { + return false; + } + } + else if (y + getHeight() > parentRect.getY2() + 1) + { + y = (parentRect.getY() + parentRect.getY()) - getHeight(); + + // Check new y value + + if (y < parentRect.getY()) + { + return false; + } + } + } + } + + // Perform move if necessary + + if ((m_rect.getX() != x) || (m_rect.getY() != y)) + { + erase(); + + nxgl_coord_t oldX = m_rect.getX(); + nxgl_coord_t oldY = m_rect.getY(); + + m_rect.setX(x); + m_rect.setY(y); + + redraw(); + m_widgetEventHandlers->raiseMoveEvent(x, y, x - oldX, y - oldY); + return true; + } + + return false; +} + +/** + * Resize the widget to the new dimensions. + * + * @param width The new width. + * @param height The new height. + * @return True if the resize was successful. + */ + +bool CNxWidget::resize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Enforce widget to stay within parent confines if necessary + + if (m_parent != (CNxWidget *)NULL) + { + if (!m_parent->isPermeable()) + { + CRect parentRect; + m_parent->getClientRect(parentRect); + + // Check width + + if (m_rect.getX() + width > parentRect.getX2() + 1) + { + width = parentRect.getX2() + 1 - m_rect.getX(); + } + + // Check height + + if (m_rect.getY() + height > parentRect.getY2() + 1) + { + height = parentRect.getY2() + 1 - m_rect.getY(); + } + } + } + + if (getWidth() != width || getHeight() != height) + { + // Remember if the widget is permeable + + bool wasPermeable = m_flags.permeable; + + // Remember if widget was drawing + + bool wasDrawEnabled = m_flags.drawingEnabled; + + m_flags.permeable = true; + erase(); + disableDrawing(); + + m_rect.setWidth(width); + m_rect.setHeight(height); + + // Handle visible region caching + + if (m_parent != (CNxWidget *)NULL) + { + m_parent->invalidateLowerWidgetsVisibleRectCache(this); + } + + onResize(width, height); + + // Reset the permeable value + + m_flags.permeable = wasPermeable; + + // Reset drawing value + + m_flags.drawingEnabled = wasDrawEnabled; + redraw(); + m_widgetEventHandlers->raiseResizeEvent(width, height); + return true; + } + + return false; +} + +/** + * Resize and move the widget in one operation. + * Only performs one redraw so it is faster than calling the + * two separate functions. + * + * @param x The new x coordinate. + * @param y The new y coordinate. + * @param width The new width. + * @param height The new height. + * @return True if the widget was adjusted successfully. + */ + +bool CNxWidget::changeDimensions(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +{ + bool wasDrawing = m_flags.drawingEnabled; + m_flags.drawingEnabled = false; + bool moved = moveTo(x, y); + m_flags.drawingEnabled = wasDrawing; + return (resize(width, height) | moved); +} + +/** + * Raises the widget to the top of its parent's widget stack. + * + * @return True if the raise was successful. + */ + +bool CNxWidget::raiseToTop(void) +{ + if (m_parent != (CNxWidget *)NULL) + { + if (m_parent->raiseWidgetToTop(this)) + { + m_widgetEventHandlers->raiseMoveForwardEvent(); + return true; + } + } + + return false; +} + +/** + * Lowers the widget to the bottom of its parent's widget stack. + * + * @return True if the lower was successful. + */ + +bool CNxWidget::lowerToBottom(void) +{ + if (m_parent != (CNxWidget *)NULL) + { + if (m_parent->lowerWidgetToBottom(this)) + { + m_widgetEventHandlers->raiseMoveBackwardEvent(); + return true; + } + } + + return false; +} + +/** + * Raises the supplied widget to the top of this widget's child stack. + * The supplied widget pointer must be a child of this widget. + * + * @param widget A pointer to the child widget to raise. + * @return True if the raise was successful. + */ + +bool CNxWidget::raiseWidgetToTop(CNxWidget *widget) +{ + // Locate widget in the stack + + int index = getWidgetIndex(widget); + + if ((index > -1) && (index < m_children.size() - 1)) + { + m_children.erase(index); + m_children.push_back(widget); + + widget->invalidateVisibleRectCache(); + + // Invalidate all widgets that collide with the depth-swapped widget + + for (int i = 0; i < m_children.size(); i++) + { + if (m_children[i]->checkCollision(widget)) + { + m_children[i]->invalidateVisibleRectCache(); + } + } + + widget->redraw(); + return true; + } + + return false; +} + +/** + * Lowers the supplied widget to the bottom of this widget's child stack. + * The supplied widget pointer must be a child of this widget. + * + * @param widget A pointer to the child widget to lower. + * @return True if the lower was successful. + */ + +bool CNxWidget::lowerWidgetToBottom(CNxWidget *widget) +{ + // Locate widget in the stack + + int index = getWidgetIndex(widget); + + if (index > 0) + { + widget->erase(); + + // Handle visible region caching + + widget->invalidateVisibleRectCache(); + invalidateLowerWidgetsVisibleRectCache(widget); + + m_children.erase(index); + m_children.insert(0, widget); + + widget->redraw(); + return true; + } + + return false; +} + +/** + * Moves the supplied child widget to the deletion queue. + * For framework use only. + * + * @param widget A pointer to the child widget. + */ + +void CNxWidget::moveChildToDeleteQueue(CNxWidget *widget) +{ + // Locate widget in main vector + + for (int i = 0; i < m_children.size(); i++) + { + if (m_children[i] == widget) + { + // Add widget to controlling widget's delete vector + + m_widgetControl->addToDeleteQueue(widget); + + // Remove widget from main vector + + m_children.erase(i); + break; + } + } +} + +/** + * Moves the supplied child widget to the shelved widget list. + * For framework use only. + * + * @param widget A pointer to the child widget. + * @return True if the widget was moved successfully. + * @see moveShelvedToChildList() + * @see hide() + */ + +bool CNxWidget::moveChildToShelvedList(CNxWidget *widget) +{ + // Locate widget in main vector + + for (int i = 0; i < m_children.size(); i++) + { + if (m_children[i] == widget) + { + // Add widget to shelved vector + + m_shelvedWidgets.push_back(widget); + + // Remove widget from main vector + + m_children.erase(i); + return true; + } + } + + return false; +} + +/** + * Moves the supplied child widget from the shelved list back + * to the child widget list. + * For framework use only. + * + * @param widget A pointer to the shelved widget. + * @return True if the widget was moved successfully. + * @see moveChildtoShelvedList() + * @see show() + */ + +bool CNxWidget::moveShelvedToChildList(CNxWidget *widget) +{ + // Locate widget in shelved vector + + for (int i = 0; i < m_shelvedWidgets.size(); i++) + { + if (m_shelvedWidgets[i] == widget) + { + // Add widget to end of main vector + + m_children.push_back(widget); + + // Remove widget from shelved vector + + m_shelvedWidgets.erase(i); + return true; + } + } + + return false; +} + +/** + * Sets the supplied widget as the focused child. The widget must + * be a child of this widget. + * + * @param widget A pointer to the child widget. + * @see getFocusedWidget() + */ + +void CNxWidget::setFocusedWidget(CNxWidget *widget) +{ + if (m_focusedChild != widget) + { + if (m_focusedChild != NULL) + { + // Blur the current active widget + + m_focusedChild->blur(); + } + } + + // Remember the new active widget + + m_focusedChild = widget; + + // Make this widget active too + + focus(); + + // Route keyboard input to the focused widget + + m_widgetControl->setFocusedWidget(this); +} + +/** + * Checks if the supplied coordinates collide with this widget. + * + * @param x The x coordinate to check. + * @param y The y coordinate to check. + * @return True if a collision occurred. + */ + +bool CNxWidget::checkCollision(nxgl_coord_t x, nxgl_coord_t y) const +{ + if (isHidden()) + { + return false; + } + + // Get the clipped rect + + CRect rect; + getRectClippedToHierarchy(rect); + return rect.contains(x, y); +} + +/** + * Checks if the supplied rectangle definition collides with this widget. + * + * @param x The x coordinate of the rectangle to check. + * @param y The y coordinate of the rectangle to check. + * @param width The width of the rectangle to check. + * @param height The height of the rectangle to check. + * @return True if a collision occurred. + */ + +bool CNxWidget::checkCollision(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) const +{ + if (isHidden()) + { + return false; + } + + // Get the clipped rect + + CRect rect; + getRectClippedToHierarchy(rect); + return rect.intersects(CRect(x, y, width, height)); +} + +/** + * Checks if the supplied widget collides with this widget. + * + * @param widget A pointer to another widget to check for collisions with. + * @return True if a collision occurred. + */ + +bool CNxWidget::checkCollision(CNxWidget *widget) const +{ + // Get the clipped rect + + CRect rect; + widget->getRectClippedToHierarchy(rect); + return rect.intersects(m_rect); +} + +/** + * Invalidate the visible region cache for all widgets below the supplied + * widget in this widget's child stack. This will cause those widgets to + * + * recalculate their visible regions next time they try to draw themselves. + * @param widget A pointer to a child widget. + */ + +void CNxWidget::invalidateLowerWidgetsVisibleRectCache(CNxWidget *widget) +{ + // Find the widget + + int widgetIndex = getWidgetIndex(widget); + + // Invalidate lower widgets + + for (int i = widgetIndex - 1; i > -1; i--) + { + if (m_children[i]->checkCollision(widget)) + { + m_children[i]->invalidateVisibleRectCache(); + } + } +} + +/** + * Adds a widget to this widget's child stack. The widget is added to the + * top of the stack. Note that the widget can only be added if it is not + * already a child of another widget. + * + * @param widget A pointer to the widget to add to the child list. + * @see insertWidget() + */ + +void CNxWidget::addWidget(CNxWidget *widget) +{ + if (widget->getParent() == NULL) + { + widget->setParent(this); + m_children.push_back(widget); + + // Should the widget steal the focus? + + if (widget->hasFocus()) + { + setFocusedWidget(widget); + } + + widget->enableDrawing(); + invalidateVisibleRectCache(); + widget->redraw(); + } +} + +/** + * Inserts a widget into this widget's child stack at the bottom of the + * stack. Note that the widget can only be added if it is not already + * a child of another widget. + * + * @param widget A pointer to the widget to add to the child list. + * @see addWidget() + */ + +void CNxWidget::insertWidget(CNxWidget *widget) +{ + if (widget->getParent() == NULL) + { + widget->setParent(this); + m_children.insert(0, widget); + + widget->enableDrawing(); + invalidateVisibleRectCache(); + widget->redraw(); + } +} + +/** + * Rebuild the list of this widget's visible regions + */ + +void CNxWidget::cacheVisibleRects(void) const +{ + m_rectCache->cache(); +} + +/** + * Mark this widget's visible region cache as invalid, and do the same + * to its child widgets. + */ + +void CNxWidget::invalidateVisibleRectCache(void) +{ + m_rectCache->invalidate(); + + // Invalidate child cache + + for (int i = 0; i < m_children.size(); i++) + { + m_children[i]->invalidateVisibleRectCache(); + } +} + +/** + * Erase a child widget by drawing the widgets behind it. + * + * @param widget The child widget to erase. + */ + +void CNxWidget::eraseWidget(CNxWidget *widget) +{ + // Locate the widget + + int widgetIndex = getWidgetIndex(widget); + + // Ensure rect cache is up to date + + widget->cacheVisibleRects(); + + // Order all lower widgets to redraw themselves based on the erased widget's + // visible rect cache + + for (int i = widgetIndex - 1; i > -1; i--) + { + m_children[i]->redrawDirty(widget->getForegroundRegions(), widget); + } + + // Order this widget to redraw itself based on any remaining rectangles + // in the erased widget's rect cache + + redrawDirty(widget->getForegroundRegions(), widget); + invalidateVisibleRectCache(); +} + +/** + * Redraw any visible regions of this widget that have become corrupted. + * + * @param invalidRects A list of corrupt regions. + * @param sender A pointer to the widget that corrupted the regions. + */ + +void CNxWidget::redrawDirty(TNxArray *invalidRects, CNxWidget *sender) +{ + if (isDrawingEnabled()) + { + // Draw any children first + + redrawDirtyChildren(invalidRects, sender); + + // Create an array that will contain all of the rects from the + // original array that overlap this widget + + TNxArray *overlappingRects = new TNxArray(); + + // Remove any non-overlapping rectangles from dirty vector and add to + // overlapping vector + + m_rectCache->splitRectangles(invalidRects, overlappingRects, sender); + + // Create an array that will contain all of the rects that overlap this + // widget clipped to its parent + + TNxArray *rectsToDraw = new TNxArray(); + + // Split from overlappingRects into rectsToDraw, giving us an array + // of rects that overlap only the visible portions of this widget + + m_rectCache->splitRectangles(overlappingRects, rectsToDraw, sender); + + // Get the graphics port for drawing in this window + + CGraphicsPort *port = m_widgetControl->getGraphicsPort(); + + // Draw the dirty rects + + if (rectsToDraw->size() > 0) + { + for (int i = 0; i < rectsToDraw->size(); i++) + { + drawBorder(port); + drawContents(port); + } + } + + // Copy all of the overlapping rects we didn't draw back to the main + // array of rects that need to be drawn by another widget + + for (int i = 0; i < overlappingRects->size(); i++) + { + invalidRects->push_back(overlappingRects->at(i)); + } + + // Clean up + + delete overlappingRects; + delete rectsToDraw; + } +} + +/** + * Clips a rectangular region to the dimensions of this widget and its ancestors. + * + * @param rect The region that needs to be clipped. + */ + +void CNxWidget::clipRectToHierarchy(CRect &rect) const { + + const CNxWidget *parent = m_parent; + const CNxWidget *widget = this; + CRect thisRect; + + while (parent != NULL) + { + // Standard widgets can draw into client space + + parent->getClientRect(thisRect); + + // Adjust rect to screen space + + thisRect.offset(parent->getX(), parent->getY()); + rect.clipToIntersect(thisRect); + + // Send up to parent + + widget = parent; + parent = parent->getParent(); + } +} + + /** + * Swaps the depth of the supplied child widget. + * + * @param widget A pointer to the child widget that needs to swap depths. + * @return True if the swap was successful. + */ + +bool CNxWidget::swapWidgetDepth(CNxWidget *widget) +{ + // Can we swap? + + if (m_children.size() > 1) + { + int widgetSource = 0; + int widgetDest = 0; + + // Locate the widget in the vector + + widgetSource = getWidgetIndex(widget); + + // Attempt to raise up + + int i = getHigherVisibleWidget(widgetSource); + if (i > -1) + { + // Raise + + widgetDest = i; + } + else + { + // Lower to bottom of stack + + widgetDest = 0; + } + + // Erase the widget from the screen + + eraseWidget(widget); + + // Swap + + CNxWidget *tmp = m_children[widgetSource]; + m_children[widgetSource] = m_children[widgetDest]; + m_children[widgetDest] = tmp; + + // Invalidate the widgets below the top affected widget + + if (widgetSource < widgetDest) + { + // Source lower; invalidate from dest down + + m_children[widgetDest]->invalidateVisibleRectCache(); + invalidateLowerWidgetsVisibleRectCache(m_children[widgetDest]); + } + else + { + // Dest lower; invalidate from source down + + m_children[widgetSource]->invalidateVisibleRectCache(); + invalidateLowerWidgetsVisibleRectCache(m_children[widgetSource]); + } + + // Redraw the widget + + widget->redraw(); + return true; + } + + return false; +} + +/** + * Swap the depth of this widget. + * + * @return True if the swap was successful. + */ + +bool CNxWidget::swapDepth(void) +{ + if (m_parent != (CNxWidget *)NULL) + { + return m_parent->swapWidgetDepth(this); + } + + return false; +} + +/** + * Remove this widget from the widget hierarchy. Returns + * responsibility for deleting the widget back to the developer. + * Does not unregister the widget from the VBL system. + * Does not erase the widget from the display. + * + * @return True if the widget was successfully removed. + */ + +bool CNxWidget::remove(void) +{ + if (m_parent != (CNxWidget *)NULL) + { + return m_parent->removeChild(this); + } + + return false; +} + +/** + * Remove a child widget from the widget hierarchy. Returns + * responsibility for deleting the widget back to the developer. + * Does not unregister the widget from the VBL system. + * Does not erase the widget from the display. + * + * @param widget Pointer to the widget to remove from the hierarchy. + * @return True if the widget was succesfully removed. + */ + +bool CNxWidget::removeChild(CNxWidget *widget) +{ + // Do we need to make another widget active? + + if (m_focusedChild == widget) + { + m_focusedChild = (CNxWidget *)NULL; + m_widgetControl->clearFocusedWidget(this); + } + + // Unset clicked widget if necessary + + CNxWidget *clickedWidget = m_widgetControl->getClickedWidget(); + if (clickedWidget == widget) + { + clickedWidget->release(clickedWidget->getX(), clickedWidget->getY()); + } + + // Divorce child from parent + + widget->setParent((CNxWidget *)NULL); + widget->disableDrawing(); + + // Locate widget in main vector + + for (int i = 0; i < m_children.size(); i++) + { + if (m_children[i] == widget) + { + // Remove widget from main vector + + m_children.erase(i); + return true; + } + } + + // Try to locate in shelved vector + + for (int i = 0; i < m_shelvedWidgets.size(); i++) + { + if (m_shelvedWidgets[i] == widget) + { + // Divorce child from parent + + m_shelvedWidgets[i]->setParent((CNxWidget *)NULL); + + // Remove widget from shelved vector + + m_shelvedWidgets.erase(i); + widget->disableDrawing(); + return true; + } + } + + return false; +} + +/** + * Run the widget modally. + */ + +void CNxWidget::goModal(void) +{ + // Remember that we're running modally + + m_flags.modal = true; + + // Steal focus + + focus(); + + // Loop until no longer modal + + while (isModal()) + { + // Process pending events + + bool interestingEvent = m_widgetControl->pollEvents(this); + + // Did any interesting events occur? + + if (!interestingEvent) + { + // No, give up the CPU until something interesting happens. + + m_widgetControl->waitForModalEvent(); + } + } +} + +/** + * Get the index of the specified child widget. + * + * @param widget The widget to get the index of. + * @return The index of the widget. -1 if the widget is not found. + */ + +const int CNxWidget::getWidgetIndex(const CNxWidget *widget) const +{ + for (int i = 0; i < m_children.size(); i++) + { + if (m_children[i] == widget) + { + return i; + } + } + + return -1; +} + +/** + * Get the child widget at the specified index. + * + * @param index Index of the child to retrieve. + * @return Pointer to the child at the specified index. + */ + +const CNxWidget *CNxWidget::getChild(const int index) const +{ + if (index < (int)m_children.size()) + { + return m_children[index]; + } + return (CNxWidget *)NULL; +} + +/** + * Sets the border size. The border cannot be drawn over in the + * drawContents() method. + * + * @param borderSize The new border size. + */ + +void CNxWidget::setBorderSize(const WidgetBorderSize &borderSize) +{ + m_borderSize.top = borderSize.top; + m_borderSize.right = borderSize.right; + m_borderSize.bottom = borderSize.bottom; + m_borderSize.left = borderSize.left; +} + +/** + * Use the provided widget style + */ + +void CNxWidget::useWidgetStyle(const CWidgetStyle *style) +{ + m_style.colors.background = style->colors.background; + m_style.colors.selectedBackground = style->colors.selectedBackground; + m_style.colors.shineEdge = style->colors.shineEdge; + m_style.colors.shadowEdge = style->colors.shadowEdge; + m_style.colors.highlight = style->colors.highlight; + m_style.colors.disabledText = style->colors.disabledText; + m_style.colors.enabledText = style->colors.enabledText; + m_style.colors.selectedText = style->colors.selectedText; + m_style.font = style->font; +} + +/** + * Checks if the supplied coordinates collide with a portion of this widget + * that is not obscured by its siblings, but that may be obscured by + * its children. + * + * @param x X coordinate of the click. + * @param y Y coordinate of the click. + * @return True if a collision occurred; false if not. + */ + +bool CNxWidget::checkCollisionWithForegroundRects(nxgl_coord_t x, nxgl_coord_t y) const +{ + if (isHidden()) + { + return false; + } + + cacheVisibleRects(); + + CRect *rect; + for (int i = 0; i < m_rectCache->getForegroundRegions()->size(); ++i) + { + rect = &(m_rectCache->getForegroundRegions()->at(i)); + if (rect->contains(x, y)) + { + return true; + } + } + + return false; +} + +/** + * Draw all visible regions of this widget's children. + */ + +void CNxWidget::drawChildren(void) +{ + for (int i = 0; i < m_children.size(); i++) + { + m_children[i]->redraw(); + } +} + +/** + * Erase and remove the supplied child widget from this widget and + * send it to the deletion queue. + * + * @param widget The widget to close. + * @see close(). + */ + +void CNxWidget::closeChild(CNxWidget *widget) +{ + if (widget == NULL) + { + return; + } + + // Ensure widget knows it is being closed + + widget->close(); + + // Do we need to make another widget active? + + if (m_focusedChild == widget) + { + m_focusedChild = (CNxWidget *)NULL; + m_widgetControl->clearFocusedWidget(this); + + // Try to choose highest widget + + for (int i = m_children.size() - 1; i > -1; i--) + { + if ((m_children[i] != widget) && (!m_children[i]->isHidden())) + { + m_focusedChild = m_children[i]; + } + } + + // Where should the focus go? + + if (m_focusedChild != NULL) + { + // Send focus to the new active widget + + m_focusedChild->focus(); + + // Route keyboard input to the focused widget + + m_widgetControl->setFocusedWidget(this); + } + else + { + // Give focus to this + + setFocusedWidget((CNxWidget *)NULL); + } + } + + moveChildToDeleteQueue(widget); +} + +/** + * Erase the supplied child widget and move it out of the main child + * list into the shelved list. The widget remains in memory and can + * be restored by calling "unshelve()" on the widget. + * + * @param widget The widget to hide. + */ + +void CNxWidget::shelveChild(CNxWidget *widget) +{ + if (widget == NULL) + { + return; + } + + // Ensure widget knows it is being shelved + + widget->shelve(); + + // Do we need to give another widget focus? + + if (m_focusedChild == widget) + { + m_focusedChild = (CNxWidget *)NULL; + m_widgetControl->clearFocusedWidget(this); + + // Try to choose highest widget + + for (int i = m_children.size() - 1; i > -1; i--) + { + if ((m_children[i] != widget) && (!m_children[i]->isHidden())) + { + m_focusedChild = m_children[i]; + } + } + + // Where should the focus go? + + if (m_focusedChild != NULL) + { + // Send focus to the new active widget + + m_focusedChild->focus(); + + // Route keyboard input to the focused widget + + m_widgetControl->setFocusedWidget(this); + } + else + { + // Give focus to this + + setFocusedWidget((CNxWidget *)NULL); + } + } + + moveChildToShelvedList(widget); +} + + /** + * Redraws all regions of child widgets that fall within the invalidRects + * regions. + * + * @param invalidRects List of invalid regions that need to be redrawn. + * @param sender Pointer to the widget that initiated the redraw. + */ + +void CNxWidget::redrawDirtyChildren(TNxArray *invalidRects, CNxWidget *sender) +{ + for (int i = m_children.size() - 1; i > -1 ; i--) + { + if (invalidRects->size() > 0) + { + if (m_children.at(i) != sender) + { + m_children[i]->redrawDirty(invalidRects, sender); + } + } + else + { + break; + } + } +} + +/** + * Get the index of the next visible widget higher up the z-order. + * + * @param startIndex The starting index. + * @return The index of the next highest visible widget. + */ + +const int CNxWidget::getHigherVisibleWidget(const int startIndex) const +{ + for (int i = startIndex; i < m_children.size(); i++) + { + if (!m_children[i]->isHidden()) + { + return i; + } + } + + return -1; +} + +/** + * Get the index of the next visible widget lower down the z-order. + * + * @param startIndex The starting index. + * @return The index of the next lowest visible widget. + */ + +const int CNxWidget::getLowerVisibleWidget(const int startIndex) const +{ + for (int i = startIndex; i > -1; i--) + { + if (!m_children[i]->isHidden()) + { + return i; + } + } + + return -1; +} + +/** + * Notify this widget that it is being dragged, and set its drag point. + * + * @param x The x coordinate of the drag position relative to this widget. + * @param y The y coordinate of the drag position relative to this widget. + */ + +void CNxWidget::startDragging(nxgl_coord_t x, nxgl_coord_t y) +{ + if (m_flags.draggable) + { + m_flags.dragging = true; + m_flags.clicked = true; + m_grabPointX = x - getX(); + m_grabPointY = y - getY(); + m_newX = m_rect.getX(); + m_newY = m_rect.getY(); + + onDragStart(); + } +} + +/** + * Notify this widget that it is no longer being dragged. + */ + +void CNxWidget::stopDragging(nxgl_coord_t x, nxgl_coord_t y) +{ + if (m_flags.dragging) + { + onDragStop(); + m_flags.dragging = false; + m_widgetEventHandlers->raiseDropEvent(x, y); + } +} diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx new file mode 100644 index 000000000..fd4cc6ef2 --- /dev/null +++ b/libnxwidgets/src/cnxwindow.cxx @@ -0,0 +1,342 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cnxwindow.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cnxwindow.hxx" +#include "cbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param hNxServer Handle to the NX server. + */ + +CNxWindow::CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) + : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hNxWindow(0), + m_widgetControl(pWidgetControl) +{ + // Create the CGraphicsPort instance for this window + + m_widgetControl->createGraphicsPort(static_cast(this)); +} + +/** + * Destructor. + */ + +CNxWindow::~CNxWindow(void) +{ + // Release the window. We do not release the widget control + // instance. The lifetime of that instance is owned by he-who- + // constructed-us. + + (void)nx_closewindow(m_hNxWindow); +} + +/** + * Creates a new window. Window creation is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully opened. + */ + +bool CNxWindow::open(void) +{ + // Get the C-callable callback vtable + + FAR struct nx_callback_s *vtable = getCallbackVTable(); + + // Create the window + + m_hNxWindow = nx_openwindow(m_hNxServer, vtable, (FAR void *)m_widgetControl); + return m_hNxWindow != NULL; +} + +/** + * 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. + * + * @return True on success, false on any failure. + */ + +bool CNxWindow::requestPosition(void) +{ + // Request the window position + + return nx_getposition(m_hNxWindow) == OK; +} + +/** + * Get the position of the window in the physical display coordinates + * (as reported by the NX callback). + * + * @return The position. + */ + +bool CNxWindow::getPosition(FAR struct nxgl_point_s *pPos) +{ + return m_widgetControl->getWindowPosition(pPos); +} + +/** + * Get the size of the window (as reported by the NX callback). + * + * @return The size. + */ + +bool CNxWindow::getSize(FAR struct nxgl_size_s *pSize) +{ + return m_widgetControl->getWindowSize(pSize); +} + +/** + * Set the position and size of the window. + * + * @param pPos The new position of the window. + * @return True on success, false on any failure. + */ + +bool CNxWindow::setPosition(FAR const struct nxgl_point_s *pPos) +{ + // Set the window size and position + + return nx_setposition(m_hNxWindow, pPos) == OK; +} + +/** + * Set the size of the selected window. + * + * @param pSize The new size of the window. + * @return True on success, false on any failure. + */ + +bool CNxWindow::setSize(FAR const struct nxgl_size_s *pSize) +{ + // Set the window size + + return nx_setsize(m_hNxWindow, pSize) == OK; +} + +/** + * Bring the window to the top of the display. + * + * @return True on success, false on any failure. + */ + +bool CNxWindow::raise(void) +{ + // Raise the window to the top of the display + + return nx_raise(m_hNxWindow) == OK; +} + +/** + * Lower the window to the bottom of the display. + * + * @return True on success, false on any failure. + */ + +bool CNxWindow::lower(void) +{ + // Lower the window to the bottom of the display + + return nx_lower(m_hNxWindow) == OK; +} + +/** + * Set an individual pixel in the window with the specified color. + * + * @param pPos The location of the pixel to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxWindow::setPixel(FAR const struct nxgl_point_s *pPos, + nxgl_mxpixel_t color) +{ + // Set an individual pixel to the specified color + + return nx_setpixel(m_hNxWindow, pPos, &color) == OK; +} + +/** + * Fill the specified rectangle in the window with the specified color. + * + * @param pRect The location to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxWindow::fill(FAR const struct nxgl_rect_s *pRect, + nxgl_mxpixel_t color) +{ + // Fill a rectangular region with a solid color + + return nx_fill(m_hNxWindow, pRect, &color) == OK; +} + +/** + * 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. + * + * @param rect The location to be copied + * @param dest - The describes the destination bitmap to receive the + * graphics data. + */ + +void CNxWindow::getRectangle(FAR const struct nxgl_rect_s *rect, struct SBitmap *dest) +{ + // Get a rectangule region from the window + + (void)nx_getrectangle(m_hNxWindow, rect, 0, (FAR uint8_t*)dest->data, dest->stride); +} +/** + * Fill the specified trapezoidal region in the window with the specified + * color. + * + * @param pClip Clipping rectangle relative to window (may be null). + * @param pTrap The trapezoidal region to be filled. + * @param color The color to use in the fill. + * + * @return True on success; false on failure. + */ + +bool CNxWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, + FAR const struct nxgl_trapezoid_s *pTrap, + nxgl_mxpixel_t color) +{ + // Fill a trapezoidal region with a solid color + + return nx_filltrapezoid(m_hNxWindow, pClip, pTrap, &color) == OK; +} + +/** + * Fill the specified line in the window with the specified color. + * + * @param vector - Describes the line to be drawn + * @param width - The width of the line + * @param color - The color to use to fill the line + * + * @return True on success; false on failure. + */ + +bool CNxWindow::drawLine(FAR struct nxgl_vector_s *vector, + nxgl_coord_t width, nxgl_mxpixel_t color) +{ + // Draw a line with the specified color + + return nx_drawline(m_hNxWindow, vector, width, &color) == OK; +} + +/** + * Draw a filled circle at the specified position, size, and color. + * + * @param center The window-relative coordinates of the circle center. + * @param radius The radius of the rectangle in pixels. + * @param color The color of the rectangle. + */ + +bool CNxWindow::drawFilledCircle(struct nxgl_point_s *center, nxgl_coord_t radius, + nxgl_mxpixel_t color) +{ + return nx_fillcircle(m_hNxWindow, center, radius, &color) == OK; +} + +/** + * Move a rectangular region within the window. + * + * @param pRect Describes the rectangular region to move. + * @param pOffset The offset to move the region. + * + * @return True on success; false on failure. + */ + +bool CNxWindow::move(FAR const struct nxgl_rect_s *pRect, + FAR const struct nxgl_point_s *pOffset) +{ + // Move a rectangular region of the display + + return nx_move(m_hNxWindow, pRect, pOffset) == OK; +} + +/** + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. The source image is treated as an opaque image. + * + * @param pDest Describes the rectangular on the display that will receive + * the bitmap. + * @param pSrc The start of the source image. + * @param 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. + * @param stride The width of the full source image in bytes. + * + * @return True on success; false on failure. + */ + +bool CNxWindow::bitmap(FAR const struct nxgl_rect_s *pDest, + FAR const void *pSrc, + FAR const struct nxgl_point_s *pOrigin, + unsigned int stride) +{ + // Copy a rectangular bitmap image in a region on the display + + return nx_bitmap(m_hNxWindow, pDest, &pSrc, pOrigin, stride) == OK; +} diff --git a/libnxwidgets/src/cprogressbar.cxx b/libnxwidgets/src/cprogressbar.cxx new file mode 100644 index 000000000..5f29a3f7e --- /dev/null +++ b/libnxwidgets/src/cprogressbar.cxx @@ -0,0 +1,230 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cprogressbar.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include "cprogressbar.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the progress bar, relative to its parent. + * @param y The y coordinate of the progress bar, relative to its parent. + * @param width The width of the progress bar. + * @param height The height of the progress bar. + */ + +CProgressBar::CProgressBar(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +: CNxWidget(pWidgetControl, x, y, width, height, 0) +{ + m_minimumValue = 0; + m_maximumValue = 0; + m_value = 0; + m_showPercentageText = true; + m_flags.borderless = false; +} + +/** + * Set the value that of the progress bar. + * + * @param value The new value. + */ + +void CProgressBar::setValue(const int16_t value) +{ + m_value = value; + + // Limit to max/min values + + if (m_value > m_maximumValue) + { + m_value = m_maximumValue; + } + + if (m_value < m_minimumValue) + { + m_value = m_minimumValue; + } + + redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CProgressBar::drawContents(CGraphicsPort *port) +{ + // Get the drawing window, accounting for the presence of any border + + CRect rect; + getRect(rect); + + // Calculate ratio of pixels to value range (max fractional value of 255) + + uint32_t ratio = ((uint32_t)rect.getWidth() << 8) / (uint32_t)(m_maximumValue - m_minimumValue); + + // Convert value using ratio, rounding up and shifting down + + int16_t barWidth = ((m_value * ratio) + 128) >> 8; + + // Draw filled region + + port->drawFilledRect(rect.getX(), rect.getY(), barWidth, rect.getHeight(), getHighlightColor()); + + // Draw unfilled background + + if (barWidth < rect.getWidth()) + { + port->drawFilledRect(rect.getX() + barWidth, rect.getY(), + rect.getWidth() - barWidth, rect.getHeight(), + getBackgroundColor()); + } + + // Draw completion percentage text + + if (m_showPercentageText) + { + char text[6]; + sprintf(text, "%d%%", (100 * m_value) / (m_maximumValue - m_minimumValue)); + + struct nxgl_point_s pos; + pos.x = rect.getX() + + ((rect.getWidth() - getFont()->getStringWidth(text)) >> 1); + pos.y = rect.getY() + + ((rect.getHeight() - getFont()->getHeight()) >> 1); + + // Determine the background and text color + + nxgl_mxpixel_t textColor; + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + } + else + { + textColor = getEnabledTextColor(); + } + + // And draw the text using the selected color + + port->drawText(&pos, &rect, getFont(), text, 0, strlen(text), + textColor); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CProgressBar::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} diff --git a/libnxwidgets/src/cradiobutton.cxx b/libnxwidgets/src/cradiobutton.cxx new file mode 100644 index 000000000..86ad4118f --- /dev/null +++ b/libnxwidgets/src/cradiobutton.cxx @@ -0,0 +1,225 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cradiobutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cwidgetcontrol.hxx" +#include "cradiobutton.hxx" +#include "cradiobuttongroup.hxx" +#include "cgraphicsport.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CLabel Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the radio button, relative to its + * parent. + * @param y The y coordinate of the radio button, relative to its + * parent. + * @param width The width of the radio button. + * @param height The height of the radio button. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * defaultCWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CRadioButton::CRadioButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CButton(pWidgetControl, x, y, width, height, *NXWidgets::g_nullString, style) +{ + m_state = RADIO_BUTTON_STATE_OFF; + m_flags.borderless = true; +} + +/** + * Set the state of the radio button. + * + * @param state The new radio button state. + */ + +void CRadioButton::setState(CRadioButton::RadioButtonState state) +{ + if (m_state != state) + { + m_state = state; + + if (m_state != RADIO_BUTTON_STATE_OFF) + { + ((CRadioButtonGroup*)m_parent)->setSelectedWidget(this); + } + + m_widgetEventHandlers->raiseValueChangeEvent(); + redraw(); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CRadioButton::drawContents(CGraphicsPort *port) +{ + // Get the X/Y position of the drawable region within the Label + + nxgl_coord_t x = getX(); + nxgl_coord_t y = getY(); + + nxgl_coord_t width = getWidth(); + nxgl_coord_t height = getHeight(); + + // Include and offset for the border + + if (!m_flags.borderless) + { + x += m_borderSize.left; + y += m_borderSize.top; + + width -= (m_borderSize.left + m_borderSize.right); + height -= (m_borderSize.top + m_borderSize.bottom); + } + + // Decide which glyph to draw + + const struct SBitmap *glyph; + + switch (m_state) + { + default: + case RADIO_BUTTON_STATE_ON: + glyph = &g_radioButtonOn; + break; + + case RADIO_BUTTON_STATE_OFF: + glyph = &g_radioButtonOff; + break; + + case RADIO_BUTTON_STATE_MU: + glyph = &g_radioButtonMu; + break; + } + + // Don't exceed the size of the glyph + + if (width > glyph->width) + { + width = glyph->width; + } + + if (height > glyph->height) + { + height = glyph->height; + } + + // Draw button + + port->drawBitmap(x, y, width, height, glyph, 0, 0, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); +} + +/** + * Sets the radiobutton's state to "on". + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CRadioButton::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + setState(RADIO_BUTTON_STATE_ON); +} diff --git a/libnxwidgets/src/cradiobuttongroup.cxx b/libnxwidgets/src/cradiobuttongroup.cxx new file mode 100644 index 000000000..b1d75f625 --- /dev/null +++ b/libnxwidgets/src/cradiobuttongroup.cxx @@ -0,0 +1,344 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cradiobutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cradiobuttongroup.hxx" +#include "cradiobutton.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CLabel Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. Note that the group determines its width and height + * from the position and dimensions of its children. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the group. + * @param y The y coordinate of the group. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CRadioButtonGroup::CRadioButtonGroup(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, 0, 0, WIDGET_BORDERLESS, style) +{ + m_widgetControl = pWidgetControl; + m_selectedWidget = (CRadioButton *)NULL; +} + +/** + * Simple method for adding a new radio button to the group. + * This should be used in preference to the usual addWidget() method, + * as this method automatically resizes the group. + * + * @param x The x coordinate of the new button, relative to this + * widget. + * @param y The y coordinate of the new button, relative to this + * widget. + * @param width The width of the new button. + * @param height The height of the new button. + */ + +CRadioButton *CRadioButtonGroup::newRadioButton(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +{ + CRadioButton *newButton = new CRadioButton(m_widgetControl, x, y, width, height, &m_style); + newButton->addWidgetEventHandler(this); + addWidget(newButton); + + // Do we need to resize? + + nxgl_coord_t newWidth = getWidth(); + nxgl_coord_t newHeight = getHeight(); + + if (newWidth < x + width) + { + newWidth = x + width; + } + + if (newHeight < y + height) + { + newHeight = y + height; + } + + resize(newWidth, newHeight); + return newButton; +} + +/** + * Gets a pointer to the selected widget. + * + * @return Pointer to the selected widget. + */ + +const CRadioButton *CRadioButtonGroup::getSelectedWidget(void) const +{ + return (CRadioButton *)m_selectedWidget; +} + +/** + * Gets the index of the selected widget. + * + * @return The index of the selected widget. + */ + +const int CRadioButtonGroup::getSelectedIndex(void) const +{ + for (int i = 0; i < m_children.size(); i++) + { + if (((CRadioButton*)m_children[i]) == m_selectedWidget) + { + return i; + } + } + + // Nothing selected + + return -1; +} + +/** + * Sets the selected radio button to the supplied widget. + * + * @param widget The radio button to select. + */ + +void CRadioButtonGroup::setSelectedWidget(CRadioButton* widget) +{ + if (m_selectedWidget != widget) + { + if (m_selectedWidget != NULL) + { + m_selectedWidget->setState(CRadioButton::RADIO_BUTTON_STATE_OFF); + } + + m_selectedWidget = widget; + + if (m_selectedWidget != NULL) + { + m_selectedWidget->setState(CRadioButton::RADIO_BUTTON_STATE_ON); + } + + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Selects the widget at the specified index. + * + * @param index The index of the widget to select. + */ + +void CRadioButtonGroup::setSelectedIndex(int index) +{ + if (index < m_children.size()) + { + setSelectedWidget((CRadioButton*)m_children[index]); + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. Value is based on the length of the largest string + * in the set of options. + * + * @param rect Reference to a rect to populate with data. + */ + +void CRadioButtonGroup::getPreferredDimensions(CRect& rect) const +{ + nxgl_coord_t width = 0; + nxgl_coord_t height = 0; + + if (!m_flags.borderless) + { + width = m_borderSize.left + m_borderSize.right; + height = m_borderSize.top + m_borderSize.bottom; + } + + nxgl_coord_t widgetX = 0; + nxgl_coord_t widgetY = 0; + + nxgl_coord_t maxX = 0; + nxgl_coord_t maxY = 0; + + // Locate largest x and y coords within children + + for (int i = 0; i < m_children.size(); ++i) + { + widgetX = m_children[i]->getX() + m_children[i]->getWidth(); + widgetY = m_children[i]->getY() + m_children[i]->getHeight(); + + if (widgetX > maxX) + { + maxX = widgetX; + } + + if (widgetY > maxY) + { + maxY = widgetY; + } + } + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width + maxX - getX()); + rect.setHeight(height + maxY - getY()); +} + +/** + * Handle a mouse click event. + * + * @param e The event data. + */ + +void CRadioButtonGroup::handleClickEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseClickEvent(e.getX(), e.getY()); +} + +/** + * Handle a mouse double-click event. + * + * @param e The event data. + */ + +void CRadioButtonGroup::handleDoubleClickEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseDoubleClickEvent(e.getX(), e.getY()); +} + +/** + * Handle a mouse button release event that occurred within the bounds of + * the source widget. + * @param e The event data. + */ + +void CRadioButtonGroup::handleReleaseEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseReleaseEvent(e.getX(), e.getY()); +} + +/** + * Handle a mouse button release event that occurred outside the bounds of + * the source widget. + * + * @param e The event data. + */ + +void CRadioButtonGroup::handleReleaseOutsideEvent(const CWidgetEventArgs &e) +{ + // Child raised a release outside event, but we need to raise a different + // event if the release occurred within the bounds of this parent widget + + if (checkCollision(e.getX(), e.getY())) + { + m_widgetEventHandlers->raiseReleaseEvent(e.getX(), e.getY()); + } + else + { + m_widgetEventHandlers->raiseReleaseOutsideEvent(e.getX(), e.getY()); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CRadioButtonGroup::drawContents(CGraphicsPort *port) +{ + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), getBackgroundColor()); +} diff --git a/libnxwidgets/src/crect.cxx b/libnxwidgets/src/crect.cxx new file mode 100644 index 000000000..8e0ed2cd4 --- /dev/null +++ b/libnxwidgets/src/crect.cxx @@ -0,0 +1,380 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cbgwindow.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "crect.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + */ + +CRect::CRect(void) +{ + m_pos.x = 0; + m_pos.y = 0; + m_size.w = 0; + m_size.h = 0; +} + +/** + * Constructor. + * + * @param x The x coordinate of the rect. + * @param y The y coordinate of the rect. + * @param width The width of the rect. + * @param height The height of the rect. + */ + +CRect::CRect(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) +{ + m_pos.x = x; + m_pos.y = y; + m_size.w = width; + m_size.h = height; +} + +/** + * Constructor. + * + * @param rect Pointer to an NX rectangle + */ + +CRect::CRect(FAR const nxgl_rect_s *rect) +{ + setNxRect(rect); +} + +/** + * Copy constructor. + * + * @param rect CRect to copy. + */ + +CRect::CRect(const CRect &rect) +{ + m_pos.x = rect.getX(); + m_pos.y = rect.getY(); + m_size.w = rect.getWidth(); + m_size.h = rect.getHeight(); +} + +/** + * Create a rect object from the supplied coordinates. + * + * @param x1 The x coordinate of the rect's top-left corner. + * @param y1 The y coordinate of the rect's top-left corner. + * @param x2 The x coordinate of the rect's bottom-right corner. + * @param y2 The y coordinate of the rect's bottom-right corner. + * @return A new rect. + */ + +CRect fromCoordinates(nxgl_coord_t x1, nxgl_coord_t y1, + nxgl_coord_t x2, nxgl_coord_t y2) +{ + // Ensure x2 is the larger value + + if (x2 < x1) + { + nxgl_coord_t swap = x1; + x1 = x2; + x2 = swap; + } + nxgl_coord_t width = x2 - x1 + 1; + + // Ensure y2 is the larger value + + if (y2 < y1) + { + nxgl_coord_t swap = y1; + y1 = y2; + y2 = swap; + } + nxgl_coord_t height = y2 - y1 + 1; + + // Create the CRect instance + + return CRect(x1, y1, width, height); +} + +/** + * Set the x coordinate of the rect's bottom-right corner. If x2 is less + * than the rect's current x coordinate the method automatically adjusts + * the coordinates so that the rect's width is never negative. Changing this + * property will change the width of the rect. + * + * @param x2 The x coordinate of the rect's bottom-right corner. + */ + +void CRect::setX2(nxgl_coord_t x2) +{ + // Ensure that x contains the smaller value + + if (x2 < m_pos.x) + { + nxgl_coord_t swap = m_pos.x; + m_pos.x = x2; + x2 = swap; + } + + // Then set the width + + m_size.w = x2 - m_pos.x + 1; +} + +/** + * Set the y coordinate of the rect's bottom-right corner. If y2 is less + * than the rect's current y coordinate the method automatically adjusts + * the coordinates so that the rect's height is never negative. Changing this + * property will change the height of the rect. + * + * @param y2 The y coordinate of the rect's bottom-right corner. + */ + +void CRect::setY2(nxgl_coord_t y2) +{ + // Ensure that y contains the smaller value + + if (y2 < m_pos.y) + { + nxgl_coord_t swap = m_pos.y; + m_pos.y = y2; + y2 = swap; + } + + // Then set the height + + m_size.h = y2 - m_pos.y + 1; +} + +/** + * Populates dest with a rectangle representating the intersection + * of this rectangle and rect. + * + * @param rect The rectangle to intersect with this. + * @param dest The destination rectangle. + */ + +void CRect::getIntersect(const CRect &rect, CRect &dest) const +{ + nxgl_coord_t x1 = ngl_max(m_pos.x, rect.getX()); + nxgl_coord_t y1 = ngl_max(m_pos.y, rect.getY()); + nxgl_coord_t x2 = ngl_min(getX2(), rect.getX2()); + nxgl_coord_t y2 = ngl_min(getY2(), rect.getY2()); + + dest.setX(x1); + dest.setY(y1); + dest.setWidth(x2 - x1 + 1); + dest.setHeight(y2 - y1 + 1); +} + +/** + * Populates dest with a rectangle representating the smallest + * rectangle that contains this rectangle and rect. + * + * @param rect The rectangle to add to this. + * @param dest The destination rectangle. + */ + +void CRect::getAddition(const CRect &rect, CRect &dest) const +{ + + nxgl_coord_t x1 = ngl_min(m_pos.x, rect.getX()); + nxgl_coord_t y1 = ngl_min(m_pos.y, rect.getY()); + nxgl_coord_t x2 = ngl_max(getX2(), rect.getX2()); + nxgl_coord_t y2 = ngl_max(getY2(), rect.getY2()); + + dest.setX(x1); + dest.setY(y1); + dest.setWidth(x2 - x1 + 1); + dest.setHeight(y2 - y1 + 1); +} + +/** + * Clips this rect to the region that intersects the supplied rect. + * + * @param rect CRect to intersect. + */ + +void CRect::clipToIntersect(const CRect &rect) +{ + CRect clipped; + getIntersect(rect, clipped); + + setX(clipped.getX()); + setY(clipped.getY()); + setWidth(clipped.getWidth()); + setHeight(clipped.getHeight()); +} + +/** + * Expands this rect so that it includes the area described by the supplied + * rect. + * + * @param rect CRect to include. + */ + +void CRect::expandToInclude(const CRect& rect) +{ + CRect addition; + getAddition(rect, addition); + + setX(addition.getX()); + setY(addition.getY()); + setWidth(addition.getWidth()); + setHeight(addition.getHeight()); +} + +/** + * Check if the supplied rect intersects this. + * + * @param rect CRect to check for intersection with this. + * @return True if the rect intersects this; false if not. + */ + +bool CRect::intersects(const CRect &rect) const +{ + return ((m_pos.x + m_size.w > rect.getX()) && + (m_pos.y + m_size.h > rect.getY()) && + (m_pos.x < rect.getX() + rect.getWidth()) && + (m_pos.y < rect.getY() + rect.getHeight())); +} + +/** + * Check if the rect contains the supplied point. + * + * @param x X coordinate of the point. + * @param y Y coordinate of the point. + * @return True if the rect contains the point; false if not. + */ + +bool CRect::contains(nxgl_coord_t x, nxgl_coord_t y) const +{ + return ((x >= m_pos.x) && (y >= m_pos.y) && + (x < m_pos.x + m_size.w) && (y < m_pos.y + m_size.h)); +} + +/** + * Copy the properties of this rect to the destination rect. + * + * @param dest Destination rect to copy to. + */ + +void CRect::copyTo(CRect &dest) const +{ + dest.setX(m_pos.x); + dest.setY(m_pos.y); + dest.setWidth(m_size.w); + dest.setHeight(m_size.h); +} + +/** + * Overloaded & operator. Returns the intersect of this rectangle and the + * rectangle passed as the "rect" argument". + * + * @param rect The rectangle to intersect with this. + */ + +CRect CRect::operator&(const CRect &rect) +{ + CRect dest; + getIntersect(rect, dest); + return dest; +} + +/** + * Overloaded + operator. Returns the smallest rectangle that can contain + * this rectangle and the rectangle passed as the "rect" argument". + * + * @param rect The rectangle to add to this. + */ + +CRect CRect::operator+(const CRect &rect) +{ + CRect dest; + getAddition(rect, dest); + return dest; +} diff --git a/libnxwidgets/src/crectcache.cxx b/libnxwidgets/src/crectcache.cxx new file mode 100644 index 000000000..3f74ee75d --- /dev/null +++ b/libnxwidgets/src/crectcache.cxx @@ -0,0 +1,521 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/crectcache.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "crectcache.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CNxFont Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param widget Widget that contains the rect cache. + */ + +CRectCache::CRectCache(const CNxWidget* widget) +{ + m_widget = widget; + m_foregroundInvalid = true; + m_backgroundInvalid = true; +} + +/** + * Rebuild the cache if it is invalid. + */ + +void CRectCache::cache(void) +{ + cacheBackgroundRegions(); +} + +/** + * Works out which rectangles in the invalidRects list overlap this + * widget, then cuts the rectangles into smaller pieces. The overlapping + * pieces are pushed into validRects, and the non-overlapping pieces are + * pushed back into the invalidRects vector. + * + * @param invalidRects A vector of regions that need to be tested + * for collisions against this widget; they represent regions that need + * to be redrawn. + * @param validRects A vector of regions that represents areas of the + * display that do not need to be redrawn. + * @param sender Pointer to the widget that initiated the split. + */ + +void CRectCache::splitRectangles(TNxArray* invalidRects, + TNxArray* validRects, + FAR const CNxWidget *sender) const +{ + // Check for collisions with any rectangles in the vector + + for (int i = 0; i < invalidRects->size(); i++) + { + // Get rectangle to check + + CRect checkRect = invalidRects->at(i); + nxgl_coord_t splitX[4]; + nxgl_coord_t splitY[4]; + unsigned int rectXCount = 0; + unsigned int rectYCount = 0; + unsigned int overlapXRect = 0; + unsigned int overlapYRect = 0; + + nxgl_coord_t width = checkRect.getWidth(); + nxgl_coord_t height = checkRect.getHeight(); + + if (m_widget->checkCollision(checkRect.getX(), checkRect.getY(), width, height)) + { + // Got a collision. We need to split this rectangle + // Get clipped dimensions of widget + + CRect widgetRect; + m_widget->getRectClippedToHierarchy(widgetRect); + + // Vertical split + // Start at left edge of rectangle + + splitX[0] = checkRect.getX(); + + // Check for second split + + if (checkRect.getX() < widgetRect.getX()) + { + // Widget is to the right of the invalid rectangle (or in the centre) + + if (splitX[rectXCount] != widgetRect.getX()) + { + rectXCount++; + splitX[rectXCount] = widgetRect.getX(); + + // The next rectangle is the overlap + + overlapXRect = rectXCount; + } + } + else + { + // Widget rectangle is on the left of the invalid rectangle + + if (splitX[rectXCount] != widgetRect.getX2() + 1) + { + // We've found the start of the overlapping rectangle! + + overlapXRect = rectXCount; + rectXCount++; + + // Split is either the end of the widget or the end of the + // invalid rect, whichever comes first + + if (widgetRect.getX2() <= checkRect.getX2()) + { + splitX[rectXCount] = widgetRect.getX2() + 1; + } + else + { + splitX[rectXCount] = checkRect.getX2() + 1; + } + } + else + { + // Found the start of the overlapping rectangle + + overlapXRect = rectXCount; + } + } + + // Check for third split + + if (widgetRect.getX2() + 1 <= checkRect.getX2() + 1) + { + // Widget ends before the invalid rectangle + + if (splitX[rectXCount] != widgetRect.getX2() + 1) + { + // Record end of overlap + + rectXCount++; + splitX[rectXCount] = widgetRect.getX2() + 1; + } + } + + // Store end of invalid rectangle + + if (splitX[rectXCount] <= checkRect.getX2()) + { + rectXCount++; + splitX[rectXCount] = checkRect.getX2() + 1; + } + + // Horizontal split + // Start at left edge of rectangle + + splitY[0] = checkRect.getY(); + + // Check for second split + + if (checkRect.getY() < widgetRect.getY()) + { + // Widget below the invalid rectangle (or in the centre) + + if (splitY[rectYCount] != widgetRect.getY()) + { + rectYCount++; + splitY[rectYCount] = widgetRect.getY(); + + // The next rectangle is the overlap + + overlapYRect = rectYCount; + } + } + else + { + // Widget rectangle above the invalid rectangle + + if (splitY[rectYCount] != widgetRect.getY2() + 1) + { + // We've found the start of the overlapping rectangle! + + overlapYRect = rectYCount; + rectYCount++; + + // Split is either the end of the widget or the end of the + // invalid rect, whichever comes first + + if (widgetRect.getY2() <= checkRect.getY2()) + { + splitY[rectYCount] = widgetRect.getY2() + 1; + } + else + { + splitY[rectYCount] = checkRect.getY2() + 1; + } + } + else + { + // Found the start of the overlapping rectangle + + overlapYRect = rectYCount; + } + } + + // Check for third split + + if (widgetRect.getY2() < checkRect.getY2()) + { + // Widget ends before the invalid rectangle + + if (splitY[rectYCount] != widgetRect.getY2() + 1) + { + // Record end of overlap + + rectYCount++; + splitY[rectYCount] = widgetRect.getY2() + 1; + } + } + + // Store end of invalid rectangle + + if (splitY[rectYCount] <= checkRect.getY2()) + { + rectYCount++; + splitY[rectYCount] = checkRect.getY() + 1; + } + + // Remove the original rectangle + + invalidRects->erase(i); + + // Force the loop to re-examine the new rectangle at this index + + i--; + + // Add the new rectangles (not the overlap; that's the one we need to draw) + + for (unsigned int xRects = 0; xRects < rectXCount; xRects++) + { + for (unsigned int yRects = 0; yRects < rectYCount; yRects++) + { + // Is this the overlap? + + if ((overlapXRect == xRects) && (overlapYRect == yRects)) + { + // Got the overlap, so set the output values + + CRect overlapRect; + overlapRect.setX(splitX[xRects]); + overlapRect.setY(splitY[yRects]); + overlapRect.setX2(splitX[xRects + 1] - 1); + overlapRect.setY2(splitY[yRects + 1] - 1); + + if (overlapRect.hasDimensions()) + { + validRects->push_back(overlapRect); + } + } + else + { + // Not an overlap; add to vector + + CRect newRect; + newRect.setX(splitX[xRects]); + newRect.setY(splitY[yRects]); + newRect.setX2(splitX[xRects + 1] - 1); + newRect.setY2(splitY[yRects + 1] - 1); + + // Insert the new rectangle at the start so we don't + + if (newRect.hasDimensions()) + { + invalidRects->push_back(newRect); + } + + // Increase iterator to compensate for insertion + + i++; + } + } + } + } + } +} + +/** + * Move any rectangles from the visibleRects list that overlap this widget + * into the invisibleRects list. Used during visible region calculations. + * + * @param visibleRects A vector of regions that are not overlapped. + * @param invisibleRects A vector of regions that are overlapped. + * @param widget The widget that requested the lists. + * @see splitRectangles() + */ + +void CRectCache::removeOverlappedRects(TNxArray *visibleRects, + TNxArray *invisibleRects, + FAR const CNxWidget* widget) const +{ + const CNxWidget* parent = m_widget; + int widgetIndex = -1; + + while ((widget != NULL) && (parent != NULL)) + { + // Locate widget in the list; we add one to the index to + // ensure that we deal with the next widget up in the z-order + + widgetIndex = parent->getWidgetIndex(widget) + 1; + + // Widget should never be the bottom item on the screen + + if (widgetIndex > 0) + { + // Remove any overlapped rectangles + + for (int i = widgetIndex; i < parent->getChildCount(); i++) + { + if (visibleRects->size() > 0) + { + parent->getChild(i)->getCRectCache()->splitRectangles(visibleRects, invisibleRects, widget); + } + else + { + break; + } + } + } + + if (visibleRects->size() > 0) + { + widget = parent; + + if (parent != NULL) + { + parent = parent->getParent(); + } + } + else + { + return; + } + } +} + +/** + * Cache the foreground regions. + */ + +void CRectCache::cacheForegroundRegions(void) +{ + if (m_foregroundInvalid) + { + // Use internal region cache to store the non-overlapped rectangles + // We will use this to clip the widget + + m_foregroundRegions.clear(); + + // Create pointer to a vector to store the overlapped rectangles + // We can discard this later as we don't need it + + TNxArray* invisibleRects = new TNxArray(); + + // Copy the clipped widget dimensions into a rect + + CRect rect; + m_widget->getRectClippedToHierarchy(rect); + + // Do we have a visible region left? + + if (rect.hasDimensions()) + { + // Add rect to list + + m_foregroundRegions.push_back(rect); + + // Request refresh + + if (m_widget->getParent() != NULL) + { + m_widget->getParent()->getCRectCache()->removeOverlappedRects(&m_foregroundRegions, invisibleRects, m_widget); + } + } + + // Tidy up + + delete invisibleRects; + m_foregroundInvalid = false; + } +} + +/** + * Cache the background regions. + */ + +void CRectCache::cacheBackgroundRegions(void) +{ + // Ensure that foreground is up to date + + cacheForegroundRegions(); + + if (m_backgroundInvalid) + { + // Cache visible regions not overlapped by children + + m_backgroundRegions.clear(); + + // Create pointer to a vector to store the overlapped rectangles + // We can discard this later as we don't need it + + TNxArray* invisibleRects = new TNxArray(); + + // Copy all foreground regions into the new vector + + for (int i = 0; i < m_foregroundRegions.size(); i++) + { + m_backgroundRegions.push_back(m_foregroundRegions[i]); + } + + // Remove all child rects from the visible vector + + for (int i = 0; i < m_widget->getChildCount(); i++) + { + if (m_backgroundRegions.size() > 0) + { + m_widget->getChild(i)->getCRectCache()->splitRectangles(&m_backgroundRegions, invisibleRects, m_widget); + } + else + { + break; + } + } + + // Tidy up + + delete invisibleRects; + m_backgroundInvalid = false; + } +} + + diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx new file mode 100644 index 000000000..25e9473ed --- /dev/null +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -0,0 +1,414 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/crlepalettebitmap.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param bitmap The bitmap structure being wrapped. + */ + +CRlePaletteBitmap::CRlePaletteBitmap(const struct SRlePaletteBitmap *bitmap) +{ + m_bitmap = bitmap; + startOfImage(); +} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + +const uint8_t CRlePaletteBitmap::getColorFormat(void) const +{ + return m_bitmap->fmt; +} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + +const uint8_t CRlePaletteBitmap::getBitsPerPixel(void) const +{ + return m_bitmap->bpp; +} + +/** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + +const nxgl_coord_t CRlePaletteBitmap::getWidth(void) const +{ + return m_bitmap->width; +} + +/** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height. + */ + +const nxgl_coord_t CRlePaletteBitmap::getHeight(void) const +{ + return m_bitmap->height; +} + +/** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width. + */ + +const nxgl_coord_t CRlePaletteBitmap::getStride(void) const +{ + // This only works if the bpp is an even multiple of 8-bit bytes + + return (m_bitmap->width * m_bitmap->bpp) >> 3; +} + +/** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + +bool CRlePaletteBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data) +{ + // Check ranges. Casts to unsigned int are ugly but permit one-sided comparisons + + if (((unsigned int)x < (unsigned int)width) && + ((unsigned int)(x + width) <= (unsigned int)m_bitmap->width)) + { + // Seek to the requested row + + if (!seekRow(y)) + { + return false; + } + + // Offset to the starting X position + + if (x > 0) + { + if (!skipPixels(x)) + { + return false; + } + } + + // Then copy the requested number of pixels + + return copyPixels(width, data); + } + + return false; +} + +/** + * Reset to the beginning of the image + */ + +void CRlePaletteBitmap::startOfImage(void) +{ + m_row = 0; + m_col = 0; + m_rle = &m_bitmap->data[0]; + m_remaining = m_rle->npixels; +} + +/** + * Advance position data ahead. Called after npixels have + * have been consume. + * + * @param npixels The number of pixels to advance + * @return False if this goes beyond the end of the image + */ + +bool CRlePaletteBitmap::advancePosition(nxgl_coord_t npixels) +{ + int newcol = m_col + npixels; + + while (newcol >= m_bitmap->width) + { + newcol -= m_bitmap->width; + if (++m_row >= m_bitmap->height) + { + return false; + } + } + + m_col = newcol; + return true; +} + +/** + * Seek ahead the specific number of pixels -- discarding + * and advancing. + * + * @param npixels The number of pixels to skip + */ + +bool CRlePaletteBitmap::skipPixels(nxgl_coord_t npixels) +{ + do + { + // Skip values in the current RLE entry + + if (m_remaining > npixels) + { + // Subtract from the number of pixels remaining + + m_remaining -= npixels; + return advancePosition(npixels); + } + + // Not enough (or just enough) in the current entry. Take what we + // can from the current entry and move to the next entry + + npixels -= m_remaining; + if (!advancePosition(m_remaining)) + { + return false; + } + + m_rle++; + m_remaining = m_rle->npixels; + } + while (npixels > 0); + + return true; +} + +/** Seek to the beginning of the next row + * + * @return False if this was the last row of the image + */ + +bool CRlePaletteBitmap::nextRow(void) +{ + return skipPixels(m_bitmap->width - m_col); +} + +/** Seek to the beignning specific row + * + * @param row The row number to seek to + * @return False if this goes beyond the end of the image + */ + +bool CRlePaletteBitmap::seekRow(nxgl_coord_t row) +{ + // Is the current position already past the requested position? + + if (row > m_row || (row == m_row && m_col != 0)) + { + // Yes.. rewind to the beginning of the image + + startOfImage(); + } + + // Seek ahead, row-by-row until we are at the beginning of + // the requested row + + while (m_row < row) + { + if (!nextRow()) + { + return false; + } + } + + return true; +} + +/** Copy the pixels from the current RLE entry the specified number of times. + * + * @param npixels The number of pixels to copy. Must be less than or equal + * to m_remaining (not checked here, must be handled by higher level code). + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + */ + +void CRlePaletteBitmap::copyColor(nxgl_coord_t npixels, FAR void *data) +{ + // Right now, only a single pixel depth is supported + + nxwidget_pixel_t *nxlut = (nxwidget_pixel_t *)m_bitmap->lut; + nxwidget_pixel_t color = nxlut[m_rle->lookup]; + + // Copy the requested pixels + + FAR nxwidget_pixel_t *dest = (FAR nxwidget_pixel_t *)data; + for (int i = 0; i < npixels; i++) + { + *dest++ = color; + } + + // Adjust the number of pixels remaining in the RLE entry + + m_remaining -= npixels; +} + +/** Copy pixels from the current position + * + * @param npixels The number of pixels to copy + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @return False if this goes beyond the end of the image + */ + +bool CRlePaletteBitmap::copyPixels(nxgl_coord_t npixels, FAR void *data) +{ + FAR nxwidget_pixel_t *ptr = (FAR nxwidget_pixel_t *)data; + do + { + // Get values in the current RLE entry + + if (m_remaining > npixels) + { + // Copy npixels from the current RLE entry (it won't be empty) + + copyColor(npixels, (FAR void *)ptr); + + // Then advance row/column position information + + return advancePosition(npixels); + } + + // Not enough (or just enough) in the current entry. Take what we + // can from the current entry and move to the next entry + + uint8_t nTaken = m_remaining; // Temporary.. copyColor clobbers m_remaining + npixels -= m_remaining; // New number of pixels needed + + // Copy all of the colors available in this RLE entry + + copyColor(m_remaining, (FAR void *)ptr); + + // Then advance row/column position information + + if (!advancePosition(nTaken)) + { + return false; + } + + // Advance the destination pointer by the number of pixels taken + // from the RLE entry + + ptr += nTaken; + + // Then move to the next RLE entry + + m_rle++; + m_remaining = m_rle->npixels; + } + while (npixels > 0); + + return true; +} diff --git a/libnxwidgets/src/cscrollbarhorizontal.cxx b/libnxwidgets/src/cscrollbarhorizontal.cxx new file mode 100644 index 000000000..13e33815d --- /dev/null +++ b/libnxwidgets/src/cscrollbarhorizontal.cxx @@ -0,0 +1,402 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "islider.hxx" +#include "cscrollbarhorizontal.hxx" +#include "cglyphbutton.hxx" +#include "csliderhorizontal.hxx" +#include "cnxtimer.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementation + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScrollbarHorizontal::CScrollbarHorizontal(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle* style) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_BORDERLESS, style) +{ + m_buttonWidth = 10; + + // Create the children + + m_slider = new CSliderHorizontal(pWidgetControl, m_buttonWidth, 0, + width - (m_buttonWidth << 1), height); + m_slider->addWidgetEventHandler(this); + + // Set up the left glyph button + + m_leftButton = new CGlyphButton(pWidgetControl, + 0, 0, + m_buttonWidth, height, + 0, 0, + &g_arrowLeft, &g_arrowLeft, &m_style); + m_leftButton->addWidgetEventHandler(this); + + // Set up the right glyph button + + m_rightButton = new CGlyphButton(pWidgetControl, + width - m_buttonWidth, 0, + m_buttonWidth, height, + 0, 0, + &g_arrowRight, &g_arrowRight, &m_style); + m_rightButton->addWidgetEventHandler(this); + + // Create timer + + m_scrollTimeout = 10; + m_timer = new CNxTimer(pWidgetControl, m_scrollTimeout, true); + m_timer->addWidgetEventHandler(this); + + addWidget(m_slider); + addWidget(m_leftButton); + addWidget(m_rightButton); + addWidget(m_timer); +} + +/** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + +const nxgl_coord_t CScrollbarHorizontal::getMinimumValue(void) const +{ + return m_slider->getMinimumValue(); +} + +/** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + +const nxgl_coord_t CScrollbarHorizontal::getMaximumValue(void) const +{ + return m_slider->getMaximumValue(); +} + +/** + * Get the current value of the slider. + * + * @return The current slider value. + */ + +const nxgl_coord_t CScrollbarHorizontal::getValue(void) const +{ + return m_slider->getValue(); +} + +/** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + +const nxgl_coord_t CScrollbarHorizontal::getPageSize(void) const +{ + return m_slider->getPageSize(); +} + +/** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + +void CScrollbarHorizontal::setMinimumValue(const nxgl_coord_t value) +{ + m_slider->setMinimumValue(value); +} + +/** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + +void CScrollbarHorizontal::setMaximumValue(const nxgl_coord_t value) +{ + m_slider->setMaximumValue(value); +} + +/** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + +void CScrollbarHorizontal::setValue(const nxgl_coord_t value) +{ + m_slider->setValue(value); +} + +/** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + +void CScrollbarHorizontal::setValueWithBitshift(const int32_t value) +{ + m_slider->setValueWithBitshift(value); +} + +/** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + +void CScrollbarHorizontal::setPageSize(nxgl_coord_t pageSize) +{ + m_slider->setPageSize(pageSize); +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarHorizontal::handleActionEvent(const CWidgetEventArgs &e) +{ + // Check which widget fired the event + + if (e.getSource() == m_timer) + { + // Which widget is clicked? + + if (m_leftButton->isClicked()) + { + // Move the grip left + + m_slider->setValue(m_slider->getValue() - m_slider->getMinimumStep()); + } + else if (m_rightButton->isClicked()) + { + // Move the grip right + + m_slider->setValue(m_slider->getValue() + m_slider->getMinimumStep()); + } + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarHorizontal::handleClickEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_leftButton) + { + // Start the timer + + m_timer->start(); + + // Move the grip left + + m_slider->setValue(m_slider->getValue() - m_slider->getMinimumStep()); + } + else if (e.getSource() == m_rightButton) + { + // Start the timer + + m_timer->start(); + + // Move the grip right + + m_slider->setValue(m_slider->getValue() + m_slider->getMinimumStep()); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarHorizontal::handleReleaseEvent(const CWidgetEventArgs &e) +{ + if ((e.getSource() == m_leftButton) || (e.getSource() == m_rightButton)) + { + // Stop the timer + + m_timer->stop(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarHorizontal::handleReleaseOutsideEvent(const CWidgetEventArgs &e) +{ + if ((e.getSource() == m_leftButton) || (e.getSource() == m_rightButton)) + { + // Stop the timer + + m_timer->stop(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarHorizontal::handleValueChangeEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_slider) + { + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Resize the scrollbar to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CScrollbarHorizontal::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Remember current values + + nxgl_coord_t value = getValue(); + bool events = raisesEvents(); + + // Disable event raising + + setRaisesEvents(false); + + // Resize and move children + + m_slider->resize(width - (m_buttonWidth << 1), height); + m_leftButton->moveTo(m_slider->getWidth(), 0); + m_rightButton->moveTo(m_slider->getWidth() + m_buttonWidth, 0); + + // Set back to current value + + setValue(value); + + // Reset event raising + + setRaisesEvents(events); +} diff --git a/libnxwidgets/src/cscrollbarpanel.cxx b/libnxwidgets/src/cscrollbarpanel.cxx new file mode 100644 index 000000000..f21cd7766 --- /dev/null +++ b/libnxwidgets/src/cscrollbarpanel.cxx @@ -0,0 +1,438 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cscrollbarpanel.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cscrollbarpanel.hxx" +#include "cbutton.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags The usual widget flags. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScollbarPanel::CScollbarPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, flags, style) +{ + m_scrollbarWidth = 10; + m_scrollbarHeight = 10; + m_hasVerticalScrollbar = true; + m_hasHorizontalScrollbar = true; + + m_borderSize.top = 0; + m_borderSize.right = 0; + m_borderSize.left = 0; + m_borderSize.bottom = 0; + m_flags.borderless = true; + + m_widgetControl = pWidgetControl; + m_panel = (CScrollingPanel *)NULL; + m_scrollbarVertical = (CScrollbarVertical *)NULL; + m_scrollbarHorizontal = (CScrollbarHorizontal *)NULL; + + buildUI(); +} + +/** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + +void CScollbarPanel::scroll(int32_t dx, int32_t dy) +{ + m_panel->scroll(dx, dy); +} + +/** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + +void CScollbarPanel::jump(int32_t x, int32_t y) +{ + m_panel->jump(x, y); +} + +/** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + +void CScollbarPanel::setAllowsVerticalScroll(bool allow) +{ + m_panel->setAllowsVerticalScroll(allow); + + if (m_hasVerticalScrollbar) + { + if (allow) + { + m_scrollbarVertical->enable(); + } + else + { + m_scrollbarVertical->disable(); + } + } +} + +/** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + +void CScollbarPanel::setAllowsHorizontalScroll(bool allow) +{ + m_panel->setAllowsHorizontalScroll(allow); + + if (m_hasHorizontalScrollbar) + { + if (allow) + { + m_scrollbarHorizontal->enable(); + } + else + { + m_scrollbarHorizontal->disable(); + } + } +} + +/** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + +void CScollbarPanel::setCanvasWidth(const int32_t width) +{ + m_panel->setCanvasWidth(width); + m_scrollbarHorizontal->setMaximumValue(width); +} + +/** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + +void CScollbarPanel::setCanvasHeight(const int32_t height) +{ + m_panel->setCanvasHeight(height); + m_scrollbarVertical->setMaximumValue(height); +} + +/** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + +bool CScollbarPanel::allowsVerticalScroll(void) const +{ + return m_panel->allowsVerticalScroll(); +} + +/** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + +bool CScollbarPanel::allowsHorizontalScroll(void) const +{ + return m_panel->allowsHorizontalScroll(); +} + +/** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + +const int32_t CScollbarPanel::getCanvasX(void) const +{ + return m_panel->getCanvasX(); +} + +/** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + +const int32_t CScollbarPanel::getCanvasY(void) const +{ + return m_panel->getCanvasY(); +} + +/** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + +const int32_t CScollbarPanel::getCanvasWidth(void) const +{ + return m_panel->getCanvasWidth(); +} + +/** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + +const int32_t CScollbarPanel::getCanvasHeight(void) const +{ + return m_panel->getCanvasHeight(); +} + +/** + * Handle a widget scroll event. + * + * @param e The event data. + */ + +void CScollbarPanel::handleScrollEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_panel) + { + if (m_scrollbarVertical != NULL) + { + m_scrollbarVertical->setRaisesEvents(false); + m_scrollbarVertical->setValue(0 - m_panel->getCanvasY()); + m_scrollbarVertical->setRaisesEvents(true); + } + else if (m_scrollbarHorizontal != NULL) + { + m_scrollbarHorizontal->setRaisesEvents(false); + m_scrollbarHorizontal->setValue(0 - m_panel->getCanvasX()); + m_scrollbarHorizontal->setRaisesEvents(true); + } + } + } +} + +/** + * Handle a widget value change event. + * + * @param e The event data. + */ + +void CScollbarPanel::handleValueChangeEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_scrollbarVertical) + { + if (m_panel != NULL) + { + m_panel->setRaisesEvents(false); + m_panel->jump(m_panel->getCanvasX(), 0 - m_scrollbarVertical->getValue()); + m_panel->setRaisesEvents(true); + } + } + else if (e.getSource() == m_scrollbarHorizontal) + { + if (m_panel != NULL) + { + m_panel->setRaisesEvents(false); + m_panel->jump(0 - m_scrollbarHorizontal->getValue(), m_panel->getCanvasY()); + m_panel->setRaisesEvents(true); + } + } + } +} + +/** + * Creates the child widgets. + */ + +void CScollbarPanel::buildUI(void) +{ + CRect rect; + getClientRect(rect); + + nxgl_coord_t panelWidth = rect.getWidth(); + if (m_hasVerticalScrollbar) + { + panelWidth -= m_scrollbarWidth; + } + + nxgl_coord_t panelHeight = rect.getHeight(); + if (m_hasHorizontalScrollbar) + { + panelHeight -= m_scrollbarHeight; + } + + m_panel = new CScrollingPanel(m_widgetControl, rect.getX(), rect.getY(), + panelWidth, panelHeight, 0, &m_style); + addWidget(m_panel); + + CRect panelRect; + m_panel->getClientRect(panelRect); + + // Disable content scrolling by default, as the panel cannot be drawn to + // without some additional programmer effort + + m_panel->setContentScrolled(false); + + // Adjust scrollbar dimensions based on scrollbar visibility + + nxgl_coord_t verticalScrollHeight = rect.getHeight(); + if (m_hasHorizontalScrollbar) + { + verticalScrollHeight -= m_scrollbarHeight; + } + + nxgl_coord_t horizontalScrollWidth = rect.getWidth(); + if (m_hasVerticalScrollbar) + { + horizontalScrollWidth -= m_scrollbarWidth; + } + + if (m_hasHorizontalScrollbar) + { + m_scrollbarHorizontal = + new CScrollbarHorizontal(m_widgetControl, + rect.getX(), rect.getHeight() - m_scrollbarHeight, + horizontalScrollWidth, m_scrollbarHeight, + &m_style); + m_scrollbarHorizontal->setMinimumValue(0); + m_scrollbarHorizontal->setMaximumValue(getCanvasWidth()); + m_scrollbarHorizontal->setPageSize(panelRect.getWidth()); + m_scrollbarHorizontal->addWidgetEventHandler(this); + addWidget(m_scrollbarHorizontal); + } + + if (m_hasVerticalScrollbar) + { + m_scrollbarVertical = + new CScrollbarVertical(m_widgetControl, + rect.getWidth() - m_scrollbarWidth, + rect.getY(), m_scrollbarWidth, + verticalScrollHeight, &m_style); + m_scrollbarVertical->setMinimumValue(0); + m_scrollbarVertical->setMaximumValue(getCanvasHeight()); + m_scrollbarVertical->setPageSize(panelRect.getHeight()); + m_scrollbarVertical->addWidgetEventHandler(this); + addWidget(m_scrollbarVertical); + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CScollbarPanel::drawContents(CGraphicsPort *port) +{ + port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); +} diff --git a/libnxwidgets/src/cscrollbarvertical.cxx b/libnxwidgets/src/cscrollbarvertical.cxx new file mode 100644 index 000000000..76b5c5dec --- /dev/null +++ b/libnxwidgets/src/cscrollbarvertical.cxx @@ -0,0 +1,404 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cscrollbarvertical.hxx" +#include "cglyphbutton.hxx" +#include "cslidervertical.hxx" +#include "cnxtimer.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementation + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScrollbarVertical::CScrollbarVertical(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_BORDERLESS, style) +{ + m_buttonHeight = 10; + + // Create the children + + m_slider = new CSliderVertical(pWidgetControl, 0, m_buttonHeight, + width, height - (m_buttonHeight << 1)); + m_slider->addWidgetEventHandler(this); + + // Setup the up button + + m_upButton = new CGlyphButton(pWidgetControl, + 0, 0, + width, m_buttonHeight, + 0, 0, + &g_arrowUp, &g_arrowUp, &m_style); + m_upButton->addWidgetEventHandler(this); + + // Setup the down button + + m_downButton = new CGlyphButton(pWidgetControl, + 0, height - m_buttonHeight, + width, m_buttonHeight, + 0, 0, + &g_arrowDown, &g_arrowDown, &m_style); + m_downButton->addWidgetEventHandler(this); + + // Create timer + + m_scrollTimeout = 10; + + m_timer = new CNxTimer(pWidgetControl, m_scrollTimeout, true); + m_timer->addWidgetEventHandler(this); + + addWidget(m_slider); + addWidget(m_upButton); + addWidget(m_downButton); + addWidget(m_timer); +} + +/** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + +const nxgl_coord_t CScrollbarVertical::getMinimumValue(void) const +{ + return m_slider->getMinimumValue(); +} + +/** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + +const nxgl_coord_t CScrollbarVertical::getMaximumValue(void) const +{ + return m_slider->getMaximumValue(); +} + +/** + * Get the current value of the slider. + * + * @return The current slider value. + */ + +const nxgl_coord_t CScrollbarVertical::getValue(void) const +{ + return m_slider->getValue(); +} + +/** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + +const nxgl_coord_t CScrollbarVertical::getPageSize(void) const +{ + return m_slider->getPageSize(); +} + +/** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + +void CScrollbarVertical::setMinimumValue(const nxgl_coord_t value) +{ + m_slider->setMinimumValue(value); +} + +/** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + +void CScrollbarVertical::setMaximumValue(const nxgl_coord_t value) +{ + m_slider->setMaximumValue(value); +} + +/** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + +void CScrollbarVertical::setValue(const nxgl_coord_t value) +{ + m_slider->setValue(value); +} + +/** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + +void CScrollbarVertical::setValueWithBitshift(const int32_t value) +{ + m_slider->setValueWithBitshift(value); +} + +/** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + +void CScrollbarVertical::setPageSize(nxgl_coord_t pageSize) +{ + m_slider->setPageSize(pageSize); +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarVertical::handleActionEvent(const CWidgetEventArgs &e) +{ + // Check which widget fired the event + + if (e.getSource() == m_timer) + { + // Which widget is clicked? + + if (m_upButton->isClicked()) + { + // Move the grip up + + m_slider->setValue(m_slider->getValue() - m_slider->getMinimumStep()); + } + else if (m_downButton->isClicked()) + { + // Move the grip down + + m_slider->setValue(m_slider->getValue() + m_slider->getMinimumStep()); + } + + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarVertical::handleClickEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_upButton) + { + // Start the timer + + m_timer->start(); + + // Move the grip up + + m_slider->setValue(m_slider->getValue() - m_slider->getMinimumStep()); + m_widgetEventHandlers->raiseValueChangeEvent(); + } + else if (e.getSource() == m_downButton) + { + // Start the timer + + m_timer->start(); + + // Move the grip down + + m_slider->setValue(m_slider->getValue() + m_slider->getMinimumStep()); + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarVertical::handleReleaseEvent(const CWidgetEventArgs &e) +{ + if ((e.getSource() == m_upButton) || (e.getSource() == m_downButton)) + { + // Stop the timer + + m_timer->stop(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarVertical::handleReleaseOutsideEvent(const CWidgetEventArgs &e) +{ + if ((e.getSource() == m_upButton) || (e.getSource() == m_downButton)) + { + // Stop the timer + + m_timer->stop(); + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CScrollbarVertical::handleValueChangeEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_slider) + { + m_widgetEventHandlers->raiseValueChangeEvent(); + } +} + +/** + * Resize the scrollbar to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CScrollbarVertical::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Remember current values + + nxgl_coord_t value = getValue(); + bool events = raisesEvents(); + + // Disable event raising + + setRaisesEvents(false); + + // Resize and move children + + m_slider->resize(width, height - (m_buttonHeight << 1)); + m_upButton->moveTo(0, m_slider->getHeight()); + m_downButton->moveTo(0, m_slider->getHeight() + m_buttonHeight); + + // Set back to current value + + setValue(value); + + // Reset event raising + + setRaisesEvents(events); +} diff --git a/libnxwidgets/src/cscrollinglistbox.cxx b/libnxwidgets/src/cscrollinglistbox.cxx new file mode 100644 index 000000000..e0d041d34 --- /dev/null +++ b/libnxwidgets/src/cscrollinglistbox.cxx @@ -0,0 +1,415 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cscrollinglistbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cscrollinglistbox.hxx" +#include "cscrollbarvertical.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScrollingListBox::CScrollingListBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + m_scrollbarWidth = 10; + + setBorderless(true); + + m_listbox = new CListBox(pWidgetControl, 0, 0, width - m_scrollbarWidth, + height, &m_style); + m_listbox->addWidgetEventHandler(this); + + // Create scrollbar + + CRect rect; + m_listbox->getClientRect(rect); + m_scrollbar = new CScrollbarVertical(pWidgetControl, width - m_scrollbarWidth, + 0, m_scrollbarWidth, height, &m_style); + m_scrollbar->setMinimumValue(0); + m_scrollbar->setMaximumValue(0); + m_scrollbar->setPageSize(rect.getHeight() / m_listbox->getOptionHeight()); + m_scrollbar->addWidgetEventHandler(this); + + // Add children to child array + + addWidget(m_listbox); + addWidget(m_scrollbar); +} + +/** + * Add a new option to the widget using default colors. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + +void CScrollingListBox::addOption(const CNxString &text, const uint32_t value) +{ + m_listbox->addOption(text, value); + m_scrollbar->setMaximumValue(m_listbox->getOptionCount() - 1); +} + +/** + * Add an option to the widget. + * + * @param option The option to add. + */ + +void CScrollingListBox::addOption(CListBoxDataItem *item) +{ + m_listbox->addOption(item); + m_scrollbar->setMaximumValue(m_listbox->getOptionCount() - 1); +} + +/** + * Add a new option to the widget. + * + * @param text Text to show in the option. + * @param value The value of the option. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + +void CScrollingListBox::addOption(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor) +{ + m_listbox->addOption(text, value, normalTextColor, normalBackColor, + selectedTextColor, selectedBackColor); + m_scrollbar->setMaximumValue(m_listbox->getOptionCount() - 1); +} + +/** + * Remove an option from the widget by its index. + * + * @param index The index of the option to remove. + */ + +void CScrollingListBox::removeOption(const int index) +{ + m_listbox->removeOption(index); + m_scrollbar->setMaximumValue(m_listbox->getOptionCount() - 1); + + // Reposition grip if necessary + + if (m_scrollbar->getValue() > m_listbox->getOptionCount()) + { + m_scrollbar->setValue(0); + } +} + +/** + * Remove all options from the widget. + */ + +void CScrollingListBox::removeAllOptions(void) +{ + m_listbox->removeAllOptions(); + m_scrollbar->setMaximumValue(0); + m_scrollbar->setValue(0); +} + +/** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + +void CScrollingListBox::handleValueChangeEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_scrollbar) + { + if (m_listbox != NULL) + { + m_listbox->setRaisesEvents(false); + m_listbox->jump(0, 0 - (m_scrollbar->getValue() * m_listbox->getOptionHeight())); + m_listbox->setRaisesEvents(true); + } + } + else if (e.getSource() == m_listbox) + { + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Handle a widget action event. + * + * @param e The event data. + */ + +void CScrollingListBox::handleActionEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_listbox) + { + // Raise action events from list box to event handler + + m_widgetEventHandlers->raiseActionEvent(); + } + } +} + +/** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + +void CScrollingListBox::handleScrollEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_listbox) + { + if (m_scrollbar != NULL) + { + m_scrollbar->setRaisesEvents(false); + + int value = ((0 - m_listbox->getCanvasY()) << 16) / m_listbox->getOptionHeight(); + + m_scrollbar->setValueWithBitshift(value); + m_scrollbar->setRaisesEvents(true); + } + } + } +} + +/** + * Handle a mouse button click event. + * + * @param e The event data. + */ + +void CScrollingListBox::handleClickEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseClickEvent(e.getX(), e.getY()); +} + +/** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + +void CScrollingListBox::handleDoubleClickEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseDoubleClickEvent(e.getX(), e.getY()); +} + +/** + * Handle a mouse button release event that occurred within the bounds of + * the source widget. + * + * @param e The event data. + */ + +void CScrollingListBox::handleReleaseEvent(const CWidgetEventArgs &e) +{ + m_widgetEventHandlers->raiseReleaseEvent(e.getX(), e.getY()); +} + +/** + * Handle a mouse button release event that occurred outside the bounds of + * the source widget. + * + * @param e The event data. + */ + +void CScrollingListBox::handleReleaseOutsideEvent(const CWidgetEventArgs &e) +{ + // Child raised a release outside event, but we need to raise a different + // event if the release occurred within the bounds of this parent widget + + if (checkCollision(e.getX(), e.getY())) + { + m_widgetEventHandlers->raiseReleaseEvent(e.getX(), e.getY()); + } + else + { + m_widgetEventHandlers->raiseReleaseOutsideEvent(e.getX(), e.getY()); + } +} + +/** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + +void CScrollingListBox::setFont(CNxFont *font) +{ + m_style.font = font; + m_listbox->setFont(font); + m_scrollbar->setFont(font); +} + +/** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the widget's + * parent. Value is based on the length of the largest string in the + * set of options. + * + * @param rect Reference to a rect to populate with data. + */ + +void CScrollingListBox::getPreferredDimensions(CRect &rect) const +{ + // Get the listbox's preferred dimensions + + m_listbox->getPreferredDimensions(rect); + + // Add on the scrollbar width + + nxgl_coord_t width = rect.getWidth(); + rect.setWidth(width + m_scrollbarWidth); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CScrollingListBox::drawContents(CGraphicsPort *port) +{ + port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); +} + +/** + * Resize the listbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CScrollingListBox::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Resize the children + + m_listbox->resize(width - m_scrollbarWidth, height); + m_scrollbar->resize(m_scrollbarWidth, height); + + // Adjust scrollbar page size + + CRect rect; + getClientRect(rect); + m_scrollbar->setPageSize(rect.getHeight() / m_listbox->getOptionHeight()); + + // Move the scrollbar + + m_scrollbar->moveTo(width - m_scrollbarWidth, 0); +} + + + + diff --git a/libnxwidgets/src/cscrollingpanel.cxx b/libnxwidgets/src/cscrollingpanel.cxx new file mode 100644 index 000000000..d3ee40cf9 --- /dev/null +++ b/libnxwidgets/src/cscrollingpanel.cxx @@ -0,0 +1,320 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cscrollingpanel.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cscrollingpanel.hxx" +#include "cgraphicsport.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the widget. + * @param y The y coordinate of the widget. + * @param width The width of the widget. + * @param height The height of the widget. + * @param flags The usual widget flags. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScrollingPanel::CScrollingPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, CWidgetStyle* style) +: CNxWidget(pWidgetControl, x, y, width, height, flags, style) +{ + m_widgetControl = pWidgetControl; + CRect rect; + getClientRect(rect); + + m_canvasWidth = rect.getWidth(); + m_canvasHeight = rect.getHeight(); + m_canvasX = 0; + m_canvasY = 0; + + setAllowsVerticalScroll(true); + setAllowsHorizontalScroll(true); + setContentScrolled(true); + + m_flags.permeable = true; +} + +/** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + +void CScrollingPanel::scroll(int32_t dx, int32_t dy) +{ + CRect rect; + getClientRect(rect); + + // Prevent scrolling outside boundaries + + if (m_canvasX + dx < -(m_canvasWidth - rect.getWidth())) + { + dx = -(m_canvasWidth - rect.getWidth()) - m_canvasX; + } + else if (m_canvasX + dx > 0) + { + dx = -m_canvasX; + } + + if (m_canvasY + dy < -(m_canvasHeight - rect.getHeight())) + { + dy = -(m_canvasHeight - rect.getHeight()) - m_canvasY; + } + else if (m_canvasY + dy > 0) + { + dy = -m_canvasY; + } + + // Prevent scrolling in disallowed planes + + if (!allowsVerticalScroll()) + { + dy = 0; + } + + if (!allowsHorizontalScroll()) + { + dx = 0; + } + + // Perform scroll if necessary + + if ((dx != 0) || (dy != 0)) + { + // Only scroll if content scrolling is enabled + + if (m_isContentScrolled) + { + // Perform scroll + + TNxArray revealedRects; + CGraphicsPort *port = m_widgetControl->getGraphicsPort(); + port->move(getX(), getY(), dx, dy, rect.getWidth(), rect.getHeight()); + + // Adjust the scroll values + + m_canvasY += dy; + m_canvasX += dx; + + if (revealedRects.size() > 0) + { + // Draw revealed sections + + for (int i = 0; i < revealedRects.size(); ++i) + { + drawBorder(port); + drawContents(port); + } + } + } + else + { + // Adjust the scroll values + + m_canvasY += dy; + m_canvasX += dx; + } + + // Scroll all child widgets + + scrollChildren(dx, dy); + + // Notify event handlers + + m_widgetEventHandlers->raiseScrollEvent(dx, dy); + } +} + +/** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + +void CScrollingPanel::jump(int32_t x, int32_t y) +{ + // Calculate difference between jump value and current value and scroll + + scroll(x - m_canvasX, y - m_canvasY); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CScrollingPanel::drawContents(CGraphicsPort *port) +{ + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), + getBackgroundColor()); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CScrollingPanel::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Scrolls the panel to match the drag. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal drag distance. + * @param vY The vertical drag distance. + */ + +void CScrollingPanel::onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + scroll(vX, vY); +} + +/** + * Starts the dragging system. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CScrollingPanel::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + startDragging(x, y); +} + +/** + * Scroll all child widgets by the specified amounts. Actually uses + * the widget's moveTo() function to reposition them. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + +void CScrollingPanel::scrollChildren(int32_t dx, int32_t dy) +{ + nxgl_coord_t widgetX = 0; + nxgl_coord_t widgetY = 0; + nxgl_coord_t thisX = getX(); + nxgl_coord_t thisY = getY(); + CNxWidget *widget = (CNxWidget *)NULL; + + for (int32_t i = 0; i < m_children.size(); i++) + { + widget = m_children[i]; + widgetX = (widget->getX() - thisX) + dx; + widgetY = (widget->getY() - thisY) + dy; + widget->moveTo(widgetX, widgetY); + } +} diff --git a/libnxwidgets/src/cscrollingtextbox.cxx b/libnxwidgets/src/cscrollingtextbox.cxx new file mode 100644 index 000000000..4de63fdf6 --- /dev/null +++ b/libnxwidgets/src/cscrollingtextbox.cxx @@ -0,0 +1,577 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cscrollingtextbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cscrollingtextbox.hxx" +#include "cscrollbarvertical.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param flags Standard widget flag options. + * @param maxRows The maximum number of rows the textbox can track. Adding + * text beyond this number will cause rows at the start of the text to be + * forgotten; text is essentially stored as a queue, and adding to the back + * of a full queue causes the front items to be popped off. Setting this to + * 0 will make the textbox track only the visible rows. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * g_defaultWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CScrollingTextBox::CScrollingTextBox(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, uint32_t flags, + nxgl_coord_t maxRows, CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, flags, style) +{ + m_scrollbarWidth = 10; + setBorderless(true); + + m_texbox = new CMultiLineTextBox(pWidgetControl, + 0, 0, width - m_scrollbarWidth, height, + text, flags, maxRows, &m_style); + m_texbox->addWidgetEventHandler(this); + + // Create scrollbar + + CRect rect; + m_texbox->getClientRect(rect); + m_scrollbar = new CScrollbarVertical(pWidgetControl, + width - m_scrollbarWidth, 0, + m_scrollbarWidth, height, &m_style); + m_scrollbar->setMinimumValue(0); + m_scrollbar->setMaximumValue(m_texbox->getCanvasHeight()); + m_scrollbar->setPageSize(rect.getHeight()); + m_scrollbar->setValue(0 - m_texbox->getCanvasY()); + m_scrollbar->addWidgetEventHandler(this); + + // Add children to child array + + addWidget(m_texbox); + addWidget(m_scrollbar); +} + +/** + * Set the horizontal alignment of text within the textbox. + * + * @param alignment The horizontal position of the text. + */ + +void CScrollingTextBox::setTextAlignmentHoriz(CMultiLineTextBox::TextAlignmentHoriz alignment) +{ + m_texbox->setTextAlignmentHoriz(alignment); +} + +/** + * Set the vertical alignment of text within the textbox. + * + * @param alignment The vertical position of the text. + */ + +void CScrollingTextBox::setTextAlignmentVert(CMultiLineTextBox::TextAlignmentVert alignment) +{ + m_texbox->setTextAlignmentVert(alignment); +} + +/** + * Returns the number of "pages" that the text spans. A page + * is defined as the amount of text that can be displayed within + * the textbox at one time. + * + * @return The page count. + */ + +const uint16_t CScrollingTextBox::getPageCount(void) const +{ + return m_texbox->getPageCount(); +} + +/** + * Returns the current page. + * + * @return The current page. + * @see getPageCount(). + */ + +const uint16_t CScrollingTextBox::getCurrentPage(void) const +{ + return m_texbox->getCurrentPage(); +} + +/** + * Returns a pointer to the Text object that contains the + * wrapped text used in the textbox. It is used as the + * pre-processed data source for the textbox, and should + * not be altered. + * + * @return Pointer to the Text object. + */ + +const CText *CScrollingTextBox::getText(void) const +{ + return m_texbox->getText(); +} + +/** + * Set the text displayed in the textbox. + * + * @param text String to display. + */ + +void CScrollingTextBox::setText(const CNxString &text) +{ + m_texbox->setText(text); + m_scrollbar->redraw(); +} + +/** + * Append new text to the end of the current text + * displayed in the textbox. + * + * @param text String to append. + */ + +void CScrollingTextBox::appendText(const CNxString &text) +{ + m_texbox->appendText(text); + m_scrollbar->redraw(); +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + +void CScrollingTextBox::removeText(const unsigned int startIndex) +{ + m_texbox->removeText(startIndex); + m_scrollbar->redraw(); +} + +/** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + +void CScrollingTextBox::removeText(const unsigned int startIndex, + const unsigned int count) +{ + m_texbox->removeText(startIndex, count); + m_scrollbar->redraw(); +} + +/** + * Set the font used in the textbox. + * + * @param font Pointer to the new font. + */ + +void CScrollingTextBox::setFont(CNxFont *font) +{ + m_style.font = font; + m_texbox->setFont(font); + m_scrollbar->setFont(font); +} + +/** + * Get the length of the text string. + * + * @return The length of the text string. + */ + +const unsigned int CScrollingTextBox::getTextLength(void) const +{ + return m_texbox->getTextLength(); +} + +/** + * Sets the cursor display mode. + * + * @param cursorMode Determines cursor display mode + */ + +void CScrollingTextBox::showCursor(EShowCursor cursorMode) +{ + m_texbox->showCursor(cursorMode); +} + +/** + * Enables/disables cursor wrapping + * + * @param wrap True enables cursor wrapping + */ + +void CScrollingTextBox::wrapCursor(bool wrap) +{ + m_texbox->wrapCursor(wrap); +} + +/** + * Move the cursor to the text position specified. 0 indicates the start + * of the string. If position is greater than the length of the string, + * the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + +void CScrollingTextBox::moveCursorToPosition(const int32_t position) +{ + m_texbox->moveCursorToPosition(position); + m_scrollbar->redraw(); +} + +/** + * Get the cursor position. This is the index within the string that + * the cursor is currently positioned over. + * + * @return position The cursor position. + */ + +const int32_t CScrollingTextBox::getCursorPosition(void) const +{ + return m_texbox->getCursorPosition(); +} + +/** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + +void CScrollingTextBox::insertText(const CNxString &text, + const unsigned int index) +{ + m_texbox->insertText(text, index); + m_scrollbar->redraw(); +} + +/** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + +void CScrollingTextBox::insertTextAtCursor(const CNxString &text) +{ + m_texbox->insertTextAtCursor(text); + m_scrollbar->redraw(); +} + +/** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + +void CScrollingTextBox::handleValueChangeEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_scrollbar) + { + if (m_texbox != NULL) + { + m_texbox->setRaisesEvents(false); + m_texbox->jump(0, 0 - m_scrollbar->getValue()); + m_texbox->setRaisesEvents(true); + } + } + else if (e.getSource() == m_texbox) + { + if (m_scrollbar != NULL) + { + m_scrollbar->setRaisesEvents(false); + m_scrollbar->setMaximumValue(m_texbox->getCanvasHeight()); + m_scrollbar->setValue(0 - m_texbox->getCanvasY()); + m_scrollbar->setRaisesEvents(true); + } + } + } +} + +/** + * Handles events raised by its sub-widgets. + * + * @param e Event arguments. + */ + +void CScrollingTextBox::handleScrollEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() != NULL) + { + if (e.getSource() == m_texbox) + { + if (m_scrollbar != NULL) + { + m_scrollbar->setRaisesEvents(false); + m_scrollbar->setValue(0 - m_texbox->getCanvasY()); + m_scrollbar->setRaisesEvents(true); + } + } + } +} + +/** + * Gets the x coordinate of the virtual canvas. + * + * @return The x coordinate of the virtual canvas. + */ + +const int32_t CScrollingTextBox::getCanvasX(void) const +{ + return m_texbox->getCanvasX(); +} + +/** + * Gets the y coordinate of the virtual canvas. + * + * @return The y coordinate of the virtual canvas. + */ + +const int32_t CScrollingTextBox::getCanvasY(void) const +{ + return m_texbox->getCanvasY(); +} + +/** + * Gets the width of the virtual canvas. + * + * @return The width of the virtual canvas. + */ + +const int32_t CScrollingTextBox::getCanvasWidth(void) const +{ + return m_texbox->getCanvasWidth(); +} + +/** + * Gets the height of the virtual canvas. + * + * @return The height of the virtual canvas. + */ + +const int32_t CScrollingTextBox::getCanvasHeight(void) const +{ + return m_texbox->getCanvasHeight(); +} + +/** + * Scroll the panel by the specified amounts. + * + * @param dx The horizontal distance to scroll. + * @param dy The vertical distance to scroll. + */ + +void CScrollingTextBox::scroll(int32_t dx, int32_t dy) +{ + m_texbox->scroll(dx, dy); +} + +/** + * Reposition the panel's scrolling region to the specified coordinates. + * + * @param x The new x coordinate of the scrolling region. + * @param y The new y coordinate of the scrolling region. + */ + +void CScrollingTextBox::jump(int32_t x, int32_t y) +{ + m_texbox->jump(x, y); +} + +/** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + +void CScrollingTextBox::setAllowsVerticalScroll(bool allow) +{ + m_texbox->setAllowsVerticalScroll(allow); +} + +/** + * Set whether or not horizontal scrolling is allowed. + * + * @param allow True to allow horizontal scrolling; false to deny it. + */ + +void CScrollingTextBox::setAllowsHorizontalScroll(bool allow) +{ + // NOP +} + +/** + * Sets the width of the virtual canvas. + * + * @param width The width of the virtual canvas. + */ + +void CScrollingTextBox::setCanvasWidth(const int32_t width) +{ + // NOP +} + +/** + * Sets the height of the virtual canvas. + * + * @param height The height of the virtual canvas. + */ + +void CScrollingTextBox::setCanvasHeight(const int32_t height) +{ + // NOP +} + +/** + * Returns true if vertical scrolling is allowed. + * + * @return True if vertical scrolling is allowed. + */ + +bool CScrollingTextBox::allowsVerticalScroll(void) const +{ + return m_texbox->allowsVerticalScroll(); +} + +/** + * Returns true if horizontal scrolling is allowed. + * + * @return True if horizontal scrolling is allowed. + */ + +bool CScrollingTextBox::allowsHorizontalScroll(void) const +{ + return m_texbox->allowsHorizontalScroll(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CScrollingTextBox::drawContents(CGraphicsPort *port) +{ + port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); +} + +/** + * Resize the textbox to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CScrollingTextBox::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Resize the children + + m_texbox->resize(width - m_scrollbarWidth, height); + m_scrollbar->resize(m_scrollbarWidth, height); + + // Move the scrollbar + + m_scrollbar->moveTo(width - m_scrollbarWidth, 0); +} diff --git a/libnxwidgets/src/csliderhorizontal.cxx b/libnxwidgets/src/csliderhorizontal.cxx new file mode 100644 index 000000000..2fe47556c --- /dev/null +++ b/libnxwidgets/src/csliderhorizontal.cxx @@ -0,0 +1,402 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/csliderhorizontal.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "csliderhorizontal.hxx" +#include "csliderhorizontalgrip.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + +CSliderHorizontal::CSliderHorizontal(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +{ + m_minimumValue = 0; + m_maximumValue = 0; + m_contentSize = 0; + m_value = 0; + m_minimumGripWidth = 10; + m_pageSize = 1; + + m_flags.permeable = false; + m_flags.borderless = false; + m_flags.doubleClickable = false; + + // Create grip + + CRect rect; + getClientRect(rect); + + m_grip = new CSliderHorizontalGrip(pWidgetControl, rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight()); + m_grip->addWidgetEventHandler(this); + addWidget(m_grip); + + m_gutterWidth = rect.getWidth(); +} + +/** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + +void CSliderHorizontal::setValue(const nxgl_coord_t value) +{ + setValueWithBitshift((int32_t)value << 16); +} + +/** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + +void CSliderHorizontal::setValueWithBitshift(const int32_t value) +{ + CRect rect; + getClientRect(rect); + + // Can the grip move? + + if ((rect.getWidth() > m_grip->getWidth()) && (m_maximumValue != m_minimumValue)) + { + int32_t newValue = value; + int32_t maxValue = getPhysicalMaximumValueWithBitshift(); + + // Limit to max/min values + + if (newValue > maxValue) + { + newValue = maxValue; + } + + if (newValue >> 16 < m_minimumValue) + { + newValue = m_minimumValue << 16; + } + + uint32_t scrollRatio = newValue / m_contentSize; + int32_t newGripX = m_gutterWidth * scrollRatio; + newGripX += newGripX & 0x8000; + newGripX >>= 16; + newGripX += rect.getX(); + + m_grip->moveTo(newGripX, rect.getY()); + + // Update stored value if necessary + + if (m_value != newValue) + { + m_value = newValue; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CSliderHorizontal::handleDragEvent(const CWidgetEventArgs &e) +{ + // Handle grip events + + if ((e.getSource() == m_grip) && (e.getSource() != NULL)) + { + int32_t newValue = getGripValue() >> 16; + + // Grip has moved - compare values and raise event if the + // value has changed. Compare using integer values rather + // than fixed-point. + + if (m_value >> 16 != newValue) + { + m_value = newValue << 16; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + +nxgl_coord_t CSliderHorizontal::getMinimumStep(void) const +{ + // If the ratio of content to gutter is greater than or equal to one, + // the minimum step that the slider can represent will be that ratio. + + uint32_t gutterRatio = m_contentSize << 16 / m_gutterWidth; + gutterRatio += gutterRatio & 0x8000; + gutterRatio >>= 16; + + if (gutterRatio > 0) + { + return gutterRatio; + } + + return 1; +} + +/** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + +int32_t CSliderHorizontal::getPhysicalMaximumValueWithBitshift(void) const +{ + uint32_t maxX = m_gutterWidth - m_grip->getWidth(); + uint32_t scrollRatio = (maxX << 16) / m_gutterWidth; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Get the value represented by the top of the grip. + * return The value represented by the top of the grip. + */ + +const int32_t CSliderHorizontal::getGripValue(void) const +{ + // Calculate the current value represented by the top of the grip + + CRect rect; + getClientRect(rect); + + uint32_t gripPos = ((m_grip->getX() - getX()) - rect.getX()); + uint32_t scrollRatio = (gripPos << 16) / m_gutterWidth; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderHorizontal::drawContents(CGraphicsPort *port) +{ + CRect rect; + getRect(rect); + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + getSelectedBackgroundColor()); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderHorizontal::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CSliderHorizontal::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Remember current values + + int32_t oldValue = m_value; + bool events = raisesEvents(); + + // Disable event raising + + setRaisesEvents(false); + resizeGrip(); + + // Set back to current value + + setValue(oldValue); + + // Reset event raising + + setRaisesEvents(events); +} + +/** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CSliderHorizontal::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Which way should the grip move? + + if (x > m_grip->getX()) + { + // Move grip right + + setValueWithBitshift(m_value + (m_pageSize << 16)); + } + else + { + // Move grip left + + setValueWithBitshift(m_value - (m_pageSize << 16)); + } +} + +/** + * Resize and redraw the grip. + */ + +void CSliderHorizontal::resizeGrip(void) +{ + // Get available size + + CRect rect; + getClientRect(rect); + + int32_t gripRatio = (m_pageSize << 16) / m_contentSize; + int32_t gripSize = rect.getWidth() * gripRatio; + gripSize >>= 16; + m_gutterWidth = rect.getWidth(); + + if (gripSize < m_minimumGripWidth) + { + // TODO: Need to implement scaling here. If we resize the grip to be + // artificially larger, we effectively reduce the scale (not just the + // height) of the gutter. Each position in the gutter needs to be + // reduced in value. + } + + m_grip->resize(gripSize, rect.getHeight()); +} + + diff --git a/libnxwidgets/src/csliderhorizontalgrip.cxx b/libnxwidgets/src/csliderhorizontalgrip.cxx new file mode 100644 index 000000000..aebdbf51d --- /dev/null +++ b/libnxwidgets/src/csliderhorizontalgrip.cxx @@ -0,0 +1,246 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/csliderhorizontalgrip.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "csliderhorizontalgrip.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + +CSliderHorizontalGrip::CSliderHorizontalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +{ +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderHorizontalGrip::drawContents(CGraphicsPort *port) +{ + CRect rect; + getRect(rect); + + nxwidget_pixel_t color; + if (!m_flags.clicked) + { + color = getSelectedBackgroundColor(); + } + else + { + color = getHighlightColor(); + } + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + color); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderHorizontalGrip::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + if (isClicked()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } + else + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShineEdgeColor(), getShadowEdgeColor()); + } + } +} + +/** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CSliderHorizontalGrip::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + startDragging(x, y); + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CSliderHorizontalGrip::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CSliderHorizontalGrip::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + +void CSliderHorizontalGrip::onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + // Work out where we're moving to + + nxgl_coord_t destX = x - m_grabPointX - m_parent->getX(); + + // Do we need to move? + + if (destX != m_rect.getX()) + { + // Get parent rect + + CRect rect; + m_parent->getClientRect(rect); + + // Prevent grip from moving outside parent + + if (destX < rect.getX()) + { + destX = rect.getX(); + } + else + { + if (destX + getWidth() > rect.getWidth() + rect.getX()) + { + destX = (rect.getWidth() + rect.getX()) - getWidth() ; + } + } + + // Move to new location + + moveTo(destX, rect.getY()); + } +} diff --git a/libnxwidgets/src/cslidervertical.cxx b/libnxwidgets/src/cslidervertical.cxx new file mode 100644 index 000000000..74d2d956b --- /dev/null +++ b/libnxwidgets/src/cslidervertical.cxx @@ -0,0 +1,402 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cslidervertical.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cslidervertical.hxx" +#include "csliderverticalgrip.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + +CSliderVertical::CSliderVertical(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +{ + m_minimumValue = 0; + m_maximumValue = 0; + m_contentSize = 0; + m_value = 0; + m_minimumGripHeight = 10; + m_pageSize = 1; + + m_flags.permeable = false; + m_flags.borderless = false; + m_flags.doubleClickable = false; + + // Create grip + + CRect rect; + getClientRect(rect); + + m_grip = new CSliderVerticalGrip(pWidgetControl, + rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight()); + m_grip->addWidgetEventHandler(this); + addWidget(m_grip); + + m_gutterHeight = rect.getHeight(); +} + +/** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + +void CSliderVertical::setValue(const nxgl_coord_t value) +{ + setValueWithBitshift((int32_t)value << 16); +} + +/** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + +void CSliderVertical::setValueWithBitshift(const int32_t value) +{ + CRect rect; + getClientRect(rect); + + // Can the grip move? + + if ((rect.getHeight() > m_grip->getHeight()) && (m_maximumValue != m_minimumValue)) + { + int32_t newValue = value; + int32_t maxValue = getPhysicalMaximumValueWithBitshift(); + + // Limit to max/min values + + if (newValue > maxValue) + { + newValue = maxValue; + } + + if (newValue >> 16 < m_minimumValue) + { + newValue = m_minimumValue << 16; + } + + uint32_t scrollRatio = newValue / m_contentSize; + int32_t newGripY = m_gutterHeight * scrollRatio; + newGripY += newGripY & 0x8000; + newGripY >>= 16; + newGripY += rect.getY(); + + m_grip->moveTo(rect.getX(), newGripY); + + // Update stored value if necessary + + if (m_value != newValue) + { + m_value = newValue; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CSliderVertical::handleDragEvent(const CWidgetEventArgs &e) +{ + // Handle grip events + + if ((e.getSource() == m_grip) && (e.getSource() != NULL)) + { + int32_t newValue = getGripValue() >> 16; + + // Grip has moved - compare values and raise event if the + // value has changed. Compare using integer values rather + // than fixed-point. + + if (m_value >> 16 != newValue) + { + m_value = newValue << 16; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + +nxgl_coord_t CSliderVertical::getMinimumStep(void) const +{ + // If the ratio of content to gutter is greater than or equal to one, + // the minimum step that the slider can represent will be that ratio. + + uint32_t gutterRatio = m_contentSize << 16 / m_gutterHeight; + gutterRatio += gutterRatio & 0x8000; + gutterRatio >>= 16; + + if (gutterRatio > 0) + { + return gutterRatio; + } + + return 1; +} + +/** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + +int32_t CSliderVertical::getPhysicalMaximumValueWithBitshift(void) const +{ + uint32_t maxY = m_gutterHeight - m_grip->getHeight(); + uint32_t scrollRatio = (maxY << 16) / m_gutterHeight; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Get the value represented by the top of the grip. The value is + * bitshifted left 16 places for accuracy. + * return The value represented by the top of the grip. + */ + +const int32_t CSliderVertical::getGripValue(void) const +{ + // Calculate the current value represented by the top of the grip + + CRect rect; + getClientRect(rect); + + uint32_t gripPos = ((m_grip->getY() - getY()) - rect.getY()); + uint32_t scrollRatio = (gripPos << 16) / m_gutterHeight; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderVertical::drawContents(CGraphicsPort *port) +{ + CRect rect; + getRect(rect); + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + getSelectedBackgroundColor()); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderVertical::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CSliderVertical::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Remember current values + + int32_t oldValue = m_value; + bool events = raisesEvents(); + + // Disable event raising + + setRaisesEvents(false); + resizeGrip(); + + // Set back to current value + + setValue(oldValue); + + // Reset event raising + + setRaisesEvents(events); +} + +/** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CSliderVertical::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Which way should the grip move? + + if (y > m_grip->getY()) + { + // Move grip down + + setValueWithBitshift(m_value + (m_pageSize << 16)); + } + else + { + // Move grip up + + setValueWithBitshift(m_value - (m_pageSize << 16)); + } +} + +/** + * Resize and redraw the grip. + */ + +void CSliderVertical::resizeGrip(void) +{ + // Get available size + + CRect rect; + getClientRect(rect); + + int32_t gripRatio = (m_pageSize << 16) / m_contentSize; + int32_t gripSize = rect.getHeight() * gripRatio; + gripSize >>= 16; + m_gutterHeight = rect.getHeight(); + + if (gripSize < m_minimumGripHeight) + { + // TODO: Need to implement scaling here. If we resize the grip to be + // artificially larger, we effectively reduce the scale (not just the + // height) of the gutter. Each position in the gutter needs to be + // reduced in value. + } + + m_grip->resize(rect.getWidth(), gripSize); +} diff --git a/libnxwidgets/src/csliderverticalgrip.cxx b/libnxwidgets/src/csliderverticalgrip.cxx new file mode 100644 index 000000000..2ddf364e8 --- /dev/null +++ b/libnxwidgets/src/csliderverticalgrip.cxx @@ -0,0 +1,245 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cslidervertical.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "csliderverticalgrip.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + +CSliderVerticalGrip::CSliderVerticalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) +: CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +{ +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderVerticalGrip::drawContents(CGraphicsPort *port) +{ + CRect rect; + getRect(rect); + + nxwidget_pixel_t color; + if (!m_flags.clicked) + { + color = getSelectedBackgroundColor(); + } + else + { + color = getHighlightColor(); + } + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), + color); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CSliderVerticalGrip::drawBorder(CGraphicsPort *port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + if (isClicked()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShadowEdgeColor(), getShineEdgeColor()); + } + else + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShineEdgeColor(), getShadowEdgeColor()); + } + } +} + +/** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CSliderVerticalGrip::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + startDragging(x, y); + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CSliderVerticalGrip::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CSliderVerticalGrip::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + +void CSliderVerticalGrip::onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + // Work out where we're moving to + + nxgl_coord_t destY = y - m_grabPointY - m_parent->getY(); + + // Do we need to move? + + if (destY != m_rect.getY()) + { + // Get parent rect + + CRect rect; + m_parent->getClientRect(rect); + + // Prevent grip from moving outside parent + + if (destY < rect.getY()) + { + destY = rect.getY(); + } + else + { + if (destY + getHeight() > rect.getHeight() + rect.getY()) + { + destY = (rect.getHeight() + rect.getY()) - getHeight(); + } + } + + // Move to new location + + moveTo(rect.getX(), destY); + } +} diff --git a/libnxwidgets/src/cstickybutton.cxx b/libnxwidgets/src/cstickybutton.cxx new file mode 100644 index 000000000..76852eaf7 --- /dev/null +++ b/libnxwidgets/src/cstickybutton.cxx @@ -0,0 +1,168 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cstickybutton.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cstickybutton.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for buttons that display a string. + * + * @param pWidgetControl The controlling widget for the display. + * @param x The x coordinate of the button, relative to its parent. + * @param y The y coordinate of the button, relative to its parent. + * @param width The width of the button. + * @param height The height of the button. + * @param text The text for the button to display. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CStickyButton::CStickyButton(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, + CWidgetStyle *style) +: CButton(pWidgetControl, x, y, width, height, text, style) +{ + m_isStuckDown = false; +} + +/** + * Sets the key's stuck down state. If this is true, the key has a + * inwards-bevelled border when drawn. If it is false, the key has + * an outwards-bevelled border. + * + * @param stuckDown The new stuck down state. + */ + +void CStickyButton::setStuckDown(bool stuckDown) + { + m_isStuckDown = stuckDown; + redraw(); + } + +/** + * Draws the outline of the button. + * + * @param port Graphics port to draw to. + */ + +void CStickyButton::drawOutline(CGraphicsPort *port) +{ + CButton::drawOutline(port, m_isStuckDown); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CStickyButton::drawContents(CGraphicsPort *port) +{ + CButton::drawContents(port, m_isStuckDown); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CStickyButton::drawBorder(CGraphicsPort *port) +{ + CButton::drawBorder(port, m_isStuckDown); +} diff --git a/libnxwidgets/src/cstickybuttonarray.cxx b/libnxwidgets/src/cstickybuttonarray.cxx new file mode 100644 index 000000000..05c9d8928 --- /dev/null +++ b/libnxwidgets/src/cstickybuttonarray.cxx @@ -0,0 +1,292 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cstickybuttonarray.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cstickybuttonarray.hxx" +#include "cgraphicsport.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CStickyButtonArray Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for an array of sticky buttons. + * + * @param pWidgetControl The widget control for the display. + * @param x The x coordinate of the button array, relative to its parent. + * @param y The y coordinate of the button array, relative to its parent. + * @param buttonColumns The number of buttons in one row of the button array + * @param buttonRows The number of buttons in one column of the button array + * @param buttonWidth The width of one button + * @param buttonHeight The height of one button + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CStickyButtonArray::CStickyButtonArray(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + uint8_t buttonColumns, uint8_t buttonRows, + nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, + CWidgetStyle *style) +: CButtonArray(pWidgetControl, x, y, buttonColumns, buttonRows, buttonWidth, buttonHeight, style) +{ + // Initialize state + + m_isStuckDown = false; + m_stickDown = false; +} + +/** + * Check if any button in the array is stuck down and, if so, + * return the indices of the stuck down button. + * + * @param column The location to return the column index of the button + * of interest + * @param row The location to return the row index of the button of + * interest + * @return True if a button in the array is clicked + */ + +bool CStickyButtonArray::isAnyButtonStuckDown(int &column, int &row) const +{ + // Return the indices of the last stuck button + + column = m_stickyColumn; + row = m_stickyRow; + + // Return true if the button is currently stuck + + return m_isStuckDown; +} + +/** + * Check if this specific button in the array is stuck down + * + * @param column The column of the button to check. + * @param row The row of the button to check. + * @return True if this button is stuck down + */ + +bool CStickyButtonArray::isThisButtonStuckDown(int column, int row) const +{ + // Does this match the index of the last stuck button? + + if (column == m_stickyColumn && row == m_stickyRow) + { + // Yes.. return true if it is still stuck + + return m_isStuckDown; + } + else + { + // This button is definitely not stuck down + + return false; + } +} + +/** + * Force the button at this position into the stuck down state + * + * @param column The column containing the button to stick down + * @param row The rowtcontaining the button to stick down + * @return False(0) is returned if the indices are out of range. + */ + +bool CStickyButtonArray::stickDown(int column, int row) +{ + // Verify that the cursor position is within range + + if ((unsigned)column < m_buttonColumns && (unsigned)row < m_buttonRows) + { + // First, unstick any currently stuck buttons + + unstick(); + + // Then stick this button down + + m_stickyColumn = column; + m_stickyRow = row; + m_isStuckDown = true; + + // We only want to update the stuck down buttons + + m_stickDown = true; + redraw(); + m_stickDown = false; + return true; + } + + return false; +} + +/** + * Unstick all buttons. + */ + +void CStickyButtonArray::unstick(void) +{ + // Is any button stuck down? + + if (m_isStuckDown) + { + // Yes.. unstick it and update the button display + + m_isStuckDown = false; + + // We only want to update the stuck down buttons + + m_stickDown = true; + redraw(); + m_stickDown = false; + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CStickyButtonArray::drawContents(CGraphicsPort *port) +{ + // Are we just updating the stuck down button? + + if (m_stickDown) + { + // There are two cases: (1) A sticky button was unstuck, or (2) a new + // button is stuck down. m_isStuckDown will distinguish these + // + // Draw the button using the clicked style if either (1) it is + // stuck down OR (2) it is currently clicked. Draw the button in + // the normal style if is is un-stuck and not clicked. + // + // NOTE: If usedClicked is false, the button may revert to either + // (1) the "normal" button state, or (2) the "highlighted" button + // stated. drawButton() will handle that. + + bool useClicked = m_isStuckDown || isThisButtonClicked(m_stickyColumn, m_stickyRow); + drawButton(port, m_stickyColumn, m_stickyRow, useClicked); + } + + // Do we draw just one button (due to click or release)? + + else if (m_redrawButton) + { + // Just one. Get the row/column indices from the last click + + int column; + int row; + bool useClicked = isButtonClicked(column, row); + + // If this is a press or release on the stuck down button, then don't + // redraw the button. Drawing of stuck down and unstuck buttons is + // controlled entirely by the m_stickDown case. + + if (!isThisButtonStuckDown(column, row)) + { + // Not a stuck down button. Re-draw that button + + drawButton(port, column, row, useClicked); + } + } + + // Do we just draw the hightlighted button? + + else if (m_cursorChange) + { + // Do nothing if the highlighted button is also the stuck down button + // or the clicked button + + if (!isThisButtonStuckDown(m_cursorColumn, m_cursorRow) && + !isThisButtonClicked(m_cursorColumn, m_cursorRow)) + { + drawButton(port, m_cursorColumn, m_cursorRow, false); + } + } + + // Draw all buttons + + else + { + // Visit each column + + for (int column = 0; column < m_buttonColumns; column++) + { + // Visit each row + + for (int row = 0; row < m_buttonRows; row++) + { + // Is the button clicked? + + bool useClicked = isThisButtonClicked(column, row); + + // If the button is not clicked but it is the stuck button, + // then draw it as clicked anyway. + + if (!useClicked) + { + useClicked = isThisButtonStuckDown(column, row); + } + + // Draw each button. If useClicked is false, then drawButton + // will do the right thing if the button is highlighted. + + drawButton(port, column, row, useClicked); + } + } + } +} + diff --git a/libnxwidgets/src/cstringiterator.cxx b/libnxwidgets/src/cstringiterator.cxx new file mode 100644 index 000000000..2327af38f --- /dev/null +++ b/libnxwidgets/src/cstringiterator.cxx @@ -0,0 +1,198 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cgraphicsport.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cnxstring.hxx" +#include "cstringiterator.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. Moves the iterator to the first character in the string. + * + * @param string Pointer to the string that will be iterated over. + */ + +CStringIterator::CStringIterator(FAR const CNxString* string) +{ + m_pString = string; + m_pCurrentChar = m_pString->getCharArray(); + m_currentIndex = 0; +} + +/** + * Moves the iterator to the first character in the string. + * + * @param Returns false if the string is empty + */ + +bool CStringIterator::moveToFirst() +{ + int length = m_pString->getLength(); + if (length > 0) + { + m_pCurrentChar = m_pString->getCharArray(); + m_currentIndex = 0; + return true; + } + + return false; +} + +/** + * Moves the iterator to the last character in the string. + * + * @param Returns false if the string is empty + */ + +bool CStringIterator::moveToLast(void) +{ + int length = m_pString->getLength(); + if (length > 0) + { + m_pCurrentChar = m_pString->getCharArray() + length - 1; + m_currentIndex = length - 1; + return true; + } + + return false; +} + +/** + * Move the iterator to the next character in the string. + * + * @return True if the iterator moved; false if not (indicates end of string). + */ + +bool CStringIterator::moveToNext(void) +{ + if (m_currentIndex < m_pString->getLength() - 1) + { + m_pCurrentChar++; + m_currentIndex++; + return true; + } + + return false; +} + +/** + * Move the iterator to the previous character in the string. + * + * @return True if the iterator moved; false if not (indicates start of string). + */ + +bool CStringIterator::moveToPrevious(void) +{ + if (m_currentIndex > 0) + { + m_pCurrentChar--; + m_currentIndex--; + return true; + } + return false; +} + +/** + * Move the iterator to the specified index. + * + * @param index The index to move to. + * @return True if the iterator moved; false if not (indicates end of string). + */ + +bool CStringIterator::moveTo(int index) +{ + // Abort if index exceeds the size of the string + + if (index < m_pString->getLength()) + { + // Move to the requested position + + m_pCurrentChar = m_pString->getCharArray() + index; + m_currentIndex = index; + return true; + } + return false; +} diff --git a/libnxwidgets/src/ctext.cxx b/libnxwidgets/src/ctext.cxx new file mode 100644 index 000000000..688031d88 --- /dev/null +++ b/libnxwidgets/src/ctext.cxx @@ -0,0 +1,675 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ctext.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "ctext.hxx" +#include "cstringiterator.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param font The font to use for this text object. + * @param text A string that this text object should wrap around. + * @param width The pixel width at which the text should wrap. + */ + +CText::CText(CNxFont *font, const CNxString &text, nxgl_coord_t width) +: CNxString(text) +{ + m_font = font; + m_width = width; + m_lineSpacing = 1; + wrap(); +} + +/** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + +void CText::setText(const CNxString &text) +{ + CNxString::setText(text); + wrap(); +} + +/** + * Set the text in the string. + * + * @param text Char array to use as the new data for this string. + */ + +void CText::setText(FAR const char *text) +{ + CNxString::setText(text); + wrap(); +} + +/** + * Set the text in the string. + * + * @param text Character to to use as the new data for this string. + */ + +void CText::setText(const nxwidget_char_t text) +{ + CNxString::setText(text); + wrap(); +} + +/** + * Append text to the end of the string. + * + * @param text String to append. + */ + +void CText::append(const CNxString &text) +{ + CNxString::append(text); + wrap(getLength() - 1); +} + +/** + * Insert text at the specified character index. + * + * @param text The text to insert. + * @param index The char index to insert at. + */ + +void CText::insert(const CNxString &text, const int index) +{ + CNxString::insert(text, index); + wrap(index); +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex The char index to start removing from. + */ + +void CText::remove(const int startIndex) +{ + CNxString::remove(startIndex); + wrap(startIndex); +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex The char index to start removing from. + * @param count The number of chars to remove. + */ + +void CText::remove(const int startIndex, const int count) +{ + CNxString::remove(startIndex, count); + wrap(startIndex); +} + + +/** + * Set the vertical spacing between rows of text. + * + * @param lineSpacing The line spacing. + */ + +void CText::setLineSpacing(uint8_t lineSpacing) +{ + m_lineSpacing = lineSpacing; + wrap(); +} + +/** + * Sets the pixel width of the text; text wider than + * this will automatically wrap. + * + * @param width Maximum pixel width of the text. + */ + +void CText::setWidth(nxgl_coord_t width) +{ + m_width = width; + wrap(); +} + +/** + * Set the font to use. + * + * @param font Pointer to the new font. + */ + +void CText::setFont(CNxFont* font) +{ + m_font = font; + wrap(); +} + +/** + * Get the number of characters in the specified line number. + * + * @param lineNumber The line number to check. + * @return The number of characters in the line. + */ + +const int CText::getLineLength(const int lineNumber) const +{ + if (lineNumber < getLineCount() - 1) + { + return m_linePositions[lineNumber + 1] - m_linePositions[lineNumber]; + } + + return getLength() - m_linePositions[lineNumber]; +} + +/** + * Get the number of characters in the specified line number, + * ignoring any trailing blank characters. + * + * @param lineNumber The line number to check. + * @return The number of characters in the line. + */ + +const int CText::getLineTrimmedLength(const int lineNumber) const +{ + nxgl_coord_t length = getLineLength(lineNumber); + + // Loop through string until the end + + CStringIterator *iterator = newStringIterator(); + + // Get char at the end of the line + + if (iterator->moveTo(m_linePositions[lineNumber] + length - 1)) + { + do + { + if (!m_font->isCharBlank(iterator->getChar())) + { + break; + } + length--; + } + while (iterator->moveToPrevious() && (length > 0)); + return length; + } + + // May occur if data has been horribly corrupted somewhere + + return 0; +} + +/** + * Get the width in pixels of the specified line number. + * + * @param lineNumber The line number to check. + * @return The pixel width of the line. + */ + +const nxgl_coord_t CText::getLinePixelLength(const int lineNumber) const +{ + return m_font->getStringWidth(*this, getLineStartIndex(lineNumber), + getLineLength(lineNumber)); +} + +/** + * Get the width in pixels of the specified line number, + * ignoring any trailing blank characters. + * + * @param lineNumber The line number to check. + * @return The pixel width of the line. + */ + +const nxgl_coord_t CText::getLineTrimmedPixelLength(const int lineNumber) const +{ + return m_font->getStringWidth(*this, getLineStartIndex(lineNumber), + getLineTrimmedLength(lineNumber)); +} + +/** + * Get a pointer to the CText object's font. + * + * @return Pointer to the font. + */ + +CNxFont *CText::getFont(void) const +{ + return m_font; +} + +/** + * Removes lines of text from the start of the text buffer. + * + * @param lines Number of lines to remove + */ + +void CText::stripTopLines(const int lines) +{ + // Get the start point of the text we want to keep + + nxgl_coord_t textStart = 0; + + for (int i = 0; i < lines; i++) + { + textStart += getLineLength(i); + } + + // Remove the characters from the start of the string to the found location + + remove(0, textStart); + + // Rewrap the text + + wrap(); +} + +/** + * Wrap all of the text. + */ + +void CText::wrap(void) +{ + wrap(0); +} + +/** + * Wrap the text from the line containing the specified char index onwards. + * + * @param charIndex The index of the char to start wrapping from; note + * that the wrapping function will re-wrap that entire line of text. + */ + +void CText::wrap(int charIndex) +{ + // Declare vars in advance of loop + + int pos = 0; + int lineWidth; + int breakIndex; + bool endReached = false; + + if (m_linePositions.size() == 0) + { + charIndex = 0; + } + + // If we're wrapping from an offset in the text, ensure that any existing data + // after the offset gets removed + + if (charIndex > 0) + { + // Remove wrapping data past this point + + // Get the index of the line in which the char index appears + + int lineIndex = getLineContainingCharIndex(charIndex); + + // Remove any longest line records that occur from the line index onwards + + while ((m_longestLines.size() > 0) && + (m_longestLines[m_longestLines.size() - 1].index >= lineIndex)) + { + m_longestLines.pop_back(); + } + + // If there are any longest line records remaining, update the text pixel width + // The last longest line record will always be the last valid longest line as + // the vector is sorted by length + + if (m_longestLines.size() > 0) + { + m_textPixelWidth = m_longestLines[m_longestLines.size() - 1].width; + } + else + { + m_textPixelWidth = 0; + } + + // Remove any wrapping data from after this line index onwards + + while ((m_linePositions.size() > 0) && + (m_linePositions.size() - 1 > (int)lineIndex)) + { + m_linePositions.pop_back(); + } + + // Adjust start position of wrapping loop so that it starts with + // the current line index + + if (m_linePositions.size() > 0) + { + pos = m_linePositions[m_linePositions.size() - 1]; + } + } + else + { + // Remove all wrapping data + + // Wipe the width variable + + m_textPixelWidth = 0; + + // Empty existing longest lines + + m_longestLines.clear(); + + // Empty existing line positions + + m_linePositions.clear(); + + // Push first line start into vector + + m_linePositions.push_back(0); + } + + // Loop through string until the end + + CStringIterator *iterator = newStringIterator(); + + while (!endReached) + { + breakIndex = 0; + lineWidth = 0; + + if (iterator->moveTo(pos)) + { + // Search for line breaks and valid breakpoints until we + // exceed the width of the text field or we run out of + // string to process + + while (lineWidth + m_font->getCharWidth(iterator->getChar()) <= m_width) + { + lineWidth += m_font->getCharWidth(iterator->getChar()); + + // Check for line return + + if (iterator->getChar() == '\n') + { + // Remember this breakpoint + + breakIndex = iterator->getIndex(); + break; + } + else if ((iterator->getChar() == ' ') || + (iterator->getChar() == ',') || + (iterator->getChar() == '.') || + (iterator->getChar() == '-') || + (iterator->getChar() == ':') || + (iterator->getChar() == ';') || + (iterator->getChar() == '?') || + (iterator->getChar() == '!') || + (iterator->getChar() == '+') || + (iterator->getChar() == '=') || + (iterator->getChar() == '/') || + (iterator->getChar() == '\0')) + { + // Remember the most recent breakpoint + + breakIndex = iterator->getIndex(); + } + + // Move to the next character + + if (!iterator->moveToNext()) + { + // No more text; abort loop + + endReached = true; + break; + } + } + } + else + { + endReached = true; + } + + if ((!endReached) && (iterator->getIndex() > pos)) + { + // Process any found data + + // If we didn't find a breakpoint split at the current position + + if (breakIndex == 0) + { + breakIndex = iterator->getIndex() - 1; + } + + // Trim blank space from the start of the next line + + CStringIterator *breakIterator = newStringIterator(); + + if (breakIterator->moveTo(breakIndex + 1)) + { + while (breakIterator->getChar() == ' ') + { + if (breakIterator->moveToNext()) + { + breakIndex++; + } + else + { + break; + } + } + } + + delete breakIterator; + + // Add the start of the next line to the vector + + pos = breakIndex + 1; + m_linePositions.push_back(pos); + + // Is this the longest line observed so far? + + if (lineWidth > m_textPixelWidth) + { + m_textPixelWidth = lineWidth; + + // Push the description of the line into the longest lines + // vector (note that we store the index in m_linePositions that + // refers to the start of the line, *not* the position of the + // line in the char array) + + LongestLine line; + line.index = m_linePositions.size() - 2; + line.width = lineWidth; + m_longestLines.push_back(line); + } + } + else if (!endReached) + { + // Add a blank row if we're not at the end of the string + + pos++; + m_linePositions.push_back(pos); + } + } + + // Add marker indicating end of text + // If we reached the end of the text, append the stopping point + + if (m_linePositions[m_linePositions.size() - 1] != getLength() + 1) + { + m_linePositions.push_back(getLength()); + } + + delete iterator; + + // Calculate the total height of the text + + m_textPixelHeight = getLineCount() * (m_font->getHeight() + m_lineSpacing); + + // Ensure height is always at least one row + + if (m_textPixelHeight == 0) + { + m_textPixelHeight = m_font->getHeight() + m_lineSpacing; + } +} + +/** + * Get the index of the line of text that contains the specified index + * within the raw char array. + * + * @param index The index to locate within the wrapped lines of text. + * @return The number of the line of wrapped text that contains the + * specified index. + */ + +const int CText::getLineContainingCharIndex(const int index) const +{ + // Early exit if there is no existing line data + + if (m_linePositions.size() == 0) + { + return 0; + } + + // Early exit if the character is in the last row + + if (index >= m_linePositions[m_linePositions.size() - 2]) + { + return m_linePositions.size() - 2; + } + + // Binary search the line vector for the line containing the supplied index + + int bottom = 0; + int top = m_linePositions.size() - 1; + int mid; + + while (bottom <= top) + { + // Standard binary search + + mid = (bottom + top) >> 1; + + if (index < m_linePositions[mid]) + { + // Index is somewhere in the lower search space + + top = mid - 1; + } + else if (index > m_linePositions[mid]) + { + // Index is somewhere in the upper search space + + bottom = mid + 1; + } + else if (index == m_linePositions[mid]) + { + // Located the index + + return mid; + } + + // Check to see if we've moved past the line that contains the index + // We have to do this because the index we're looking for can be within + // a line; it isn't necessarily the start of a line (which is what is + // stored in the m_linePositions vector) + + if (index > m_linePositions[top]) + { + // Search index falls within the line represented by the top position + + return top; + } + else if (index < m_linePositions[bottom]) + { + // Search index falls within the line represented by the bottom position + + return bottom - 1; + } + } + + // Line cannot be found + + return 0; +} diff --git a/libnxwidgets/src/ctextbox.cxx b/libnxwidgets/src/ctextbox.cxx new file mode 100644 index 000000000..9c22a2bfa --- /dev/null +++ b/libnxwidgets/src/ctextbox.cxx @@ -0,0 +1,679 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ctextbox.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "ctextbox.hxx" +#include "cgraphicsport.hxx" +#include "cnxtimer.hxx" +#include "cstringiterator.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CButton Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for a textbox containing a string. + * + * @param pWidgetControl The controlling widget for the window + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param text Pointer to a string to display in the textbox. + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * defaultCWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CTextBox::CTextBox(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + const CNxString &text, CWidgetStyle *style) + : CLabel(pWidgetControl, x, y, width, height, text, style) +{ + // Initialize state + + m_cursorPos = 0; + m_showCursor = SHOW_CURSOR_ONFOCUS; + m_wrapCursor = false; + m_textChange = false; + m_flags.doubleClickable = true; + + // Set the border thickness (2 lines) + + m_borderSize.top = 2; + m_borderSize.right = 2; + m_borderSize.bottom = 2; + m_borderSize.left = 2; + + // Move the cursor to the end of the string + + moveCursorToPosition(m_text.getLength()); + + // Register to receive keypress events + + addWidgetEventHandler(static_cast(this)); +} + +/** + * Shows the cursor. + * + * @param cursorMode Determines cursor display mode + */ + +void CTextBox::showCursor(EShowCursor cursorMode) +{ + if (m_showCursor != cursorMode) + { + m_showCursor = cursorMode; + redraw(); + } +} + +/** + * Set the text displayed in the label. + * + * @param text String to display. + */ + +void CTextBox::setText(const CNxString &text) +{ + m_text.setText(text); + repositionCursor(m_text.getLength()); + onTextChange(); +} + +/** + * Append new text to the end of the current text displayed in the + * label. + * + * @param text String to append. + */ + +void CTextBox::appendText(const CNxString &text) +{ + m_text.append(text); + repositionCursor(m_text.getLength()); + onTextChange(); +} + +/** + * Remove all characters from the string from the start index onwards. + * + * @param startIndex Index to remove from. + */ + +void CTextBox::removeText(const unsigned int startIndex) +{ + m_text.remove(startIndex); + repositionCursor(startIndex); + onTextChange(); +} + +/** + * Remove specified number of characters from the string from the + * start index onwards. + * + * @param startIndex Index to remove from. + * @param count Number of characters to remove. + */ + +void CTextBox::removeText(const unsigned int startIndex, const unsigned int count) +{ + m_text.remove(startIndex, count); + repositionCursor(startIndex); + onTextChange(); +} + +/** + * Insert text at the specified index. + * + * @param text The text to insert. + * @param index Index at which to insert the text. + */ + +void CTextBox::insertText(const CNxString &text, const unsigned int index) +{ + m_text.insert(text, index); + repositionCursor(index + text.getLength()); + onTextChange(); +} + +/** + * Insert text at the current cursor position. + * + * @param text The text to insert. + */ + +void CTextBox::insertTextAtCursor(const CNxString &text) +{ + insertText(text, getCursorPosition()); +} + +/** + * Move the cursor to the text position specified. 0 indicates the + * start of the string. If position is greater than the length of the + * string, the cursor is moved to the end of the string. + * + * @param position The new cursor position. + */ + +void CTextBox::moveCursorToPosition(const int position) +{ + if (repositionCursor(position)) + { + calculateTextPositionHorizontal(); + redraw(); + } +} + +/** + * Handle a keyboard press event. + * + * @param e The event data. + */ + +void CTextBox::handleKeyPressEvent(const CWidgetEventArgs &e) +{ + nxwidget_char_t key = e.getKey(); + + if (key == KEY_CODE_BACKSPACE) + { + if (m_cursorPos == 0) return; + + // Delete the character in front of the cursor + + removeText(m_cursorPos - 1, 1); + } + else if (key == KEY_CODE_ENTER) + { + // Fire an action event + + m_widgetEventHandlers->raiseActionEvent(); + } + else if (key != KEY_CODE_NONE) + { + // Not modifier; append value + + insertTextAtCursor(key); + } +} + +/** + * Handle a cursor control event. Replaces CWidgetEventHandler method. + * + * @param e The event data. + */ + +void CTextBox::handleCursorControlEvent(const CWidgetEventArgs &e) +{ + ECursorControl control = e.getCursorControl(); + + if (control == CURSOR_LEFT) + { + if (m_cursorPos > 0) + { + moveCursorToPosition(m_cursorPos - 1); + } + else if (m_wrapCursor) + { + moveCursorToPosition(m_text.getLength() - 1); + } + } + else if (control == CURSOR_RIGHT) + { + if (m_cursorPos < m_text.getLength()) + { + moveCursorToPosition(m_cursorPos + 1); + } + else if (m_wrapCursor) + { + moveCursorToPosition(0); + } + } +} + +/** + * Redraws the widget + */ + +void CTextBox::onBlur(void) +{ + redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CTextBox::drawContents(CGraphicsPort *port) +{ + // Get the drawing area (excluding the border) + + CRect rect; + getRect(rect); + + // Determine the background and text color + + nxgl_mxpixel_t textColor; + nxgl_mxpixel_t backColor; + + if (!isEnabled()) + { + textColor = getDisabledTextColor(); + backColor = getBackgroundColor(); + } + else if (m_highlighted) + { + textColor = getSelectedTextColor(); + backColor = getSelectedBackgroundColor(); + } + else + { + textColor = getEnabledTextColor(); + backColor = getBackgroundColor(); + } + + // Draw the background (excluding the border) + + port->drawFilledRect(rect.getX(), rect.getY(), + rect.getWidth(), rect.getHeight(), backColor); + + // Get the X/Y position of the text within the textbox + + struct nxgl_point_s pos; + pos.x = rect.getX() + m_align.x; + pos.y = rect.getY() + m_align.y; + + // And draw the text + + CNxFont *font = getFont(); + port->drawText(&pos, &rect, font, m_text, 0, m_text.getLength(), textColor); + + // Draw cursor + + if (isCursorVisible()) + { + // Calculate the (relative) cursor position + // Warning: drawText modifies pos! + + pos.x = getCursorXPos() + m_align.x; + pos.y = m_align.y; + + // Calculate the cursor width + + struct nxgl_size_s size; + size.w = getCursorWidth(); + size.h = getFont()->getHeight(); + + // Is the cursor wholly within the visible region? + + if (pos.x >= 0 && pos.x + size.w < rect.getWidth()) + { + // Invert the colors in the cursor region. + + pos.x += rect.getX(); + pos.y += rect.getY(); + + port->invert(pos.x, pos.y, size.w, size.h); + } + } +} + +/** + * Moves the cursor without redrawing. + * + * @param position New cursor position. + */ + +bool CTextBox::repositionCursor(const int position) +{ + int len = m_text.getLength(); + + // Set the cursor position if the new position is within the string. + + if (m_cursorPos != position && position <= len) + { + m_cursorPos = position; + return true; + } + + return false; +} + +/** + * Move the cursor to the specified coordinates. The coordinates + * are expected to be the result of a click, and therefore in + * world-space rather than widget-space. + */ + +void CTextBox::moveCursorToClickLocation(nxgl_coord_t x, nxgl_coord_t y) +{ + // Work out where in the string the click coordinates represent + // and move the cursor to that location + + if (m_text.getLength() > 0) + { + // Transform click coordinates to widget-space coordinates + + nxgl_coord_t clickX = x - getX() - m_borderSize.left; + nxgl_coord_t charX = m_align.x; + + // Locate the first character that comes after the clicked character + + CStringIterator *iterator = m_text.newStringIterator(); + + while (charX < clickX) + { + charX += getFont()->getCharWidth(iterator->getChar()); + + if (!iterator->moveToNext()) + { + break; + } + } + + int index = iterator->getIndex(); + + // Move back to the clicked character if we've moved past it + + if (charX > clickX) + { + iterator->moveToPrevious(); + index = iterator->getIndex(); + } + else if (charX < clickX) + { + // Move past end of string if click is after the text + + index++; + } + + moveCursorToPosition(index); + delete iterator; + } +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CTextBox::drawBorder(CGraphicsPort *port) +{ + // Check if the widget indicates it should have an outline: That + // the outline is enabled and the this is not just a text-only + // redraw + + if (!isBorderless() && !isTextChange()) + { + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), + getShineEdgeColor(), getShadowEdgeColor()); + port->drawBevelledRect(getX() + 1, getY() + 1, getWidth() - 2, getHeight() - 2, + getShadowEdgeColor(), getShineEdgeColor()); + } +} + +/** + * Moves the cursor to the clicked coordinates. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + +void CTextBox::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + moveCursorToClickLocation(x, y); +} + +/** + * Does nothing. + * + * @param x The x coordinates of the click. + * @param y The y coordinates of the click. + */ + +void CTextBox::onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // No double click action +} + +/** + * Return true if the cursor is visible + */ + +bool CTextBox::isCursorVisible(void) const +{ + return (m_showCursor == SHOW_CURSOR_ALWAYS || + (m_showCursor == SHOW_CURSOR_ONFOCUS && hasFocus())); +} + +/** + * Get the x coordinate of the cursor in pixels relative + * to the left-hand edge of the client rect. + * + * @return The x coordinate of the cursor in pixels. + */ + +const nxgl_coord_t CTextBox::getCursorXPos(void) const +{ + // Calculate position of cursor + + nxgl_coord_t cursorX = 0; + + CStringIterator *iterator = m_text.newStringIterator(); + + for (nxgl_coord_t i = 0; i < m_cursorPos; i++) + { + cursorX += getFont()->getCharWidth(iterator->getChar()); + iterator->moveToNext(); + } + + delete iterator; + return cursorX; +} + +/** + * Get the width of the cursor in pixels. + * + * @return The width of the cursor in pixels. + */ + +nxgl_coord_t CTextBox::getCursorWidth(void) const +{ + if (m_cursorPos < m_text.getLength()) + { + // Cursor within the string - get the width of the character + + return getFont()->getCharWidth(m_text.getCharAt(m_cursorPos)); + } + else + { + // Cursor past end of string - get the width of a space + + return getFont()->getCharWidth(' '); + } +} + +/** + * Calculate the horizontal position of the string based on its length + * and the alignment options. Alignment options are overridden if the + * width of the string exceeds the width of the textbox. + */ + +void CTextBox::calculateTextPositionHorizontal(void) +{ + // Calculate the string width - if the width is longer than the box, + // ignore alignment and align left + + nxgl_coord_t stringWidth = getFont()->getStringWidth(m_text); + + // Add the width of a blank space to the width to ensure that we can + // see the cursor + + if (isCursorVisible()) + { + stringWidth += getFont()->getCharWidth(' '); + } + + CRect rect; + getClientRect(rect); + + // Use alignment options if cursor is hidden or string is smaller + // than textbox + + nxgl_coord_t width = rect.getWidth(); + if ((stringWidth < width) || !isCursorVisible()) + { + // Text not wider than box, so apply alignment options + + switch (m_hAlignment) + { + case TEXT_ALIGNMENT_HORIZ_CENTER: + m_align.x = (width - stringWidth) >> 1; + break; + + case TEXT_ALIGNMENT_HORIZ_LEFT: + m_align.x = rect.getX(); + break; + + case TEXT_ALIGNMENT_HORIZ_RIGHT: + m_align.x = width - stringWidth; + break; + } + + return; + } + + // Text is wider than box - view needs to follow the cursor + // If cursor is at the end of the text, we can just right-align + + if (m_cursorPos == m_text.getLength()) + { + m_align.x = width - stringWidth; + return; + } + + // Work out the coordinates of the left edge of the cursor + + int cursorX1 = getCursorXPos(); + + // Work out the coordinates of the right edge of the cursor + + int cursorX2 = cursorX1 + getCursorWidth(); + + // Ensure that the cursor is on-screen + + if (cursorX1 + m_align.x < 0) + { + // Cursor is off left side of screen, so adjust m_align.x + + m_align.x = 0 - cursorX1; + } + else if (cursorX2 + m_align.x > width) + { + // Cursor is off right side of screen, so adjust m_align.x + + m_align.x = width - cursorX2; + } + + // We need to ensure that the text cannot be positioned in + // such a way that there is a gap between the end of the + // text and the right edge of the textbox + + if (stringWidth + m_align.x < width) + { + m_align.x = width - stringWidth; + } +} diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx new file mode 100644 index 000000000..5ea672a2f --- /dev/null +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -0,0 +1,890 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cnxserver.hxx" +#include "cnxwidget.hxx" +#include "cnxfont.hxx" +#include "cwidgetstyle.hxx" +#include "cnxtimer.hxx" +#include "cgraphicsport.hxx" +#include "cwidgetcontrol.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Global Static Data + ****************************************************************************/ + +using namespace NXWidgets; + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +/** + * CWidgetControl constructor (for the case where the display size is known) + * + * @param style The style that the widget should use. If this is not + * specified, the widget will use the values stored in the global + * defaultCWidgetStyle object. The widget will copy the properties of + * the style into its own internal style object. + */ + +CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) +{ + // Initialize state + + m_port = (CGraphicsPort *)NULL; + m_modal = false; + m_clickedWidget = (CNxWidget *)NULL; + m_focusedWidget = (CNxWidget *)NULL; + + // Initialize data that we will get from the position callback + + m_hWindow = NULL; + m_size.h = 0; + m_size.w = 0; + m_pos.x = 0; + m_pos.y = 0; + m_bounds.pt1.x = 0; + m_bounds.pt1.y = 0; + m_bounds.pt2.y = 0; + m_bounds.pt2.y = 0; + + // Initialize the mouse/touchscreen event and keyboard data structures + + memset(&m_mouse, 0, sizeof(struct SMouse)); + m_nCh = 0; + m_nCc = 0; + + // Enable the semaphore that will wake up the modal loop on mouse or + // keypress events + + sem_init(&m_modalsem, 0, 0); + + // Do we need to fetch the default style? + + if (style == (CWidgetStyle *)NULL) + { + // Get the style from the controlling widget + + copyWidgetStyle(&m_style, g_defaultWidgetStyle); + } + else + { + // Use specified style + + copyWidgetStyle(&m_style, style); + } +} + + +/** + * Destructor. + */ + +CWidgetControl::~CWidgetControl(void) +{ + // Stop any ongoing modal operation + + stopModal(); + + // Delete any contained instances + + if (m_port) + { + delete m_port; + } + + // Flush the delete queue + + processDeleteQueue(); + + // Delete controlled widget list + + while (m_widgets.size() > 0) + { + m_widgets[0]->destroy(); + } +} + +/** + * Run the widget modally. This will run the CWidgetControl + * application until stopModal() is called. + */ + +void CWidgetControl::goModal(void) +{ + // Enter modal + + m_modal = true; + + // Loop until stopModal() is called + + while (m_modal) + { + // Process pending events + + bool interestingEvent = pollEvents(); + + // Did any interesting events occur? + + if (!interestingEvent) + { + // No, give up the CPU until something interesting happens. + + waitForModalEvent(); + } + } +} + +/** + * Wait for an interesting modal event to occur (like a mouse or keyboard event) + */ + +void CWidgetControl::waitForModalEvent(void) +{ + // It would be an error if this were called outside of a modal loop + + if (m_modal) + { + // Wait for an interesting event (like a mouse or keyboard event) + + (void)sem_wait(&m_modalsem); + } +} + +/** + * Wake up the modal loop + */ + +void CWidgetControl::wakeupModalLoop(void) +{ + if (m_modal) + { + (void)sem_post(&m_modalsem); + } +} + +/** + * Stop the widget running modally. + */ + +void CWidgetControl::stopModal(void) +{ + if (m_modal) + { + // No longer modal + + m_modal = false; + + // Wake up the modal loop so that it can terminate properly + + (void)sem_post(&m_modalsem); + } +} + +/** + * Run all code that needs to take place on a periodic basis. + * This is normally called from and is the main body of goModal() + * with widget == NULL. + * + * @param widget Sub-widget to run, used for modal widgets; omit + * this parameter to run the whole system. + * @return True means some interesting event occurred + */ + +bool CWidgetControl::pollEvents(CNxWidget *widget) +{ + // Delete any queued widgets + + processDeleteQueue(); + + // Handle mouse input + + bool mouseEvent = pollMouseEvents(widget); + + // Handle keyboard input + + bool keyboardEvent = pollKeyboardEvents(); + + // Handle cursor control input + + bool cursorControlEvent = pollCursorControlEvents(); + return mouseEvent || keyboardEvent || cursorControlEvent; +} + +/** + * Get the index of the specified controlled widget. + * + * @param widget The widget to get the index of. + * @return The index of the widget. -1 if the widget is not found. + */ + +const int CWidgetControl::getWidgetIndex(const CNxWidget *widget) const +{ + for (int i = 0; i < m_widgets.size(); i++) + { + if (m_widgets[i] == widget) + { + return i; + } + } + + return -1; +} + +/** + * Redraws any dirty regions within the supplied region. + * + * @param rect The region to redraw + */ + +void CWidgetControl::eraseRect(CRect rect) +{ + // Create pointer to a vector to store the invalid rectangles + + TNxArray *invalidRectangles = new TNxArray(); + + if (invalidRectangles != (TNxArray *)NULL) + { + // Add rectangle into the vector + + invalidRectangles->push_back(rect); + + // Refresh children + + for (int i = m_widgets.size() - 1; i > -1 ; i--) + { + if (invalidRectangles->size() > 0) + { + m_widgets[i]->redrawDirty(invalidRectangles, (CNxWidget *)NULL); + } + else + { + break; + } + } + + // Tidy up + + delete invalidRectangles; + } +} + +/** + * Remove a controlled widget + * + * @param widget The widget to be removed + */ + +void CWidgetControl::removeControlledWidget(CNxWidget *widget) +{ + // Locate the widget + + int index = getWidgetIndex(widget); + if (index >= 0) + { + m_widgets.erase(index); + } +} + +/** + * Add a widget to the list of widgets to be deleted. + * Must never be called by anything other than the framework itself. + * + * @param widget The widget to add to the delete queue. + */ + +void CWidgetControl::addToDeleteQueue(CNxWidget *widget) +{ + m_deleteQueue.push_back(widget); +} + +/** + * Set the clicked widget pointer. Note that this should not be + * called by code other than within the CWidgetControl library itself. + * + * @param widget The new clicked widget. + */ + +void CWidgetControl::setClickedWidget(CNxWidget *widget) +{ + // Do we have a clicked widget already? + + if (m_clickedWidget != (CNxWidget *)NULL) + { + // Ensure that the existing clicked widget is released *outside* its bounds + + m_clickedWidget->release(m_clickedWidget->getX() - 10, 0); + } + + // Update the pointer + + m_clickedWidget = widget; +} + +/** + * Set the focused widget that will receive keyboard input. + * + * @param widget The new focused widget. + */ + +void CWidgetControl::setFocusedWidget(CNxWidget *widget) +{ + if (m_focusedWidget != widget) + { + // This widget will now receive focus + + m_focusedWidget = widget; + + // Make sure that the widget knows that is has focus + + widget->focus(); + } +#warning "Widgets with focus need to go on a stack so that focus can be restored" +} + +/** + * This event is called from CCallback instance to provide + * notifications of certain NX-server related events. This event, + * in particular, will occur when the position or size of the underlying + * window occurs. + * + * @param hWindow The window handle that should be used to communicate + * with the window + * @param pos The position of the window in the physical device space. + * @param size The size of the window. + * @param bounds The size of the underlying display (pixels x rows) + */ + +void CWidgetControl::geometryEvent(NXHANDLE hWindow, + const struct nxgl_size_s *size, + const struct nxgl_point_s *pos, + const struct nxgl_rect_s *bounds) +{ + // Save positional data that may change dynamically + + m_pos.x = pos->x; + m_pos.y = pos->y; + m_size.h = size->h; + m_size.w = size->w; + + // The first callback is important. This is the handshake that proves + // that we are truly communicating with the servier. This is also + // a critical point because this is when we know the physical + // dimensions of the underlying window. + + if (!m_hWindow) + { + // Save one-time server specific information + + m_hWindow = hWindow; + nxgl_rectcopy(&m_bounds, bounds); + } +} + +/** + * This event is called from CCallback instance to provide + * notifications of certain NX-server related events. This event, + * in particular, will occur when the a portion of the window that was + * previously obscured is now exposed. + * + * @param rect The region in the window that must be redrawn. + * @param more True means that more re-draw requests will follow + */ + +void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more) +{ + CRect rect; + rect.setNxRect(nxRect); + eraseRect(rect); +} + +/** + * This event is called from CCallback instance to provide notifications of + * certain NX-server related events. This event, in particular, means that + * new mouse data is available for the window. + * + * @param pPos The (x,y) position of the mouse. + * @param buttons See NX_MOUSE_* definitions. + */ + +void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pPos, uint8_t buttons) +{ + // Save the mouse X/Y position + + m_mouse.x = pPos->x; + m_mouse.y = pPos->y; + + // Update button press states + + clearMouseEvents(); + + if ((buttons & NX_MOUSE_LEFTBUTTON) != 0) + { + // Handle left button press events. leftHeld means that the left mouse + // button was pressed on the previous sample as well. + + if (m_mouse.leftHeld) + { + m_mouse.leftDrag = 1; + } + else + { + // New left button press + + m_mouse.leftPressed = 1; + + (void)clock_gettime(CLOCK_REALTIME, &m_mouse.leftPressTime); + + // Check for double click event + + if (elapsedTime(&m_mouse.leftReleaseTime) <= CONFIG_NXWIDGETS_DOUBLECLICK_TIME) + { + m_mouse.doubleClick = 1; + } + } + + m_mouse.leftHeld = 1; + } + else + { + // Handle left button release events + + if (m_mouse.leftHeld) + { + // New left button release + + m_mouse.leftReleased = 1; + (void)clock_gettime(CLOCK_REALTIME, &m_mouse.leftReleaseTime); + } + + m_mouse.leftHeld = 0; + } + +#if 0 // Center and right buttons not used + if ((buttons & NX_MOUSE_CENTERBUTTON) != 0) + { + // Handle center button press events. centerHeld means that the center mouse + // button was pressed on the previous sample as well. + + if (m_mouse.centerHeld) + { + m_mouse.centerDrag = 1; + } + else + { + // New center button press + + m_mouse.centerPressed = 1; + } + + m_mouse.centerHeld = 1; + } + else + { + // Handle center button release events + + if (m_mouse.centerHeld) + { + // New center button release + + m_mouse.centerReleased = 1; + } + + m_mouse.centerHeld = 0; + } + + if ((buttons & NX_MOUSE_RIGHTBUTTON) != 0) + { + // Handle right button press events. rightHeld means that the right mouse + // button was pressed on the previous sample as well. + + if (m_mouse.rightHeld) + { + m_mouse.rightDrag = 1; + } + else + { + // New right button press + + m_mouse.rightPressed = 1; + } + + m_mouse.rightHeld = 1; + } + else + { + // Handle right button release events + + if (m_mouse.rightHeld) + { + // New right button release + + m_mouse.rightReleased = 1; + } + + m_mouse.rightHeld = 0; + } +#endif + + // Then wake up the modal loop + + wakeupModalLoop(); +} + +/** + * This event is called from CCallback instance to provide notifications of + * certain NX-server related events. This event, in particular, means that + * keyboard/keypad data is available for the window. + * + * @param nCh The number of characters that are available in pStr[]. + * @param pStr The array of characters. + */ + +void CWidgetControl::newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr) +{ + FAR uint8_t *pBuffer = &m_kbdbuf[m_nCh]; + + // Append each new character to keyboard character buffer + + for (uint8_t i = 0; + i < nCh && m_nCh < CONFIG_NXWIDGETS_KBDBUFFER_SIZE; + i++, m_nCh++) + { + *pBuffer++ = *pStr++; + } + + // Then wake up the modal loop + + wakeupModalLoop(); +} + +/** + * This event means that cursor control data is available for the window. + * + * @param cursorControl The cursor control code received. + */ + +void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl) +{ + // Append the new cursor control + + if (m_nCc < CONFIG_NXWIDGETS_CURSORCONTROL_SIZE) + { + m_controls[m_nCc] = (uint8_t)cursorControl; + m_nCc++; + } + + // Then wake up the modal loop + + wakeupModalLoop(); +} + +/** + * Copy a widget style + * + * @param dest The destination style + * @param src The source to use + */ + +void CWidgetControl::copyWidgetStyle(CWidgetStyle *dest, const CWidgetStyle *src) +{ + dest->colors.background = src->colors.background; + dest->colors.selectedBackground = src->colors.selectedBackground; + dest->colors.shineEdge = src->colors.shineEdge; + dest->colors.shadowEdge = src->colors.shadowEdge; + dest->colors.highlight = src->colors.highlight; + dest->colors.disabledText = src->colors.disabledText; + dest->colors.enabledText = src->colors.enabledText; + dest->colors.selectedText = src->colors.selectedText; + dest->font = src->font; +} + +/** + * Return the elapsed time in millisconds + * + * @param tp A time in the past from which to compute the elapsed time. + * @return The elapsed time since tp + */ + +uint32_t CWidgetControl::elapsedTime(FAR const struct timespec *startTime) +{ + struct timespec endTime; + + (void)clock_gettime(CLOCK_REALTIME, &endTime); + if (startTime->tv_sec <= endTime.tv_sec) + { + // Get the elapsed seconds + + uint32_t seconds = endTime.tv_sec - startTime->tv_sec; + + // Get the elapsed nanoseconds, borrowing from the seconds if necessary + + int32_t endNanoSeconds = endTime.tv_nsec; + if (startTime->tv_nsec > endNanoSeconds) + { + // Are there any seconds to borrow from? + + if (seconds < 1) + { + // startTime is in the future??? + + return 0; + } + + // Borrow from the seconds + + seconds--; + endNanoSeconds += 1000000000; + } + uint32_t nanoseconds = endNanoSeconds - startTime->tv_nsec; + + // Then return the elapsed time in milliseconds + + return seconds * 1000000 + nanoseconds / 1000; + } + + // startTime is in the future??? + + return 0; +} + +/** + * Pass clicks to the widget hierarchy. If a single widget + * is supplied, only that widget is sent the click. That widget + * should be running modally. + * + * @param x Click xcoordinate. + * @param y Click ycoordinate. + * @param widget Pointer to a modally-running widget or NULL. + */ + +void CWidgetControl::handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget *widget) +{ + // Working with a modal widget or the whole structure? + + if (widget == (CNxWidget *)NULL) + { + // All widgets + + for (int i = m_widgets.size() - 1; i > -1; i--) + { + if (m_widgets[i]->click(x, y)) + { + return; + } + } + } + else + { + // One widget + + (void)widget->click(x, y); + } +} + +/** + * Delete any widgets in the deletion queue. + */ + +void CWidgetControl::processDeleteQueue(void) +{ + int i = 0; + while (i < m_deleteQueue.size()) + { + m_deleteQueue[i]->destroy(); + i++; + } + + m_deleteQueue.clear(); +} + +/** + * Process mouse/touchscreen events and send throughout the hierarchy. + * + * @param widget to process, used for modal widgets; omit this parameter + * to run the whole system. + * @return True means a mouse event occurred + */ + +bool CWidgetControl::pollMouseEvents(CNxWidget *widget) +{ + bool mouseEvent = true; // Assume that an interesting mouse event occurred + + // All widgets + + if (m_mouse.leftPressed) + { + // Handle a new left button press event + + handleLeftClick(m_mouse.x, m_mouse.y, widget); + } + else if (m_mouse.leftDrag) + { + // The left button is still being held down + + if (m_clickedWidget != (CNxWidget *)NULL) + { + // Handle a mouse drag event + + m_clickedWidget->drag(m_mouse.x, m_mouse.y, + m_mouse.x - m_mouse.lastX, + m_mouse.y - m_mouse.lastY); + } + } + else if (m_clickedWidget != (CNxWidget *)NULL) + { + // Mouse left button release event + + m_clickedWidget->release(m_mouse.x, m_mouse.y); + } + else + { + // No interesting mouse events + + mouseEvent = false; + } + + // Clear all press and release events once they have been processed + + clearMouseEvents(); + + // Save the mouse position for the next poll + + m_mouse.lastX = m_mouse.x; + m_mouse.lastY = m_mouse.y; + return mouseEvent; +} + +/** + * Process keypad events and send throughout the hierarchy. + * + * @return True means a keyboard event occurred + */ + +bool CWidgetControl::pollKeyboardEvents(void) +{ + bool keyboardEvent = false; // Assume no interesting keyboard events + + // Keyboard presses with no focused widget is not an interesting + // event + + if (m_focusedWidget != (CNxWidget *)NULL) + { + // Forward each character to the widget with the focus + + for (uint8_t i = 0; i < m_nCh; i++) + { + m_focusedWidget->keyPress((nxwidget_char_t)m_kbdbuf[i]); + keyboardEvent = true; + } + } + + // All of the buffered characters have been consumed + + m_nCh = 0; + return keyboardEvent; +} + +/** + * Process cursor control events and send throughout the hierarchy. + * + * @return True means a cursor control event was processes + */ + +bool CWidgetControl::pollCursorControlEvents(void) +{ + bool cursorControlEvent = false; // Assume no interesting cursor events + + // Cursor controls with no focused widget is not an interesting + // event + + if (m_focusedWidget != (CNxWidget *)NULL) + { + // Forward each cursor control to the widget with the focus + + for (uint8_t i = 0; i < m_nCc; i++) + { + m_focusedWidget->cursorControl((ECursorControl)m_controls[i]); + cursorControlEvent = true; + } + } + + // All of the buffered events have been consumed + + m_nCc = 0; + return cursorControlEvent; +} + +/** + * Clear all mouse events + */ + +void CWidgetControl::clearMouseEvents(void) +{ + // Clear all press and release events once they have been processed + + m_mouse.leftPressed = 0; + m_mouse.leftReleased = 0; + m_mouse.leftDrag = 0; + +#if 0 // Center and right buttons are not used + m_mouse.centerPressed = 0; + m_mouse.centerReleased = 0; + m_mouse.centerDrag = 0; + + m_mouse.rightPressed = 0; + m_mouse.rightReleased = 0; + m_mouse.rightDrag = 0; +#endif + + m_mouse.doubleClick = 0; +} diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx new file mode 100644 index 000000000..48b762d0d --- /dev/null +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -0,0 +1,606 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cwidgeteventhandlerlist.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cnxwidget.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgeteventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +#define DOUBLE_CLICK_BOUNDS 10 + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param widget The owning widget. + */ + +CWidgetEventHandlerList::CWidgetEventHandlerList(CNxWidget *widget) +{ + m_widget = widget; + m_isEnabled = true; +} + +/** + * Check if the object raises events or not. + * + * @return True if events are enabled. + */ + +const bool CWidgetEventHandlerList::isEnabled(void) const +{ + return m_isEnabled && !m_widget->isDeleted(); +} + +/** + * Adds a widget event handler. The event handler will receive + * all events raised by this object. + * @param eventHandler A pointer to the event handler. + */ + +void CWidgetEventHandlerList::addWidgetEventHandler(CWidgetEventHandler *eventHandler) +{ + // Prevent insertion if the handler already exists + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + if (m_widgetEventHandlers.at(i) == eventHandler) + { + return; + } + } + + // Add the new handler + + m_widgetEventHandlers.push_back(eventHandler); +} + +/** + * Remove a widget event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + +void CWidgetEventHandlerList::removeWidgetEventHandler(CWidgetEventHandler *eventHandler) +{ + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + if (m_widgetEventHandlers.at(i) == eventHandler) + { + m_widgetEventHandlers.erase(i); + return; + } + } +} + +/** + * Raise a click event to the event handler. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CWidgetEventHandlerList::raiseClickEvent(nxgl_coord_t x, nxgl_coord_t y) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleClickEvent(e); + } + } +} + +/** + * Raise a double-click event to the event handler. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CWidgetEventHandlerList::raiseDoubleClickEvent(nxgl_coord_t x, nxgl_coord_t y) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleDoubleClickEvent(e); + } + } +} + +/** + * Raise a mouse release event to the event handler. + * + * @param x The x coordinate of the release. + * @param y The y coordinate of the release. + */ + +void CWidgetEventHandlerList::raiseReleaseEvent(nxgl_coord_t x, nxgl_coord_t y) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleReleaseEvent(e); + } + } +} + +/** + * Raise a mouse release-outside event to the event handler. + * + * @param x The x coordinate of the release. + * @param y The y coordinate of the release. + */ + +void CWidgetEventHandlerList::raiseReleaseOutsideEvent(nxgl_coord_t x, nxgl_coord_t y) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleReleaseOutsideEvent(e); + } + } +} + +/** + * Raise a mouse drag event to the event handler. + * + * @param x The x coordinate of the mouse when the drag started. + * @param y The y coordinate of the mouse when the drag started. + * @param vX The horizontal distance dragged. + * @param vY The vertical distance dragged. + */ + +void CWidgetEventHandlerList::raiseDragEvent(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, vX, vY, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleDragEvent(e); + } + } +} + +/** + * Raise a widget drop event to the event handler. + * + * @param x The x coordinate of the mouse when the drop occurred. + * @param y The y coordinate of the mouse when the drop occurred. + */ + +void CWidgetEventHandlerList::raiseDropEvent(nxgl_coord_t x, nxgl_coord_t y) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleDropEvent(e); + } + } +} + +/** + * Raise a move forward event to the event handler. + */ + +void CWidgetEventHandlerList::raiseMoveForwardEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleMoveForwardEvent(e); + } + } +} + +/** + * Raise a move backward event to the event handler. + */ + +void CWidgetEventHandlerList::raiseMoveBackwardEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleMoveBackwardEvent(e); + } + } +} + +/** + * Raise a key press event to the event handler. + * + * @param key The code of the key that caused the event. + */ + +void CWidgetEventHandlerList::raiseKeyPressEvent(nxwidget_char_t key) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, key); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleKeyPressEvent(e); + } + } +} + +/** + * Raise a cursor control event to the event handler. + * + * @param cursorControl The cursor control code that caused the event. + */ + +void CWidgetEventHandlerList::raiseCursorControlEvent(ECursorControl cursorControl) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, (nxwidget_char_t)cursorControl); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleCursorControlEvent(e); + } + } +} + +/** + * Raise a focus event to the event handler. + */ + +void CWidgetEventHandlerList::raiseFocusEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleFocusEvent(e); + } + } +} + +/** + * Raise a blur event to the event handler. + */ + +void CWidgetEventHandlerList::raiseBlurEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleBlurEvent(e); + } + } +} + +/** + * Raise a close event to the event handler. + */ + +void CWidgetEventHandlerList::raiseCloseEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleCloseEvent(e); + } + } +} + +/** + * Raise a hide event to the event handler. + */ + +void CWidgetEventHandlerList::raiseHideEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleHideEvent(e); + } + } +} + +/** + * Raise a show event to the event handler. + */ + +void CWidgetEventHandlerList::raiseShowEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleShowEvent(e); + } + } +} + +/** + * Raise a shelve event to the event handler. + */ + +void CWidgetEventHandlerList::raiseShelveEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleShelveEvent(e); + } + } +} + +/** + * Raise a unshelve event to the event handler. + */ + +void CWidgetEventHandlerList::raiseUnshelveEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleUnshelveEvent(e); + } + } +} + +/** + * Raise an enable event to the event handler. + */ + +void CWidgetEventHandlerList::raiseEnableEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleEnableEvent(e); + } + } +} + +/** + * Raise a disable event to the event handler. + */ + +void CWidgetEventHandlerList::raiseDisableEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleDisableEvent(e); + } + } +} + +/** + * Raise a value change event to the event handler. + */ + +void CWidgetEventHandlerList::raiseValueChangeEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleValueChangeEvent(e); + } + } +} + +/** + * Raise a resize event to the event handler. + * + * @param width The new width of the widget. + * @param height The new height of the widget. + */ + +void CWidgetEventHandlerList::raiseResizeEvent(nxgl_coord_t width, nxgl_coord_t height) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleResizeEvent(e); + } + } +} + +/** + * Raise a move event to the event handler. + * + * @param x The new x coordinate of the widget. + * @param y The new y coordinate of the widget. + * @param vX The horizontal distance moved. + * @param vY The vertical distance moved. + */ + +void CWidgetEventHandlerList::raiseMoveEvent(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, x, y, vX, vY, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleMoveEvent(e); + } + } +} + +/** + * Raise an action event to the event handler. This should be called + * when a widget's purpose has been fulfilled. For example, in the case + * of a button, this event is raised when the button is released within + * its boundaries. The button has produced a valid click, and thus + * fulfilled its purpose, so it needs to raise an "action" event. + */ + +void CWidgetEventHandlerList::raiseActionEvent(void) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleActionEvent(e); + } + } +} + +/** + * Raises a scroll event. Fired when the panel scrolls. + * + * @param vX Horizontal distance scrolled. + * @param vY Vertical distance scrolled. + */ + +void CWidgetEventHandlerList::raiseScrollEvent(nxgl_coord_t vX, nxgl_coord_t vY) +{ + if (isEnabled()) + { + CWidgetEventArgs e(m_widget, 0, 0, vX, vY, KEY_CODE_NONE); + + for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + { + m_widgetEventHandlers.at(i)->handleScrollEvent(e); + } + } +} diff --git a/libnxwidgets/src/glyph_arrowdown.cxx b/libnxwidgets/src/glyph_arrowdown.cxx new file mode 100644 index 000000000..ec2a6baf0 --- /dev/null +++ b/libnxwidgets/src/glyph_arrowdown.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_arrowdown.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_arrowDownGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_BLACK, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_BLACK, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_BLACK, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_arrowDownGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_BLACK, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_BLACK, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_BLACK, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_arrowDown = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 6, // width - Width in pixels + 10, // height - Height in rows + (6*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_arrowDownGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_arrowleft.cxx b/libnxwidgets/src/glyph_arrowleft.cxx new file mode 100644 index 000000000..6b3e8ee92 --- /dev/null +++ b/libnxwidgets/src/glyph_arrowleft.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_glypharrowleft.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_arrowLeftGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_arrowLeftGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_arrowLeft = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_arrowLeftGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_arrowright.cxx b/libnxwidgets/src/glyph_arrowright.cxx new file mode 100644 index 000000000..74763a6fd --- /dev/null +++ b/libnxwidgets/src/glyph_arrowright.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_arrowright.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_arrowRightGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_arrowRightGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_arrowRight = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_arrowRightGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_arrowup.cxx b/libnxwidgets/src/glyph_arrowup.cxx new file mode 100644 index 000000000..9ec840d43 --- /dev/null +++ b/libnxwidgets/src/glyph_arrowup.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_arrowup.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_arrowUpGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_arrowUpGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_arrowUp = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 6, // width - Width in pixels + 10, // height - Height in rows + (6*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_arrowUpGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_backspace.cxx b/libnxwidgets/src/glyph_backspace.cxx new file mode 100644 index 000000000..967963347 --- /dev/null +++ b/libnxwidgets/src/glyph_backspace.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_backspace.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_backspaceGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_backspaceGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_backspace = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_backspaceGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_capslock.cxx b/libnxwidgets/src/glyph_capslock.cxx new file mode 100644 index 000000000..663e601f0 --- /dev/null +++ b/libnxwidgets/src/glyph_capslock.cxx @@ -0,0 +1,155 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_capslock.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_capslockGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_capslockGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_capslock = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_capslockGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 + diff --git a/libnxwidgets/src/glyph_checkboxmu.cxx b/libnxwidgets/src/glyph_checkboxmu.cxx new file mode 100644 index 000000000..681c17445 --- /dev/null +++ b/libnxwidgets/src/glyph_checkboxmu.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_checkboxmu.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_checkBoxMuGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, + RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, + RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_checkBoxMuGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, + RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, + RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_checkBoxMu = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_checkBoxMuGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_checkboxoff.cxx b/libnxwidgets/src/glyph_checkboxoff.cxx new file mode 100644 index 000000000..250d2455e --- /dev/null +++ b/libnxwidgets/src/glyph_checkboxoff.cxx @@ -0,0 +1,121 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_checkboxoff.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_checkBoxOff = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 0, // width - Width in pixels + 0, // height - Height in rows + (0*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + (const nxgl_mxpixel_t*)NULL // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_checkboxon.cxx b/libnxwidgets/src/glyph_checkboxon.cxx new file mode 100644 index 000000000..5b9c18b78 --- /dev/null +++ b/libnxwidgets/src/glyph_checkboxon.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_checkboxon.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_checkBoxOnGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_checkBoxOnGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_checkBoxOn = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_checkBoxOnGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_control.cxx b/libnxwidgets/src/glyph_control.cxx new file mode 100644 index 000000000..ffbdf965b --- /dev/null +++ b/libnxwidgets/src/glyph_control.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_control.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_controlGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_controlGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_control = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_controlGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx new file mode 100644 index 000000000..5c98b8b90 --- /dev/null +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -0,0 +1,155 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_cycle.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_cycleGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_cycleGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_cycle = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_cycleGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 + diff --git a/libnxwidgets/src/glyph_nxlogo.cxx b/libnxwidgets/src/glyph_nxlogo.cxx new file mode 100644 index 000000000..1b3aab143 --- /dev/null +++ b/libnxwidgets/src/glyph_nxlogo.cxx @@ -0,0 +1,3450 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_nxlogo.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define BITMAP_NLUTCODES 164 /* Number of unique RGB colors in the image */ + +static const uint32_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x000000, 0x102028, 0x5898e0, 0x3c30e4, 0x3c34e4, 0x0c0828, 0x382ce4, 0x3c34e8, /* Codes 0-7 */ + 0x3834d4, 0x241c74, 0x2c2490, 0x343c8c, 0x5ca0ec, 0x4454d0, 0x2c288c, 0x5ca0e8, /* Codes 8-15 */ + 0x3830d4, 0x687078, 0xd0e4f0, 0x3428e4, 0x24282c, 0xcce4f0, 0x848cec, 0xdcf4f4, /* Codes 16-23 */ + 0xd8ecf0, 0x2c24e0, 0xa8b8c4, 0xb4c4f0, 0x5854e4, 0xd8f0f0, 0xd8f0f4, 0x484890, /* Codes 24-31 */ + 0x2c287c, 0x28287c, 0x282478, 0x342cb4, 0xcce0f0, 0xd8e8f4, 0xa8bcc8, 0x587c98, /* Codes 32-39 */ + 0x5c98bc, 0x2c4c60, 0xe0f8fc, 0x1c1478, 0x2c2884, 0x302894, 0xfcfcfc, 0xd4e8f4, /* Codes 40-47 */ + 0x5090b8, 0x101c20, 0xd8ecf8, 0x5c94bc, 0x8c90ec, 0x7c84bc, 0xc8e0f0, 0x98c0d8, /* Codes 48-55 */ + 0xe8f0f8, 0x94bcd8, 0x3830e4, 0xb0bcec, 0xf4f8fc, 0xe4f0f8, 0x3c34ec, 0x142028, /* Codes 56-63 */ + 0x5894bc, 0x5078ac, 0x5084b4, 0x282080, 0x3428b4, 0xd0e4f4, 0x70a4c8, 0x3c34d8, /* Codes 64-71 */ + 0x7880b0, 0x5490b8, 0x5484b4, 0x281c78, 0x5ca4ec, 0xdcf4fc, 0x181078, 0x2c2880, /* Codes 72-79 */ + 0x382cd0, 0x342cb8, 0x1c1888, 0x888cf0, 0xc4e0f0, 0x98c4dc, 0x180c74, 0x5080b0, /* Codes 80-87 */ + 0x282480, 0x04000c, 0x282474, 0x4038f4, 0x3024ec, 0x302c9c, 0x7c84b4, 0x0c1c28, /* Codes 88-95 */ + 0x5090e0, 0x3020e4, 0xd8f0f8, 0x7478b4, 0x100870, 0x08006c, 0x24188c, 0x201c7c, /* Codes 96-103 */ + 0x2c2090, 0x5098d0, 0xd4e4f0, 0x589cd0, 0x3840e0, 0x4048e4, 0xc4dcf0, 0xdcf4f8, /* Codes 104-111 */ + 0x3024e8, 0x342cac, 0x4878b8, 0x4048e0, 0x8084e8, 0x2c248c, 0x3430bc, 0x241c70, /* Codes 112-119 */ + 0x141074, 0x3428e0, 0x342cec, 0x2c24b4, 0x201c78, 0x3028d0, 0x241c8c, 0x7078b4, /* Codes 120-127 */ + 0x040028, 0xd4e8f0, 0x4c7cd4, 0x282078, 0x5484b0, 0x20285c, 0x20187c, 0x4c7cb0, /* Codes 128-135 */ + 0x3830d0, 0x4034f0, 0x2820c8, 0xdcf0f4, 0x34408c, 0x98d4ec, 0x2c1ce0, 0x5080ac, /* Codes 136-143 */ + 0x3c30e8, 0x7078a8, 0x04001c, 0x2c3034, 0x305064, 0x2c4458, 0x74a8c8, 0xf8f8fc, /* Codes 144-151 */ + 0xdcecf8, 0xb0c0dc, 0xa0b0bc, 0xb4d4e4, 0x707880, 0x7c98a8, 0xdcf4f0, 0x2820ac, /* Codes 152-159 */ + 0x201874, 0x302898, 0x3844ac, 0x507ce0, /* Codes 160-163 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# define BITMAP_NLUTCODES 141 /* Number of unique RGB colors in the image */ + +static const uint16_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x0000, 0x1105, 0x5cdc, 0x399c, 0x41bc, 0x0845, 0x397c, 0x39bc, 0x41bd, 0x39ba, /* Codes 0-9 */ + 0x28ee, 0x3132, 0x31f2, 0x5d1d, 0x42ba, 0x3152, 0x399a, 0x6b8f, 0xd73e, 0x315c, /* Codes 10-19 */ + 0x2945, 0x8c7d, 0xe7be, 0xdf7e, 0x313c, 0xadd9, 0xb63e, 0x5abd, 0xdf9e, 0xdf9f, /* Codes 20-29 */ + 0x4a52, 0x2950, 0x292f, 0x3176, 0xcf1e, 0xdf5f, 0xadf9, 0x5bf3, 0x5cd8, 0x326c, /* Codes 30-39 */ + 0xe7df, 0x18af, 0x3153, 0xdf5e, 0xffff, 0x5497, 0x10e4, 0xdf7f, 0x5cb8, 0x8c9d, /* Codes 40-49 */ + 0x8437, 0x9e1b, 0xef9f, 0x9dfb, 0xb5fe, 0xffdf, 0x41be, 0x53d6, 0x5436, 0x2910, /* Codes 50-59 */ + 0x3156, 0x7539, 0x39bb, 0x7c16, 0x95fb, 0x28ef, 0x653d, 0xe7bf, 0x188f, 0x397a, /* Codes 60-69 */ + 0x3977, 0x20d1, 0x8c7e, 0xe79f, 0x9e3b, 0x186e, 0x5416, 0x2930, 0x0801, 0x41de, /* Codes 70-79 */ + 0x313d, 0x3173, 0x7c36, 0x08e5, 0x549c, 0xd75f, 0x311c, 0x73d6, 0x3150, 0x315d, /* Codes 80-89 */ + 0x104e, 0x080e, 0x20f0, 0x2912, 0x54da, 0xdf3e, 0x5cfa, 0x3a1c, 0x425c, 0xcefe, /* Codes 90-99 */ + 0x4bd7, 0x843d, 0x2932, 0x3997, 0xf7df, 0x397d, 0x2936, 0x20ef, 0x315a, 0x20f1, /* Codes 100-109 */ + 0x0005, 0xd75e, 0x53fa, 0x290f, 0x214b, 0x20cf, 0x4bf6, 0x2919, 0x3212, 0x9ebd, /* Codes 110-119 */ + 0x28fc, 0x5415, 0x399d, 0x73d5, 0x0804, 0x3187, 0x328d, 0x2a2b, 0x7559, 0xe77f, /* Codes 120-129 */ + 0xb61c, 0x3186, 0xa598, 0xbebd, 0x73d0, 0x84d5, 0x5cb7, 0x2916, 0x20ce, 0x3a35, /* Codes 130-139 */ + 0x53fc /* Codes 140-140 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE +# define BITMAP_NLUTCODES 116 /* Number of unique greyscale levels in the image */ + +/* 8-bit Greyscale */ + +static const uint8_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x00, 0x19, 0x8b, 0x46, 0x4a, 0x0b, 0x8d, 0x41, 0x44, 0x27, 0x32, 0x92, 0x59, 0x34, 0x6d, 0xdb, /* Codes 0-15 */ + 0x3f, 0x26, 0x91, 0xec, 0xe5, 0x39, 0xb4, 0xc0, 0x62, 0xe6, 0x4c, 0x2f, 0x2e, 0x3c, 0xda, 0xe4, /* Codes 16-31 */ + 0x72, 0x86, 0xed, 0x1d, 0x35, 0xe2, 0xfc, 0xe3, 0x7d, 0x16, 0x97, 0x87, 0xee, 0xb2, 0x42, 0xbc, /* Codes 32-47 */ + 0xf6, 0x4b, 0x1c, 0x70, 0x90, 0x77, 0x2c, 0xdf, 0x96, 0x29, 0x45, 0x7f, 0x81, 0xb1, 0x28, 0xea, /* Codes 48-63 */ + 0x40, 0x3d, 0x23, 0x95, 0xe9, 0xd6, 0xb7, 0x2d, 0x02, 0x3a, 0x85, 0x17, 0x82, 0xe7, 0x7b, 0x33, /* Codes 64-79 */ + 0x0e, 0x25, 0x84, 0xe0, 0x8c, 0x4d, 0x56, 0x1e, 0x3b, 0x6e, 0x31, 0x3e, 0xf3, 0x1a, 0x20, 0x04, /* Codes 80-95 */ + 0xe1, 0x74, 0x2a, 0x79, 0x21, 0x71, 0xc4, 0x76, 0x48, 0x98, 0xf7, 0x94, 0xe8, 0xbe, 0xac, 0xc9, /* Codes 96-111 */ + 0x75, 0x8e, 0x49, 0x7a /* Codes 112-115 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ +# define BITMAP_NLUTCODES 27 /* Number of unique RGB colors in the image */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x00, 0x25, 0x77, 0x4b, 0x01, 0x47, 0x26, 0x4a, 0x4f, 0x72, 0xdf, 0x93, 0xff, 0x27, 0xbb, 0xdb, /* Codes 0-15 */ + 0x6f, 0x29, 0x53, 0x97, 0x73, 0x22, 0x05, 0x02, 0x57, 0xbf, 0x4e /* Codes 16-26 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 2, 7}, { 3, 4}, { 1, 5}, /* Row 1 */ + { 75, 0}, + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ + { 1, 7}, { 3, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 12}, /* Row 3 */ + { 1, 13}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 4 */ + { 1, 6}, { 1, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 5 */ + { 1, 6}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 6 */ + { 1, 6}, { 5, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 7 */ + { 1, 6}, { 7, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 8 */ + { 1, 6}, { 9, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 9 */ + { 1, 6}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 10 */ + { 1, 6}, { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 11 */ + { 1, 6}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 12 */ + { 1, 6}, { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 13 */ + { 1, 6}, { 19, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 14 */ + { 1, 6}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 15 */ + { 1, 6}, { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 16 */ + { 1, 6}, { 25, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 17 */ + { 1, 6}, { 27, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 18 */ + { 1, 6}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 26, 0}, + { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 19 */ + { 1, 6}, { 10, 4}, { 5, 19}, { 16, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, + { 1, 5}, { 23, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, + { 1, 20}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 20 */ + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 3, 24}, { 1, 23}, { 1, 22}, + { 1, 25}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 22, 0}, + { 11, 18}, { 1, 20}, { 22, 0}, + { 23, 0}, { 1, 17}, { 5, 18}, { 1, 26}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ + { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, + { 1, 21}, { 5, 18}, { 1, 21}, { 1, 23}, { 1, 28}, { 15, 4}, { 1, 16}, { 1, 14}, + { 1, 7}, { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 1, 21}, { 11, 18}, { 1, 20}, + { 21, 0}, + { 21, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, { 1, 20}, /* Row 22 */ + { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 29}, { 1, 28}, + { 4, 7}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 19, 0}, + { 14, 18}, { 21, 0}, + { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, /* Row 23 */ + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 10, 4}, { 1, 22}, { 1, 21}, { 10, 18}, + { 1, 30}, { 1, 31}, { 1, 32}, { 1, 33}, { 1, 34}, { 1, 35}, { 1, 7}, { 10, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, + { 4, 18}, { 1, 36}, { 2, 37}, { 1, 36}, { 4, 18}, { 1, 21}, { 1, 17}, { 20, 0}, + { 20, 0}, { 1, 38}, { 1, 21}, { 11, 18}, { 1, 39}, { 4, 40}, { 1, 41}, { 13, 0}, /* Row 24 */ + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 3, 36}, { 5, 18}, { 1, 42}, { 1, 43}, + { 3, 44}, { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, + { 1, 5}, { 16, 0}, { 5, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 47}, + { 1, 48}, { 1, 49}, { 18, 0}, + { 19, 0}, { 1, 17}, { 1, 21}, { 12, 18}, { 1, 50}, { 1, 48}, { 3, 40}, { 1, 51}, /* Row 25 */ + { 1, 40}, { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 11, 4}, { 1, 52}, { 1, 21}, { 3, 18}, { 1, 37}, { 3, 46}, + { 1, 37}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 45}, { 1, 7}, { 10, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, + { 3, 18}, { 1, 54}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, { 1, 40}, + { 1, 49}, { 17, 0}, + { 19, 0}, { 5, 18}, { 1, 54}, { 2, 56}, { 1, 37}, { 5, 18}, { 1, 21}, { 1, 57}, /* Row 26 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 11, 4}, { 1, 58}, { 1, 59}, { 3, 18}, + { 1, 21}, { 1, 60}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, + { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, + { 13, 0}, { 5, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 2, 40}, + { 1, 49}, { 16, 0}, + { 18, 0}, { 1, 17}, { 1, 21}, { 3, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 5, 18}, /* Row 27 */ + { 1, 50}, { 1, 48}, { 5, 40}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 24}, { 3, 18}, + { 1, 37}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, + { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 3, 40}, + { 16, 0}, + { 18, 0}, { 4, 18}, { 1, 54}, { 5, 46}, { 1, 60}, { 1, 36}, { 4, 18}, { 1, 21}, /* Row 28 */ + { 1, 57}, { 4, 40}, { 1, 51}, { 1, 41}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, + { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 24}, + { 3, 18}, { 1, 61}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, + { 1, 34}, { 1, 62}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, + { 10, 0}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, + { 2, 40}, { 1, 51}, { 1, 41}, { 15, 0}, + { 18, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 29 */ + { 5, 40}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 4, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 30 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, + { 1, 62}, { 12, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, + { 1, 63}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 31 */ + { 5, 40}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 9, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 5, 40}, { 1, 41}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 32 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 9, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 6, 40}, { 1, 63}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 33 */ + { 3, 40}, { 1, 64}, { 1, 65}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 34 */ + { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 68}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 69}, { 1, 70}, { 5, 40}, { 1, 51}, { 1, 41}, + { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 35 */ + { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 34}, { 1, 71}, { 1, 11}, { 1, 15}, + { 1, 6}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 16}, { 1, 14}, + { 1, 7}, { 3, 4}, { 1, 72}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 50}, { 1, 73}, { 6, 40}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 36 */ + { 1, 74}, { 1, 67}, { 3, 44}, { 1, 75}, { 1, 76}, { 1, 6}, { 21, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 1, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 5, 18}, { 1, 77}, { 1, 78}, /* Row 37 */ + { 4, 44}, { 1, 79}, { 1, 80}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 38 */ + { 5, 44}, { 1, 81}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 12, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, + { 1, 16}, { 1, 82}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 39 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 13, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, + { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 40 */ + { 5, 44}, { 1, 35}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 13, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 41 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 42 */ + { 5, 44}, { 1, 35}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 14, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 43 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 61}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 15, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 44 */ + { 5, 44}, { 1, 35}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, + { 1, 84}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, + { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 61}, { 6, 46}, { 1, 56}, { 5, 18}, /* Row 45 */ + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 18, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 84}, { 7, 46}, { 1, 54}, { 4, 18}, /* Row 46 */ + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 4, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, + { 1, 41}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 56}, { 6, 46}, { 1, 56}, /* Row 47 */ + { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 17, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 9, 4}, { 1, 22}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, + { 6, 40}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 54}, /* Row 48 */ + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, + { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 85}, + { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 6, 46}, /* Row 49 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, /* Row 50 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, { 1, 41}, + { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 56}, { 6, 46}, /* Row 51 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, /* Row 52 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 4, 44}, { 1, 67}, { 1, 87}, { 1, 41}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 56}, { 6, 46}, /* Row 53 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 88}, { 1, 89}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, /* Row 54 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 90}, { 1, 62}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 56}, { 6, 46}, /* Row 55 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 33}, { 1, 91}, { 2, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, /* Row 56 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 92}, { 1, 23}, + { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 93}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 56}, { 6, 46}, /* Row 57 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 12, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 94}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, /* Row 58 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 2, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 95}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 6, 18}, { 1, 56}, /* Row 59 */ + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 53}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, + { 5, 44}, { 1, 34}, { 1, 62}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, + { 1, 5}, { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 96}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 60 */ + { 6, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 2, 18}, { 1, 21}, { 1, 47}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 5, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 97}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 61 */ + { 1, 36}, { 7, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 53}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 6, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, /* Row 62 */ + { 8, 46}, { 1, 36}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 35}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, { 1, 42}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 101}, { 1, 42}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 8, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 102}, { 1, 98}, { 2, 18}, /* Row 63 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 98}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 105}, { 1, 106}, /* Row 64 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 2, 18}, { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 9, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, + { 6, 44}, { 1, 35}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 108}, /* Row 65 */ + { 1, 29}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, + { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 66 */ + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, + { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 7, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 14, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 67 */ + { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, + { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 5, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, + { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 68 */ + { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 2, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 5, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 69 */ + { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 6, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 18, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 70 */ + { 4, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 6, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 3, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 3, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 20, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 71 */ + { 5, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 2, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 72 */ + { 6, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 4, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 1, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 73 */ + { 7, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 4, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 110}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, + { 24, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 74 */ + { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 4, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 43}, { 1, 111}, { 3, 18}, { 1, 54}, { 15, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 26, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 75 */ + { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 4, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 56}, { 13, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 10, 4}, /* Row 76 */ + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 112}, { 1, 23}, { 3, 18}, { 1, 54}, { 13, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, { 1, 5}, { 1, 0}, + { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 11, 4}, { 1, 19}, /* Row 77 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 2, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 56}, { 11, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 1, 3}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 12, 4}, { 1, 19}, { 1, 24}, /* Row 78 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 54}, { 11, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 32, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, + { 1, 4}, { 1, 113}, { 1, 114}, { 1, 115}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 79 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, + { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 56}, { 9, 46}, { 1, 61}, { 4, 18}, + { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 33, 4}, { 1, 16}, { 1, 14}, + { 1, 62}, { 1, 4}, + { 1, 4}, { 1, 7}, { 1, 117}, { 1, 8}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 80 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 54}, { 9, 46}, { 1, 37}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 35, 4}, { 1, 118}, { 1, 119}, { 1, 7}, + { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 81 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 60}, { 1, 21}, + { 3, 18}, { 1, 98}, { 1, 120}, { 5, 44}, { 1, 33}, { 1, 62}, { 34, 4}, { 1, 8}, + { 1, 11}, { 1, 76}, { 1, 3}, + { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 82 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 121}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 33}, { 1, 62}, { 33, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, { 1, 19}, { 1, 24}, /* Row 83 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 1, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 122}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 32, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 19}, /* Row 84 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 123}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 1, 0}, + { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, /* Row 85 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 124}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 35}, { 29, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 19}, /* Row 86 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 3, 0}, + { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 6, 4}, { 1, 19}, /* Row 87 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 35}, { 26, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 19}, /* Row 88 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 24, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, + { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 4, 4}, { 1, 19}, /* Row 89 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 23, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 19}, /* Row 90 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 2, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 1, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 2, 4}, { 1, 19}, /* Row 91 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 2, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 20, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, + { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 19}, /* Row 92 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 18, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 121}, { 1, 24}, /* Row 93 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 6, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, + { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 125}, { 1, 24}, { 2, 18}, /* Row 94 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 7, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, + { 1, 54}, { 8, 46}, { 1, 54}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, + { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 126}, { 1, 98}, { 2, 18}, { 1, 36}, /* Row 95 */ + { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, + { 7, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 100}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, + { 6, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 14, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 96 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, + { 1, 99}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 7, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, + { 1, 62}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 97 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 47}, + { 1, 21}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, + { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 47}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 98 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 8, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 127}, { 1, 42}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 99 */ + { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 25}, + { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 8, 18}, { 1, 36}, { 7, 46}, + { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 1, 53}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 128}, { 1, 129}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, /* Row 100 */ + { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 22}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 7, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, + { 1, 43}, { 1, 42}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 101 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 53}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 102 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 43}, { 1, 42}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 34}, { 1, 62}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 103 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 53}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 2, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 104 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 43}, { 1, 42}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 34}, { 1, 62}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 105 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 94}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 93}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 106 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 92}, + { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, + { 5, 44}, { 1, 88}, { 1, 130}, { 1, 6}, { 1, 4}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 107 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 1, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 131}, { 1, 7}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 108 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 1, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 4, 44}, { 1, 67}, { 1, 132}, { 1, 133}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 109 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 3, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 110 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 3, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, + { 1, 41}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 111 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 112 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 5, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 85}, { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 113 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 114 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 8, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, + { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 5, 40}, { 1, 51}, { 1, 41}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 115 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 22}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, + { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 134}, /* Row 116 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 84}, { 7, 46}, { 1, 84}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 3, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, + { 1, 41}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 135}, /* Row 117 */ + { 1, 67}, { 4, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 25}, { 1, 23}, { 4, 18}, + { 1, 56}, { 6, 46}, { 1, 61}, { 7, 46}, { 1, 61}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 2, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 118 */ + { 1, 66}, { 1, 67}, { 3, 44}, { 1, 79}, { 1, 136}, { 19, 4}, { 1, 22}, { 1, 21}, + { 3, 18}, { 1, 54}, { 22, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 34}, { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 119 */ + { 1, 64}, { 1, 66}, { 1, 67}, { 2, 44}, { 1, 79}, { 1, 45}, { 1, 16}, { 18, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 20, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 120 */ + { 1, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 33}, { 1, 137}, { 1, 14}, + { 1, 16}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 20, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 13, 4}, { 1, 138}, + { 1, 139}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 121 */ + { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 33}, { 2, 7}, { 1, 14}, { 1, 16}, + { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 18, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 8}, { 1, 140}, { 1, 141}, + { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, + { 6, 40}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 122 */ + { 3, 40}, { 1, 64}, { 1, 66}, { 1, 131}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 14}, + { 1, 16}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 18, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 142}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 123 */ + { 4, 40}, { 1, 64}, { 1, 143}, { 1, 144}, { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, + { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 16, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 145}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 50}, { 1, 48}, { 6, 40}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 124 */ + { 5, 40}, { 1, 64}, { 1, 146}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 16, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 1, 147}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 125 */ + { 6, 40}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 126 */ + { 6, 40}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 127 */ + { 6, 40}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 128 */ + { 6, 40}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 129 */ + { 6, 40}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 130 */ + { 6, 40}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 55}, { 5, 40}, { 1, 51}, { 1, 148}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 131 */ + { 6, 40}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 57}, { 6, 40}, { 1, 149}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 132 */ + { 6, 40}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, + { 4, 18}, { 1, 57}, { 7, 40}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 133 */ + { 6, 40}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 6, 46}, + { 1, 56}, { 3, 18}, { 1, 69}, { 1, 150}, { 6, 40}, { 1, 51}, { 1, 148}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 134 */ + { 6, 40}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 36}, { 1, 151}, { 4, 46}, { 1, 151}, { 1, 36}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 56}, + { 5, 46}, { 1, 54}, { 3, 18}, { 1, 50}, { 1, 73}, { 7, 40}, { 1, 41}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 135 */ + { 6, 40}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 36}, + { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 6, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, { 2, 18}, + { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 8, 40}, { 1, 41}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 136 */ + { 6, 40}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, + { 1, 22}, { 1, 21}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 34}, { 1, 62}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 50}, { 1, 48}, { 8, 40}, + { 1, 63}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 137 */ + { 6, 40}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, + { 1, 25}, { 1, 23}, { 12, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, { 1, 17}, + { 1, 21}, { 9, 18}, { 1, 47}, { 1, 70}, { 9, 40}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 138 */ + { 6, 40}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, + { 1, 22}, { 1, 21}, { 10, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 9, 18}, { 1, 47}, { 1, 70}, { 8, 40}, { 1, 51}, { 1, 41}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 69}, { 2, 47}, { 1, 152}, { 1, 73}, /* Row 139 */ + { 6, 40}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, + { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 21}, { 1, 153}, { 1, 103}, { 6, 44}, + { 1, 35}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 23, 0}, { 1, 147}, { 1, 154}, { 1, 18}, { 1, 21}, { 2, 18}, { 1, 21}, { 1, 47}, + { 1, 155}, { 1, 150}, { 10, 40}, { 15, 0}, + { 25, 0}, { 5, 48}, { 4, 73}, { 7, 40}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 7}, /* Row 140 */ + { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 1, 21}, { 4, 18}, + { 1, 21}, { 1, 42}, { 1, 53}, { 1, 103}, { 6, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 156}, + { 1, 17}, { 1, 157}, { 1, 55}, { 1, 48}, { 1, 64}, { 9, 40}, { 1, 51}, { 1, 41}, + { 15, 0}, + { 25, 0}, { 16, 40}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 141 */ + { 9, 4}, { 1, 25}, { 1, 22}, { 1, 158}, { 2, 98}, { 1, 77}, { 1, 53}, { 1, 43}, + { 7, 44}, { 1, 33}, { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 30, 0}, { 1, 63}, { 11, 40}, { 1, 51}, { 1, 40}, { 16, 0}, + { 25, 0}, { 16, 40}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 142 */ + { 10, 4}, { 1, 19}, { 1, 159}, { 1, 160}, { 1, 103}, { 7, 44}, { 1, 79}, { 1, 161}, + { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 32, 0}, { 1, 41}, { 1, 51}, { 8, 40}, { 1, 51}, { 1, 40}, { 17, 0}, + { 25, 0}, { 16, 40}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 143 */ + { 11, 4}, { 1, 62}, { 1, 35}, { 1, 34}, { 5, 33}, { 1, 161}, { 1, 136}, { 1, 7}, + { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 34, 0}, + { 8, 40}, { 1, 51}, { 1, 40}, { 18, 0}, + { 25, 0}, { 16, 40}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 144 */ + { 12, 4}, { 7, 7}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 35, 0}, { 1, 49}, { 7, 40}, { 1, 41}, { 19, 0}, + { 25, 0}, { 16, 40}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 145 */ + { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 64, 0}, + { 25, 0}, { 16, 40}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 146 */ + { 19, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 17, 4}, { 1, 8}, /* Row 147 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, { 1, 8}, /* Row 148 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, { 1, 8}, /* Row 149 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 8}, /* Row 150 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 8}, /* Row 151 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 8}, /* Row 152 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 8}, /* Row 153 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 8}, /* Row 154 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 8}, /* Row 155 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 118}, { 1, 11}, { 1, 15}, /* Row 156 */ + { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 162}, { 1, 15}, { 1, 6}, { 1, 4}, /* Row 157 */ + { 1, 5}, { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 163}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ + }; + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 2, 8}, { 3, 4}, { 1, 5}, /* Row 1 */ + { 75, 0}, + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 10}, { 1, 11}, /* Row 2 */ + { 1, 8}, { 3, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 3 */ + { 1, 14}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 4 */ + { 1, 6}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 5 */ + { 1, 6}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 6 */ + { 1, 6}, { 4, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 7 */ + { 1, 6}, { 6, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 8 */ + { 1, 6}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 9 */ + { 1, 6}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 10 */ + { 1, 6}, { 12, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 11 */ + { 1, 6}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 12 */ + { 1, 6}, { 16, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 13 */ + { 1, 6}, { 18, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 14 */ + { 1, 6}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 15 */ + { 1, 6}, { 22, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 16 */ + { 1, 6}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 17 */ + { 1, 6}, { 26, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 18 */ + { 1, 6}, { 28, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 26, 0}, { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 19 */ + { 1, 6}, { 10, 4}, { 5, 19}, { 15, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 3, 4}, { 1, 5}, { 23, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 20 */ + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 3, 23}, { 1, 22}, { 1, 21}, + { 1, 24}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 22, 0}, { 11, 18}, { 1, 20}, { 22, 0}, + { 23, 0}, { 1, 17}, { 5, 18}, { 1, 25}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, + { 7, 18}, { 1, 22}, { 1, 27}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 12, 18}, { 1, 20}, { 21, 0}, + { 21, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 22 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, + { 9, 18}, { 1, 28}, { 1, 27}, { 4, 8}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 19, 0}, { 14, 18}, { 21, 0}, + { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, /* Row 23 */ + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, { 1, 21}, { 11, 18}, { 1, 29}, + { 1, 30}, { 2, 31}, { 1, 32}, { 1, 33}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 5, 18}, { 1, 34}, + { 2, 35}, { 1, 34}, { 5, 18}, { 1, 17}, { 20, 0}, + { 20, 0}, { 1, 36}, { 12, 18}, { 1, 37}, { 4, 38}, { 1, 39}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 3, 34}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, + { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, + { 1, 5}, { 16, 0}, { 5, 18}, { 1, 43}, { 4, 44}, { 1, 43}, { 4, 18}, { 1, 35}, + { 1, 45}, { 1, 46}, { 18, 0}, + { 19, 0}, { 1, 17}, { 13, 18}, { 1, 47}, { 1, 45}, { 3, 38}, { 1, 48}, { 1, 38}, /* Row 25 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 11, 4}, { 1, 49}, { 4, 18}, { 1, 35}, { 3, 44}, { 1, 43}, { 5, 18}, + { 1, 50}, { 4, 31}, { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, + { 1, 8}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 4, 18}, { 1, 34}, { 6, 44}, + { 1, 34}, { 4, 18}, { 1, 51}, { 1, 38}, { 1, 46}, { 17, 0}, + { 19, 0}, { 5, 18}, { 1, 34}, { 2, 52}, { 1, 35}, { 6, 18}, { 1, 53}, { 4, 38}, /* Row 26 */ + { 1, 48}, { 1, 39}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 11, 4}, { 1, 3}, { 1, 54}, { 4, 18}, { 1, 55}, + { 4, 44}, { 1, 43}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 42}, { 1, 8}, + { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 13, 0}, + { 5, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 2, 38}, { 1, 46}, + { 16, 0}, + { 18, 0}, { 1, 17}, { 4, 18}, { 1, 43}, { 4, 44}, { 1, 35}, { 5, 18}, { 1, 47}, /* Row 27 */ + { 1, 45}, { 5, 38}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 23}, { 3, 18}, { 1, 35}, + { 6, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 3, 38}, { 16, 0}, + { 18, 0}, { 4, 18}, { 1, 34}, { 5, 44}, { 1, 55}, { 1, 34}, { 5, 18}, { 1, 53}, /* Row 28 */ + { 4, 38}, { 1, 48}, { 1, 39}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 23}, { 3, 18}, + { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, + { 1, 56}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 10, 0}, { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 51}, { 2, 38}, + { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 29 */ + { 5, 38}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 4, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 30 */ + { 1, 48}, { 1, 39}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 8, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 1}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 31 */ + { 5, 38}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 5, 38}, { 1, 39}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 32 */ + { 1, 48}, { 1, 39}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 1}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 33 */ + { 3, 38}, { 1, 48}, { 1, 57}, { 1, 13}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 2, 38}, /* Row 34 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 1, 60}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 61}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 35 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 1, 32}, { 1, 62}, { 1, 12}, { 1, 13}, + { 1, 6}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 11, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 63}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 5, 18}, { 1, 64}, { 1, 58}, /* Row 36 */ + { 1, 59}, { 3, 31}, { 1, 65}, { 1, 66}, { 1, 6}, { 21, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, + { 1, 32}, { 1, 56}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 1, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 5, 18}, { 1, 67}, { 1, 68}, /* Row 37 */ + { 5, 31}, { 1, 69}, { 22, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 38 */ + { 1, 70}, { 1, 7}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 7}, { 1, 16}, { 1, 71}, { 1, 67}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 39 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, + { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 40 */ + { 1, 33}, { 1, 7}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 13, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 41 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 42 */ + { 1, 33}, { 1, 7}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 14, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 43 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 73}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, + { 1, 7}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 44 */ + { 1, 33}, { 1, 7}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, + { 1, 56}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 73}, { 6, 44}, { 1, 52}, { 5, 18}, /* Row 45 */ + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 18, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 46 */ + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 2, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 52}, { 6, 44}, { 1, 52}, /* Row 47 */ + { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, + { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 2, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 48 */ + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, + { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, + { 1, 48}, { 1, 39}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 6, 44}, /* Row 49 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 16, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, + { 1, 58}, { 1, 48}, { 4, 38}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, /* Row 50 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 1, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 6, 44}, /* Row 51 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, /* Row 52 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 4, 31}, { 1, 59}, { 1, 76}, { 1, 39}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 6, 44}, /* Row 53 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 14, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 5, 31}, { 1, 77}, { 1, 78}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, /* Row 54 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 6, 44}, /* Row 55 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, + { 1, 79}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, /* Row 56 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 80}, { 1, 22}, + { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 81}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 6, 44}, /* Row 57 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 82}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, + { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, /* Row 58 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 2, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 83}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 6, 18}, { 1, 52}, /* Row 59 */ + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 3, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 84}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 60 */ + { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, + { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 86}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 61 */ + { 1, 34}, { 7, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 1, 88}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, /* Row 62 */ + { 8, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 91}, { 1, 40}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 71}, { 1, 29}, { 2, 18}, /* Row 63 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 29}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, + { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 5}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 94}, { 1, 95}, /* Row 64 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, + { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 9, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 97}, /* Row 65 */ + { 1, 28}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, + { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 66 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 67 */ + { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 2, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, + { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 68 */ + { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 15, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 69 */ + { 3, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 6, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 17, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 70 */ + { 4, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 18, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 71 */ + { 5, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 2, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 1, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 72 */ + { 6, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 1, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 21, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 73 */ + { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 4, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 99}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 23, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 74 */ + { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, + { 1, 41}, { 1, 67}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 2, 4}, { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 75 */ + { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 4, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, { 1, 52}, { 13, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 26, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 10, 4}, /* Row 76 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, + { 1, 22}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, + { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 5}, { 1, 0}, + { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 11, 4}, { 1, 19}, /* Row 77 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 5, 31}, { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 21}, { 4, 18}, { 1, 52}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 29, 4}, { 1, 7}, { 1, 16}, { 1, 15}, + { 1, 8}, { 2, 4}, { 1, 5}, + { 1, 3}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 78 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, + { 1, 33}, { 1, 7}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 30, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 4}, { 1, 33}, { 1, 100}, { 1, 98}, { 13, 4}, { 1, 19}, { 1, 23}, { 2, 18}, /* Row 79 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, + { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, + { 1, 101}, { 4, 18}, { 1, 52}, { 9, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 5, 31}, { 1, 32}, { 1, 56}, { 32, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 56}, + { 1, 7}, + { 1, 4}, { 1, 8}, { 1, 102}, { 1, 9}, { 1, 7}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 80 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, { 1, 101}, + { 4, 18}, { 1, 34}, { 9, 44}, { 1, 35}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 33, 4}, { 1, 7}, { 1, 103}, { 1, 10}, { 1, 8}, + { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, { 1, 19}, { 1, 23}, /* Row 81 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 104}, { 4, 18}, { 1, 29}, + { 1, 68}, { 6, 31}, { 1, 56}, { 33, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 66}, + { 1, 3}, + { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, /* Row 82 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 21}, { 4, 18}, + { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 56}, { 32, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, { 1, 19}, /* Row 83 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 6, 31}, { 1, 8}, { 1, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 105}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 80}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 30, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 8, 4}, /* Row 84 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 106}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, + { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 29, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, + { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 85 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 107}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, + { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 6, 4}, /* Row 86 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 4, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 26, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 3, 0}, + { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 87 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 4, 4}, /* Row 88 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 3, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 23, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 5, 0}, + { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 89 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 21, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 2, 4}, /* Row 90 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 2, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 91 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 1, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, + { 18, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 8, 0}, + { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 19}, /* Row 92 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 6, 31}, { 1, 8}, { 6, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 1, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, + { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 5, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 19}, { 1, 23}, /* Row 93 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 6, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 5, 18}, { 1, 40}, { 1, 41}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 108}, { 1, 23}, { 2, 18}, /* Row 94 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, + { 7, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 14, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 11, 0}, + { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 109}, { 1, 29}, { 2, 18}, { 1, 34}, /* Row 95 */ + { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 7, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, + { 1, 90}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 6, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, + { 1, 7}, { 12, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 96 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 87}, { 1, 29}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 50}, { 4, 18}, + { 1, 34}, { 8, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 97 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 24}, + { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 85}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 98 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, + { 1, 87}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 5, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 99 */ + { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 24}, { 1, 22}, + { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 1, 50}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 110}, { 1, 111}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, /* Row 100 */ + { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, + { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 41}, { 1, 40}, { 3, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 5, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 101 */ + { 6, 31}, { 1, 8}, { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 50}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, + { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 102 */ + { 6, 31}, { 1, 8}, { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 3, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 103 */ + { 6, 31}, { 1, 8}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 50}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 2, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 104 */ + { 6, 31}, { 1, 8}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 5, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 105 */ + { 6, 31}, { 1, 8}, { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 82}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 81}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 106 */ + { 6, 31}, { 1, 8}, { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 80}, { 1, 22}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 77}, { 1, 112}, { 1, 6}, + { 1, 4}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 107 */ + { 6, 31}, { 1, 8}, { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 4}, { 1, 21}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, + { 1, 113}, { 1, 8}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 108 */ + { 6, 31}, { 1, 8}, { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 4, 31}, { 1, 59}, + { 1, 58}, { 1, 114}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 109 */ + { 6, 31}, { 1, 8}, { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 2, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 110 */ + { 6, 31}, { 1, 8}, { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 59}, + { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 111 */ + { 6, 31}, { 1, 8}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, + { 1, 58}, { 1, 48}, { 4, 38}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 112 */ + { 6, 31}, { 1, 8}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, + { 1, 48}, { 1, 39}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 113 */ + { 6, 31}, { 1, 8}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 114 */ + { 6, 31}, { 1, 8}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 2, 34}, + { 7, 44}, { 2, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 115 */ + { 6, 31}, { 1, 8}, { 17, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 115}, /* Row 116 */ + { 6, 31}, { 1, 8}, { 18, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 7, 44}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 116}, /* Row 117 */ + { 1, 59}, { 5, 31}, { 1, 8}, { 18, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 73}, { 7, 44}, { 1, 73}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 118 */ + { 1, 58}, { 1, 59}, { 4, 31}, { 1, 16}, { 1, 7}, { 18, 4}, { 1, 21}, { 4, 18}, + { 1, 34}, { 22, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 119 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 3, 31}, { 1, 42}, { 1, 16}, { 1, 7}, { 17, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 20, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 21}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 120 */ + { 1, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 2, 31}, { 1, 56}, { 1, 15}, { 1, 16}, + { 1, 7}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 20, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 12, 4}, { 1, 7}, { 1, 117}, { 1, 73}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, + { 1, 39}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 121 */ + { 2, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 2, 8}, { 1, 15}, { 1, 16}, + { 1, 7}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 18, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, + { 1, 9}, { 1, 118}, { 1, 119}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 47}, { 1, 45}, { 6, 38}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 122 */ + { 3, 38}, { 1, 48}, { 1, 58}, { 1, 113}, { 1, 8}, { 1, 4}, { 1, 8}, { 1, 15}, + { 1, 16}, { 1, 7}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 18, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 120}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 123 */ + { 4, 38}, { 1, 48}, { 1, 121}, { 1, 122}, { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, + { 1, 7}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 16, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 123}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 124 */ + { 5, 38}, { 1, 48}, { 1, 124}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 1, 125}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 125 */ + { 6, 38}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 126 */ + { 6, 38}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 127 */ + { 6, 38}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 128 */ + { 6, 38}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 129 */ + { 6, 38}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 130 */ + { 6, 38}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 51}, { 5, 38}, { 1, 48}, { 1, 126}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 131 */ + { 6, 38}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 127}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 132 */ + { 6, 38}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 4, 18}, { 1, 53}, { 7, 38}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 133 */ + { 6, 38}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 128}, { 6, 38}, { 1, 48}, { 1, 126}, + { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 134 */ + { 6, 38}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 1, 55}, { 4, 44}, { 1, 55}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 52}, + { 5, 44}, { 1, 34}, { 3, 18}, { 1, 47}, { 1, 45}, { 7, 38}, { 1, 39}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 135 */ + { 6, 38}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, + { 1, 34}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, + { 1, 17}, { 3, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, { 1, 34}, { 4, 18}, + { 1, 53}, { 8, 38}, { 1, 39}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 136 */ + { 6, 38}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 9, 4}, { 1, 21}, { 6, 18}, { 2, 34}, { 6, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 4, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, { 5, 18}, { 2, 34}, { 5, 18}, { 1, 47}, { 1, 45}, { 8, 38}, + { 1, 1}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 137 */ + { 6, 38}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 8, 4}, { 1, 24}, { 1, 22}, { 12, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, + { 1, 7}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 20, 0}, { 1, 17}, { 10, 18}, { 1, 35}, { 1, 61}, { 9, 38}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 138 */ + { 6, 38}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 8, 4}, { 1, 21}, { 12, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 9, 18}, { 1, 35}, { 1, 61}, { 8, 38}, { 1, 48}, { 1, 39}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 18}, { 2, 35}, { 1, 129}, { 1, 45}, /* Row 139 */ + { 6, 38}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 7, 4}, { 1, 19}, { 1, 26}, { 10, 18}, { 1, 130}, { 1, 107}, { 6, 31}, { 1, 33}, + { 1, 7}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 23, 0}, { 1, 131}, { 1, 132}, { 5, 18}, { 1, 35}, { 1, 133}, { 1, 128}, + { 10, 38}, { 15, 0}, + { 25, 0}, { 9, 45}, { 7, 38}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, /* Row 140 */ + { 1, 16}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 6, 18}, { 1, 40}, + { 1, 50}, { 1, 107}, { 6, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 134}, { 1, 17}, + { 1, 135}, { 1, 51}, { 1, 45}, { 1, 136}, { 9, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 25, 0}, { 16, 38}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 141 */ + { 1, 7}, { 8, 4}, { 1, 24}, { 1, 21}, { 1, 22}, { 2, 29}, { 1, 67}, { 1, 50}, + { 1, 41}, { 8, 31}, { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 1}, { 11, 38}, { 1, 48}, + { 1, 38}, { 16, 0}, + { 25, 0}, { 16, 38}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 142 */ + { 1, 7}, { 9, 4}, { 1, 89}, { 1, 137}, { 1, 138}, { 1, 92}, { 8, 31}, { 1, 42}, + { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, + { 1, 4}, { 1, 5}, { 32, 0}, { 1, 39}, { 1, 48}, { 8, 38}, { 1, 48}, { 1, 38}, + { 17, 0}, + { 25, 0}, { 16, 38}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 143 */ + { 1, 7}, { 9, 4}, { 1, 7}, { 1, 56}, { 1, 33}, { 1, 32}, { 5, 31}, { 1, 42}, + { 1, 16}, { 1, 8}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, + { 1, 4}, { 1, 5}, { 34, 0}, { 8, 38}, { 1, 48}, { 1, 38}, { 18, 0}, + { 25, 0}, { 16, 38}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 144 */ + { 1, 7}, { 10, 4}, { 1, 7}, { 7, 8}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 35, 0}, { 1, 46}, { 7, 38}, { 1, 39}, + { 19, 0}, + { 25, 0}, { 16, 38}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 145 */ + { 1, 7}, { 19, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 64, 0}, + { 25, 0}, { 16, 38}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 146 */ + { 1, 7}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 15, 4}, /* Row 147 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 13, 4}, /* Row 148 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, /* Row 149 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, /* Row 150 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 151 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 152 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 153 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 154 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 9}, /* Row 155 */ + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 103}, { 1, 12}, { 1, 13}, /* Row 156 */ + { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 139}, { 1, 13}, { 1, 6}, { 1, 4}, /* Row 157 */ + { 1, 5}, { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 140}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ +}; + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 5, 4}, { 1, 5}, { 75, 0}, /* Row 1 */ + { 74, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ + { 4, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 3 */ + { 1, 12}, { 1, 13}, { 4, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 4 */ + { 1, 7}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 5 */ + { 1, 7}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 6 */ + { 1, 7}, { 4, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 7 */ + { 1, 7}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 8 */ + { 1, 7}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 9 */ + { 1, 7}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 10 */ + { 1, 7}, { 12, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 11 */ + { 1, 7}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 12 */ + { 1, 7}, { 16, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 13 */ + { 1, 7}, { 18, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 14 */ + { 1, 7}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 15 */ + { 1, 7}, { 22, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 16 */ + { 1, 7}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 17 */ + { 1, 7}, { 26, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 18 */ + { 1, 7}, { 28, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 26, 0}, + { 1, 14}, { 5, 15}, { 1, 14}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 19 */ + { 1, 7}, { 10, 4}, { 5, 16}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, + { 1, 5}, { 23, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 20 */ + { 1, 7}, { 9, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 3, 20}, { 1, 19}, { 1, 18}, + { 1, 21}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 22, 0}, + { 11, 15}, { 1, 17}, { 22, 0}, + { 23, 0}, { 1, 14}, { 5, 15}, { 1, 22}, { 25, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 21 */ + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, + { 7, 15}, { 1, 19}, { 1, 24}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, + { 1, 5}, { 20, 0}, { 1, 14}, { 12, 15}, { 1, 17}, { 21, 0}, + { 21, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 22, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 22 */ + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, + { 9, 15}, { 1, 20}, { 1, 24}, { 4, 4}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 19, 0}, { 14, 15}, { 21, 0}, + { 21, 0}, { 11, 15}, { 1, 17}, { 20, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, /* Row 23 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, { 1, 18}, { 11, 15}, { 1, 25}, + { 1, 26}, { 2, 27}, { 1, 28}, { 1, 29}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, + { 4, 4}, { 1, 5}, { 17, 0}, { 1, 14}, { 5, 15}, { 1, 30}, { 2, 31}, { 1, 30}, + { 5, 15}, { 1, 14}, { 20, 0}, + { 20, 0}, { 1, 22}, { 12, 15}, { 1, 32}, { 4, 33}, { 1, 7}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 3, 30}, { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, + { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 16, 0}, + { 5, 15}, { 1, 37}, { 4, 38}, { 1, 37}, { 4, 15}, { 1, 39}, { 1, 40}, { 1, 41}, + { 18, 0}, + { 19, 0}, { 1, 14}, { 13, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 11, 0}, { 1, 1}, /* Row 25 */ + { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, + { 1, 42}, { 4, 15}, { 1, 31}, { 3, 38}, { 1, 37}, { 5, 15}, { 1, 43}, { 4, 27}, + { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 14, 0}, + { 1, 14}, { 4, 15}, { 1, 30}, { 6, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 1, 33}, + { 1, 41}, { 17, 0}, + { 19, 0}, { 5, 15}, { 1, 30}, { 1, 44}, { 1, 34}, { 1, 31}, { 6, 15}, { 1, 45}, /* Row 26 */ + { 5, 33}, { 1, 7}, { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, { 1, 46}, { 1, 47}, { 4, 15}, { 1, 48}, + { 4, 38}, { 1, 37}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 36}, { 10, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 13, 0}, { 5, 15}, { 1, 34}, + { 6, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 2, 33}, { 1, 41}, { 16, 0}, + { 18, 0}, { 1, 14}, { 4, 15}, { 1, 37}, { 4, 38}, { 1, 31}, { 5, 15}, { 1, 31}, /* Row 27 */ + { 1, 40}, { 5, 33}, { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 12, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 31}, + { 6, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 3, 33}, { 16, 0}, + { 18, 0}, { 4, 15}, { 1, 30}, { 5, 38}, { 1, 48}, { 1, 30}, { 5, 15}, { 1, 45}, /* Row 28 */ + { 5, 33}, { 1, 7}, { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 13, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 19}, + { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, + { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 10, 0}, { 5, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 3, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 29 */ + { 5, 33}, { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 14, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 4, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 30 */ + { 1, 7}, { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 15, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 11, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 7, 0}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 5, 33}, { 1, 50}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 31 */ + { 5, 33}, { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 1, 7}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 32 */ + { 1, 7}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 4, 0}, { 5, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 50}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 33 */ + { 4, 33}, { 1, 51}, { 1, 52}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 3, 33}, /* Row 34 */ + { 1, 53}, { 1, 54}, { 1, 21}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 1, 0}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 3, 15}, { 1, 55}, { 1, 56}, { 6, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 35 */ + { 1, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 1, 28}, { 1, 58}, { 1, 7}, { 1, 11}, + { 1, 7}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 11, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 59}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 31}, { 1, 60}, { 6, 33}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 5, 15}, { 1, 61}, { 1, 53}, /* Row 36 */ + { 1, 57}, { 3, 27}, { 1, 62}, { 1, 56}, { 1, 7}, { 21, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, + { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 2, 4}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, + { 1, 7}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 5, 15}, { 1, 63}, { 1, 35}, /* Row 37 */ + { 5, 27}, { 1, 64}, { 22, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 38 */ + { 1, 65}, { 1, 3}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 3}, { 1, 8}, { 1, 66}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 39 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, + { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, + { 6, 33}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 40 */ + { 1, 29}, { 1, 3}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 13, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 41 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, + { 6, 33}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 42 */ + { 1, 29}, { 1, 3}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 14, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 43 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 68}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, + { 1, 3}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 44 */ + { 1, 29}, { 1, 3}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, + { 1, 49}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 68}, { 6, 38}, { 1, 34}, { 5, 15}, /* Row 45 */ + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 18, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 69}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 46 */ + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 34}, { 6, 38}, { 1, 34}, /* Row 47 */ + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 17, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, + { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 2, 30}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 48 */ + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, + { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 6, 38}, /* Row 49 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 16, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, + { 1, 53}, { 5, 33}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, /* Row 50 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 1, 27}, { 1, 57}, { 1, 53}, { 3, 33}, { 1, 7}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 6, 38}, /* Row 51 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 2, 27}, { 1, 57}, { 1, 53}, { 2, 33}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, /* Row 52 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 4, 27}, { 1, 57}, { 1, 53}, { 1, 7}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 6, 38}, /* Row 53 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 14, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 71}, { 1, 72}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, /* Row 54 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 28}, { 1, 49}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 6, 38}, /* Row 55 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, + { 1, 49}, { 1, 3}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, /* Row 56 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 73}, { 1, 19}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 36}, + { 1, 13}, { 3, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 6, 38}, /* Row 57 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 74}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, + { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, /* Row 58 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 2, 3}, + { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 75}, { 1, 55}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 6, 15}, /* Row 59 */ + { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, + { 1, 49}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 3, 27}, { 1, 43}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 76}, { 1, 37}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 60 */ + { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, + { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 3, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 6}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 61 */ + { 1, 30}, { 7, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 1, 79}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 62 */ + { 8, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 80}, { 1, 34}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 9}, { 1, 77}, { 2, 15}, /* Row 63 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 37}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 68}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 82}, { 1, 83}, /* Row 64 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, + { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 9, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, + { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 85}, /* Row 65 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, + { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 66 */ + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 5, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 67 */ + { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 2, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, + { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 68 */ + { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 15, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 69 */ + { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 6, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, + { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 70 */ + { 4, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 18, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 71 */ + { 5, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 1, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, + { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 72 */ + { 6, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 1, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 21, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 73 */ + { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 4, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 69}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 74 */ + { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, + { 1, 87}, { 1, 34}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, + { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 75 */ + { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 34}, { 13, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 10, 4}, /* Row 76 */ + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, + { 1, 19}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 1, 0}, + { 1, 2}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 11, 4}, { 1, 16}, /* Row 77 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 5, 27}, { 1, 87}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 1, 4}, { 1, 18}, { 4, 15}, { 1, 34}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, { 1, 8}, { 1, 13}, + { 3, 4}, { 1, 5}, + { 1, 3}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 12, 4}, { 1, 16}, { 1, 20}, /* Row 78 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 3}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, { 1, 19}, + { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, + { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, + { 1, 4}, { 1, 88}, { 1, 89}, { 1, 86}, { 13, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 79 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, + { 4, 15}, { 1, 34}, { 9, 38}, { 1, 19}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 1, 49}, { 1, 3}, + { 2, 4}, { 1, 90}, { 1, 8}, { 1, 3}, { 12, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 80 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 3}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, { 4, 15}, { 1, 69}, + { 9, 38}, { 1, 31}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 33, 4}, + { 1, 3}, { 1, 91}, { 1, 81}, { 1, 4}, + { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 81 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 92}, { 4, 15}, { 1, 68}, { 1, 93}, + { 6, 27}, { 1, 49}, { 33, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 56}, { 1, 8}, + { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 82 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, /* Row 83 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 2, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 7}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, { 1, 16}, /* Row 84 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 3, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 5, 27}, { 1, 10}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 30}, { 12, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 1, 0}, + { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, /* Row 85 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 3, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 81}, { 1, 77}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 87}, { 1, 34}, + { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 6, 4}, { 1, 16}, /* Row 86 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 4, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 4, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 14, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 3, 0}, + { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 16}, /* Row 87 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 4, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 4, 4}, { 1, 16}, /* Row 88 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 5, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 16, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, + { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 16}, /* Row 89 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 5, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 21, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 2, 4}, { 1, 16}, /* Row 90 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 6, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, + { 1, 28}, { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 16}, /* Row 91 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 6, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 18, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, + { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 16}, { 1, 20}, /* Row 92 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 7, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, + { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, + { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 93 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 7, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 1, 35}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 94 */ + { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 1, 81}, { 1, 25}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, + { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, + { 12, 0}, { 1, 5}, { 4, 4}, { 1, 57}, { 1, 77}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 95 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 41}, { 1, 25}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 35}, + { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 6, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 96 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 78}, { 1, 77}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, + { 8, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 97 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 37}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 98 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 77}, { 1, 78}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 78}, + { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 99 */ + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 21}, { 1, 19}, { 4, 15}, + { 1, 34}, { 6, 38}, { 1, 34}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 37}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 94}, + { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 95}, { 1, 96}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, /* Row 100 */ + { 1, 25}, { 1, 81}, { 6, 27}, { 11, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 101 */ + { 6, 27}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 102 */ + { 6, 27}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 3, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 103 */ + { 6, 27}, { 12, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 2, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 104 */ + { 6, 27}, { 13, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 5, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 105 */ + { 6, 27}, { 13, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 74}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 36}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 106 */ + { 6, 27}, { 14, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 73}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 54}, { 1, 97}, { 1, 7}, { 1, 4}, + { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 107 */ + { 6, 27}, { 14, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 4}, { 1, 18}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 98}, + { 1, 4}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 108 */ + { 6, 27}, { 15, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 4, 27}, { 1, 57}, { 1, 99}, + { 1, 9}, { 25, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 109 */ + { 6, 27}, { 15, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, + { 1, 57}, { 1, 53}, { 2, 33}, { 25, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 110 */ + { 6, 27}, { 16, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 57}, { 1, 53}, + { 3, 33}, { 1, 7}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 111 */ + { 6, 27}, { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, { 1, 53}, + { 5, 33}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 112 */ + { 6, 27}, { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 113 */ + { 6, 27}, { 17, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 1, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, + { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 114 */ + { 6, 27}, { 18, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, + { 2, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 7, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 115 */ + { 6, 27}, { 18, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 100}, /* Row 116 */ + { 6, 27}, { 19, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 69}, { 7, 38}, + { 1, 69}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 9, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 101}, /* Row 117 */ + { 1, 57}, { 5, 27}, { 19, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 68}, { 7, 38}, { 1, 68}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 118 */ + { 1, 53}, { 1, 57}, { 4, 27}, { 1, 8}, { 1, 3}, { 18, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 22, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 11, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 119 */ + { 1, 33}, { 1, 53}, { 1, 57}, { 3, 27}, { 1, 36}, { 1, 8}, { 1, 3}, { 17, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 20, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 18}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 120 */ + { 2, 33}, { 1, 53}, { 1, 57}, { 2, 27}, { 1, 49}, { 1, 13}, { 1, 8}, { 1, 3}, + { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 20, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, { 1, 79}, { 1, 63}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 121 */ + { 3, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 2, 4}, { 1, 13}, { 1, 8}, { 1, 3}, + { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 18, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 102}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, + { 1, 40}, { 6, 33}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 122 */ + { 4, 33}, { 1, 53}, { 1, 62}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 16, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 18, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 79}, + { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, + { 1, 7}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 123 */ + { 5, 33}, { 1, 103}, { 1, 3}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 16, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 53}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 124 */ + { 6, 33}, { 1, 95}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 16, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, + { 1, 49}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 1, 27}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 125 */ + { 6, 33}, { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 126 */ + { 6, 33}, { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 4, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 127 */ + { 6, 33}, { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 128 */ + { 6, 33}, { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 7, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 129 */ + { 6, 33}, { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 130 */ + { 6, 33}, { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 10, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 22}, { 6, 33}, { 1, 104}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 131 */ + { 6, 33}, { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 65}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 132 */ + { 6, 33}, { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 13, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, + { 1, 45}, { 7, 33}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 133 */ + { 6, 33}, { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 6, 38}, { 1, 44}, { 3, 15}, { 1, 55}, { 1, 105}, { 7, 33}, { 1, 104}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 134 */ + { 6, 33}, { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 1, 106}, { 4, 38}, { 1, 106}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 15}, { 1, 34}, { 5, 38}, + { 1, 30}, { 3, 15}, { 1, 31}, { 1, 60}, { 7, 33}, { 1, 7}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 135 */ + { 6, 33}, { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 14}, + { 3, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, { 4, 15}, { 1, 45}, + { 8, 33}, { 1, 7}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 136 */ + { 6, 33}, { 12, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, + { 1, 18}, { 6, 15}, { 2, 30}, { 6, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 4, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 19, 0}, { 5, 15}, { 2, 30}, { 5, 15}, { 1, 31}, { 1, 40}, { 8, 33}, { 1, 50}, + { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 137 */ + { 6, 33}, { 13, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, + { 1, 21}, { 1, 19}, { 12, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, + { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 20, 0}, { 1, 14}, { 10, 15}, { 1, 39}, { 1, 107}, { 9, 33}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 138 */ + { 6, 33}, { 14, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, + { 1, 18}, { 12, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, { 9, 15}, + { 1, 39}, { 1, 107}, { 9, 33}, { 1, 7}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 55}, { 2, 96}, { 1, 108}, { 1, 60}, /* Row 139 */ + { 6, 33}, { 15, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, + { 1, 16}, { 1, 23}, { 10, 15}, { 1, 109}, { 1, 81}, { 6, 27}, { 1, 29}, { 1, 3}, + { 2, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 23, 0}, { 1, 28}, { 1, 110}, { 5, 15}, { 1, 39}, { 1, 111}, { 1, 105}, { 10, 33}, + { 15, 0}, + { 25, 0}, { 1, 59}, { 4, 40}, { 4, 60}, { 7, 33}, { 16, 0}, { 1, 5}, { 4, 4}, /* Row 140 */ + { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 6, 15}, + { 1, 34}, { 1, 43}, { 1, 81}, { 6, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 112}, + { 1, 14}, { 1, 113}, { 1, 22}, { 1, 40}, { 1, 76}, { 10, 33}, { 1, 7}, { 15, 0}, + { 25, 0}, { 16, 33}, { 17, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 141 */ + { 8, 4}, { 1, 21}, { 1, 18}, { 1, 19}, { 1, 77}, { 1, 25}, { 1, 34}, { 1, 43}, + { 1, 35}, { 8, 27}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 50}, { 13, 33}, { 16, 0}, + { 25, 0}, { 16, 33}, { 18, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 142 */ + { 9, 4}, { 1, 16}, { 1, 10}, { 1, 66}, { 1, 81}, { 8, 27}, { 1, 36}, { 1, 8}, + { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 32, 0}, { 1, 7}, { 11, 33}, { 17, 0}, + { 25, 0}, { 16, 33}, { 19, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 143 */ + { 9, 4}, { 1, 3}, { 1, 49}, { 1, 29}, { 1, 28}, { 5, 27}, { 1, 36}, { 1, 8}, + { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 34, 0}, { 10, 33}, { 18, 0}, + { 25, 0}, { 16, 33}, { 20, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 144 */ + { 10, 4}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 35, 0}, { 1, 41}, { 7, 33}, { 1, 7}, { 19, 0}, + { 25, 0}, { 16, 33}, { 21, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 145 */ + { 19, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 64, 0}, + { 25, 0}, { 16, 33}, { 22, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 146 */ + { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 65, 0}, + { 64, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 3}, /* Row 147 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, { 1, 3}, /* Row 148 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 3}, /* Row 149 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 3}, /* Row 150 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 3}, /* Row 151 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 3}, /* Row 152 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 3}, /* Row 153 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 154 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 8}, { 1, 7}, /* Row 155 */ + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 91}, { 1, 7}, { 1, 11}, { 1, 7}, /* Row 156 */ + { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 4, 4}, { 1, 114}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 157 */ + { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 8}, { 1, 115}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 5, 3}, { 1, 4}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 6, 3}, { 1, 4}, { 75, 0}, /* Row 1 */ + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 2, 6}, { 4, 3}, { 1, 4}, /* Row 2 */ + { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 8}, /* Row 3 */ + { 1, 6}, { 4, 3}, { 1, 4}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 4 */ + { 2, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 5 */ + { 4, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 6 */ + { 6, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 7 */ + { 8, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 8 */ + { 10, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 9 */ + { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 10 */ + { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 11 */ + { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 12 */ + { 18, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 13 */ + { 20, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 14 */ + { 22, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 15 */ + { 24, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 16 */ + { 26, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 17 */ + { 28, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 18 */ + { 30, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 26, 0}, { 1, 9}, { 5, 10}, { 1, 9}, + { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 19 */ + { 10, 3}, { 5, 5}, { 17, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 23, 0}, { 1, 1}, + { 9, 10}, { 1, 1}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 20 */ + { 9, 3}, { 1, 5}, { 1, 11}, { 5, 12}, { 1, 11}, { 1, 13}, { 16, 3}, { 1, 6}, + { 4, 3}, { 1, 4}, { 22, 0}, { 11, 10}, { 1, 1}, { 22, 0}, + { 23, 0}, { 1, 9}, { 5, 10}, { 1, 14}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 21 */ + { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 7, 10}, + { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 20, 0}, { 1, 9}, + { 12, 10}, { 1, 1}, { 21, 0}, + { 21, 0}, { 1, 1}, { 9, 10}, { 1, 1}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 22 */ + { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 9, 10}, + { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 19, 0}, { 14, 10}, + { 21, 0}, + { 21, 0}, { 11, 10}, { 1, 1}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, /* Row 23 */ + { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 11}, { 11, 10}, { 1, 12}, { 1, 7}, + { 3, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 17, 0}, { 1, 9}, + { 6, 10}, { 2, 12}, { 6, 10}, { 1, 9}, { 20, 0}, + { 20, 0}, { 1, 14}, { 12, 10}, { 1, 9}, { 4, 2}, { 1, 17}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 13}, + { 1, 12}, { 12, 10}, { 1, 12}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, + { 16, 0}, { 5, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 1, 1}, { 18, 0}, + { 19, 0}, { 1, 9}, { 13, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 11, 0}, { 1, 1}, /* Row 25 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, { 1, 19}, + { 4, 10}, { 5, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, + { 1, 4}, { 14, 0}, { 1, 9}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 14}, { 1, 2}, + { 1, 1}, { 17, 0}, + { 19, 0}, { 6, 10}, { 3, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 9, 0}, /* Row 26 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, + { 1, 5}, { 1, 14}, { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 12, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 13, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 14}, + { 2, 2}, { 1, 1}, { 16, 0}, + { 18, 0}, { 1, 9}, { 4, 10}, { 6, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, /* Row 27 */ + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 1, 11}, { 5, 6}, + { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 11, 0}, { 1, 9}, { 5, 10}, + { 8, 12}, { 4, 10}, { 1, 14}, { 3, 2}, { 16, 0}, + { 18, 0}, { 5, 10}, { 6, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 6, 0}, /* Row 28 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 13, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 13, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 10, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 3, 2}, { 1, 17}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 5, 0}, /* Row 29 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 14, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 13, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 8, 0}, { 1, 9}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 3, 0}, /* Row 30 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 15, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 7, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 5, 2}, { 1, 1}, { 14, 0}, + { 18, 0}, { 4, 10}, { 9, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 2, 0}, /* Row 31 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 16, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 5, 0}, { 1, 9}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 9, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 1, 1}, /* Row 32 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 17, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 10, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 15, 3}, { 1, 6}, + { 4, 3}, { 1, 4}, { 4, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, + { 1, 1}, { 14, 0}, + { 18, 0}, { 4, 10}, { 10, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 1, 18}, /* Row 33 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 18, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 2, 0}, { 1, 9}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 10, 12}, { 6, 10}, { 1, 14}, { 3, 2}, { 1, 20}, { 1, 6}, /* Row 34 */ + { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 19, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 11, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, { 1, 6}, { 4, 3}, + { 1, 4}, { 1, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 1, 17}, + { 15, 0}, + { 18, 0}, { 4, 10}, { 11, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 1, 2}, { 1, 20}, /* Row 35 */ + { 3, 6}, { 1, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 20, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 11, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 16, 3}, { 1, 6}, + { 4, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 16, 0}, + { 18, 0}, { 4, 10}, { 11, 12}, { 6, 10}, { 1, 14}, { 1, 20}, { 5, 6}, { 1, 2}, /* Row 36 */ + { 1, 5}, { 21, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 17, 3}, { 1, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 22, 3}, /* Row 37 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 17, 3}, { 1, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, + { 1, 18}, { 6, 2}, { 17, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 22, 3}, /* Row 38 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 13, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 18, 3}, + { 1, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 17, 0}, + { 18, 0}, { 4, 10}, { 13, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 22, 3}, { 1, 5}, /* Row 39 */ + { 1, 12}, { 3, 10}, { 13, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 17, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, + { 18, 0}, { 4, 10}, { 13, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 21, 3}, /* Row 40 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, + { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 18, 0}, + { 18, 0}, { 4, 10}, { 14, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 21, 3}, { 1, 5}, /* Row 41 */ + { 1, 12}, { 3, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, + { 18, 0}, { 4, 10}, { 14, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 20, 3}, /* Row 42 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 15, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, + { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 19, 0}, + { 18, 0}, { 4, 10}, { 15, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 20, 3}, { 1, 5}, /* Row 43 */ + { 1, 12}, { 3, 10}, { 15, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 13, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 20, 0}, + { 18, 0}, { 4, 10}, { 15, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 19, 3}, /* Row 44 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 20, 0}, + { 18, 0}, { 4, 10}, { 16, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 19, 3}, { 1, 5}, /* Row 45 */ + { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, + { 1, 5}, { 11, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 46 */ + { 1, 5}, { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 47 */ + { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 48 */ + { 1, 5}, { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 49 */ + { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 50 */ + { 1, 5}, { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 51 */ + { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 52 */ + { 1, 5}, { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 5, 6}, { 1, 20}, { 1, 17}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 53 */ + { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 54 */ + { 1, 5}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 7, 6}, { 1, 3}, { 1, 4}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 55 */ + { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 3, 3}, { 1, 4}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 56 */ + { 1, 5}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 8, 6}, { 3, 3}, { 1, 4}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 57 */ + { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 2, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 58 */ + { 1, 5}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 3, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 19, 0}, + { 17, 0}, { 1, 22}, { 1, 12}, { 3, 10}, { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, /* Row 59 */ + { 1, 12}, { 6, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, + { 8, 12}, { 5, 10}, { 1, 11}, { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 5, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 18}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, { 7, 12}, /* Row 60 */ + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 3, 6}, + { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 6, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, /* Row 61 */ + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 1, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 8, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 2, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 9, 10}, /* Row 62 */ + { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 10, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 23}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 9, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 12}, { 3, 10}, /* Row 63 */ + { 8, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, + { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, + { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 11, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 24}, { 1, 12}, /* Row 64 */ + { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 65 */ + { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 9, 10}, + { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 66 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 8, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 15, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 2, 3}, /* Row 67 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 3, 3}, /* Row 68 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 18, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 4, 3}, /* Row 69 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 7, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 20, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 5, 3}, /* Row 70 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 6, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 21, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 6, 3}, /* Row 71 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 23, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 7, 3}, /* Row 72 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 24, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 8, 3}, /* Row 73 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 5, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 26, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 9, 3}, /* Row 74 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 4, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, + { 15, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 27, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 10, 3}, /* Row 75 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 15, 12}, + { 4, 10}, { 1, 12}, { 7, 6}, { 29, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 11, 3}, { 1, 5}, /* Row 76 */ + { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 5, 10}, + { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, + { 13, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 30, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 1, 0}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 12, 3}, { 1, 5}, { 1, 12}, /* Row 77 */ + { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 12}, { 6, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 4, 10}, { 13, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 32, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 2, 3}, { 1, 6}, { 1, 2}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 78 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 1, 5}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 11, 12}, { 5, 10}, + { 1, 11}, { 6, 6}, { 1, 5}, { 33, 3}, { 1, 6}, { 3, 3}, + { 1, 3}, { 1, 5}, { 1, 18}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 79 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 6, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 4, 10}, { 11, 12}, { 4, 10}, { 1, 12}, + { 7, 6}, { 35, 3}, { 1, 6}, { 2, 3}, + { 2, 3}, { 1, 6}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 80 */ + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 1, 5}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 4, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 35, 3}, { 1, 5}, { 1, 6}, { 1, 3}, + { 3, 3}, { 1, 6}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 81 */ + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 6, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 6, 6}, { 36, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 82 */ + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 2, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, + { 1, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 35, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 83 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 1, 5}, { 33, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, + { 1, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 84 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 32, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 0}, + { 2, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 85 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 30, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 2, 0}, + { 3, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 8, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 86 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 6, 6}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 29, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 3, 0}, + { 4, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 87 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 27, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, + { 5, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 6, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 88 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 5, 6}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 26, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 5, 0}, + { 6, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 89 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 1, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 24, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 6, 0}, + { 7, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 4, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 90 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 4, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 23, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, + { 8, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 91 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 3, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 21, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 8, 0}, + { 9, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 92 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 20, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 9, 0}, + { 10, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 93 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 18, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 10, 0}, + { 11, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 94 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 8, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, + { 1, 11}, { 1, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, + { 1, 11}, { 5, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 11, 0}, + { 12, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 95 */ + { 1, 12}, { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 1, 21}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, + { 1, 12}, { 4, 10}, { 9, 12}, { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 12, 0}, + { 13, 0}, { 1, 4}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 96 */ + { 1, 12}, { 7, 6}, { 9, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, { 5, 10}, + { 8, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 14, 3}, { 1, 7}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, + { 14, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 97 */ + { 1, 12}, { 7, 6}, { 9, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, + { 9, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 14, 0}, + { 15, 0}, { 1, 4}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 98 */ + { 1, 12}, { 7, 6}, { 10, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 10, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 1, 12}, + { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 11, 3}, { 1, 7}, { 1, 2}, + { 1, 5}, { 1, 3}, { 1, 4}, { 15, 0}, + { 16, 0}, { 1, 4}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, /* Row 99 */ + { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 7, 12}, + { 4, 10}, { 1, 12}, { 4, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 1, 6}, { 1, 11}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 9, 3}, { 1, 7}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, + { 17, 0}, { 1, 4}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, /* Row 100 */ + { 11, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 9, 10}, { 7, 12}, { 9, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 11, 3}, { 1, 13}, /* Row 101 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 11}, /* Row 102 */ + { 5, 10}, { 7, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 4, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 5, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 13}, /* Row 103 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 11}, /* Row 104 */ + { 5, 10}, { 7, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 2, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 13}, /* Row 105 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 11}, /* Row 106 */ + { 5, 10}, { 7, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 1, 18}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 13}, /* Row 107 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 4}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 11}, /* Row 108 */ + { 5, 10}, { 7, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 5, 6}, { 1, 20}, { 1, 1}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 13}, /* Row 109 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 11}, /* Row 110 */ + { 5, 10}, { 7, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 13}, /* Row 111 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 11}, /* Row 112 */ + { 5, 10}, { 7, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 13}, /* Row 113 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 11}, /* Row 114 */ + { 5, 10}, { 7, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 13}, /* Row 115 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 19, 3}, { 1, 11}, /* Row 116 */ + { 5, 10}, { 7, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 18}, { 6, 6}, { 19, 3}, /* Row 117 */ + { 1, 13}, { 1, 12}, { 4, 10}, { 24, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 1, 5}, + { 11, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, + { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 2}, { 1, 20}, { 5, 6}, /* Row 118 */ + { 20, 3}, { 1, 11}, { 5, 10}, { 22, 12}, { 5, 10}, { 1, 11}, { 7, 6}, { 12, 3}, + { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 2}, { 1, 20}, { 5, 6}, /* Row 119 */ + { 19, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 22, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 1, 5}, { 13, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 2}, { 1, 20}, { 3, 6}, /* Row 120 */ + { 1, 3}, { 1, 6}, { 19, 3}, { 1, 11}, { 5, 10}, { 20, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 2}, { 1, 20}, { 2, 6}, /* Row 121 */ + { 2, 3}, { 1, 6}, { 18, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 20, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 14, 3}, { 1, 7}, { 1, 25}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 2}, { 1, 20}, { 1, 6}, /* Row 122 */ + { 3, 3}, { 1, 6}, { 18, 3}, { 1, 11}, { 5, 10}, { 18, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 14, 3}, { 1, 7}, { 1, 2}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 2}, { 1, 20}, { 4, 3}, /* Row 123 */ + { 1, 6}, { 17, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 18, 12}, { 4, 10}, { 1, 12}, + { 7, 6}, { 1, 5}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 20}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 4, 3}, /* Row 124 */ + { 1, 6}, { 17, 3}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 7, 6}, + { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 17}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 1, 4}, /* Row 125 */ + { 4, 3}, { 1, 6}, { 16, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 2, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 2, 0}, { 1, 4}, /* Row 126 */ + { 4, 3}, { 1, 6}, { 16, 3}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 3, 0}, { 1, 4}, /* Row 127 */ + { 4, 3}, { 1, 6}, { 15, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 5, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 16, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 4, 0}, { 1, 4}, /* Row 128 */ + { 4, 3}, { 1, 6}, { 15, 3}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 5, 0}, { 1, 4}, /* Row 129 */ + { 4, 3}, { 1, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 8, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 6, 0}, { 1, 4}, /* Row 130 */ + { 4, 3}, { 1, 6}, { 14, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 10, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 26}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 7, 0}, { 1, 4}, /* Row 131 */ + { 4, 3}, { 1, 6}, { 13, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 11, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 6, 2}, + { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 8, 0}, { 1, 4}, /* Row 132 */ + { 4, 3}, { 1, 6}, { 13, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 7, 2}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 9, 0}, { 1, 4}, /* Row 133 */ + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 14, 0}, { 1, 9}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 19}, + { 7, 2}, { 1, 26}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 10, 0}, { 1, 4}, /* Row 134 */ + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 11}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, + { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 8, 2}, { 1, 17}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 11, 0}, { 1, 4}, /* Row 135 */ + { 4, 3}, { 1, 6}, { 11, 3}, { 1, 13}, { 1, 12}, { 5, 10}, { 4, 12}, { 5, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 17, 0}, { 1, 9}, { 4, 10}, { 4, 12}, { 5, 10}, { 1, 14}, { 8, 2}, + { 1, 17}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 12, 0}, { 1, 4}, /* Row 136 */ + { 4, 3}, { 1, 6}, { 11, 3}, { 1, 11}, { 14, 10}, { 1, 11}, { 7, 6}, { 7, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, { 12, 10}, { 1, 12}, + { 1, 18}, { 8, 2}, { 1, 1}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 13, 0}, { 1, 4}, /* Row 137 */ + { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 12, 10}, { 1, 12}, { 7, 6}, + { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, + { 1, 9}, { 10, 10}, { 1, 12}, { 10, 2}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 14, 0}, { 1, 4}, /* Row 138 */ + { 4, 3}, { 1, 6}, { 10, 3}, { 1, 11}, { 12, 10}, { 1, 11}, { 7, 6}, { 6, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, { 9, 10}, { 1, 12}, + { 10, 2}, { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 7, 2}, { 15, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 139 */ + { 9, 3}, { 1, 5}, { 1, 15}, { 10, 10}, { 1, 15}, { 7, 6}, { 1, 5}, { 5, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, { 1, 17}, { 1, 14}, + { 5, 10}, { 1, 12}, { 1, 10}, { 1, 19}, { 10, 2}, { 15, 0}, + { 25, 0}, { 1, 20}, { 4, 18}, { 11, 2}, { 16, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 140 */ + { 9, 3}, { 1, 5}, { 1, 11}, { 1, 12}, { 6, 10}, { 1, 12}, { 1, 11}, { 8, 6}, + { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 27, 0}, { 2, 9}, + { 1, 19}, { 1, 14}, { 1, 18}, { 11, 2}, { 1, 17}, { 15, 0}, + { 25, 0}, { 16, 2}, { 17, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, /* Row 141 */ + { 1, 11}, { 4, 12}, { 1, 11}, { 9, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 1, 3}, { 1, 4}, { 30, 0}, { 1, 1}, { 13, 2}, { 16, 0}, + { 25, 0}, { 16, 2}, { 18, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, /* Row 142 */ + { 1, 13}, { 11, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, + { 32, 0}, { 1, 17}, { 11, 2}, { 17, 0}, + { 25, 0}, { 16, 2}, { 19, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 5}, /* Row 143 */ + { 7, 6}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 34, 0}, + { 10, 2}, { 18, 0}, + { 25, 0}, { 16, 2}, { 20, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 25, 3}, { 1, 7}, /* Row 144 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 35, 0}, { 1, 1}, { 7, 2}, { 1, 17}, + { 19, 0}, + { 25, 0}, { 16, 2}, { 21, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 23, 3}, { 1, 7}, /* Row 145 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 64, 0}, + { 25, 0}, { 16, 2}, { 22, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 21, 3}, { 1, 7}, /* Row 146 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 65, 0}, + { 64, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 19, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 147 */ + { 1, 3}, { 1, 4}, { 66, 0}, + { 65, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 148 */ + { 1, 3}, { 1, 4}, { 67, 0}, + { 66, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 149 */ + { 1, 3}, { 1, 4}, { 68, 0}, + { 67, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 150 */ + { 1, 3}, { 1, 4}, { 69, 0}, + { 68, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 151 */ + { 1, 3}, { 1, 4}, { 70, 0}, + { 69, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 152 */ + { 1, 3}, { 1, 4}, { 71, 0}, + { 70, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 153 */ + { 1, 3}, { 1, 4}, { 72, 0}, + { 71, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 154 */ + { 1, 3}, { 1, 4}, { 73, 0}, + { 72, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 155 */ + { 1, 3}, { 1, 4}, { 74, 0}, + { 73, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 5}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 156 */ + { 1, 3}, { 1, 4}, { 75, 0}, + { 74, 0}, { 1, 4}, { 5, 3}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 76, 0}, /* Row 157 */ + { 75, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 20}, { 1, 5}, { 1, 3}, { 1, 4}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 4}, { 4, 3}, { 1, 4}, { 78, 0} /* Row 159 */ +}; + +# endif +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + 160, // width - Width in pixels + 160, // height - Height in rows + g_nuttxLut, // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nuttxRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/libnxwidgets/src/glyph_radiobuttonmu.cxx b/libnxwidgets/src/glyph_radiobuttonmu.cxx new file mode 100644 index 000000000..a9e4d6708 --- /dev/null +++ b/libnxwidgets/src/glyph_radiobuttonmu.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_radiobuttonmu.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_radioButtonMuGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_radioButtonMuGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_radioButtonMu = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_radioButtonMuGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_radiobuttonoff.cxx b/libnxwidgets/src/glyph_radiobuttonoff.cxx new file mode 100644 index 000000000..029b93896 --- /dev/null +++ b/libnxwidgets/src/glyph_radiobuttonoff.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_radiobuttonoff.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_radioButtonOffGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_radioButtonOffGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_radioButtonOff = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_radioButtonOffGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_radiobuttonon.cxx b/libnxwidgets/src/glyph_radiobuttonon.cxx new file mode 100644 index 000000000..242f6f373 --- /dev/null +++ b/libnxwidgets/src/glyph_radiobuttonon.cxx @@ -0,0 +1,156 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_radiobuttonon.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 +# define RGB16_COLOR RGBTO16(216,196,96) + +static const uint16_t g_radioButtonOnGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_COLOR, RGB16_COLOR, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_COLOR, RGB16_COLOR, RGB16_COLOR, RGB16_COLOR, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_COLOR, RGB16_COLOR, RGB16_COLOR, RGB16_COLOR, RGB16_TRANSP, RGB16_WHITE, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_COLOR, RGB16_COLOR, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 +# define RGB24_COLOR RGBTO24(216,196,96) + +static const uint32_t g_radioButtonOnGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_COLOR, RGB24_COLOR, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_COLOR, RGB24_COLOR, RGB24_COLOR, RGB24_COLOR, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_COLOR, RGB24_COLOR, RGB24_COLOR, RGB24_COLOR, RGB24_TRANSP, RGB24_WHITE, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_COLOR, RGB24_COLOR, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_radioButtonOn = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_radioButtonOnGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_return.cxx b/libnxwidgets/src/glyph_return.cxx new file mode 100644 index 000000000..47314f65c --- /dev/null +++ b/libnxwidgets/src/glyph_return.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_return.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_returnGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_returnGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_return = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_returnGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_screendepthdown.cxx b/libnxwidgets/src/glyph_screendepthdown.cxx new file mode 100644 index 000000000..c3f0e15ee --- /dev/null +++ b/libnxwidgets/src/glyph_screendepthdown.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_screendepthdown.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_screenDepthDownGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, RGB16_WHITE, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_screenDepthDownGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, RGB24_WHITE, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_screenDepthDown = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_screenDepthDownGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_screendepthup.cxx b/libnxwidgets/src/glyph_screendepthup.cxx new file mode 100644 index 000000000..e4574a367 --- /dev/null +++ b/libnxwidgets/src/glyph_screendepthup.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_screendepthup.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_screenDepthUpGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_screenDepthUpGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_screenDepthUp = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_screenDepthUpGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_screenflipdown.cxx b/libnxwidgets/src/glyph_screenflipdown.cxx new file mode 100644 index 000000000..253ad6afb --- /dev/null +++ b/libnxwidgets/src/glyph_screenflipdown.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_screenflipdown.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_screenFlipDownGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_screenFlipDownGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_screenFlipDown = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_screenFlipDownGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_screenflipup.cxx b/libnxwidgets/src/glyph_screenflipup.cxx new file mode 100644 index 000000000..63b58a4a6 --- /dev/null +++ b/libnxwidgets/src/glyph_screenflipup.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_screenflipup.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_screenFlipUpGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_screenFlipUpGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_screenFlipUp = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 7, // width - Width in pixels + 10, // height - Height in rows + (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_screenFlipUpGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_shift.cxx b/libnxwidgets/src/glyph_shift.cxx new file mode 100644 index 000000000..193fd1719 --- /dev/null +++ b/libnxwidgets/src/glyph_shift.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_shift.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_shiftGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_shiftGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_shift = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_shiftGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_windowclose.cxx b/libnxwidgets/src/glyph_windowclose.cxx new file mode 100644 index 000000000..3a60aa137 --- /dev/null +++ b/libnxwidgets/src/glyph_windowclose.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_windowclose.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_windowCloseGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_windowCloseGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_windowClose = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 6, // width - Width in pixels + 10, // height - Height in rows + (6*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_windowCloseGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_windowdepthdown.cxx b/libnxwidgets/src/glyph_windowdepthdown.cxx new file mode 100644 index 000000000..d75b7d676 --- /dev/null +++ b/libnxwidgets/src/glyph_windowdepthdown.cxx @@ -0,0 +1,154 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_windowdepthdown.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_windowDepthDownGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, RGB16_WHITE, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_windowDepthDownGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, RGB24_WHITE, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_windowDepthDown = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_windowDepthDownGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 diff --git a/libnxwidgets/src/glyph_windowdepthup.cxx b/libnxwidgets/src/glyph_windowdepthup.cxx new file mode 100644 index 000000000..f5d67e968 --- /dev/null +++ b/libnxwidgets/src/glyph_windowdepthup.cxx @@ -0,0 +1,156 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_windowdepthup.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "cbitmap.hxx" +#include "glyphs.hxx" + +#if CONFIG_NXWIDGETS_BPP != 8 // No support for 8-bit color format + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +#if CONFIG_NXWIDGETS_BPP == 16 +# define COLOR_FMT FB_FMT_RGB16_565 +# define RGB16_TRANSP 0x0000 + +static const uint16_t g_windowDepthUpGlyph[] = +{ + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_TRANSP, RGB16_TRANSP, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_DARKRED, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_WHITE, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, RGB16_DARKRED, + RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, RGB16_TRANSP, +}; + +#elif CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define COLOR_FMT FB_FMT_RGB24 +# define RGB24_TRANSP 0x00000000 + +static const uint32_t g_windowDepthUpGlyph[] = +{ + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_TRANSP, RGB24_TRANSP, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_DARKRED, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_WHITE, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, RGB24_DARKRED, + RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, RGB24_TRANSP, +}; + +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SBitmap NXWidgets::g_windowDepthUp = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + COLOR_FMT, // fmt - Color format + 8, // width - Width in pixels + 10, // height - Height in rows + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + g_windowDepthUpGlyph // data - Pointer to the beginning of pixel data +}; + +#endif // CONFIG_NXWIDGETS_BPP != 8 + + diff --git a/libnxwidgets/src/singletons.cxx b/libnxwidgets/src/singletons.cxx new file mode 100644 index 000000000..fc5d919e6 --- /dev/null +++ b/libnxwidgets/src/singletons.cxx @@ -0,0 +1,202 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/singletons.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +#include "nxconfig.hxx" +#include "cnxserver.hxx" +#include "cnxstring.hxx" +#include "cwidgetstyle.hxx" +#include "cnxfont.hxx" +#include "singletons.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Global Static Data + ****************************************************************************/ + +using namespace NXWidgets; + +CWidgetStyle *NXWidgets::g_defaultWidgetStyle; /**< The default widget style */ +CNxString *NXWidgets::g_nullString; /**< The reusable empty string */ +TNxArray *NXWidgets::g_nxTimers; /**< An array of all timers */ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +/** + * Setup misc singleton instances. Why is there here? Because it needs to be + * done one time before any widgets are created. So why isn't it just the + * default style just a statically constructed class? Because not all platforms + * will support static class constructions. + */ + +void NXWidgets::instantiateSingletons(void) +{ + // Disable pre-emption. Since we are dealing with global resources here we + // are not inherently thread-safe. + + sched_lock(); + + // Create a global, empty string that may be used whereever a string is + // required, but not needed. + + if (!g_nullString) + { + g_nullString = new CNxString(); + } + + // Setup the default widget style + + if (!g_defaultWidgetStyle) + { + // Create the singleton + + g_defaultWidgetStyle = new CWidgetStyle(); + + // Default colors + + g_defaultWidgetStyle->colors.background = CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR; + g_defaultWidgetStyle->colors.selectedBackground = CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR; + g_defaultWidgetStyle->colors.shineEdge = CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR; + g_defaultWidgetStyle->colors.shadowEdge = CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR; + g_defaultWidgetStyle->colors.highlight = CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR; + + g_defaultWidgetStyle->colors.disabledText = CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR; + g_defaultWidgetStyle->colors.enabledText = CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR; + g_defaultWidgetStyle->colors.selectedText = CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR; + + // Default font using the default font ID and the default font colors + + g_defaultWidgetStyle->font = new CNxFont((enum nx_fontid_e)CONFIG_NXWIDGETS_DEFAULT_FONTID, + CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR, + CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + } + + // Create the timer list + + if (!g_nxTimers) + { + g_nxTimers = new TNxArray(); + } + + sched_unlock(); +} + +/** + * Free the singleton instances when the last NX server is destroyed. + */ + +void NXWidgets::freeSingletons(void) +{ + // Delete the null string singleton + + if (g_nullString) + { + delete g_nullString; + g_nullString = (CNxString *)NULL; + } + + // Delete the default widget style singleton + + if (g_defaultWidgetStyle) + { + if (g_defaultWidgetStyle->font) + { + delete g_defaultWidgetStyle->font; + } + + delete g_defaultWidgetStyle; + g_defaultWidgetStyle = (CWidgetStyle *)NULL; + } + + // Free the timer list + + if (g_nxTimers) + { + delete g_nxTimers; + g_nxTimers = (TNxArray *)NULL; + } + +} + From a1feb598da2a4ebb3e0ef4cab7e1a4a6f243f418 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Mar 2012 22:41:11 +0000 Subject: [PATCH 002/390] Prep for NxWidgets 1.0 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4506 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 5 + README.txt | 51 +++++++ ReleaseNotes.txt | 9 ++ UnitTests/CButton/Makefile | 4 +- UnitTests/CButton/cbutton-pushed.png | Bin 0 -> 22223 bytes UnitTests/CButton/cbutton-released.png | Bin 0 -> 19844 bytes UnitTests/CButton/cbuttontest.hxx | 2 +- UnitTests/CButtonArray/Makefile | 4 +- UnitTests/CButtonArray/cbuttonarray.png | Bin 0 -> 35615 bytes UnitTests/CButtonArray/cbuttonarraytest.hxx | 2 +- UnitTests/CCheckBox/Makefile | 4 +- UnitTests/CCheckBox/ccheckbox.png | Bin 0 -> 20124 bytes UnitTests/CCheckBox/ccheckboxtest.hxx | 2 +- UnitTests/CGlyphButton/Makefile | 4 +- UnitTests/CGlyphButton/cglyphbuttontest.hxx | 2 +- UnitTests/CImage/Makefile | 4 +- UnitTests/CImage/cimagetest.hxx | 2 +- UnitTests/CKeypad/Makefile | 4 +- UnitTests/CKeypad/ckeypadtest.hxx | 2 +- UnitTests/CLabel/Makefile | 4 +- UnitTests/CLabel/clabel.png | Bin 0 -> 18204 bytes UnitTests/CLabel/clabeltest.hxx | 2 +- UnitTests/CLatchButton/Makefile | 4 +- UnitTests/CLatchButton/clatchbuttontest.hxx | 2 +- UnitTests/CLatchButtonArray/Makefile | 4 +- .../clatchbuttonarraytest.hxx | 2 +- UnitTests/CListBox/Makefile | 4 +- UnitTests/CListBox/clistboxtest.hxx | 2 +- UnitTests/CProgressBar/Makefile | 4 +- UnitTests/CProgressBar/cprogressbar.png | Bin 0 -> 20469 bytes UnitTests/CProgressBar/cprogressbartest.hxx | 2 +- UnitTests/CRadioButton/Makefile | 4 +- UnitTests/CRadioButton/cradiobutton.png | Bin 0 -> 32930 bytes UnitTests/CRadioButton/cradiobuttontest.hxx | 2 +- UnitTests/CScrollbarHorizontal/Makefile | 4 +- .../cscrollbarhorizontal.png | Bin 0 -> 20426 bytes .../cscrollbarhorizontaltest.hxx | 2 +- UnitTests/CScrollbarVertical/Makefile | 4 +- .../CScrollbarVertical/cscrollbarvertical.png | Bin 0 -> 31491 bytes .../cscrollbarverticaltest.hxx | 2 +- UnitTests/CSliderHorizonal/Makefile | 4 +- .../CSliderHorizonal/csliderhorizontal.png | Bin 0 -> 21590 bytes .../csliderhorizontaltest.hxx | 2 +- UnitTests/CSliderVertical/Makefile | 4 +- UnitTests/CSliderVertical/cslidervertical.png | Bin 0 -> 19625 bytes .../CSliderVertical/csliderverticaltest.hxx | 2 +- UnitTests/CTextBox/Makefile | 4 +- UnitTests/CTextBox/ctextbox.png | Bin 0 -> 45575 bytes UnitTests/CTextBox/ctextboxtest.hxx | 2 +- UnitTests/TestStatus.txt | 59 +++++++++ {UnitTests/tools => tools}/addobjs.sh | 4 +- tools/indent.sh | 45 +++++++ {UnitTests/tools => tools}/install.sh | 8 +- tools/zipme.sh | 125 ++++++++++++++++++ 54 files changed, 351 insertions(+), 57 deletions(-) create mode 100755 ChangeLog.txt create mode 100755 README.txt create mode 100755 ReleaseNotes.txt create mode 100755 UnitTests/CButton/cbutton-pushed.png create mode 100755 UnitTests/CButton/cbutton-released.png create mode 100755 UnitTests/CButtonArray/cbuttonarray.png create mode 100755 UnitTests/CCheckBox/ccheckbox.png create mode 100755 UnitTests/CLabel/clabel.png create mode 100755 UnitTests/CProgressBar/cprogressbar.png create mode 100755 UnitTests/CRadioButton/cradiobutton.png create mode 100755 UnitTests/CScrollbarHorizontal/cscrollbarhorizontal.png create mode 100755 UnitTests/CScrollbarVertical/cscrollbarvertical.png create mode 100755 UnitTests/CSliderHorizonal/csliderhorizontal.png create mode 100755 UnitTests/CSliderVertical/cslidervertical.png create mode 100755 UnitTests/CTextBox/ctextbox.png create mode 100755 UnitTests/TestStatus.txt rename {UnitTests/tools => tools}/addobjs.sh (97%) create mode 100755 tools/indent.sh rename {UnitTests/tools => tools}/install.sh (95%) create mode 100755 tools/zipme.sh diff --git a/ChangeLog.txt b/ChangeLog.txt new file mode 100755 index 000000000..5a2806fcd --- /dev/null +++ b/ChangeLog.txt @@ -0,0 +1,5 @@ +1.0 2012-03-22 Gregory Nutt + +* The initial release of the NxWidgets package + +1.1 2012-xx-xx Gregory Nutt diff --git a/README.txt b/README.txt new file mode 100755 index 000000000..380051a22 --- /dev/null +++ b/README.txt @@ -0,0 +1,51 @@ +NXWidgets +========= + +In order to better support NuttX based platforms, a special graphical user +interface has been created called NXWidgets. NXWidgets is written in C++ +and integrates seamlessly with the NuttX NX graphics subsystem in order +to provide graphic objects, or "widgets," in the NX Graphics Subsystem + +Some of the features of NXWidgets include: + +o Conservative C++ + + NXWidgets is written entirely in C++ but using only selected “embedded + friendly” C++ constructs that are fully supported under NuttX. No + additional C++ support libraries are required. + +o NX Integration + + NXWidgets integrate seamlessly with the NX graphics system. Think of the + X server under Linux … the NX graphics system is like a tiny X server + that provides windowing under NuttX. By adding NXWidgets, you can support + graphics objects like buttons and text boxes in the NX windows and toolbars. + +o Small Footprint + + NXWidgets is tailored for use MCUs in embedded applications. It is ideally + suited for mid- and upper-range of most MCU families. A complete NXWidgets + is possible in as little as 40Kb of FLASH and maybe 4Kb of SRAM. + +o Output Devices + + NXWidgets will work on the high-end frame buffer devices as well as on LCDs + connected via serial or parallel ports to a small MCU. + +o Input Devices + + NXWidgets will accept position and selection inputs from a mouse or a + touchscreen. It will also support character input from a keyboard such as a + USB keyboard. NXWidgets supports on very special widget called CKeypad that + will provide keyboard input via an on-screen keypad that can be operated + via mouse or touchscreen inputs. + +o Many Graphic Objects + + Some of the graphic objects supported by NXWidgets include labels, buttons, + text boxes, button arrays, check boxes, cycle buttons, images, sliders, + scrollable list boxes, progress bars, and more. + +Note: Many of the fundamental classed in NxWidgets derive from the Antony +Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style +license. See the COPYING file for details. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt new file mode 100755 index 000000000..dea4771a3 --- /dev/null +++ b/ReleaseNotes.txt @@ -0,0 +1,9 @@ +NxWidgets-1.0 +============= + +The initial version of NxWidgets was released on March 22, 2012. This +package has been used in several projects prior to its release to open +source and is considered stable its initial release (although not all +features have been fully verified). + + diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index fbb7d815b..4e1ae042f 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CButton/cbutton-pushed.png b/UnitTests/CButton/cbutton-pushed.png new file mode 100755 index 0000000000000000000000000000000000000000..079076b86208cff1b9327f47d7ef70dc684128a8 GIT binary patch literal 22223 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 IPJ}D}0|i^RQvd(} literal 0 HcmV?d00001 diff --git a/UnitTests/CCheckBox/ccheckboxtest.hxx b/UnitTests/CCheckBox/ccheckboxtest.hxx index 52371ab73..73e72e282 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CCHECKBOXTEST_BGCOLOR -# define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 527d882fa..01e843555 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/UnitTests/CGlyphButton/cglyphbuttontest.hxx index 889ce21ca..940d82a9f 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -69,7 +69,7 @@ #endif #ifndef CONFIG_CGLYPHBUTTONTEST_BGCOLOR -# define CONFIG_CGLYPHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CGLYPHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_CGLYPHBUTTONTEST_FONTCOLOR diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index e248761e7..8db783364 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CImage/cimagetest.hxx b/UnitTests/CImage/cimagetest.hxx index 8a8a55556..64592ee23 100644 --- a/UnitTests/CImage/cimagetest.hxx +++ b/UnitTests/CImage/cimagetest.hxx @@ -68,7 +68,7 @@ #endif #ifndef CONFIG_CIMAGETEST_BGCOLOR -# define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 631be3b68..ddb8fb962 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CKeypad/ckeypadtest.hxx b/UnitTests/CKeypad/ckeypadtest.hxx index 820113960..c1c7ba79e 100644 --- a/UnitTests/CKeypad/ckeypadtest.hxx +++ b/UnitTests/CKeypad/ckeypadtest.hxx @@ -69,7 +69,7 @@ #endif #ifndef CONFIG_CKEYPADTEST_BGCOLOR -# define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 163d04175..4e49a7f5c 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CLabel/clabel.png b/UnitTests/CLabel/clabel.png new file mode 100755 index 0000000000000000000000000000000000000000..d74430ca5e4a8b7eba339432d6d729d10fefdfcc GIT binary patch literal 18204 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 T)z0&v00000NkvXXu0mjf`mni% literal 0 HcmV?d00001 diff --git a/UnitTests/CLabel/clabeltest.hxx b/UnitTests/CLabel/clabeltest.hxx index 2d404b2df..f7e13fdfb 100644 --- a/UnitTests/CLabel/clabeltest.hxx +++ b/UnitTests/CLabel/clabeltest.hxx @@ -68,7 +68,7 @@ #endif #ifndef CONFIG_CLABELTEST_BGCOLOR -# define CONFIG_CLABELTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CLABELTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_CLABELTEST_FONTCOLOR diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index ea6e7d662..d953c3e99 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CLatchButton/clatchbuttontest.hxx b/UnitTests/CLatchButton/clatchbuttontest.hxx index 22ded3d77..62405ac88 100644 --- a/UnitTests/CLatchButton/clatchbuttontest.hxx +++ b/UnitTests/CLatchButton/clatchbuttontest.hxx @@ -68,7 +68,7 @@ #endif #ifndef CONFIG_CLATCHBUTTONTEST_BGCOLOR -# define CONFIG_CLATCHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CLATCHBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_CLATCHBUTTONTEST_FONTCOLOR diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index faa9d8fd9..ddd44f8b3 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index 89ed242e7..f8642f089 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -68,7 +68,7 @@ #endif #ifndef CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR -# define CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 9f3d5721d..4f933ad98 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CListBox/clistboxtest.hxx b/UnitTests/CListBox/clistboxtest.hxx index 5cc356849..88e41f3bf 100644 --- a/UnitTests/CListBox/clistboxtest.hxx +++ b/UnitTests/CListBox/clistboxtest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CLISTBOXTEST_BGCOLOR -# define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 53d66fefa..a1e09ed57 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CProgressBar/cprogressbar.png b/UnitTests/CProgressBar/cprogressbar.png new file mode 100755 index 0000000000000000000000000000000000000000..321c4d6d9dbd8422f254534bd41a29c60c27b5c1 GIT binary patch literal 20469 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 XE-Yupb{U~3_<+amv;(Hr+AH~A=rAsn literal 0 HcmV?d00001 diff --git a/UnitTests/CProgressBar/cprogressbartest.hxx b/UnitTests/CProgressBar/cprogressbartest.hxx index f5058a0c4..99312cf8f 100644 --- a/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/UnitTests/CProgressBar/cprogressbartest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CPROGRESSBARTEST_BGCOLOR -# define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 0b4906dd8..f861326e9 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CRadioButton/cradiobutton.png b/UnitTests/CRadioButton/cradiobutton.png new file mode 100755 index 0000000000000000000000000000000000000000..058badd5d11287cfea595c443efb690c92f913cf GIT binary patch literal 32930 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

)SUT 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 Qq5uE@07*qoM6N<$g4HhtbpQYW literal 0 HcmV?d00001 diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index feae319d0..fac165033 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR -# define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index a2c404aad..ad7ae2a38 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CScrollbarVertical/cscrollbarvertical.png b/UnitTests/CScrollbarVertical/cscrollbarvertical.png new file mode 100755 index 0000000000000000000000000000000000000000..58067690dab9def17fe4d6b77c71a28d49abc747 GIT binary patch literal 31491 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 G3I2ZrK>dLL literal 0 HcmV?d00001 diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index 874a851fd..e6005ced9 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR -# define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index b496bdda7..0a86aaf5f 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CSliderHorizonal/csliderhorizontal.png b/UnitTests/CSliderHorizonal/csliderhorizontal.png new file mode 100755 index 0000000000000000000000000000000000000000..0b68a48c5b71591afbae647b5275f71187f461b8 GIT binary patch literal 21590 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 literal 0 HcmV?d00001 diff --git a/UnitTests/CSliderVertical/csliderverticaltest.hxx b/UnitTests/CSliderVertical/csliderverticaltest.hxx index e8d506db9..a0d3df801 100644 --- a/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -66,7 +66,7 @@ #endif #ifndef CONFIG_CSLIDERVERTICALTEST_BGCOLOR -# define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif // What is the entry point called? diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index 3fe0fa43e..bd7d98491 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -41,7 +41,7 @@ include $(APPDIR)/Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../NXWidgets/libnxwidgets" +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" @@ -56,7 +56,7 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../tools" +TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh # Hello, World! C++ Example diff --git a/UnitTests/CTextBox/ctextbox.png b/UnitTests/CTextBox/ctextbox.png new file mode 100755 index 0000000000000000000000000000000000000000..4c9f76ae77d3a4b208d3ae8de21f2f8d246c9616 GIT binary patch literal 45575 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 B>zV)n literal 0 HcmV?d00001 diff --git a/UnitTests/CTextBox/ctextboxtest.hxx b/UnitTests/CTextBox/ctextboxtest.hxx index 2a839b06d..1d470a1a8 100644 --- a/UnitTests/CTextBox/ctextboxtest.hxx +++ b/UnitTests/CTextBox/ctextboxtest.hxx @@ -68,7 +68,7 @@ #endif #ifndef CONFIG_CTEXTBOXTEST_BGCOLOR -# define CONFIG_CTEXTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKCOLOR +# define CONFIG_CTEXTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_CTEXTBOXTEST_FONTCOLOR diff --git a/UnitTests/TestStatus.txt b/UnitTests/TestStatus.txt new file mode 100755 index 000000000..965f83ef7 --- /dev/null +++ b/UnitTests/TestStatus.txt @@ -0,0 +1,59 @@ +NxWidgets Test Status +===================== + +At this point, the NXWidgets GUI toolkit code complete but still not +completely tested. This is a list of testing issues that still need to be +addressed. + +The following Widgets have been have completed unit testing. The level of +unit testing is, however, superficial. Many features have not yet been +tested: + + - CLabel + - CTextBox + - CButton + - CButtonArray + - CKeypad + - CRadioButton (and CRadioButtonGoup) + - CGlyphButton + - CLatchButton (and CStickyButton) + - CLatchButtonArray (and CStickyButtonArray) + - CCheckBox + - CProgressBar + - CImage + - CSliderHorizontal (and CSliderHorizontalGrip) + - CSliderVertical (and CSliderVerticalGrip) + - CScrollBarHorizontal (except paging buttons) + - CScrollBarVertical (except paging buttons) + +The following components have unit test in place, but do not successfully +pass the test: + + - CListBox (and CListBoxDataItem) which also tests: + o CText + o CList and CListDataItem + o CScrollingPanel + +The following no unit tests (and, hence, are probably non-functional): + + Infrastructure (won't have their own unit tests) + - CScrollBarPanel + + Widgets that need unit tests: + - CCycleButton + - CScrollingTextBox + - CMultiLineTextBox + - CScrollingListBox + +There are things that require testing after all widgets complete their unit +tests as well. As examples: + + - Need to verify that a screen with many widgets works correctly. That + focus is correctly handled when widgets are removed. etc. + - Need to verify that widget with many children work correctly together. + - Need to verfiy that a display with many windows with multiple wigets + per window works okay. + +Most unit-level testing was performed in a simulated environment driven by +simulated mouse and keyboard input. So many features are not tested that +require human interaction ... such grabbing and dragging scrollbars. diff --git a/UnitTests/tools/addobjs.sh b/tools/addobjs.sh similarity index 97% rename from UnitTests/tools/addobjs.sh rename to tools/addobjs.sh index e998cfc64..5ccb289c5 100755 --- a/UnitTests/tools/addobjs.sh +++ b/tools/addobjs.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################# -# NxWidgets/UnitTests/tools/addobjs.sh +# NxWidgets/tools/addobjs.sh # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -62,7 +62,7 @@ while [ ! -z "$1" ]; do echo $usage echo "" echo "Where:" - echo " is the full, absolute path to the library to use" + echo " is the full, absolute path to the library to use" echo " is full path to the directory containing the object files to be added" echo "OPTIONS include:" echo " -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-'" diff --git a/tools/indent.sh b/tools/indent.sh new file mode 100755 index 000000000..e763cff37 --- /dev/null +++ b/tools/indent.sh @@ -0,0 +1,45 @@ +#!/bin/sh +################################################################################# +# NxWidgets/tools/install.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# +# +# This script uses the Linux 'indent' utility to re-format C source files +# to match the coding style that I use. It differs from my coding style in that +# +# - I normally put the traiing */ of a multi-line comment on a separate line, +# - I usually align things vertically (like '='in assignments. +# + +indent -nbad -bap -bbb -nbbo -nbc -bl -bl2 -bls -nbs -cbi2 -ncdw -nce -ci2 -cli0 -cp40 -ncs -nbfda -nbfde -di1 -nfc1 -fca -i2 -l80 -lp -ppi2 -lps -npcs -pmt -nprs -npsl -saf -sai -sbi2 -saw -sc -sob -nss -nut "$@" + diff --git a/UnitTests/tools/install.sh b/tools/install.sh similarity index 95% rename from UnitTests/tools/install.sh rename to tools/install.sh index 3ba086aff..6917b4b03 100755 --- a/UnitTests/tools/install.sh +++ b/tools/install.sh @@ -1,6 +1,6 @@ #!/bin/bash ################################################################################# -# NxWidgets/UnitTests/tools/install.sh +# NxWidgets/tools/install.sh # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -81,14 +81,14 @@ fi WD=`pwd` if [ -x install.sh ]; then - UNITTEST_DIRPATH="${WD}/.." + UNITTEST_DIRPATH="${WD}/../UnitTests" TOOLS_DIRPATH="${WD}" else if [ -x tools/install.sh ]; then - UNITTEST_DIRPATH="${WD}" + UNITTEST_DIRPATH="${WD}/UnitTests" TOOLS_DIRPATH="${WD}/tools" else - echo "This script must be executed in the UnitTest or UnitTest/tools directory" + echo "This script must be executed in the NxWidgets or NxWidgets/tools directory" ShowUsage exit 1 fi diff --git a/tools/zipme.sh b/tools/zipme.sh new file mode 100755 index 000000000..a77748c3b --- /dev/null +++ b/tools/zipme.sh @@ -0,0 +1,125 @@ +#!/bin/bash +################################################################################# +# NxWidgets/tools/zipme.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +#set -x + +WD=`pwd` +VERSION=$1 + +TAR="tar cvf" +ZIP=gzip + +# Make sure we know what is going on + +if [ -z ${VERSION} ] ; then + echo "You must supply a version like xx.yy as a parameter" + exit 1; +fi + +# Find the directory we were executed from and were we expect to +# see the directory to tar up + +MYNAME=`basename $0` + +if [ -x ${WD}/${MYNAME} ] ; then + NXWIDGETS=`dirname ${WD}` +else + if [ -x ${WD}/tools/${MYNAME} ] ; then + NXWIDGETS=${WD} + else + echo "You must cd into the NxWidgets or NxWidgets/tools directory to execute this script." + exit 1 + fi +fi + +# Get the NxWidgets directory name and the path to the parent directory + +NXWIDGETSDIR=`basename ${NXWIDGETS}` +PROJECTS=`dirname ${NXWIDGETS}` + +# The name of the directory must match the version number + +if [ "X${NXWIDGETSDIR}" != "Xupthreads-${VERSION}" ]; then + echo "Expected directory name to be NxWidgets-${VERSION} found ${NXWIDGETSDIR}" + exit 1 +fi + +cd ${PROJECTS} || \ + { echo "Failed to cd to ${PROJECTS}" ; exit 1 ; } + +if [ ! -d ${NXWIDGETSDIR} ] ; then + echo "${PROJECTS}/${NXWIDGETSDIR} does not exist!" + exit 1 +fi + +TAR_NAME=NxWidgets-${VERSION}.tar +ZIP_NAME=${TAR_NAME}.gz + +# Prepare the NxWidgets directory -- Remove editor garbage + +find ${NXWIDGETSDIR} -name '*~' -exec rm -f '{}' ';' || \ + { echo "Removal of emacs garbage failed!" ; exit 1 ; } + +find ${NXWIDGETSDIR} -name '#*' -exec rm -f '{}' ';' || \ + { echo "Removal of VI garbage failed!" ; exit 1 ; } + +find ${NXWIDGETSDIR} -name '*.swp' -exec rm -f '{}' ';' || \ + { echo "Removal of VI garbage failed!" ; exit 1 ; } + +# Perform a full clean for the distribution + +make -C ${NXWIDGETSDIR} distclean + +# Remove any previous tarballs + +if [ -f ${TAR_NAME} ] ; then + echo "Removing ${PROJECTS}/${TAR_NAME}" + rm -f ${TAR_NAME} || \ + { echo "rm ${TAR_NAME} failed!" ; exit 1 ; } +fi + +if [ -f ${ZIP_NAME} ] ; then + echo "Removing ${PROJECTS}/${ZIP_NAME}" + rm -f ${ZIP_NAME} || \ + { echo "rm ${ZIP_NAME} failed!" ; exit 1 ; } +fi + +# Then zip it + +${TAR} ${TAR_NAME} ${NXWIDGETSDIR} || \ + { echo "tar of ${NXWIDGETSDIR} failed!" ; exit 1 ; } +${ZIP} ${TAR_NAME} || \ + { echo "zip of ${TAR_NAME} failed!" ; exit 1 ; } From ac9766cb016a3684611bb3aa66d9f72b4ecfce84 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Mar 2012 22:51:53 +0000 Subject: [PATCH 003/390] NxWidgets ready for first release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4507 42af7a65-404d-4744-a932-0658087f49c3 --- tools/zipme.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/zipme.sh b/tools/zipme.sh index a77748c3b..ae62d64f9 100755 --- a/tools/zipme.sh +++ b/tools/zipme.sh @@ -72,7 +72,7 @@ PROJECTS=`dirname ${NXWIDGETS}` # The name of the directory must match the version number -if [ "X${NXWIDGETSDIR}" != "Xupthreads-${VERSION}" ]; then +if [ "X${NXWIDGETSDIR}" != "XNxWidgets-${VERSION}" ]; then echo "Expected directory name to be NxWidgets-${VERSION} found ${NXWIDGETSDIR}" exit 1 fi From cbf0f054f17b9ef2781ecd9b7ba3578b88dd636b Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Mar 2012 15:01:22 +0000 Subject: [PATCH 004/390] Update NxWidgets Doxygen support git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4527 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++ Doxygen/README.txt | 31 ++++++++++++++++++----- libnxwidgets/doc/mainpage.h | 50 +++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 libnxwidgets/doc/mainpage.h diff --git a/ChangeLog.txt b/ChangeLog.txt index 5a2806fcd..c9c1bc8a5 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,3 +3,7 @@ * The initial release of the NxWidgets package 1.1 2012-xx-xx Gregory Nutt + +* Updated and verified the NxWidgets DOxygen documentation. Contributed + by Jose Pablo Carballo. + diff --git a/Doxygen/README.txt b/Doxygen/README.txt index 4546d4903..26d76ce4b 100644 --- a/Doxygen/README.txt +++ b/Doxygen/README.txt @@ -8,6 +8,7 @@ Contents o Installing the necessary packages in Ubuntu o Generating documentation + o References Installing the necessary packages in Ubuntu =========================================== @@ -16,13 +17,13 @@ Installing the necessary packages in Ubuntu $ sudo aptitude install doxygen doxygen-doc doxygen-gui dot2tex graphviz -2. (Optional) Install from the latest sourcode. +2. (Optional) Install Doxygen from the latest sourcode. - The Ubuntu package is outdated. The newer the version of Doxygen, the cooler + The Ubuntu package is outdated. The newer the version of Doxygen, the better the documentation looks. Place yourself in some temporary folder where you can download the source, - and run (http://www.stack.nl/~dimitri/doxygen/download.html): + and run [1]: $ svn co https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk doxygen-svn $ cd doxygen-svn @@ -33,13 +34,31 @@ Installing the necessary packages in Ubuntu Generating documentation ======================== -1. Position the shell into this folder: +Two ways described here: - misc/NXWidgets/Doxygen +1. Use the provided gendoc.sh script. + + trunk/NXWidgets/Doxygen/gendoc.sh + + The script only needs the argument to the absolute path where to place the + generated documentation. I.e.: + + $ cd /path/to/nuttx/trunk/NXWidgets/Doxygen/ + $ mkdir doc + $ ./gendoc.sh $PWD/doc + + +2. Using the Doxyfile directly: The file "Doxyfile" contains the configuration of the Doxygen settings for the run, edit only if necessary. To generate the documentation type: - $ doxygen Doxyfile + $ cd /path/to/nuttx/trunk/NXWidgets/Doxygen/ + $ doxygen Doxyfile + +References +========== + +[1] http://www.stack.nl/~dimitri/doxygen/download.html diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h new file mode 100644 index 000000000..9eb5ded83 --- /dev/null +++ b/libnxwidgets/doc/mainpage.h @@ -0,0 +1,50 @@ +/*! \mainpage NXWidgets Documentation + * + * In order to better support NuttX based platforms, a special graphical user + * interface has been created called NXWidgets. NXWidgets is written in C++ + * and integrates seamlessly with the NuttX NX graphics subystem in order to + * provide graphic objects, or "widgets", in the + * NX Graphics Subsystem. + * + * \section feature Features + * + * \subsection conservative_cxx Conservative C++ + * + * Written entirely in C++ but using only selected "embedded + * friendly" C++ constructs that are fully supported under NuttX. No + * additional C++ support libraries are required. + * + * \subsection nx_integration NX Integration + * + * Integrates seamlessly with the NX graphics subsytem. Think of the X + * server under Linux... the NX graphics subsystem is like a tiny X server + * that provides windowing under NuttX. By adding NXWidgets, you can + * support graphic objects like buttons and text boxes in the NX windows + * and toolbars. + * + * \subsection small_footprint Small Footprint + * + * Tailored for use MCUs in embedded applications. It is ideally suited for + * mid- and upper-range of most MCU families. A complete NXWidgets is + * possible in as little as 40Kb of FLASH and maybe 4Kb of SRAM. + * + * \subsection output_devices Output Devices + * + * NXWidgets will work on the high-end fram buffer devices as well as on + * LCDs connected via serial or parallel port to a small MCU. + * + * \subsection input_devices Input Devices + * + * NXWidgets will accept position and selection inputs from a mouse or a + * touchscreen. It will also support character input from a keyboard such + * as a USB keyboard. NXWidgets supports a very special widget called + * CKeypad that will provide keyboard input via on-screen keypad that can + * be operated via mouse or touchscreen inputs. + * + * \subsection many_graphic_objects Many Graphic Objects\ + * + * Some of the graphic objects supported by NXWidgets include labels, + * buttons, text boxes, button arrays, check boxes, cycle buttons, images, + * sliders, scrollable list boxes, progress bars, and more. + */ From 26382eddca53cd7ba6fe9629d98a97cc4240922f Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 28 Apr 2012 14:25:16 +0000 Subject: [PATCH 005/390] Update to README and comments git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4668 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/README.txt | 8 ++++---- libnxwidgets/include/cimage.hxx | 2 +- libnxwidgets/src/cimage.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index b0f3c9aab..2360e2425 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -115,7 +115,7 @@ Installing and Building the Unit Tests Then reconfigure that to use the Unit Test of your choice: - cd /trunk/UnitTests/tools + cd /trunk/UnitTests/tools ./install.sh Where: @@ -144,7 +144,7 @@ Installing and Building the Unit Tests 5. Build the NXWidgets Library - cd /trunk/NXWidgets/libnxwidgets + cd /trunk/NXWidgets/libnxwidgets make TOPDIR= 6. Build NuttX including the unit test and the NXWidget library @@ -289,7 +289,7 @@ Example /home/patacongo/projects/nuttx/nuttx/trunk/apps//external already exists... Removing the old symbolic link. Creating symbolic link - - To /home/patacongo/projects/nuttx/gui/raztek-nxwidgets/trunk/UnitTests/tools/../CButton + - To /home/patacongo/projects/nuttx/nuttx/trunk/NxWidgets/UnitTests/CButton - At /home/patacongo/projects/nuttx/nuttx/trunk/apps//external 4. Instantiate the Configuration @@ -311,7 +311,7 @@ Example 7. Build the NXWdigets Library Where XWidgets/trunk/NXWidgets/libnxwidgets - $ cd /home/patacongo/projects/nuttx/gui/raztek-nxwidgets/trunkXWidgets/libnxwidgets + $ cd /home/patacongo/projects/nuttx/nuttx/trunk/NxWidgets/libnxwidgets $ make TOPDIR=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx 8. Build NuttX diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index fa87b3f9c..47f4d557f 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -141,7 +141,7 @@ namespace NXWidgets public: /** - * Constructor for a label containing a string. + * Constructor for an image. * * @param pWidgetControl The controlling widget for the display * @param x The x coordinate of the image box, relative to its parent. diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index b57857e66..5e46b801b 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -168,7 +168,7 @@ void CImage::drawContents(CGraphicsPort *port) FAR nxwidget_pixel_t *buffer = new nxwidget_pixel_t[rect.getWidth()]; - // Set up a simple bitmap structure to describe on row + // Set up a simple bitmap structure to describe one row struct SBitmap bitmap; bitmap.bpp = m_bitmap->getBitsPerPixel(); From beb26c73167a26a72e0616427acfeff8d494e5a6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 28 Apr 2012 17:36:53 +0000 Subject: [PATCH 006/390] A few pieces of what may become an NX window manager git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4669 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 24 +-- UnitTests/README.txt | 10 +- libnxwidgets/include/cbitmap.hxx | 9 ++ libnxwidgets/include/cbuttonarray.hxx | 2 +- libnxwidgets/include/cimage.hxx | 16 +- libnxwidgets/include/crlepalettebitmap.hxx | 14 +- libnxwidgets/include/ibitmap.hxx | 11 +- libnxwidgets/src/cimage.cxx | 64 ++++++-- libnxwidgets/src/crlepalettebitmap.cxx | 17 +- libnxwidgets/src/glyph_nxlogo.cxx | 5 +- nxwm/images/nxconsole.gif | Bin 0 -> 131 bytes nxwm/include/cnxconsole.hxx | 98 +++++++++++ nxwm/include/inxapplication.hxx | 76 +++++++++ nxwm/include/nxwmconfig.hxx | 84 ++++++++++ nxwm/src/snxconsole.cxx | 180 +++++++++++++++++++++ 15 files changed, 578 insertions(+), 32 deletions(-) create mode 100644 nxwm/images/nxconsole.gif create mode 100644 nxwm/include/cnxconsole.hxx create mode 100644 nxwm/include/inxapplication.hxx create mode 100644 nxwm/include/nxwmconfig.hxx create mode 100644 nxwm/src/snxconsole.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index c9c1bc8a5..8064137e0 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,9 +1,15 @@ -1.0 2012-03-22 Gregory Nutt - -* The initial release of the NxWidgets package - -1.1 2012-xx-xx Gregory Nutt - -* Updated and verified the NxWidgets DOxygen documentation. Contributed - by Jose Pablo Carballo. - +1.0 2012-03-22 Gregory Nutt + +* The initial release of the NxWidgets package + +1.1 2012-xx-xx Gregory Nutt + +* Updated and verified the NxWidgets DOxygen documentation. Contributed + by Jose Pablo Carballo. +* IBitmap, CRlePalettBitmap: Extended class to support differnt LUTs + for selected and non-selected images. +* CImage: If selected, uses different LUTs based, different borders. + CImage is now basically a button type. +* CImage: Add logic to hightlight an CImage (using the selected LUT). +* nxwm: This directory will, hopefully, eventually hold the NX tiny + desktop (NxWM). diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 2360e2425..8534efb9d 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -115,7 +115,7 @@ Installing and Building the Unit Tests Then reconfigure that to use the Unit Test of your choice: - cd /trunk/UnitTests/tools + cd /tools ./install.sh Where: @@ -144,10 +144,10 @@ Installing and Building the Unit Tests 5. Build the NXWidgets Library - cd /trunk/NXWidgets/libnxwidgets + cd /libnxwidgets make TOPDIR= -6. Build NuttX including the unit test and the NXWidget library +6. Build NuttX including the unit test and the NXWidgets library cd . ./setenv.sh @@ -283,7 +283,7 @@ Example Do nothing... sim/nsh2 already has C++ support enabled. 3. Install the CButton C++ application (for example) - Where: NXWidgets/trunk/UnitTests/tool + Where: /tool $ ./install.sh ~/projects/nuttx/nuttx/trunk/apps/ CButton /home/patacongo/projects/nuttx/nuttx/trunk/apps//external already exists... @@ -309,7 +309,7 @@ Example of unit test stack as described above under "Stack Size Issues." 7. Build the NXWdigets Library - Where XWidgets/trunk/NXWidgets/libnxwidgets + Where /libnxwidgets $ cd /home/patacongo/projects/nuttx/nuttx/trunk/NxWidgets/libnxwidgets $ make TOPDIR=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx diff --git a/libnxwidgets/include/cbitmap.hxx b/libnxwidgets/include/cbitmap.hxx index 473403aa8..4828ca9cc 100644 --- a/libnxwidgets/include/cbitmap.hxx +++ b/libnxwidgets/include/cbitmap.hxx @@ -181,6 +181,15 @@ namespace NXWidgets const nxgl_coord_t getStride(void) const; + /** + * Use the colors associated with a selected image. + * + * @param selected. true: Use colors for a selected widget, + * false: Use normal (default) colors. + */ + + inline void setSelected(bool selected) {} + /** * Get one row from the bit map image. * diff --git a/libnxwidgets/include/cbuttonarray.hxx b/libnxwidgets/include/cbuttonarray.hxx index d5f8be449..487a6cb9f 100644 --- a/libnxwidgets/include/cbuttonarray.hxx +++ b/libnxwidgets/include/cbuttonarray.hxx @@ -80,7 +80,7 @@ namespace NXWidgets uint8_t m_buttonColumns; /**< The number of columns in one row */ uint8_t m_buttonRows; /**< The number buttons in one column */ bool m_redrawButton; /**< True: Redraw button; False: redraw all */ - bool m_cursorOn; /**< Cursor on; hightlighted button displayed */ + bool m_cursorOn; /**< Cursor on; highlighted button displayed */ bool m_cursorChange; /**< True: Redraw cursor button only */ nxgl_coord_t m_buttonWidth; /**< The width of one button in pixels */ nxgl_coord_t m_buttonHeight; /**< The height of one button in rows */ diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 47f4d557f..a1c282393 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -109,8 +109,9 @@ namespace NXWidgets class CImage : public CNxWidget { protected: - FAR IBitmap *m_bitmap; /**< Source bitmap image */ - struct nxgl_point_s m_origin; /**< Origin for offset image display position */ + FAR IBitmap *m_bitmap; /**< Source bitmap image */ + struct nxgl_point_s m_origin; /**< Origin for offset image display position */ + bool m_highlighted; /**< Image is highlighted */ /** * Draw the area of this widget that falls within the clipping region. @@ -191,6 +192,17 @@ namespace NXWidgets */ void setImageTop(nxgl_coord_t row); + + /** + * Control the highlight state. + * + * @param highlightOn True(1), the image will be highlighted + */ + + inline void highlight(bool highlightOn) + { + m_highlighted = highlightOn; + } }; } diff --git a/libnxwidgets/include/crlepalettebitmap.hxx b/libnxwidgets/include/crlepalettebitmap.hxx index 2b1e4f065..451b472f4 100644 --- a/libnxwidgets/include/crlepalettebitmap.hxx +++ b/libnxwidgets/include/crlepalettebitmap.hxx @@ -84,7 +84,7 @@ namespace NXWidgets uint8_t nlut; /**< Number of colors in the Look-Up Table (LUT) */ nxgl_coord_t width; /**< Width in pixels */ nxgl_coord_t height; /**< Height in rows */ - FAR const void *lut; /**< Pointer to the beginning of the Look-Up Table (LUT) */ + FAR const void *lut[2]; /**< Pointers to the beginning of the Look-Up Tables (LUTs) */ /** * The pointer to the beginning of the RLE data @@ -113,6 +113,7 @@ namespace NXWidgets nxgl_coord_t m_row; /**< Logical row number */ nxgl_coord_t m_col; /**< Logical column number */ uint8_t m_remaining; /**< Number of bytes remaining in current entry */ + FAR const void *m_lut; /**< The selected LUT */ FAR const struct SRlePaletteBitmapEntry *m_rle; /**< RLE entry being processed */ /** @@ -237,7 +238,16 @@ namespace NXWidgets const nxgl_coord_t getStride(void) const; /** - * Get one row from the bit map image. + * Use the colors associated with a selected image. + * + * @param selected. true: Use colors for a selected widget, + * false: Use normal (default) colors. + */ + + void setSelected(bool selected); + + /** + * Get one row from the bit map image using the selected colors. * * @param x The offset into the row to get * @param y The row number to get diff --git a/libnxwidgets/include/ibitmap.hxx b/libnxwidgets/include/ibitmap.hxx index c4bb3b5ac..5eaa5b3c9 100644 --- a/libnxwidgets/include/ibitmap.hxx +++ b/libnxwidgets/include/ibitmap.hxx @@ -143,7 +143,16 @@ namespace NXWidgets virtual const nxgl_coord_t getStride(void) const = 0; /** - * Get one row from the bit map image. + * Use the colors associated with a selected image. + * + * @param selected. true: Use colors for a selected widget, + * false: Use normal (default) colors. + */ + + virtual void setSelected(bool selected) = 0; + + /** + * Get one row from the bit map image using the selected colors. * * @param x The offset into the row to get * @param y The row number to get diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 5e46b801b..c905737fd 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -156,7 +156,7 @@ void CImage::getPreferredDimensions(CRect &rect) const * @param port The CGraphicsPort to draw to. * @see redraw() */ - + void CImage::drawContents(CGraphicsPort *port) { // Get the the drawable region @@ -178,6 +178,10 @@ void CImage::drawContents(CGraphicsPort *port) bitmap.stride = (rect.getWidth() * m_bitmap->getBitsPerPixel()) >> 3; bitmap.data = buffer; + // Select the correct colorization + + m_bitmap->setSelected(isClicked() || m_highlighted); + // This is the number of rows that we can draw at the top of the display nxgl_coord_t nTopRows = m_bitmap->getHeight() - m_origin.y; @@ -261,12 +265,21 @@ void CImage::drawContents(CGraphicsPort *port) // And put these on the display - port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, - &bitmap, 0, 0); + if (isEnabled()) + { + port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, + &bitmap, 0, 0); + } + else + { + port->drawBitmapGreyScale(rect.getX(),displayRow, + rect.getWidth(), 1, + &bitmap, 0, 0); + } } } - // Are we going to draw any rows at the top of the display? + // Are we going to draw any rows at the bottom of the display? if (nTopRows < rect.getHeight()) { @@ -286,8 +299,18 @@ void CImage::drawContents(CGraphicsPort *port) { // Put the padded row on the display - port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, - &bitmap, 0, 0); + if (isEnabled()) + { + port->drawBitmap(rect.getX(), displayRow, + rect.getWidth(), 1, + &bitmap, 0, 0); + } + else + { + port->drawBitmapGreyScale(rect.getX(),displayRow, + rect.getWidth(), 1, + &bitmap, 0, 0); + } } } @@ -304,11 +327,34 @@ void CImage::drawContents(CGraphicsPort *port) void CImage::drawBorder(CGraphicsPort *port) { - if (!isBorderless()) + // Stop drawing if the widget indicates it should not have an outline + + if (isBorderless()) { - port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), - getShadowEdgeColor(), getShineEdgeColor()); + return; } + + // Work out which colors to use + + nxgl_coord_t color1; + nxgl_coord_t color2; + + if (isClicked()) + { + // Bevelled into the screen + + color1 = getShadowEdgeColor(); + color2 = getShineEdgeColor(); + } + else + { + // Bevelled out of the screen + + color1 = getShineEdgeColor(); + color2 = getShadowEdgeColor(); + } + + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } /** diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 25e9473ed..79a614349 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -101,6 +101,7 @@ using namespace NXWidgets; CRlePaletteBitmap::CRlePaletteBitmap(const struct SRlePaletteBitmap *bitmap) { m_bitmap = bitmap; + m_lut = bitmap->lut[0]; startOfImage(); } @@ -162,7 +163,19 @@ const nxgl_coord_t CRlePaletteBitmap::getStride(void) const } /** - * Get one row from the bit map image. + * Use the colors associated with a selected image. + * + * @param selected. true: Use colors for a selected widget, + * false: Use normal (default) colors. + */ + +void CRlePaletteBitmap::setSelected(bool selected) +{ + m_lut = m_bitmap->lut[selected ? 1 : 0]; +} + +/** + * Get one row from the bit map image using the selected LUT. * * @param x The offset into the row to get * @param y The row number to get @@ -337,7 +350,7 @@ void CRlePaletteBitmap::copyColor(nxgl_coord_t npixels, FAR void *data) { // Right now, only a single pixel depth is supported - nxwidget_pixel_t *nxlut = (nxwidget_pixel_t *)m_bitmap->lut; + nxwidget_pixel_t *nxlut = (nxwidget_pixel_t *)m_lut; nxwidget_pixel_t color = nxlut[m_rle->lookup]; // Copy the requested pixels diff --git a/libnxwidgets/src/glyph_nxlogo.cxx b/libnxwidgets/src/glyph_nxlogo.cxx index 1b3aab143..5f1bd7dbf 100644 --- a/libnxwidgets/src/glyph_nxlogo.cxx +++ b/libnxwidgets/src/glyph_nxlogo.cxx @@ -3445,6 +3445,9 @@ const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap = BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) 160, // width - Width in pixels 160, // height - Height in rows - g_nuttxLut, // lut - Pointer to the beginning of the Look-Up Table (LUT) + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nuttxLut, // Index 0: Unselected LUT + g_nuttxLut, // Index 1: Selected LUT + }, g_nuttxRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/images/nxconsole.gif b/nxwm/images/nxconsole.gif new file mode 100644 index 0000000000000000000000000000000000000000..acb56754bb4a196700e919f323605ff25a5f5699 GIT binary patch literal 131 zcmZ?wbhEHblw^=%XkcUjg8%>j>wsvG2m@16Pd_8~%X=c-9~INm)`gwk+IUSoNJ(Ux zd}-qiuKjY$PCmMFq3YkUcez#*RSwG=l&ak7St2iV{fTC;@k-$nyM0BEEbMxVEfSOWld$u|oC literal 0 HcmV?d00001 diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx new file mode 100644 index 000000000..eb76ba10b --- /dev/null +++ b/nxwm/include/cnxconsole.hxx @@ -0,0 +1,98 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cnxconsole.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXCONSOLE_NXX +#define __INCLUDE_CNXCONSOLE_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "crlepalettebitmap.hxx" +#include "cnxapplication.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Bitmap Glyph References + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + extern const struct NxWidgets::SRlePaletteBitmap g_nshBitmap; + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + + /** + * This class implements the NxConsole application. + */ + + class CNxConsole : public CNxApplication + { + public: + /** + * CNxConsole constructor + */ + + CNxConsole(void); + + /** + * CNxConsole destructor + */ + + ~CNxConsole(void); + + /** + * Get the icon associated with the application + * + * @return An instance if INxBitmap that may be used to rend the + * application's icon. This is an new INxBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::INxBitmap *getIcon(void); + }; +} +#endif // __cplusplus + +#endif // __INCLUDE_CNXCONSOLE_NXX diff --git a/nxwm/include/inxapplication.hxx b/nxwm/include/inxapplication.hxx new file mode 100644 index 000000000..367ba871f --- /dev/null +++ b/nxwm/include/inxapplication.hxx @@ -0,0 +1,76 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/inxapplication.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_INXAPPLICATION_NXX +#define __INCLUDE_INXAPPLICATION_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "ibitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + class INxApplication + { + public: + /** + * Get the icon associated with the application + * + * @return An instance if INxBitmap that may be used to rend the + * application's icon. This is an new INxBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + virtual NXWidgets::INxBitmap *getIcon(void) = 0; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_INXAPPLICATION_NXX diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx new file mode 100644 index 000000000..18b35d83a --- /dev/null +++ b/nxwm/include/nxwmconfig.hxx @@ -0,0 +1,84 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/nxwmconfig.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_NXWM_CONFIG_HXX +#define __INCLUDE_NXWM_CONFIG_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/** + * Normal background color + */ + +#ifndef CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR +#endif + +/** + * Default selected background color + */ + +#ifndef CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR +#endif + +/** + * Default foreground color + */ + +#ifndef CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR MKRGB(192,192,192) +#endif + +/** + * Default selected forecround color + */ + +#ifndef CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248) +#endif + + +#endif // __INCLUDE_NXWM_CONFIG_HXX diff --git a/nxwm/src/snxconsole.cxx b/nxwm/src/snxconsole.cxx new file mode 100644 index 000000000..34912933e --- /dev/null +++ b/nxwm/src/snxconsole.cxx @@ -0,0 +1,180 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/snxconsole.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxwmconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "cnxconsole.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 26 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 2 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_nshNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR +}; + +static const uint32_t g_nshSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_nshNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR +}; + +static const uint16_t g_nshSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 + +/* RGB8 (332) Colors or 8-bit greyscale */ + +static const nxgl_mxpixel_t g_nshNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR +}; + +static const nxgl_mxpixel_t g_nshSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR +}; + +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_nshRleEntries[] = +{ + {11, 0}, {4, 1}, {10, 0}, /* Row 0 */ + {7, 0}, {1, 1}, {2, 0}, {5, 1}, {2, 0}, {1, 1}, {7, 0}, /* Row 1 */ + {6, 0}, {3, 1}, {2, 0}, {4, 1}, {2, 0}, {2, 1}, {6, 0}, /* Row 2 */ + {5, 0}, {4, 1}, {2, 0}, {4, 1}, {2, 0}, {4, 1}, {4, 0}, /* Row 3 */ + {6, 0}, {3, 1}, {2, 0}, {4, 1}, {2, 0}, {3, 1}, {5, 0}, /* Row 4 */ + {3, 0}, {1, 1}, {2, 0}, {3, 1}, {2, 0}, {4, 1}, {1, 0}, {4, 1}, /* Row 5 */ + {2, 0}, {1, 1}, {2, 0}, + {2, 0}, {3, 1}, {1, 0}, {3, 1}, {2, 0}, {4, 1}, {1, 0}, {4, 1}, /* Row 6 */ + {1, 0}, {3, 1}, {1, 0}, + {1, 0}, {4, 1}, {2, 0}, {3, 1}, {1, 0}, {4, 1}, {1, 0}, {3, 1}, /* Row 7 */ + {2, 0}, {3, 1}, {1, 0}, + {1, 0}, {5, 1}, {1, 0}, {3, 1}, {1, 0}, {4, 1}, {1, 0}, {3, 1}, /* Row 8 */ + {1, 0}, {4, 1}, {1, 0}, + {2, 0}, {4, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, {2, 0}, {2, 1}, /* Row 9 */ + {2, 0}, {4, 1}, {1, 0}, + {3, 0}, {3, 1}, {2, 0}, {2, 1}, {1, 0}, {3, 1}, {2, 0}, {2, 1}, /* Row 10 */ + {1, 0}, {4, 1}, {2, 0}, + {2, 1}, {2, 0}, {3, 1}, {1, 0}, {2, 1}, {2, 0}, {2, 1}, {2, 0}, /* Row 11 */ + {2, 1}, {1, 0}, {3, 1}, {2, 0}, {1, 1}, + {3, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 12 */ + {2, 1}, {2, 0}, {3, 1}, {1, 0}, {2, 1}, + {4, 1}, {1, 0}, {3, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 13 */ + {2, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, + {4, 1}, {2, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 14 */ + {2, 1}, {1, 0}, {2, 1}, {2, 0}, {3, 1}, + {1, 0}, {4, 1}, {2, 0}, {1, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, /* Row 15 */ + {1, 0}, {1, 1}, {1, 0}, {2, 1}, {2, 0}, {3, 1}, {1, 0}, + {2, 0}, {4, 1}, {1, 0}, {2, 1}, {1, 0}, {1, 1}, {1, 0}, {2, 1}, /* Row 16 */ + {1, 0}, {1, 1}, {1, 0}, {2, 1}, {1, 0}, {4, 1}, {1, 0}, + {3, 0}, {4, 1}, {1, 0}, {1, 1}, {1, 0}, {1, 1}, {1, 0}, {6, 1}, /* Row 17 */ + {1, 0}, {4, 1}, {2, 0}, + {5, 0}, {2, 1}, {1, 0}, {9, 1}, {1, 0}, {3, 1}, {4, 0}, /* Row 18 */ + {6, 0}, {14, 1}, {5, 0}, /* Row 19 */ + {5, 0}, {16, 1}, {4, 0}, /* Row 20 */ + {4, 0}, {18, 1}, {3, 0}, /* Row 21 */ + {4, 0}, {18, 1}, {3, 0}, /* Row 22 */ + {4, 0}, {18, 1}, {3, 0}, /* Row 23 */ + {4, 0}, {18, 1}, {3, 0}, /* Row 24 */ + {5, 0}, {16, 1}, {4, 0}, /* Row 25 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct SRlePaletteBitmap NxWM::g_nshBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nshNormalLut, // Index 0: Unselected LUT + g_nshSelectedLut, // Index 1: Selected LUT + }, + g_nshRleEntries // data - Pointer to the beginning of the RLE data +}; From f566d87e5b7f4585833f943818b02e52266aadb8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 28 Apr 2012 22:46:36 +0000 Subject: [PATCH 007/390] More NX window manager pieces git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4670 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/include/cnxbackimage.hxx | 88 +++++++++ nxwm/include/cnxconsole.hxx | 18 +- nxwm/include/cnxstart.hxx | 102 ++++++++++ nxwm/include/cnxtaskbar.hxx | 201 +++++++++++++++++++ nxwm/include/inxapplication.hxx | 8 +- nxwm/src/cnxconsole.cxx | 76 +++++++ nxwm/src/cnxtaskbar.cxx | 339 ++++++++++++++++++++++++++++++++ 7 files changed, 823 insertions(+), 9 deletions(-) create mode 100644 nxwm/include/cnxbackimage.hxx create mode 100644 nxwm/include/cnxstart.hxx create mode 100644 nxwm/include/cnxtaskbar.hxx create mode 100644 nxwm/src/cnxconsole.cxx create mode 100644 nxwm/src/cnxtaskbar.cxx diff --git a/nxwm/include/cnxbackimage.hxx b/nxwm/include/cnxbackimage.hxx new file mode 100644 index 000000000..903a4880d --- /dev/null +++ b/nxwm/include/cnxbackimage.hxx @@ -0,0 +1,88 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cnxbackimage.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __NXWM_INCLUDE_CNXBACKIMAGE_HXX +#define __NXWM_INCLUDE_CNXBACKIMAGE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Class Definition + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This class describes the NX windo manager's background image. + */ + + class CNxBackImage : public NxWidgets::CImage + { + private: + NxWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window + + public: + /** + * CNxBackImage Constructor + */ + + CNxBackImage(void); + + /** + * CNxBackImage Destructor + */ + + ~CNxBackImage(void); + }; +} + +#endif // __cplusplus +#endif // __NXWM_INCLUDE_CNXBACKIMAGE_HXX diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index eb76ba10b..793a46849 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -43,6 +43,7 @@ #include #include "crlepalettebitmap.hxx" +#include "inxwindow.hxx" #include "cnxapplication.hxx" /**************************************************************************** @@ -69,19 +70,22 @@ namespace NxWM class CNxConsole : public CNxApplication { - public: - /** - * CNxConsole constructor - */ - - CNxConsole(void); - + protected: /** * CNxConsole destructor */ ~CNxConsole(void); + public: + /** + * CNxConsole constructor + * + * @param window. The application window + */ + + CNxConsole(NXWidgets::INxWindow *window); + /** * Get the icon associated with the application * diff --git a/nxwm/include/cnxstart.hxx b/nxwm/include/cnxstart.hxx new file mode 100644 index 000000000..42ea67b35 --- /dev/null +++ b/nxwm/include/cnxstart.hxx @@ -0,0 +1,102 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cnxstart.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CNXSTART_NXX +#define __INCLUDE_CNXSTART_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "cnxapplication.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + class CNxStart : public INxApplication + { + protected: + CNxTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + + /** + * CNxStart Constructor + */ + + ~CNxStart(void); + + public: + + /** + * CNxStart Constructor + */ + + CNxStart(CNxTaskbar *taskbar); + + /** + * Get the icon associated with the application + * + * @return An instance if INxBitmap that may be used to rend the + * application's icon. This is an new INxBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::INxBitmap *getIcon(void); + + /** + * Add the application to the start window + * + * @param application. The new application to add to the start window + * @return true on success + */ + + bool addApplication(INxApplication *application); + + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CNXSTART_NXX diff --git a/nxwm/include/cnxtaskbar.hxx b/nxwm/include/cnxtaskbar.hxx new file mode 100644 index 000000000..ff8b7e4c1 --- /dev/null +++ b/nxwm/include/cnxtaskbar.hxx @@ -0,0 +1,201 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cnxtaskbar.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __NXWM_INCLUDE_CNXTASKBAR_HXX +#define __NXWM_INCLUDE_CNXTASKBAR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Class Definition + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This class describes the NX window manager's task bar + */ + + class CNxTaskBar : public NxWidgets::CNxServer + { + private: + NxWidgets:INxWindow *m_toolbar; /**< The toolbar window */ + NxWidgets:INxWindow *m_background; /**< The background window */ + INxApplication *m_start; /**< The start window */ + + /** + * Connect to the server + */ + + bool connect(void); + + /** + * Disconnect from the server + */ + + void disconnect(void); + + /** + * Create a raw window. + * + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. This will "smarten" the CWidgetControl + * instance with some window knowlede + * 3) Call the open() method on the window to display the window. + * 4) After that, the fully smartened CWidgetControl instance can + * be used to generate additional widgets by passing it to the + * widget constructor + */ + + NXWidgets::INxWindow *openRawWindow(void); + + /** + * Create a framed application window + * + * This may be used to provide the window parater to the INxApplication constructor + * + * @return A partially initialized application window instance. + */ + + NXWidgets::INxWindow *openFramedWindow(void); + + /** + * Create the toolbar window. + * + * @return true on success + */ + + bool createToolbarWindow(void); + + /** + * Create the background window. + * + * @return true on success + */ + + bool createBackgroundWindow(void); + + /** + * CNxTaskBar Destructor + */ + + ~CNxTaskBar(void); + + public: + /** + * CNxTaskBar Constructor + * + * @param hWnd - NX server handle + */ + + CNxTaskBar(void); + + /** + * Add the application to the start window. The window manager start-up + * sequence is: + * + * 1. Create the CNxTaskBar instance, + * 2. Call addApplication repeatedly to add applications to the start window + * 3. Call startWindowManager to start the display + * + * @param application. The new application to add to the start window + * @return true on success + */ + + bool addApplication(INxApplication *application); + + /** + * Start the window manager and present the initial displays. The window + * manager start-up sequence is: + * + * 1. Create the CNxTaskBar instance, + * 2. Call addApplication repeatedly to add applications to the start window + * 3. Call startWindowManager to start the display + * + * startWindowManager will present the taskar and the background image. The + * initial taskbar will contain only the start window icon. + * + * @param application. The new application to add to the start window + * @return true on success + */ + + bool startWindowManager(start); + + /** + * Start an application and add its icon to the taskbar. The applications's + * window is brought to the top. + * + * @param application. The new application to add to the task bar + * @return true on success + */ + + bool startApplication(INxApplication *application); + + /** + * Hide an application by moving its window to the bottom. + * + * @param application. The new application to add to the task bar + * @return true on success + */ + + bool hideApplication(INxApplication *application); + + /** + * Destroy an application. Move its window to the bottom and remove its + * icon from the task bar. + * + * @param application. The new application to remove from the task bar + * @return true on success + */ + + bool stopApplication(INxApplication *application); + }; +} + +#endif // __cplusplus +#endif // __NXWM_INCLUDE_CNXTASKBAR_HXX diff --git a/nxwm/include/inxapplication.hxx b/nxwm/include/inxapplication.hxx index 367ba871f..ef7c52326 100644 --- a/nxwm/include/inxapplication.hxx +++ b/nxwm/include/inxapplication.hxx @@ -42,8 +42,6 @@ #include -#include "ibitmap.hxx" - /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -68,6 +66,12 @@ namespace NxWM */ virtual NXWidgets::INxBitmap *getIcon(void) = 0; + + /** + * Start the application. + */ + + virtual run(void) = 0; }; } diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx new file mode 100644 index 000000000..d4e4b15c6 --- /dev/null +++ b/nxwm/src/cnxconsole.cxx @@ -0,0 +1,76 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cnxconsole.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include "nxwmconfig.hxx" +#include "cnxconsole.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CNxConsole Method Implementations + ********************************************************************************************/ + +/** + * CNxConsole constructor + * + * @param window. The application window + */ + +CNxConsole::CNxConsole(NXWidgets::INxWindow *window) +{ +} + +/** + * Get the icon associated with the application + * + * @return An instance if INxBitmap that may be used to rend the + * application's icon. This is an new INxBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::INxBitmap *CNxConsole::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = new NXWidgets::CRlePaletteBitmap(&g_nshBitmap); + return static_cast(bitmap); +} + diff --git a/nxwm/src/cnxtaskbar.cxx b/nxwm/src/cnxtaskbar.cxx new file mode 100644 index 000000000..d34fddd99 --- /dev/null +++ b/nxwm/src/cnxtaskbar.cxx @@ -0,0 +1,339 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cnxtaskbar.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include "nxwmconfig.hxx" +#include "cnxconsole.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CNxConsole Method Implementations + ********************************************************************************************/ + +/** + * CNxTaskBar Constructor + * + * @param hWnd - NX server handle + */ + +CNxTaskBar::CNxTaskBar(void) +{ + m_toolbar = (INxWindow *)NULL; + m_background = (INxWindow *)NULL; + m_start = (INxWindow *)NULL; +} + +/** + * CNxTaskBar Destructor + */ + +CNxTaskBar::~CNxTaskBar(void) +{ + disconnect(); +} +/** + * Add the application to the start window. The window manager start-up + * sequence is: + * + * 1. Create the CNxTaskBar instance, + * 2. Call addApplication repeatedly to add applications to the start window + * 3. Call startWindowManager to start the display + * + * @param application. The new application to add to the start window + * @return true on success + */ + +bool CNxTaskBar::addApplication(INxApplication *application) +{ +} + +/** + * Start the window manager and present the initial displays. The window + * manager start-up sequence is: + * + * 1. Create the CNxTaskBar instance, + * 2. Call addApplication repeatedly to add applications to the start window + * 3. Call startWindowManager to start the display + * + * startWindowManager will present the taskar and the background image. The + * initial taskbar will contain only the start window icon. + * + * @param application. The new application to add to the start window + * @return true on success + */ + +bool CNxTaskBar::startWindowManager(start); + +/** + * Start an application and add its icon to the taskbar + * + * @param application. The new application to add to the task bar + * @return true on success + */ + +bool CNxTaskBar::startApplication(INxApplication *application) +{ +} + +/** + * Hide an application by moving its window to the bottom. + * + * @param application. The new application to add to the task bar + * @return true on success + */ + +bool CNxTaskBar::hideApplication(INxApplication *application) +{ +} + +/** + * Destroy an application. Move its window to the bottom and remove its + * icon from the task bar. + * + * @param application. The new application to remove from the task bar + * @return true on success + */ + +bool CNxTaskBar::stopApplication(INxApplication *application) +{ +} + +/** + * Connect to the server + */ + +bool CNxTaskBar::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CNXWM_BGCOLOR)) + { + message("CNxwm::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +/** + * Disconnect from the server + */ + +void CNxTaskBar::disconnect(void) +{ + // Delete all applications +#warning "Missing logic + + // Close the windows + + if (m_toolbar) + { + delete m_toolbar; + } + + if (m_background) + { + delete m_background; + } + + if (m_start) + { + delete m_start; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +/** + * Create a raw window. + * + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. This will "smarten" the CWidgetControl + * instance with some window knowlede + * 3) Call the open() method on the window to display the window. + * 4) After that, the fully smartened CWidgetControl instance can + * be used to generate additional widgets by passing it to the + * widget constructor + */ + +NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void) +{ + // Initialize the widget control using the default style + + NxWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + NxWidgets::CNxWindow window = createRawWindow(widgetControl); + if (!window) + { + message("CNxwm::createGraphics: Failed to create background window\n"); + delete widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = window->open(); + if (!success) + { + message("CNxwm::createGraphics: Failed to open background window\n"); + delete window; + window = (NXWidgets::INxWindow *)0; + return false; + } + + return static_cast(window); +} + +/** + * Create a framed application window + * + * This may be used to provide the window parater to the INxApplication constructor + * + * @return A partially initialized application window instance. + */ + +NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void) +{ + // Initialize the widget control using the default style + + NxWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + NxWidgets:CFramedWindow window = createRawWindow(widgetControl); + if (!window) + { + message("CNxwm::createGraphics: Failed to create background window\n"); + delete widgetControl; + return false; + } + + // Open (and initialize) the window + + bool success = window->open(); + if (!success) + { + message("CNxwm::createGraphics: Failed to open background window\n"); + delete window; + window = (NXWidgets::INxWindow *)0; + return false; + } + + return static_cast(window); +} + +/** + * Create the toolbar window. + * + * @return true on success + */ + +bool CNxTaskBar::createToolbarWindow(void) +{ + // Create a raw window to present the toolbar + + m_toolbar = openRawWindow(); + if (!m_toolbar) + { + message("CNxwm::createGraphics: Failed to create CBgWindow instance\n"); + return false; + } + + return true; +} + +/** + * Create the background window. + * + * @return true on success + */ + +bool CNxTaskBar::createBackgroundWindow(void) +{ + // Create a raw window to present the background image + + m_background = openRawWindow(); + if (!m_background) + { + message("CNxwm::createGraphics: Failed to create background window\n"); + return false; + } + + return true; +} + +/** + * Create the background window. + * + * @return true on success + */ + +bool CNxTaskBar::createStartWindow(void) +{ + // Create a raw window to present the background image + + INxWindow *window = openFramedWindow(); + if (!window) + { + message("CNxwm::createGraphics: Failed to create start window\n"); + return false; + } + + // Now create the start up application +#warning "Missing logic" + + // m_start + return true; +} From 34dc6f0e2e50bfdda346dad904a9b494b624a6ac Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 14:34:56 +0000 Subject: [PATCH 008/390] Fix STM32 USART4/5 vs UART4/5 confusion git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4671 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/cbgwindow.hxx | 9 ++ libnxwidgets/include/cnxserver.hxx | 7 +- libnxwidgets/include/cnxtkwindow.hxx | 11 +- libnxwidgets/include/cnxtoolbar.hxx | 9 ++ libnxwidgets/include/cnxwindow.hxx | 9 ++ libnxwidgets/include/inxwindow.hxx | 10 ++ libnxwidgets/src/cbgwindow.cxx | 12 ++ libnxwidgets/src/cnxserver.cxx | 2 +- libnxwidgets/src/cnxtkwindow.cxx | 12 ++ libnxwidgets/src/cnxtoolbar.cxx | 12 ++ libnxwidgets/src/cnxwindow.cxx | 12 ++ nxwm/include/cnxstart.hxx | 35 ++++- nxwm/include/cnxtaskbar.hxx | 42 +++++- nxwm/include/inxapplication.hxx | 28 ++++ nxwm/include/nxwmconfig.hxx | 38 +++++ nxwm/src/cnxtaskbar.cxx | 209 +++++++++++++++++++++++++-- 16 files changed, 438 insertions(+), 19 deletions(-) diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 1f8e417af..435fdffbf 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -130,6 +130,15 @@ namespace NXWidgets bool open(void); + /** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + + CWidgetControl *getWidgetControl(void) const; + /** * Request the position and size information of the window. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index 2c79558a0..3043fd9e0 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -48,6 +48,7 @@ #include #include "cnxwindow.hxx" +#include "cnxtkwindow.hxx" #include "cbgwindow.hxx" /**************************************************************************** @@ -176,12 +177,10 @@ namespace NXWidgets * Get an instance of the framed NX window. */ -#if 0 // Not ready for prime time - inline CFramedWindow *createFramedWindow(CWidgetControl *widgetControl) + inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl) { - return new CFramedWindow(m_hNxServer, widgetControl); + return new CNxTkWindow(m_hNxServer, widgetControl); } -#endif /** * Get an instance of the background window. diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index ed2ecdbd2..b6915a6c1 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -102,7 +102,7 @@ namespace NXWidgets * 3) The window constructor call CWidgetControl methods to "smarten" * the CWidgetControl instance with window-specific knowledge. * 4) Call the open() method on the window to display the window. - * 5) After that, the fully smartend CWidgetControl instance can + * 5) After that, the fully smartened CWidgetControl instance can * be used to generate additional widgets. * 6) After that, the fully smartened CWidgetControl instance can * be used to generate additional widgets by passing it to the @@ -129,6 +129,15 @@ namespace NXWidgets bool open(void); + /** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + + CWidgetControl *getWidgetControl(void) const; + /** * Open a toolbar on the framed window. Toolbar creation is separate * from object instantion so that errors can be reported diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index ff65cf1a9..8e016c15e 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -120,6 +120,15 @@ namespace NXWidgets bool open(void); + /** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + + CWidgetControl *getWidgetControl(void) const; + /** * Request the position and size information of the toolbar. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 4a371bb27..e39c3cc81 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -130,6 +130,15 @@ namespace NXWidgets bool open(void); + /** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + + CWidgetControl *getWidgetControl(void) const; + /** * Request the position and size information of the window. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 0c372ee0d..c38052de0 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -60,6 +60,7 @@ namespace NXWidgets { struct SBitmap; + class CWidgetControl; /** * This class defines common operations on a any NX window. @@ -89,6 +90,15 @@ namespace NXWidgets virtual bool open(void) = 0; + /** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + + virtual CWidgetControl *getWidgetControl(void) const = 0; + /** * Request the position and size information of the window. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx index 08ae584b8..58ecc1f51 100644 --- a/libnxwidgets/src/cbgwindow.cxx +++ b/libnxwidgets/src/cbgwindow.cxx @@ -113,6 +113,18 @@ bool CBgWindow::open(void) return true; } +/** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + +CWidgetControl *CBgWindow::getWidgetControl(void) const +{ + return m_widgetControl; +} + /** * Request the position and size information of the window. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 2f36b0f2d..ef71deb44 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -120,7 +120,7 @@ CNxServer::~CNxServer(void) #ifndef CONFIG_NX_MULTIUSER bool CNxServer::connect(void) { -#if defined(SCREENS_EXTERNINIT) +#if defined(CONFIG_NXWIDGETS_EXTERNINIT) // Use external graphics driver initialization m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 36b07dce5..ba62ee435 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -111,6 +111,18 @@ bool CNxTkWindow::open(void) return m_hNxTkWindow != NULL; } +/** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + +CWidgetControl *CNxTkWindow::getWidgetControl(void) const +{ + return m_widgetControl; +} + /** * Open a toolbar on the framed window * diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 5911c731d..1c560deb1 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -117,6 +117,18 @@ bool CNxToolbar::open(void) return ret == OK; } +/** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + +CWidgetControl *CNxToolbar::getWidgetControl(void) const +{ + return m_widgetControl; +} + /** * Request the position and size information of the toolbar. The values * will be returned asynchronously through the client callback method. diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index fd4cc6ef2..599335972 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -103,6 +103,18 @@ bool CNxWindow::open(void) return m_hNxWindow != NULL; } +/** + * Each implementation of INxWindow must provide a method to recover + * the contained CWidgetControl instance. + * + * @return The contained CWidgetControl instance + */ + +CWidgetControl *CNxWindow::getWidgetControl(void) const +{ + return m_widgetControl; +} + /** * Request the position and size information of the window. The values * will be returned asynchronously through the client callback method. diff --git a/nxwm/include/cnxstart.hxx b/nxwm/include/cnxstart.hxx index 42ea67b35..fbfb9c54b 100644 --- a/nxwm/include/cnxstart.hxx +++ b/nxwm/include/cnxstart.hxx @@ -56,6 +56,9 @@ namespace NxWM { + class CNxTaskbar; + class CApplicationWindow; + class CNxStart : public INxApplication { protected: @@ -71,9 +74,19 @@ namespace NxWM /** * CNxStart Constructor + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. */ - CNxStart(CNxTaskbar *taskbar); + CNxStart(CNxTaskbar *taskbar, CApplicationWindow *window); + + /** + * Each implementation of INxApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + + CApplicationWindow *getWindow(void) const; /** * Get the icon associated with the application @@ -85,6 +98,26 @@ namespace NxWM NXWidgets::INxBitmap *getIcon(void); + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + NXWidgets::CNxString getName(void); + + /** + * Start the application. + */ + + run(void); + + /** + * Stop the application. + */ + + stop(void); + /** * Add the application to the start window * diff --git a/nxwm/include/cnxtaskbar.hxx b/nxwm/include/cnxtaskbar.hxx index ff8b7e4c1..606514bb0 100644 --- a/nxwm/include/cnxtaskbar.hxx +++ b/nxwm/include/cnxtaskbar.hxx @@ -92,7 +92,7 @@ namespace NxWM * widget constructor */ - NXWidgets::INxWindow *openRawWindow(void); + NXWidgets::CNxWindow *openRawWindow(void); /** * Create a framed application window @@ -102,7 +102,15 @@ namespace NxWM * @return A partially initialized application window instance. */ - NXWidgets::INxWindow *openFramedWindow(void); + NXWidgets::CNxTkWindow *openFramedWindow(void); + + /** + * Set size and position of a window in the application area. + * + * @param window. The window to be resized and repositioned + */ + + void setApplicationGeometry(NxWidgets::INxWindow *window); /** * Create the toolbar window. @@ -166,9 +174,37 @@ namespace NxWM bool startWindowManager(start); + /** + * Create an application window. Creating a new applicatino in the start + * window requires three steps: + * + * 1. Call openApplicationWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call addApplication to add the application to the start window. + * + * When the application is selected from the start window: + * + * 4. Call startApplication start the application and bring its window to + * the top. + */ + + CApplicationWindow *openApplicationWindow(void); + /** * Start an application and add its icon to the taskbar. The applications's - * window is brought to the top. + * window is brought to the top. Creating a new applicatino in the start + * window requires three steps: + * + * 1. Call openApplicationWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call addApplication to add the application to the start window. + * + * When the application is selected from the start window: + * + * 4. Call startApplication start the application and bring its window to + * the top. * * @param application. The new application to add to the task bar * @return true on success diff --git a/nxwm/include/inxapplication.hxx b/nxwm/include/inxapplication.hxx index ef7c52326..70d4ac104 100644 --- a/nxwm/include/inxapplication.hxx +++ b/nxwm/include/inxapplication.hxx @@ -54,9 +54,23 @@ namespace NxWM { + class CApplicationWindow; + class NxWidget::CNxString; + + /** + * INxApplication provides the abstract base class for each NxWM application. + */ + class INxApplication { public: + /** + * Each implementation of INxApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + + virtual CApplicationWindow *getWindow(void) const = 0; + /** * Get the icon associated with the application * @@ -67,11 +81,25 @@ namespace NxWM virtual NXWidgets::INxBitmap *getIcon(void) = 0; + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + virtual NXWidgets::CNxString getName(void) = 0; + /** * Start the application. */ virtual run(void) = 0; + + /** + * Stop the application. + */ + + virtual stop(void) = 0; }; } diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 18b35d83a..e5a85ac5a 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -47,7 +47,16 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ +/* General Configuration ****************************************************/ +/** + * NX Multi-user support is required + */ +#ifndef CONFIG_NX_MULTIUSER +# warning "NX multi-user support is required (CONFIG_NX_MULTIUSER)" +#endif + +/* Colors *******************************************************************/ /** * Normal background color */ @@ -80,5 +89,34 @@ # define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248) #endif +/* Task Bar Configuation ***************************************************/ +/* At present, all icons are 25 pixels in "widgth" and, hence require a + * task bar of at least that size. + */ + +#ifndef CONFIG_NXWM_TASKBAR_WIDTH +# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*2) +#endif + +/* Check task bar location */ + +#if defined(CONFIG_NXWM_TASKBAR_TOP) +# if defined(CONFIG_NXWM_TASKBAR_BOTTOM) || defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) +# warning "Multiple task positions specified" +# endif +#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) +# if defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) +# warning "Multiple task positions specified" +# endif +#elif defined(CONFIG_NXWM_TASKBAR_LEFT) +# if defined defined (CONFIG_NXWM_TASKBAR_RIGHT) +# warning "Multiple task positions specified" +# endif +#elif !defined(CONFIG_NXWM_TASKBAR_RIGHT) +# warning "No task positions specified" +# define CONFIG_NXWM_TASKBAR_TOP 1 +#endif + +/* Colors *******************************************************************/ #endif // __INCLUDE_NXWM_CONFIG_HXX diff --git a/nxwm/src/cnxtaskbar.cxx b/nxwm/src/cnxtaskbar.cxx index d34fddd99..3cacc2629 100644 --- a/nxwm/src/cnxtaskbar.cxx +++ b/nxwm/src/cnxtaskbar.cxx @@ -105,7 +105,36 @@ bool CNxTaskBar::addApplication(INxApplication *application) bool CNxTaskBar::startWindowManager(start); /** - * Start an application and add its icon to the taskbar + * Create an application window. Creating a new applicatino in the start + * window requires three steps: + * + * 1. Call openApplicationWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call addApplication to add the application to the start window. + * + * When the application is selected from the start window: + * + * 4. Call startApplication start the application and bring its window to + * the top. + */ + +CApplicationWindow *CNxTaskBar::openApplicationWindow(void); + +/** + * Start an application and add its icon to the taskbar. The applications's + * window is brought to the top. Creating a new applicatino in the start + * window requires three steps: + * + * 1. Call openApplicationWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call addApplication to add the application to the start window. + * + * When the application is selected from the start window: + * + * 4. Call startApplication start the application and bring its window to + * the top. * * @param application. The new application to add to the task bar * @return true on success @@ -171,18 +200,52 @@ void CNxTaskBar::disconnect(void) // Close the windows + NxWidgets::CWidgetControl *control; if (m_toolbar) { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_toolbar->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the toolbar + delete m_toolbar; } if (m_background) { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_background->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the background + delete m_background; } if (m_start) { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_start->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the start window + delete m_start; } @@ -204,7 +267,7 @@ void CNxTaskBar::disconnect(void) * widget constructor */ -NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void) +NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void) { // Initialize the widget control using the default style @@ -232,7 +295,7 @@ NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void) return false; } - return static_cast(window); + return window; } /** @@ -243,7 +306,7 @@ NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void) * @return A partially initialized application window instance. */ -NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void) +NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) { // Initialize the widget control using the default style @@ -252,7 +315,7 @@ NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void) // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NxWidgets:CFramedWindow window = createRawWindow(widgetControl); + NxWidgets:CNxTkWindow window = createRawWindow(widgetControl); if (!window) { message("CNxwm::createGraphics: Failed to create background window\n"); @@ -271,7 +334,64 @@ NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void) return false; } - return static_cast(window); + return window; +} + +/** + * Set size and position of a window in the application area. + * + * @param window. The window to be resized and repositioned + * + * @return true on success + */ + +bool CNxTaskBar::setApplicationGeometry(NxWidgets::INxWindow *window) +{ + // Get the widget control from the toolbar window. The physical window geometry + // should be the same for all windows. + + NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + + // Now position and size the application. This will depend on the position and + // orientation of the toolbar. + + nxgl_point_t pos; + nxgl_size_t size; + +#if defined(CONFIG_NXWM_TASKBAR_TOP) + pos.x = 0; + pos.y = CONFIG_NXWM_TASKBAR_WIDTH; + + size.w = rect.getWidth(); + size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; +#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) + pos.x = 0; + pos.y = 0; + + size.w = rect.getWidth(); + size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; +#elif defined(CONFIG_NXWM_TASKBAR_LEFT) + pos.x = CONFIG_NXWM_TASKBAR_WIDTH; + pos.y = 0; + + size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); +#else + pos.x = 0; + pos.y = 0; + + size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); +#endif + + /* Set the size and position the window. + * + * @param pPos The new position of the window. + * @return True on success, false on failure. + */ + + window->setPosition(&pos); + window->setSize(&size); } /** @@ -291,6 +411,61 @@ bool CNxTaskBar::createToolbarWindow(void) return false; } + // Get the contained widget control + + NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + + // Get the size of the window from the widget control + + CRect rect = control->getWindowBoundingBox(); + + // Now position and size the toolbar. This will depend on the position and + // orientation of the toolbar. + + nxgl_point_t pos; + nxgl_size_t size; + +#if defined(CONFIG_NXWM_TASKBAR_TOP) + pos.x = 0; + pos.y = 0; + + size.w = rect.getWidth(); + size.h = CONFIG_NXWM_TASKBAR_WIDTH; +#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) + pos.x = 0; + pos.y = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; + + size.w = rect.getWidth(); + size.h = CONFIG_NXWM_TASKBAR_WIDTH; +#elif defined(CONFIG_NXWM_TASKBAR_LEFT) + pos.x = 0; + pos.y = 0; + + size.w = CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); +#else + pos.x = rect.getWidgth() - CONFIG_NXWM_TASKBAR_WIDTH; + pos.y = 0; + + size.w = CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); +#endif + + /* Set the size and position the window. + * + * @param pPos The new position of the window. + * @return True on success, false on failure. + */ + + m_toolbar->setPosition(&pos); + m_toolbar->setSize(&size); + + /* And raise the window to the top of the display */ + + m_toolbar->raise(void); + + // Add the start menu's icon to the toolbar +#warning "Missing logic" return true; } @@ -311,11 +486,19 @@ bool CNxTaskBar::createBackgroundWindow(void) return false; } + // Set the geometry to fit in the application window space + + setApplicationGeometry(static_cast(m_background)); + + /* And lower the background window to the bottom of the display */ + + m_background->lower(void); + return true; } /** - * Create the background window. + * Create the start window. * * @return true on success */ @@ -324,13 +507,21 @@ bool CNxTaskBar::createStartWindow(void) { // Create a raw window to present the background image - INxWindow *window = openFramedWindow(); - if (!window) + m_start = openFramedWindow(); + if (!m_start) { message("CNxwm::createGraphics: Failed to create start window\n"); return false; } + // Set the geometry to fit in the application window space + + setApplicationGeometry(static_cast(m_start)); + + /* And lower the background window to the top of the display */ + + m_start->raise(void); + // Now create the start up application #warning "Missing logic" From 61b7b9f52ac603ac9f0145055fdb4783d54b1e74 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 16:57:06 +0000 Subject: [PATCH 009/390] more NxWM stuff git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4672 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/images/minimize.png | Bin 0 -> 462 bytes nxwm/images/stop.png | Bin 0 -> 732 bytes nxwm/include/capplicationwindow.hxx | 147 ++++++++++++++++++ nxwm/include/cnxconsole.hxx | 8 +- nxwm/include/cnxtaskbar.hxx | 2 +- nxwm/include/nxwmglyphs.hxx | 64 ++++++++ nxwm/src/capplicationwindow.cxx | 115 ++++++++++++++ nxwm/src/cnxtaskbar.cxx | 24 +-- nxwm/src/glyph_minimize.cxx | 185 +++++++++++++++++++++++ nxwm/src/glyph_stop.cxx | 223 ++++++++++++++++++++++++++++ 10 files changed, 749 insertions(+), 19 deletions(-) create mode 100755 nxwm/images/minimize.png create mode 100755 nxwm/images/stop.png create mode 100644 nxwm/include/capplicationwindow.hxx create mode 100644 nxwm/include/nxwmglyphs.hxx create mode 100644 nxwm/src/capplicationwindow.cxx create mode 100644 nxwm/src/glyph_minimize.cxx create mode 100755 nxwm/src/glyph_stop.cxx diff --git a/nxwm/images/minimize.png b/nxwm/images/minimize.png new file mode 100755 index 0000000000000000000000000000000000000000..7671547f8716b7bb902d4166303e37cba50225cd GIT binary patch literal 462 zcmV;<0WtoGP)P000>X1^@s6#OZ}&00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyc5 z5ELIlTPCIe00B-(L_t(Y$K96Qk%KS{gui4`id2l#%cYnUa}=}cg?qq&0UO9nl84hw zhCf*=?=B*jzVCZJ99O;&xADa99nckz95fuJ(EMl-Q{I@6aC3g2wgiEW&|_OsmDU6h z`NB4NM&!#ih}P}-3xs$^8HxsAbU<2a5@Sbi3*QQF)Ao--6%K2h+B@78pR%x4oyI3X zyh+L42CusdPJ_K|CtBI{KqkEmq8%3P000>X1^@s6#OZ}&00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyc5 z5GMslQo8H_00LY|L_t(Y$K96Ek=rl~L|-yj3Rn!%3ssENi%|@=7v=+$MElP7mt-cK zu_Tis7K;Ty{TO2m{_yz8UlR)!1|LRkP8 z&&(&ow(r+Iw(Um!48o#Gf_eGa43r?y^!@}hZxxd1k>UWwr>MMSS5`!C+u~7K7;;X_cld{Bb zG%|(uc-c0qAp%ktfR=0iv$j$>T0ZDag?~|gbocGOZEmx>FOti2-Kr?*n1wa8PgrbVI09BpAJ8cqeFZ~RF zF~`GfBt9P4c$klok6OqaqxX?85*vw)huPSTF?z4{F~-Qp*xkntweEhJ9v^G@1c901 zyI;Lav6B%~cHPa`j6;D3Sl_^$?jjPTd{XBQ7YP{d8+f1Dmh2H#{c8Yh>Xst*mp)e*8C|M85% literal 0 HcmV?d00001 diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx new file mode 100644 index 000000000..6f802ebe5 --- /dev/null +++ b/nxwm/include/capplicationwindow.hxx @@ -0,0 +1,147 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/capplicationwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CAPPLICATIONWINDOW_NXX +#define __INCLUDE_CAPPLICATIONWINDOW_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "cnxtkwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + class CNxtkWindow; + + /** + * This callback class is used by the application to get notification of toolbar + * related events. + */ + + class IApplicationCallback + { + public: + /** + * Called when the window minimize button is pressed. + */ + + virtual void minimize(void) = 0; + + /** + * Called when the window minimize close is pressed. + */ + + virtual void close(void) = 0; + }; + + /** + * This class represents that application window. This class contains that the + * framed window and its toolbar. It manages callbacks from the toolbar minimize + * and close buttions and passes these to the application via callbacks. + */ + + class CApplicationWindow : public INxApplication + { + protected: + NxWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ + NxWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ + NxWidgets::CImage *m_minimize; /**< The minimize icon */ + NxWidgets::CImage *m_close; /**< The close icon */ + IApplicationCallback *m_callback; /**< Toolbar action callbacks */ + + /** + * CNxApplicationWindow Destructor + */ + + ~CNxApplicationWindow(void); + + public: + + /** + * CNxApplicationWindow Constructor + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + + CNxApplicationWindow(NxWidgets::CNxTkWindow *window); + + /** + * Initialize window. Window initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully initialized. + */ + + bool open(void); + + /** + * Recover the contained NXTK window instance + * + * @return. The window used by this application + */ + + inline NxWidgets::CNxTkWindow *getWindow(void) const + { + return m_window; + } + + /** + * Register to receive callbacks when toolbar icons are selected + */ + + void registerCallbacks(IApplicationCallback *callback) + { + m_callback = callback + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CAPPLICATIONWINDOW_NXX diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 793a46849..891ac8884 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -51,19 +51,13 @@ ****************************************************************************/ /**************************************************************************** - * Bitmap Glyph References + * Implementation Classes ****************************************************************************/ #if defined(__cplusplus) namespace NxWM { - extern const struct NxWidgets::SRlePaletteBitmap g_nshBitmap; - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - /** * This class implements the NxConsole application. */ diff --git a/nxwm/include/cnxtaskbar.hxx b/nxwm/include/cnxtaskbar.hxx index 606514bb0..5f1a81527 100644 --- a/nxwm/include/cnxtaskbar.hxx +++ b/nxwm/include/cnxtaskbar.hxx @@ -63,7 +63,7 @@ namespace NxWM class CNxTaskBar : public NxWidgets::CNxServer { private: - NxWidgets:INxWindow *m_toolbar; /**< The toolbar window */ + NxWidgets:INxWindow *m_taskbar; /**< The toolbar window */ NxWidgets:INxWindow *m_background; /**< The background window */ INxApplication *m_start; /**< The start window */ diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx new file mode 100644 index 000000000..0e58962c9 --- /dev/null +++ b/nxwm/include/nxwmglyphs.hxx @@ -0,0 +1,64 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/nxwmconfig.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_NXWM_CONFIG_HXX +#define __INCLUDE_NXWM_CONFIG_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Bitmap Glyphs + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + extern const struct NxWidgets::SRlePaletteBitmap g_nshBitmap; + extern const struct NxWidgets::SRlePaletteBitmap g_minimizeBitmap; + extern const struct NxWidgets::SRlePaletteBitmap g_stopBitmap; + +#endif // __cplusplus +#endif // __INCLUDE_NXWM_CONFIG_HXX diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx new file mode 100644 index 000000000..0c5c9791f --- /dev/null +++ b/nxwm/src/capplicationwindow.cxx @@ -0,0 +1,115 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cnxtaskbar.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include "nxwmconfig.hxx" +#include "cappliationwinow.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CNxApplicationWindow Method Implementations + ********************************************************************************************/ + + using namespace NxWM; + +/** + * CNxApplicationWindow Constructor + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + +CNxApplicationWindow::CNxApplicationWindow(NxWidgets::CNxTkWindow *window); +{ + m_window = (NxWidgets::CNxTkWindow *)0; + m_toolbar = (NxWidgets::CNxToolbar *)0; + m_minimize = (NxWidgets::CImage *)0; + m_close = (NxWidgets::CImage *)0; + m_callback = (IApplicationCallback *)0; +} + +/** + * CNxApplicationWindow Destructor + */ + +CNxApplicationWindow::~CNxApplicationWindow(void) +{ + // Free the resources that we are responsible for + + if (m_toolbar) + { + delete m_toolbar; + } + + if (m_minimize) + { + delete m_minimize; + } + + if (m_close) + { + delete m_close; + } + + // We didn't create the window. That was done by the task bar, + // Be we will handle destruction of with window as a courtesy. + + if (m_window) + { + delete m_window; + } +} + +/** + * Initialize window. Window initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully initialized. + */ + +bool CNxApplicationWindow::open(void) +{ + +} + + diff --git a/nxwm/src/cnxtaskbar.cxx b/nxwm/src/cnxtaskbar.cxx index 3cacc2629..b230c6785 100644 --- a/nxwm/src/cnxtaskbar.cxx +++ b/nxwm/src/cnxtaskbar.cxx @@ -50,6 +50,8 @@ * CNxConsole Method Implementations ********************************************************************************************/ +using namespace NxWM; + /** * CNxTaskBar Constructor * @@ -58,7 +60,7 @@ CNxTaskBar::CNxTaskBar(void) { - m_toolbar = (INxWindow *)NULL; + m_taskbar = (INxWindow *)NULL; m_background = (INxWindow *)NULL; m_start = (INxWindow *)NULL; } @@ -201,12 +203,12 @@ void CNxTaskBar::disconnect(void) // Close the windows NxWidgets::CWidgetControl *control; - if (m_toolbar) + if (m_taskbar) { // Delete the contained widget control. We are responsible for it // because we created it - control = m_toolbar->getWidgetControl(); + control = m_taskbar->getWidgetControl(); if (control) { delete control; @@ -214,7 +216,7 @@ void CNxTaskBar::disconnect(void) // Then delete the toolbar - delete m_toolbar; + delete m_taskbar; } if (m_background) @@ -350,7 +352,7 @@ bool CNxTaskBar::setApplicationGeometry(NxWidgets::INxWindow *window) // Get the widget control from the toolbar window. The physical window geometry // should be the same for all windows. - NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + NxWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Now position and size the application. This will depend on the position and // orientation of the toolbar. @@ -404,8 +406,8 @@ bool CNxTaskBar::createToolbarWindow(void) { // Create a raw window to present the toolbar - m_toolbar = openRawWindow(); - if (!m_toolbar) + m_taskbar = openRawWindow(); + if (!m_taskbar) { message("CNxwm::createGraphics: Failed to create CBgWindow instance\n"); return false; @@ -413,7 +415,7 @@ bool CNxTaskBar::createToolbarWindow(void) // Get the contained widget control - NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + NxWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Get the size of the window from the widget control @@ -457,12 +459,12 @@ bool CNxTaskBar::createToolbarWindow(void) * @return True on success, false on failure. */ - m_toolbar->setPosition(&pos); - m_toolbar->setSize(&size); + m_taskbar->setPosition(&pos); + m_taskbar->setSize(&size); /* And raise the window to the top of the display */ - m_toolbar->raise(void); + m_taskbar->raise(void); // Add the start menu's icon to the toolbar #warning "Missing logic" diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx new file mode 100644 index 000000000..1d5237412 --- /dev/null +++ b/nxwm/src/glyph_minimize.cxx @@ -0,0 +1,185 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_minimize.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 25 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = +{ + 0xffffff, 0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, /* Codes 0-7 */ + 0x002492, 0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, /* Codes 8-15 */ + 0x4949b6, 0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, /* Codes 16-23 */ + 0x4949ff /* Codes 24-24 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, /* Codes 0-9 */ + 0x2136, 0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, /* Codes 10-19 */ + 0xdedf, 0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 20-24 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = +{ + 0xff, 0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, 0x6a, 0x5f, /* Codes 0-15 */ + 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 16-24 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = +{ + 0xff, 0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, 0x4e, 0x2e, /* Codes 0-15 */ + 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 16-24 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_minimizeRleEntries[] = +{ + { 25, 0}, /* Row 0 */ + { 25, 0}, /* Row 1 */ + { 2, 0}, { 1, 1}, { 3, 2}, { 1, 3}, { 1, 4}, { 3, 3}, { 2, 4}, { 4, 3}, /* Row 2 */ + { 1, 4}, { 1, 3}, { 2, 2}, { 1, 1}, { 1, 5}, { 2, 0}, + { 2, 0}, { 1, 2}, { 3, 6}, { 8, 7}, { 2, 8}, { 3, 7}, { 2, 8}, { 1, 4}, /* Row 3 */ + { 1, 1}, { 2, 0}, + { 2, 0}, { 1, 4}, { 11, 6}, { 3, 7}, { 1, 6}, { 4, 7}, { 1, 2}, { 2, 0}, /* Row 4 */ + { 2, 0}, { 1, 7}, { 11, 6}, { 3, 7}, { 1, 6}, { 4, 7}, { 1, 3}, { 2, 0}, /* Row 5 */ + { 2, 0}, { 1, 4}, { 9, 6}, { 10, 7}, { 1, 1}, { 2, 0}, /* Row 6 */ + { 2, 0}, { 1, 4}, { 9, 6}, { 2, 7}, { 1, 8}, { 7, 7}, { 1, 1}, { 2, 0}, /* Row 7 */ + { 2, 0}, { 1, 4}, { 8, 6}, { 4, 7}, { 1, 8}, { 6, 7}, { 1, 1}, { 2, 0}, /* Row 8 */ + { 2, 0}, { 1, 4}, { 9, 6}, { 8, 7}, { 1, 9}, { 1, 7}, { 1, 1}, { 2, 0}, /* Row 9 */ + { 2, 0}, { 1, 10}, { 9, 6}, { 1, 7}, { 1, 6}, { 6, 7}, { 1, 9}, { 1, 7}, /* Row 10 */ + { 1, 1}, { 2, 0}, + { 2, 0}, { 1, 10}, { 7, 6}, { 1, 7}, { 2, 6}, { 6, 7}, { 2, 9}, { 1, 7}, /* Row 11 */ + { 1, 10}, { 2, 0}, + { 2, 0}, { 1, 10}, { 6, 6}, { 3, 7}, { 1, 6}, { 6, 7}, { 3, 9}, { 1, 10}, /* Row 12 */ + { 2, 0}, + { 2, 0}, { 1, 10}, { 4, 6}, { 8, 7}, { 3, 9}, { 1, 7}, { 3, 9}, { 1, 10}, /* Row 13 */ + { 2, 0}, + { 2, 0}, { 1, 4}, { 1, 7}, { 1, 6}, { 1, 7}, { 2, 6}, { 2, 7}, { 3, 9}, /* Row 14 */ + { 1, 7}, { 6, 9}, { 1, 7}, { 1, 9}, { 1, 4}, { 2, 0}, + { 2, 0}, { 1, 10}, { 2, 6}, { 1, 7}, { 1, 6}, { 3, 7}, { 2, 9}, { 1, 7}, /* Row 15 */ + { 6, 9}, { 1, 7}, { 1, 6}, { 1, 9}, { 1, 10}, { 2, 0}, + { 2, 0}, { 1, 10}, { 1, 11}, { 2, 6}, { 5, 7}, { 1, 6}, { 3, 7}, { 3, 9}, /* Row 16 */ + { 2, 7}, { 2, 9}, { 1, 10}, { 2, 0}, + { 2, 0}, { 1, 10}, { 3, 11}, { 5, 6}, { 3, 9}, { 5, 7}, { 1, 6}, { 1, 7}, /* Row 17 */ + { 1, 9}, { 1, 10}, { 2, 0}, + { 2, 0}, { 1, 10}, { 1, 6}, { 1, 12}, { 1, 13}, { 1, 14}, { 1, 1}, { 2, 15}, /* Row 18 */ + { 1, 1}, { 1, 14}, { 2, 16}, { 3, 14}, { 1, 1}, { 1, 15}, { 1, 17}, { 2, 9}, + { 1, 4}, { 2, 0}, + { 2, 0}, { 1, 4}, { 2, 10}, { 1, 18}, { 13, 0}, { 1, 18}, { 1, 10}, { 1, 4}, /* Row 19 */ + { 1, 2}, { 2, 0}, + { 2, 0}, { 1, 4}, { 1, 10}, { 1, 9}, { 1, 19}, { 3, 20}, { 2, 21}, { 7, 20}, /* Row 20 */ + { 1, 21}, { 1, 18}, { 1, 13}, { 1, 4}, { 1, 2}, { 2, 0}, + { 2, 0}, { 1, 1}, { 3, 6}, { 1, 17}, { 2, 22}, { 1, 5}, { 1, 23}, { 2, 22}, /* Row 21 */ + { 3, 5}, { 2, 22}, { 1, 5}, { 1, 22}, { 1, 24}, { 1, 7}, { 1, 1}, { 2, 0}, + { 2, 0}, { 1, 5}, { 1, 1}, { 1, 6}, { 1, 7}, { 2, 10}, { 3, 7}, { 2, 6}, /* Row 22 */ + { 6, 7}, { 2, 10}, { 1, 1}, { 1, 5}, { 2, 0}, + { 25, 0}, /* Row 23 */ + { 25, 0} /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_mimimizeBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_minimizeLut, // Index 0: Unselected LUT + g_minimizeLut, // Index 1: Selected LUT + }, + g_minimizeRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx new file mode 100755 index 000000000..d5b2fe697 --- /dev/null +++ b/nxwm/src/glyph_stop.cxx @@ -0,0 +1,223 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_stop.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 66 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_stopLut[BITMAP_NLUTCODES] = +{ + 0xffffff, 0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, /* Codes 0-7 */ + 0xb64949, 0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, /* Codes 8-15 */ + 0xff9292, 0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, /* Codes 16-23 */ + 0xff2424, 0xffffdb, 0xdbb692, 0xdb2424, 0xff4924, 0xffb6db, 0xffdbb6, 0xff6d49, /* Codes 24-31 */ + 0xffb692, 0xdb4924, 0xb64924, 0xdbdb92, 0xb69292, 0xb62424, 0xdb496d, 0xb6926d, /* Codes 32-39 */ + 0xdbffff, 0xdbffdb, 0xb6496d, 0xdb0024, 0xdb6d92, 0xff2400, 0xb66d49, 0xdb2400, /* Codes 40-47 */ + 0xb62400, 0x922424, 0xb60000, 0x922449, 0xff92b6, 0x920000, 0xdb0049, 0xb60024, /* Codes 48-55 */ + 0xdb0000, 0x922400, 0x924949, 0x924924, 0x920024, 0xff6d92, 0x6d4924, 0x6d2400, /* Codes 56-63 */ + 0x6d2424, 0x6d0000 /* Codes 64-65 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_stopLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, /* Codes 0-9 */ + 0xd92d, 0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, /* Codes 10-19 */ + 0xf92d, 0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, /* Codes 20-29 */ + 0xfed6, 0xfb69, 0xfdb2, 0xda44, 0xb244, 0xded2, 0xb492, 0xb124, 0xda4d, 0xb48d, /* Codes 30-39 */ + 0xdfff, 0xdffb, 0xb24d, 0xd804, 0xdb72, 0xf920, 0xb369, 0xd920, 0xb120, 0x9124, /* Codes 40-49 */ + 0xb000, 0x9129, 0xfc96, 0x9000, 0xd809, 0xb004, 0xd800, 0x9120, 0x9249, 0x9244, /* Codes 50-59 */ + 0x9004, 0xfb72, 0x6a44, 0x6920, 0x6924, 0x6800 /* Codes 60-65 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_stopLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, 0xe9, 0xe5, /* Codes 0-15 */ + 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, 0x5a, 0x7b, 0xd0, 0xe1, 0x94, /* Codes 16-31 */ + 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, 0xf4, 0xf0, 0x6d, 0x45, 0x92, 0x61, 0x7e, 0x56, /* Codes 32-47 */ + 0x4b, 0x44, 0x36, 0x49, 0xb6, 0x2b, 0x49, 0x3a, 0x41, 0x40, 0x5e, 0x5a, 0x2f, 0x9c, 0x4f, 0x35, /* Codes 48-63 */ + 0x39, 0x20 /* Codes 64-65 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, 0xfb, 0xfb, /* Codes 0-15 */ + 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, 0xc4, 0xe8, 0xf7, 0xfa, 0xed, /* Codes 16-31 */ + 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, 0xdf, 0xdf, 0xa9, 0xc0, 0xce, 0xe4, 0xad, 0xc4, /* Codes 32-47 */ + 0xa4, 0x84, 0xa0, 0x85, 0xf2, 0x80, 0xc1, 0xa0, 0xc0, 0x84, 0x89, 0x88, 0x80, 0xee, 0x68, 0x64, /* Codes 48-63 */ + 0x64, 0x60 /* Codes 64-65 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_stopRleEntries[] = +{ + { 25, 0}, /* Row 0 */ + { 25, 0}, /* Row 1 */ + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 2}, { 2, 3}, { 2, 4}, { 1, 5}, /* Row 2 */ + { 2, 6}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 1, 8}, { 1, 11}, + { 1, 12}, { 1, 13}, { 2, 0}, + { 2, 0}, { 1, 1}, { 1, 14}, { 2, 15}, { 1, 1}, { 1, 3}, { 1, 13}, { 2, 16}, /* Row 3 */ + { 2, 17}, { 1, 18}, { 1, 11}, { 2, 19}, { 1, 20}, { 1, 19}, { 1, 21}, { 2, 19}, + { 1, 17}, { 2, 0}, + { 2, 0}, { 1, 2}, { 1, 14}, { 2, 15}, { 1, 22}, { 1, 3}, { 1, 4}, { 2, 17}, /* Row 4 */ + { 3, 23}, { 3, 24}, { 2, 21}, { 1, 23}, { 1, 19}, { 1, 24}, { 1, 8}, { 2, 0}, + { 2, 0}, { 1, 3}, { 2, 15}, { 1, 0}, { 2, 25}, { 1, 26}, { 1, 6}, { 1, 11}, /* Row 5 */ + { 2, 23}, { 1, 24}, { 2, 27}, { 1, 28}, { 2, 15}, { 1, 0}, { 1, 17}, { 1, 23}, + { 1, 8}, { 2, 0}, + { 2, 0}, { 1, 3}, { 1, 29}, { 1, 13}, { 1, 30}, { 1, 0}, { 1, 25}, { 1, 22}, /* Row 6 */ + { 1, 5}, { 1, 11}, { 2, 27}, { 1, 24}, { 1, 27}, { 1, 31}, { 1, 32}, { 1, 25}, + { 1, 0}, { 1, 26}, { 1, 33}, { 1, 27}, { 1, 34}, { 2, 0}, + { 2, 0}, { 1, 3}, { 1, 13}, { 2, 16}, { 1, 30}, { 1, 0}, { 1, 25}, { 1, 26}, /* Row 7 */ + { 1, 8}, { 2, 21}, { 1, 27}, { 1, 11}, { 1, 26}, { 1, 25}, { 1, 0}, { 1, 35}, + { 1, 34}, { 1, 33}, { 1, 27}, { 1, 8}, { 2, 0}, + { 2, 0}, { 1, 36}, { 2, 16}, { 2, 6}, { 1, 13}, { 1, 0}, { 1, 25}, { 1, 4}, /* Row 8 */ + { 3, 8}, { 1, 4}, { 1, 25}, { 1, 0}, { 1, 13}, { 1, 8}, { 1, 37}, { 2, 24}, + { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 36}, { 1, 4}, { 1, 17}, { 1, 12}, { 1, 11}, { 1, 38}, { 1, 15}, /* Row 9 */ + { 2, 0}, { 2, 36}, { 1, 7}, { 1, 15}, { 1, 0}, { 1, 15}, { 1, 23}, { 1, 27}, + { 3, 24}, { 1, 27}, { 2, 0}, + { 2, 0}, { 1, 39}, { 1, 6}, { 2, 23}, { 1, 19}, { 1, 37}, { 1, 38}, { 1, 15}, /* Row 10 */ + { 1, 0}, { 2, 40}, { 1, 41}, { 1, 0}, { 1, 29}, { 1, 42}, { 1, 43}, { 1, 27}, + { 3, 24}, { 1, 27}, { 2, 0}, + { 2, 0}, { 1, 7}, { 1, 18}, { 1, 21}, { 2, 24}, { 1, 21}, { 1, 9}, { 1, 44}, /* Row 11 */ + { 1, 0}, { 3, 40}, { 1, 0}, { 1, 44}, { 1, 9}, { 3, 27}, { 1, 45}, { 1, 24}, + { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 7}, { 1, 18}, { 1, 21}, { 2, 24}, { 1, 21}, { 1, 9}, { 1, 44}, /* Row 12 */ + { 1, 0}, { 3, 40}, { 1, 0}, { 1, 44}, { 1, 9}, { 3, 27}, { 1, 45}, { 1, 24}, + { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 46}, { 1, 11}, { 4, 27}, { 1, 9}, { 1, 44}, { 5, 0}, { 1, 44}, /* Row 13 */ + { 1, 9}, { 1, 27}, { 2, 37}, { 1, 47}, { 1, 27}, { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 8}, { 3, 27}, { 1, 48}, { 1, 37}, { 1, 6}, { 1, 15}, { 1, 0}, /* Row 14 */ + { 3, 15}, { 1, 0}, { 1, 15}, { 1, 7}, { 1, 37}, { 1, 49}, { 1, 37}, { 1, 48}, + { 1, 27}, { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 8}, { 1, 37}, { 1, 27}, { 2, 48}, { 1, 46}, { 1, 15}, { 1, 0}, /* Row 15 */ + { 1, 15}, { 3, 7}, { 1, 15}, { 1, 0}, { 1, 30}, { 1, 23}, { 1, 37}, { 2, 48}, + { 1, 27}, { 1, 37}, { 2, 0}, + { 2, 0}, { 1, 49}, { 1, 37}, { 1, 27}, { 1, 50}, { 1, 34}, { 1, 30}, { 1, 0}, /* Row 16 */ + { 1, 25}, { 1, 7}, { 2, 51}, { 1, 9}, { 1, 7}, { 1, 25}, { 1, 0}, { 1, 52}, + { 1, 27}, { 1, 53}, { 1, 47}, { 1, 27}, { 1, 49}, { 2, 0}, + { 2, 0}, { 1, 37}, { 1, 54}, { 1, 55}, { 1, 9}, { 1, 30}, { 1, 0}, { 1, 15}, /* Row 17 */ + { 1, 17}, { 1, 56}, { 2, 43}, { 1, 37}, { 1, 57}, { 1, 17}, { 1, 15}, { 1, 0}, + { 1, 30}, { 1, 58}, { 1, 53}, { 1, 37}, { 1, 58}, { 2, 0}, + { 2, 0}, { 1, 9}, { 1, 53}, { 1, 37}, { 1, 32}, { 1, 0}, { 1, 25}, { 1, 5}, /* Row 18 */ + { 1, 37}, { 1, 55}, { 2, 50}, { 1, 53}, { 1, 49}, { 1, 59}, { 1, 5}, { 1, 25}, + { 1, 0}, { 1, 16}, { 1, 9}, { 1, 60}, { 1, 49}, { 2, 0}, + { 2, 0}, { 1, 49}, { 1, 60}, { 1, 61}, { 1, 0}, { 1, 25}, { 1, 30}, { 1, 62}, /* Row 19 */ + { 1, 57}, { 1, 53}, { 2, 50}, { 1, 57}, { 1, 63}, { 1, 57}, { 1, 49}, { 1, 30}, + { 1, 15}, { 1, 0}, { 1, 61}, { 1, 37}, { 1, 49}, { 2, 0}, + { 2, 0}, { 1, 49}, { 1, 55}, { 1, 11}, { 1, 8}, { 1, 58}, { 1, 64}, { 1, 65}, /* Row 20 */ + { 1, 55}, { 1, 50}, { 2, 55}, { 1, 37}, { 1, 53}, { 1, 37}, { 1, 53}, { 1, 64}, + { 1, 8}, { 1, 11}, { 1, 21}, { 1, 60}, { 1, 51}, { 2, 0}, + { 2, 0}, { 1, 38}, { 1, 55}, { 1, 60}, { 2, 49}, { 1, 65}, { 1, 60}, { 1, 50}, /* Row 21 */ + { 1, 43}, { 3, 50}, { 1, 55}, { 2, 50}, { 1, 64}, { 1, 49}, { 2, 60}, { 1, 37}, + { 1, 38}, { 2, 0}, + { 2, 0}, { 1, 29}, { 1, 38}, { 2, 49}, { 2, 64}, { 1, 49}, { 2, 55}, { 2, 37}, /* Row 22 */ + { 3, 49}, { 1, 37}, { 1, 64}, { 1, 58}, { 2, 49}, { 1, 6}, { 1, 13}, { 2, 0}, + { 25, 0}, /* Row 23 */ + { 25, 0} /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_mimimizeBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_stopLut, // Index 0: Unselected LUT + g_stopLut, // Index 1: Selected LUT + }, + g_stopRleEntries // data - Pointer to the beginning of the RLE data +}; From 1678a29ea00e0555cc108c333e096b2c0b43ccae Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 17:09:57 +0000 Subject: [PATCH 010/390] More images of NxWM git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4673 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/images/nxconsole.gif | Bin 131 -> 0 bytes nxwm/images/nxlogo.png | Bin 0 -> 608 bytes nxwm/src/glyph_nsh.cxx | 210 ++++++++++++++++++++++++++++++++++++++ nxwm/src/glyph_stop.cxx | 8 +- 4 files changed, 214 insertions(+), 4 deletions(-) delete mode 100644 nxwm/images/nxconsole.gif create mode 100755 nxwm/images/nxlogo.png create mode 100755 nxwm/src/glyph_nsh.cxx diff --git a/nxwm/images/nxconsole.gif b/nxwm/images/nxconsole.gif deleted file mode 100644 index acb56754bb4a196700e919f323605ff25a5f5699..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 131 zcmZ?wbhEHblw^=%XkcUjg8%>j>wsvG2m@16Pd_8~%X=c-9~INm)`gwk+IUSoNJ(Ux zd}-qiuKjY$PCmMFq3YkUcez#*RSwG=l&ak7St2iV{fTC;@k-$nyM0BEEbMxVEfSOWld$u|oC diff --git a/nxwm/images/nxlogo.png b/nxwm/images/nxlogo.png new file mode 100755 index 0000000000000000000000000000000000000000..63ece46e5b6fd4a189f82c22324321248c9bffd8 GIT binary patch literal 608 zcmV-m0-ybfP)P000>X0ssI2ON$aT00001b5ch_0Itp) z=>Px#32;bRa{vGi!~g&e!~vBn4jTXf00(qQO+^RX1RW6oDWQ!HT>t<9@<~KNR5;6x zmC?DYKnR5Ylkb)S#b7T|4BJa628y{4tH$Ic@$6GnG7JMd{8SZRj|j`c{Z9AyKyF+e zRjN?E4CLRJZ)PXN{W0^eyyPvSIYoV9ChxEW!Sewz|Lh^Y3S^zw?NSPe*KaIAAXYI; zH__+JSpjjtxr0bIUY&dX+qLbX z{n;mSw1B(S?mU~U4WK4!dW_3FKM(&B5l|h9&7dj)rphV^bYs?8G6}k7q+a`%o(B3b zgE=wbJ>L{9@;5J>9Z=Z}qnjM5yE=e{spbV%Z7epWXYz<-w~vT!FqKdKwRgA3WV09D zT;4r1TQQU>+@ae9PgDEsIa8+zH!IEVF;cPOX^C`m-aHS#m+m9O^9_Xv5i3xA+D1{G up0WGa&*e^=V`WCf#ag@GX;t_ifPnwSIte~|43zT#0000 + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 36 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_nshLut[BITMAP_NLUTCODES] = +{ + 0xdbdbdb, 0xffffdb, 0x4949db, 0x2424db, 0x4924db, 0xdbdbff, 0x6d6ddb, 0x6d92db, /* Codes 0-7 */ + 0x2424b6, 0xffdbdb, 0xdbffff, 0x4992db, 0x24246d, 0xffffff, 0x6db6db, 0x242492, /* Codes 8-15 */ + 0x4924ff, 0x49b6db, 0x6d6db6, 0x92b6db, 0xb6dbdb, 0xb6dbff, 0x2424ff, 0x9292db, /* Codes 16-23 */ + 0x9292b6, 0x00006d, 0x9292ff, 0x240092, 0x24006d, 0x4949ff, 0x494992, 0x92b6ff, /* Codes 24-31 */ + 0xb6b6db, 0x4924b6, 0x92dbdb, 0x926ddb /* Codes 32-35 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_nshLut[BITMAP_NLUTCODES] = +{ + 0xdedb, 0xfffb, 0x4a5b, 0x213b, 0x493b, 0xdedf, 0x6b7b, 0x6c9b, 0x2136, 0xfedb, /* Codes 0-9 */ + 0xdfff, 0x4c9b, 0x212d, 0xffff, 0x6dbb, 0x2132, 0x493f, 0x4dbb, 0x6b76, 0x95bb, /* Codes 10-19 */ + 0xb6db, 0xb6df, 0x213f, 0x949b, 0x9496, 0x000d, 0x949f, 0x2012, 0x200d, 0x4a5f, /* Codes 20-29 */ + 0x4a52, 0x95bf, 0xb5bb, 0x4936, 0x96db, 0x937b /* Codes 30-35 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_nshLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0xfa, 0x59, 0x38, 0x43, 0xdf, 0x79, 0x8f, 0x34, 0xe5, 0xf4, 0x84, 0x2c, 0xff, 0xa4, 0x30, /* Codes 0-15 */ + 0x48, 0x99, 0x75, 0xaf, 0xcf, 0xd4, 0x3c, 0x9a, 0x96, 0x0c, 0x9e, 0x1b, 0x17, 0x5d, 0x51, 0xb3, /* Codes 16-31 */ + 0xba, 0x3f, 0xc5, 0x84 /* Codes 32-35 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_nshLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0xff, 0x4b, 0x27, 0x47, 0xdb, 0x6f, 0x73, 0x26, 0xfb, 0xdf, 0x53, 0x25, 0xff, 0x77, 0x26, /* Codes 0-15 */ + 0x47, 0x57, 0x6e, 0x97, 0xbb, 0xbb, 0x27, 0x93, 0x92, 0x01, 0x93, 0x22, 0x21, 0x4b, 0x4a, 0x97, /* Codes 16-31 */ + 0xb7, 0x46, 0x9b, 0x8f /* Codes 32-35 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_nshRleEntries[] = +{ + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 1}, { 11, 0}, /* Row 0 */ + { 11, 0}, { 3, 3}, { 11, 0}, /* Row 1 */ + { 9, 0}, { 4, 3}, { 1, 4}, { 2, 3}, { 9, 0}, /* Row 2 */ + { 4, 0}, { 1, 5}, { 4, 0}, { 2, 3}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 4}, /* Row 3 */ + { 1, 3}, { 6, 0}, { 1, 9}, { 2, 0}, + { 3, 0}, { 1, 5}, { 1, 10}, { 1, 11}, { 2, 0}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 4 */ + { 2, 10}, { 1, 12}, { 1, 3}, { 1, 4}, { 1, 3}, { 3, 0}, { 1, 13}, { 1, 5}, + { 1, 14}, { 2, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 15}, { 1, 16}, { 2, 4}, { 1, 3}, /* Row 5 */ + { 1, 10}, { 1, 13}, { 1, 10}, { 1, 12}, { 1, 3}, { 1, 4}, { 1, 3}, { 1, 2}, + { 1, 10}, { 1, 5}, { 1, 17}, { 1, 15}, { 2, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 18}, { 1, 8}, { 2, 4}, { 1, 3}, /* Row 6 */ + { 1, 10}, { 2, 13}, { 1, 19}, { 1, 12}, { 1, 4}, { 1, 3}, { 1, 19}, { 1, 13}, + { 1, 20}, { 1, 15}, { 1, 9}, { 2, 0}, + { 3, 0}, { 1, 10}, { 2, 13}, { 1, 10}, { 1, 12}, { 1, 16}, { 1, 4}, { 1, 3}, /* Row 7 */ + { 1, 10}, { 1, 5}, { 1, 13}, { 1, 10}, { 1, 12}, { 1, 4}, { 1, 2}, { 1, 10}, + { 1, 13}, { 1, 17}, { 1, 15}, { 3, 0}, + { 3, 0}, { 1, 10}, { 2, 13}, { 1, 10}, { 1, 18}, { 1, 8}, { 1, 4}, { 1, 3}, /* Row 8 */ + { 1, 10}, { 1, 21}, { 2, 13}, { 1, 19}, { 1, 22}, { 1, 23}, { 2, 13}, { 1, 15}, + { 1, 1}, { 3, 0}, + { 2, 0}, { 1, 2}, { 2, 13}, { 1, 5}, { 1, 13}, { 1, 10}, { 1, 18}, { 1, 4}, /* Row 9 */ + { 1, 3}, { 1, 10}, { 1, 5}, { 1, 24}, { 2, 13}, { 1, 24}, { 2, 13}, { 1, 19}, + { 1, 16}, { 1, 3}, { 1, 2}, { 2, 0}, + { 2, 0}, { 1, 2}, { 2, 13}, { 1, 18}, { 2, 13}, { 1, 10}, { 1, 16}, { 1, 3}, /* Row 10 */ + { 2, 10}, { 1, 12}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 12}, + { 2, 4}, { 1, 3}, { 1, 1}, { 1, 0}, + { 1, 1}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 25}, { 1, 10}, { 1, 13}, { 1, 10}, /* Row 11 */ + { 1, 15}, { 1, 3}, { 2, 10}, { 1, 25}, { 1, 26}, { 1, 13}, { 1, 10}, { 1, 13}, + { 1, 19}, { 1, 12}, { 3, 4}, { 1, 2}, { 1, 1}, + { 1, 2}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 3}, { 1, 10}, { 1, 13}, /* Row 12 */ + { 1, 18}, { 1, 27}, { 2, 10}, { 1, 28}, { 1, 22}, { 1, 23}, { 1, 13}, { 1, 20}, + { 1, 25}, { 1, 16}, { 3, 4}, { 1, 3}, { 1, 2}, + { 1, 1}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 3}, { 1, 23}, { 1, 13}, /* Row 13 */ + { 1, 10}, { 1, 25}, { 2, 10}, { 1, 25}, { 1, 29}, { 1, 10}, { 1, 13}, { 1, 10}, + { 1, 30}, { 1, 8}, { 3, 4}, { 1, 3}, { 1, 1}, + { 2, 0}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 2, 10}, { 1, 18}, /* Row 14 */ + { 1, 5}, { 1, 10}, { 1, 25}, { 1, 31}, { 1, 13}, { 1, 10}, { 1, 13}, { 1, 32}, + { 1, 28}, { 2, 4}, { 1, 3}, { 2, 0}, + { 2, 0}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 23}, { 1, 13}, /* Row 15 */ + { 1, 5}, { 1, 21}, { 1, 10}, { 1, 12}, { 1, 10}, { 1, 13}, { 1, 5}, { 1, 13}, + { 1, 10}, { 1, 30}, { 1, 4}, { 2, 3}, { 2, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 2, 4}, { 1, 3}, { 2, 13}, { 2, 21}, /* Row 16 */ + { 1, 10}, { 1, 13}, { 1, 5}, { 1, 3}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 33}, + { 4, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 3, 4}, { 1, 10}, { 1, 13}, { 2, 21}, /* Row 17 */ + { 2, 13}, { 1, 18}, { 1, 3}, { 1, 6}, { 2, 13}, { 1, 15}, { 1, 1}, { 3, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 3, 4}, { 1, 23}, { 1, 13}, { 1, 10}, /* Row 18 */ + { 1, 5}, { 1, 13}, { 1, 5}, { 1, 28}, { 1, 4}, { 1, 3}, { 1, 5}, { 1, 13}, + { 1, 14}, { 1, 15}, { 3, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 19 */ + { 1, 10}, { 3, 13}, { 1, 18}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 6}, { 1, 10}, + { 1, 21}, { 1, 15}, { 1, 9}, { 2, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 1}, { 1, 0}, { 1, 3}, { 1, 4}, /* Row 20 */ + { 1, 3}, { 1, 10}, { 1, 13}, { 1, 18}, { 1, 15}, { 1, 4}, { 1, 2}, { 1, 1}, + { 2, 0}, { 1, 13}, { 1, 34}, { 1, 15}, { 2, 0}, + { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 9}, { 2, 0}, { 2, 3}, { 1, 23}, /* Row 21 */ + { 1, 20}, { 1, 25}, { 1, 4}, { 1, 3}, { 1, 1}, { 3, 0}, { 1, 5}, { 1, 14}, + { 1, 15}, { 2, 0}, + { 3, 0}, { 1, 9}, { 2, 15}, { 1, 9}, { 2, 0}, { 3, 3}, { 1, 12}, { 1, 8}, /* Row 22 */ + { 1, 3}, { 1, 2}, { 4, 0}, { 1, 14}, { 1, 15}, { 1, 20}, { 2, 0}, + { 11, 0}, { 2, 3}, { 1, 6}, { 1, 1}, { 10, 0}, /* Row 23 */ + { 11, 0}, { 1, 1}, { 1, 35}, { 1, 1}, { 11, 0}, /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_nshBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nshLut, // Index 0: Unselected LUT + g_nshLut, // Index 1: Selected LUT + }, + g_nshRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index d5b2fe697..3e1568b98 100755 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -208,7 +208,7 @@ static const struct SRlePaletteBitmapEntry g_stopRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_mimimizeBitmap = +const struct SRlePaletteBitmap NXWidgets::g_stopBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format @@ -216,8 +216,8 @@ const struct SRlePaletteBitmap NXWidgets::g_mimimizeBitmap = BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_stopLut, // Index 0: Unselected LUT - g_stopLut, // Index 1: Selected LUT + g_stopLut, // Index 0: Unselected LUT + g_stopLut, // Index 1: Selected LUT }, - g_stopRleEntries // data - Pointer to the beginning of the RLE data + g_stopRleEntries // data - Pointer to the beginning of the RLE data }; From 598cf20658e0acd941fb0294adad939645f035d0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 17:30:37 +0000 Subject: [PATCH 011/390] More images of NxWM git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4674 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/images/start.png | Bin 0 -> 719 bytes nxwm/include/nxwmglyphs.hxx | 2 + nxwm/src/glyph_minimize.cxx | 2 +- nxwm/src/glyph_start.cxx | 211 ++++++++++++++++++++++++++++++++++++ nxwm/src/snxconsole.cxx | 180 ------------------------------ 5 files changed, 214 insertions(+), 181 deletions(-) create mode 100755 nxwm/images/start.png create mode 100755 nxwm/src/glyph_start.cxx delete mode 100644 nxwm/src/snxconsole.cxx diff --git a/nxwm/images/start.png b/nxwm/images/start.png new file mode 100755 index 0000000000000000000000000000000000000000..8cad1875684b48e7161366c93c2e893c333bcf59 GIT binary patch literal 719 zcmV;=0xP000>X0ssI2ON$aT00001b5ch_0Itp) z=>Px#32;bRa{vGh*8l(w*8xH(n|J^K00(qQO+^RX1RW6+4_z)?^#A|@VM#!0=`_$iZ;)%USEAYVO3?z1pow51OWiv;EWL;5iQz7k|(UJTyg=dh#lqmGhCSf zCCxDlXMxjuAUyzG`=O`^2vwDt*RTz%Q0Y8@E`3X)V#_a}OfaaCJ}aNGdS+EANMHa- zI}jPXRJtD&GMvuZGf$(as)WvNB+XpL)s^6d%fbcwWGQB4?h~H?^ricJK|wR;lc@`J z9UVYup9}}lHAUXr4pksLA#bM<5vc%L3}XT>YqbaKznSLle0R;~VY2 zO;Dal@@(Xxt9|k~^jxkd4_^H+2|B}#?jE?B(XbPF?RR9q$OwW2-6$f@%q)Tkh3!Jw zNF<8mr2vwfpZx6D+jdbN<}jS@!P#Nt=nH32R74PL`Fj_D0gj2?hK>&rlqNJb!fcDr`UK_L|9{%T80a>AIeXVjA-w7v@rH}07Us)fft+z@}TMa{}3v3o86{H z9hT!IYv>W^jUNReAgY{M8%djr07+wC3vd39{{hN7c5#w3=UxB+002ovPDHLkV1jck BIzs>e literal 0 HcmV?d00001 diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 0e58962c9..a311155b0 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -58,7 +58,9 @@ namespace NxWM { extern const struct NxWidgets::SRlePaletteBitmap g_nshBitmap; extern const struct NxWidgets::SRlePaletteBitmap g_minimizeBitmap; + extern const struct NxWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NxWidgets::SRlePaletteBitmap g_stopBitmap; +} #endif // __cplusplus #endif // __INCLUDE_NXWM_CONFIG_HXX diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 1d5237412..25521ee35 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -170,7 +170,7 @@ static const struct SRlePaletteBitmapEntry g_minimizeRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_mimimizeBitmap = +const struct SRlePaletteBitmap NXWidgets::g_minimizeBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx new file mode 100755 index 000000000..95a22e611 --- /dev/null +++ b/nxwm/src/glyph_start.cxx @@ -0,0 +1,211 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_start.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 34 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_startLut[BITMAP_NLUTCODES] = +{ + 0xdbdbdb, 0x6db66d, 0x006d00, 0x246d00, 0x6d9249, 0xdbffb6, 0xb6b692, 0x246d24, /* Codes 0-7 */ + 0x249224, 0x49b649, 0x6db649, 0x499249, 0xdbffdb, 0x92b692, 0xb6dbb6, 0x6ddb6d, /* Codes 8-15 */ + 0x92b66d, 0x6d926d, 0x92db92, 0x49926d, 0x49b624, 0x92db6d, 0xb6ffb6, 0xffffff, /* Codes 16-23 */ + 0x496d49, 0x92ff92, 0x24b624, 0x496d24, 0xb6db92, 0x499224, 0x249200, 0x92dbb6, /* Codes 24-31 */ + 0x004900, 0x009200 /* Codes 32-33 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_startLut[BITMAP_NLUTCODES] = +{ + 0xdedb, 0x6dad, 0x0360, 0x2360, 0x6c89, 0xdff6, 0xb5b2, 0x2364, 0x2484, 0x4da9, /* Codes 0-9 */ + 0x6da9, 0x4c89, 0xdffb, 0x95b2, 0xb6d6, 0x6ecd, 0x95ad, 0x6c8d, 0x96d2, 0x4c8d, /* Codes 10-19 */ + 0x4da4, 0x96cd, 0xb7f6, 0xffff, 0x4b69, 0x97f2, 0x25a4, 0x4b64, 0xb6d2, 0x4c84, /* Codes 20-29 */ + 0x2480, 0x96d6, 0x0240, 0x0480 /* Codes 30-33 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_startLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0x97, 0x3f, 0x4a, 0x7e, 0xeb, 0xb1, 0x4e, 0x64, 0x88, 0x93, 0x73, 0xf0, 0xa7, 0xcb, 0xad, /* Codes 0-15 */ + 0xa2, 0x82, 0xbc, 0x77, 0x84, 0xb8, 0xe0, 0xff, 0x5e, 0xd1, 0x79, 0x59, 0xc7, 0x6f, 0x60, 0xc0, /* Codes 16-31 */ + 0x2a, 0x55 /* Codes 32-33 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_startLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0x75, 0x0c, 0x2c, 0x71, 0xde, 0xb6, 0x2c, 0x30, 0x55, 0x75, 0x51, 0xdf, 0x96, 0xba, 0x79, /* Codes 0-15 */ + 0x95, 0x71, 0x9a, 0x51, 0x54, 0x99, 0xbe, 0xff, 0x4d, 0x9e, 0x34, 0x4c, 0xba, 0x50, 0x30, 0x9a, /* Codes 16-31 */ + 0x08, 0x10 /* Codes 32-33 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_startRleEntries[] = +{ + { 7, 0}, { 1, 1}, { 3, 2}, { 1, 3}, { 4, 2}, { 1, 4}, { 1, 5}, { 7, 0}, /* Row 0 */ + { 5, 0}, { 1, 6}, { 2, 7}, { 1, 8}, { 1, 9}, { 2, 1}, { 1, 10}, { 2, 9}, /* Row 1 */ + { 1, 11}, { 2, 7}, { 1, 1}, { 1, 12}, { 5, 0}, + { 4, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 1, 9}, { 8, 1}, { 1, 9}, { 1, 3}, /* Row 2 */ + { 1, 7}, { 1, 11}, { 1, 14}, { 4, 0}, + { 3, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 1, 9}, { 1, 15}, { 4, 1}, { 1, 16}, /* Row 3 */ + { 3, 1}, { 1, 15}, { 1, 9}, { 1, 8}, { 1, 7}, { 1, 17}, { 4, 0}, + { 2, 0}, { 1, 14}, { 1, 11}, { 1, 3}, { 1, 9}, { 1, 15}, { 4, 1}, { 1, 18}, /* Row 4 */ + { 1, 14}, { 1, 13}, { 1, 1}, { 1, 15}, { 1, 10}, { 1, 1}, { 1, 10}, { 2, 7}, + { 1, 13}, { 3, 0}, + { 2, 0}, { 1, 19}, { 1, 7}, { 1, 20}, { 1, 10}, { 2, 1}, { 1, 21}, { 1, 1}, /* Row 5 */ + { 1, 18}, { 1, 22}, { 1, 23}, { 1, 14}, { 1, 1}, { 2, 15}, { 1, 1}, { 1, 10}, + { 1, 9}, { 1, 2}, { 1, 11}, { 1, 14}, { 2, 0}, + { 1, 0}, { 1, 14}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 1}, { 1, 18}, /* Row 6 */ + { 1, 23}, { 1, 1}, { 1, 15}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 1}, { 2, 23}, + { 1, 1}, { 2, 9}, { 1, 8}, { 1, 2}, { 1, 4}, { 2, 0}, + { 1, 0}, { 1, 24}, { 1, 2}, { 1, 8}, { 1, 9}, { 1, 1}, { 1, 13}, { 2, 23}, /* Row 7 */ + { 1, 1}, { 1, 21}, { 1, 22}, { 1, 23}, { 1, 14}, { 1, 1}, { 1, 25}, { 1, 23}, + { 1, 14}, { 1, 1}, { 1, 9}, { 1, 26}, { 1, 2}, { 1, 7}, { 1, 14}, { 1, 0}, + { 1, 22}, { 1, 7}, { 1, 8}, { 2, 9}, { 1, 1}, { 1, 5}, { 1, 23}, { 1, 18}, /* Row 8 */ + { 1, 9}, { 1, 1}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 1}, { 1, 22}, + { 1, 23}, { 1, 21}, { 1, 9}, { 1, 26}, { 1, 8}, { 1, 7}, { 1, 1}, { 1, 0}, + { 1, 13}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 18}, { 1, 23}, { 1, 14}, { 2, 9}, /* Row 9 */ + { 1, 1}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 9}, { 1, 1}, { 1, 23}, + { 1, 14}, { 1, 10}, { 2, 8}, { 1, 2}, { 1, 24}, { 1, 0}, + { 1, 1}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 14}, { 1, 23}, { 1, 1}, { 2, 9}, /* Row 10 */ + { 1, 1}, { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 22}, { 1, 23}, + { 1, 1}, { 2, 8}, { 1, 3}, { 1, 27}, { 1, 14}, + { 1, 11}, { 1, 2}, { 2, 8}, { 1, 10}, { 2, 23}, { 1, 9}, { 2, 20}, { 1, 1}, /* Row 11 */ + { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 18}, { 1, 23}, { 1, 1}, + { 2, 8}, { 2, 7}, { 1, 14}, + { 1, 11}, { 1, 2}, { 2, 8}, { 1, 10}, { 1, 23}, { 1, 22}, { 1, 9}, { 2, 26}, /* Row 12 */ + { 1, 1}, { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 18}, { 1, 23}, + { 1, 1}, { 2, 8}, { 2, 7}, { 1, 13}, + { 1, 1}, { 1, 3}, { 2, 8}, { 1, 9}, { 1, 23}, { 1, 22}, { 1, 9}, { 2, 8}, /* Row 13 */ + { 1, 1}, { 1, 22}, { 1, 23}, { 1, 18}, { 2, 8}, { 1, 11}, { 1, 18}, { 1, 23}, + { 1, 1}, { 2, 8}, { 2, 7}, { 1, 14}, + { 1, 13}, { 1, 7}, { 2, 8}, { 1, 11}, { 1, 18}, { 1, 23}, { 1, 1}, { 2, 8}, /* Row 14 */ + { 1, 10}, { 1, 28}, { 1, 22}, { 1, 21}, { 2, 8}, { 1, 11}, { 1, 22}, { 1, 23}, + { 1, 9}, { 2, 8}, { 1, 7}, { 1, 24}, { 1, 0}, + { 1, 14}, { 1, 7}, { 3, 8}, { 1, 1}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 8}, /* Row 15 */ + { 1, 11}, { 1, 10}, { 1, 1}, { 1, 9}, { 1, 8}, { 1, 29}, { 1, 1}, { 1, 12}, + { 1, 23}, { 1, 11}, { 2, 8}, { 1, 7}, { 1, 11}, { 1, 0}, + { 1, 0}, { 1, 7}, { 1, 3}, { 2, 8}, { 1, 9}, { 1, 28}, { 1, 23}, { 1, 18}, /* Row 16 */ + { 1, 11}, { 5, 8}, { 1, 9}, { 1, 22}, { 1, 23}, { 1, 10}, { 2, 8}, { 1, 30}, + { 1, 7}, { 1, 13}, { 1, 0}, + { 1, 0}, { 1, 17}, { 1, 7}, { 3, 8}, { 1, 1}, { 2, 23}, { 1, 31}, { 1, 15}, /* Row 17 */ + { 2, 26}, { 1, 9}, { 1, 21}, { 1, 22}, { 1, 23}, { 1, 13}, { 1, 29}, { 2, 8}, + { 1, 2}, { 1, 8}, { 2, 0}, + { 2, 0}, { 1, 24}, { 1, 2}, { 3, 8}, { 1, 9}, { 1, 22}, { 4, 23}, { 1, 14}, /* Row 18 */ + { 2, 23}, { 1, 1}, { 1, 29}, { 2, 8}, { 2, 7}, { 1, 13}, { 2, 0}, + { 2, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 3, 8}, { 1, 9}, { 1, 1}, { 1, 18}, /* Row 19 */ + { 1, 14}, { 2, 23}, { 1, 18}, { 1, 10}, { 4, 8}, { 1, 2}, { 1, 17}, { 3, 0}, + { 3, 0}, { 1, 17}, { 1, 2}, { 1, 7}, { 3, 8}, { 1, 29}, { 1, 11}, { 1, 10}, /* Row 20 */ + { 1, 1}, { 1, 9}, { 1, 11}, { 4, 8}, { 1, 2}, { 1, 27}, { 1, 14}, { 3, 0}, + { 3, 0}, { 1, 14}, { 1, 11}, { 2, 3}, { 10, 8}, { 1, 30}, { 1, 32}, { 1, 7}, /* Row 21 */ + { 1, 13}, { 4, 0}, + { 4, 0}, { 1, 14}, { 1, 24}, { 1, 7}, { 1, 3}, { 8, 8}, { 1, 7}, { 1, 32}, /* Row 22 */ + { 1, 27}, { 1, 13}, { 5, 0}, + { 5, 0}, { 1, 14}, { 1, 17}, { 2, 7}, { 2, 2}, { 2, 33}, { 1, 3}, { 3, 7}, /* Row 23 */ + { 1, 24}, { 1, 6}, { 6, 0}, + { 6, 0}, { 1, 14}, { 1, 13}, { 1, 4}, { 1, 7}, { 4, 2}, { 1, 7}, { 1, 11}, /* Row 24 */ + { 1, 13}, { 1, 14}, { 7, 0}, +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_startBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_startLut, // Index 0: Unselected LUT + g_startLut, // Index 1: Selected LUT + }, + g_startRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/snxconsole.cxx b/nxwm/src/snxconsole.cxx deleted file mode 100644 index 34912933e..000000000 --- a/nxwm/src/snxconsole.cxx +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************************** - * NxWidgets/nxwm/src/snxconsole.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - ********************************************************************************************/ - -/******************************************************************************************** - * Included Files - ********************************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "nxwmconfig.hxx" -#include "crlepalettebitmap.hxx" -#include "cnxconsole.hxx" - -/******************************************************************************************** - * Pre-Processor Definitions - ********************************************************************************************/ - -#define BITMAP_NROWS 26 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 2 - -/******************************************************************************************** - * Private Bitmap Data - ********************************************************************************************/ - -using namespace NxWM; - -/* RGB24 (8-8-8) Colors */ - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 - -static const uint32_t g_nshNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR -}; - -static const uint32_t g_nshSelectedLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR -}; - -/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ - -#elif CONFIG_NXWIDGETS_BPP == 16 - -static const uint16_t g_nshNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR -}; - -static const uint16_t g_nshSelectedLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR -}; - -/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used - * to lookup an 8-bit value. There is no savings in that! It would be better to just put - * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these - * pointless lookups. But these pointless lookups do make the logic compatible with the - * 16- and 24-bit types. - */ - -#elif CONFIG_NXWIDGETS_BPP == 8 - -/* RGB8 (332) Colors or 8-bit greyscale */ - -static const nxgl_mxpixel_t g_nshNormalLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR -}; - -static const nxgl_mxpixel_t g_nshSelectedLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR, CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR -}; - -#else -# error "Unsupport pixel format" -#endif - -static const struct SRlePaletteBitmapEntry g_nshRleEntries[] = -{ - {11, 0}, {4, 1}, {10, 0}, /* Row 0 */ - {7, 0}, {1, 1}, {2, 0}, {5, 1}, {2, 0}, {1, 1}, {7, 0}, /* Row 1 */ - {6, 0}, {3, 1}, {2, 0}, {4, 1}, {2, 0}, {2, 1}, {6, 0}, /* Row 2 */ - {5, 0}, {4, 1}, {2, 0}, {4, 1}, {2, 0}, {4, 1}, {4, 0}, /* Row 3 */ - {6, 0}, {3, 1}, {2, 0}, {4, 1}, {2, 0}, {3, 1}, {5, 0}, /* Row 4 */ - {3, 0}, {1, 1}, {2, 0}, {3, 1}, {2, 0}, {4, 1}, {1, 0}, {4, 1}, /* Row 5 */ - {2, 0}, {1, 1}, {2, 0}, - {2, 0}, {3, 1}, {1, 0}, {3, 1}, {2, 0}, {4, 1}, {1, 0}, {4, 1}, /* Row 6 */ - {1, 0}, {3, 1}, {1, 0}, - {1, 0}, {4, 1}, {2, 0}, {3, 1}, {1, 0}, {4, 1}, {1, 0}, {3, 1}, /* Row 7 */ - {2, 0}, {3, 1}, {1, 0}, - {1, 0}, {5, 1}, {1, 0}, {3, 1}, {1, 0}, {4, 1}, {1, 0}, {3, 1}, /* Row 8 */ - {1, 0}, {4, 1}, {1, 0}, - {2, 0}, {4, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, {2, 0}, {2, 1}, /* Row 9 */ - {2, 0}, {4, 1}, {1, 0}, - {3, 0}, {3, 1}, {2, 0}, {2, 1}, {1, 0}, {3, 1}, {2, 0}, {2, 1}, /* Row 10 */ - {1, 0}, {4, 1}, {2, 0}, - {2, 1}, {2, 0}, {3, 1}, {1, 0}, {2, 1}, {2, 0}, {2, 1}, {2, 0}, /* Row 11 */ - {2, 1}, {1, 0}, {3, 1}, {2, 0}, {1, 1}, - {3, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 12 */ - {2, 1}, {2, 0}, {3, 1}, {1, 0}, {2, 1}, - {4, 1}, {1, 0}, {3, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 13 */ - {2, 1}, {1, 0}, {3, 1}, {1, 0}, {3, 1}, - {4, 1}, {2, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, {1, 0}, /* Row 14 */ - {2, 1}, {1, 0}, {2, 1}, {2, 0}, {3, 1}, - {1, 0}, {4, 1}, {2, 0}, {1, 1}, {1, 0}, {2, 1}, {1, 0}, {2, 1}, /* Row 15 */ - {1, 0}, {1, 1}, {1, 0}, {2, 1}, {2, 0}, {3, 1}, {1, 0}, - {2, 0}, {4, 1}, {1, 0}, {2, 1}, {1, 0}, {1, 1}, {1, 0}, {2, 1}, /* Row 16 */ - {1, 0}, {1, 1}, {1, 0}, {2, 1}, {1, 0}, {4, 1}, {1, 0}, - {3, 0}, {4, 1}, {1, 0}, {1, 1}, {1, 0}, {1, 1}, {1, 0}, {6, 1}, /* Row 17 */ - {1, 0}, {4, 1}, {2, 0}, - {5, 0}, {2, 1}, {1, 0}, {9, 1}, {1, 0}, {3, 1}, {4, 0}, /* Row 18 */ - {6, 0}, {14, 1}, {5, 0}, /* Row 19 */ - {5, 0}, {16, 1}, {4, 0}, /* Row 20 */ - {4, 0}, {18, 1}, {3, 0}, /* Row 21 */ - {4, 0}, {18, 1}, {3, 0}, /* Row 22 */ - {4, 0}, {18, 1}, {3, 0}, /* Row 23 */ - {4, 0}, {18, 1}, {3, 0}, /* Row 24 */ - {5, 0}, {16, 1}, {4, 0}, /* Row 25 */ -}; - -/******************************************************************************************** - * Public Bitmap Structure Defintions - ********************************************************************************************/ - -const struct SRlePaletteBitmap NxWM::g_nshBitmap = -{ - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_nshNormalLut, // Index 0: Unselected LUT - g_nshSelectedLut, // Index 1: Selected LUT - }, - g_nshRleEntries // data - Pointer to the beginning of the RLE data -}; From 2788274ea687246434c52ac2c1c8c1030c51a4bd Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 19:18:24 +0000 Subject: [PATCH 012/390] NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4675 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/include/capplicationwindow.hxx | 34 +++- nxwm/include/nxwmconfig.hxx | 28 +++- nxwm/src/capplicationwindow.cxx | 241 ++++++++++++++++++++++++++-- 3 files changed, 281 insertions(+), 22 deletions(-) diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 6f802ebe5..607538e12 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -88,11 +88,24 @@ namespace NxWM class CApplicationWindow : public INxApplication { protected: - NxWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ - NxWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ - NxWidgets::CImage *m_minimize; /**< The minimize icon */ - NxWidgets::CImage *m_close; /**< The close icon */ - IApplicationCallback *m_callback; /**< Toolbar action callbacks */ + NxWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ + NxWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ + NxWidgets::CImage *m_minimizeImage; /**< The minimize icon */ + NxWidgets::CImage *m_stopImage; /**< The close icon */ + NxWidgets::CLabel *m_windowLabel; /**< The window title */ + NxWidgets::CRlePaletteBitmap *m_minimizeBitmap; /**< The minimize icon bitmap */ + NxWidgets::CRlePaletteBitmap *m_stopBitmap; /**< The stop icon bitmap */ + NxWidgets::CRlePaletteBitmap *m_minimizeBitmap; /**< The minimize icon bitmap */ + NxWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ + IApplicationCallback *m_callback; /**< Toolbar action callbacks */ + + /** + * Configure the standard application toolbar + * + * @return True if the toolcar was successfully initialized. + */ + + bool configureToolbar(void); /** * CNxApplicationWindow Destructor @@ -131,6 +144,17 @@ namespace NxWM return m_window; } + /** + * Set the window label + * + * @param appname. The name of the application to place on the window + */ + + inline void setWindowLabel(NxWidgets::CNxString &appname) + { + m_windowLabel->setText(appname); + } + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index e5a85ac5a..1400d41a4 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -56,13 +56,21 @@ # warning "NX multi-user support is required (CONFIG_NX_MULTIUSER)" #endif +/** + * Default font ID + */ + +#ifndef CONFIG_NXWM_DEFAULT_FONTID +# define CONFIG_NXWM_DEFAULT_FONTID NXFONT_DEFAULT +#endif + /* Colors *******************************************************************/ /** * Normal background color */ #ifndef CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR #endif /** @@ -70,7 +78,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR #endif /** @@ -89,6 +97,22 @@ # define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248) #endif +/** + * The default font color + */ + +#ifndef CONFIG_NXWM_DEFAULT_FONTCOLOR +# define CONFIG_NXWM_DEFAULT_FONTCOLOR MKRGB(255,255,255) +#endif + +/** + * The transparent color + */ + +#ifndef CONFIG_NXWM_TRANSPARENT_COLOR +# define CONFIG_NXWM_TRANSPARENT_COLOR MKRGB(0,0,0) +#endif + /* Task Bar Configuation ***************************************************/ /* At present, all icons are 25 pixels in "widgth" and, hence require a * task bar of at least that size. diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 0c5c9791f..6ffb1dd53 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -40,6 +40,7 @@ #include #include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" #include "cappliationwinow.hxx" /******************************************************************************************** @@ -61,11 +62,26 @@ CNxApplicationWindow::CNxApplicationWindow(NxWidgets::CNxTkWindow *window); { - m_window = (NxWidgets::CNxTkWindow *)0; - m_toolbar = (NxWidgets::CNxToolbar *)0; - m_minimize = (NxWidgets::CImage *)0; - m_close = (NxWidgets::CImage *)0; - m_callback = (IApplicationCallback *)0; + // Save the window for later use + + m_window = window; + + // These will be created with the open method is called + + m_toolbar = (NxWidgets::CNxToolbar *)0; + + m_minimizeImage = (NxWidgets::CImage *)0; + m_stopImage = (NxWidgets::CImage *)0; + m_windowLabel = (NxWidgets::CLabel *)0; + + m_minimizeBitmap = (NxWidgets::CRlePaletteBitmap *)0; + m_stopBitmap = (NxWidgets::CRlePaletteBitmap *)0; + + m_windowFont = (NxWidgets::CNxFont *)0; + + // This will be initialized when the registerCallbacks() method is called + + m_callback = (IApplicationCallback *)0; } /** @@ -76,21 +92,41 @@ CNxApplicationWindow::~CNxApplicationWindow(void) { // Free the resources that we are responsible for + if (m_minimizeImage) + { + delete m_minimizeImage; + } + + if (m_stopImage) + { + delete m_stopImage; + } + + if (m_windowLabel) + { + delete m_windowLabel; + } + + if (m_minimizeBitmap) + { + delete m_minimizeBitmap; + } + + if (m_stopBitmap) + { + delete m_stopBitmap; + } + + if (m_windowFont) + { + delete m_windowFont; + } + if (m_toolbar) { delete m_toolbar; } - if (m_minimize) - { - delete m_minimize; - } - - if (m_close) - { - delete m_close; - } - // We didn't create the window. That was done by the task bar, // Be we will handle destruction of with window as a courtesy. @@ -109,7 +145,182 @@ CNxApplicationWindow::~CNxApplicationWindow(void) bool CNxApplicationWindow::open(void) { + /* Configure the toolbar */ + if (!configureToolbar()) + { + return false; + } + + return true; +} + +/** + * Configure the standard application toolbar + * + * @return True if the toolcar was successfully initialized. + */ + +bool configureToolbar(void) +{ + // Open the toolbar + + m_toolbar = m_window->openToolbar(); + if (!m_toolbar) + { + // We failed to open the toolbar + + return false; + } + + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_toolbar->getSize(&windowSize)) + { + return false; + } + + // Get the CWidgetControl associated with this window + + NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + if (control) + { + return false; + } + + // Create STOP bitmap container + + m_stopBitmap = new NxWidgets::CRlePaletteBitmap(&g_stopBitmap); + if (!m_stopBitmap) + { + return false; + } + + // Create the STOP application icon at the right of the toolbar + + nxgl_point_t iconPos; + nxgl_size_t iconSize; + + // Get the height and width of the stop bitmap + + iconSize.w = m_stopBitmap->getWidth(); + iconSize.h = m_stopBitmap->getHeight(); + + // The default CImage has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. + // (We could let CImage do this for us by calling + // CImage::getPreferredDimensions()) + + iconSize.w += 2 * 1; + iconSize.h += 2 * 1; + + // Pick an X/Y position such that the image will position at the right of + // the toolbar and centered vertically. + + iconPos.x = windowSize.w - iconsize.w; + + if (iconSize.h >= windowSize.h) + { + iconPos.y = 0; + } + else + { + iconPos.y = (windowSize.h - iconSize.h) >> 1; + } + + // Now we have enough information to create the image + + m_stopImage = new CImage(control, iconPos.x, iconPos.y, iconSize.w, iconSize.h, m_stopBitmap); + if (!m_stopImage) + { + return false; + } + + // Create MINIMIZE application bitmap container + + m_minimizeBitmap = new NxWidgets::CRlePaletteBitmap(&g_minimizeBitmap); + if (!m_minimizeBitmap) + { + return false; + } + + // Get the height and width of the stop bitmap + + iconSize.w = m_minimizeBitmap->getWidth(); + iconSize.h = m_minimizeBitmap->getHeight(); + + // The default CImage has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. + // (We could let CImage do this for us by calling + // CImage::getPreferredDimensions()) + + iconSize.w += 2 * 1; + iconSize.h += 2 * 1; + + // Pick an X/Y position such that the image will position at the right of + // the toolbar and centered vertically. + + iconPos.x -= iconsize.w; + + if (iconSize.h >= windowSize.h) + { + iconPos.y = 0; + } + else + { + iconPos.y = (windowSize.h - iconSize.h) >> 1; + } + + // Now we have enough information to create the image + + m_minimizeImage = new CImage(control, iconPos.x, iconPos.y, iconSize.w, iconSize.h, m_minimizeBitmap); + if (!m_minimizeImage) + { + return false; + } + + // The rest of the toolbar will hold the left-justified application label + // Create the default font instance + + m_windowFont = new CNxFont(CONFIG_NXWM_DEFAULT_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, + CONFIG_NXWM_TRANSPARENT_COLOR); + if (!m_windowFont) + { + return false; + } + // Get the width of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CLabelTest::createGraphics: Failed to get window size\n"); + return (CLabel *)NULL; + } + + // Get the height and width of the text display area + + size.w = pos.x + size.h = windowSize.h; + + pos.x = 0; + pos.y = 0; + + // Now we have enough information to create the label + + m_windowLabel = new CLabel(control, pos.x, pos.y, size.w, size.h, ""); + if (!m_windowLabel) + { + return false; + } + + // Configure the label + + m_windowLabel->setBorderLess(true); + m_windowLabel->setTextAlignmentHoriz(NxWidgets::TEXT_ALIGNMENT_HORIZ_LEFT); + m_windowLabel->setTextAlignmentVert(NxWidgets::TEXT_ALIGNMENT_VERT_CENTER); + return true; } From ff3967512e7fc683d526f694daa1a6818264cf1f Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 29 Apr 2012 22:10:52 +0000 Subject: [PATCH 013/390] NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4676 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/Makefile | 13 ++- nxwm/Makefile | 121 ++++++++++++++++++++++++ nxwm/include/capplicationwindow.hxx | 49 +++++----- nxwm/include/cnxbackimage.hxx | 4 +- nxwm/include/cnxtaskbar.hxx | 17 +++- nxwm/include/nxwmconfig.hxx | 13 ++- nxwm/include/nxwmglyphs.hxx | 14 +-- nxwm/src/capplicationwindow.cxx | 141 ++++++++++++++++------------ nxwm/src/cnxtaskbar.cxx | 33 +++++-- 9 files changed, 290 insertions(+), 115 deletions(-) create mode 100644 nxwm/Makefile diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index e3ff57339..9a52087ed 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -36,8 +36,7 @@ -include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs -NXWDIR := ${shell pwd | sed -e 's/ /\\ /g'} - +NXWIDGETDIR := ${shell pwd | sed -e 's/ /\\ /g'} ASRCS = CSRCS = @@ -76,8 +75,12 @@ OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) BIN = libnxwidgets$(LIBEXT) -CFLAGS += -I include -CXXFLAGS += -I include +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} DEPPATH = --dep-path src VPATH = src @@ -97,7 +100,7 @@ check_nuttx: @( \ if [ -z "$(TOPDIR)" ]; then \ echo "The path to the nuttx directory must be provided on the command line."; \ - echo "Usage: make -C $(NXWDIR) TOPDIR=\"\""; \ + echo "Usage: make -C $(NXWIDGETDIR) TOPDIR=\"\""; \ exit 1; \ fi; \ if [ ! -d "$(TOPDIR)" ]; then \ diff --git a/nxwm/Makefile b/nxwm/Makefile new file mode 100644 index 000000000..5197d03d6 --- /dev/null +++ b/nxwm/Makefile @@ -0,0 +1,121 @@ +################################################################################# +# NxWidgets/nxwm/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs + +NXWMDIR := ${shell pwd | sed -e 's/ /\\ /g'} +NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets + +ASRCS = +CSRCS = +# Window Manager +CXXSRCS = capplicationwindow.cxx cnxconsole.cxx cnxtaskbar.cxx +# Images +CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_start.cxx glyph_stop.cxx + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +BIN = libnxwm$(LIBEXT) + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} +CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} +CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} + +DEPPATH = --dep-path src +VPATH = src + +all: $(BIN) +.PHONY = check_nuttx depend clean distclean export + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +check_nuttx: + @( \ + if [ -z "$(TOPDIR)" ]; then \ + echo "The path to the nuttx directory must be provided on the command line."; \ + echo "Usage: make -C $(NXWMDIR) TOPDIR=\"\""; \ + exit 1; \ + fi; \ + if [ ! -d "$(TOPDIR)" ]; then \ + echo "The nuttx directory (TOPDIR) does not exist: $(TOPDIR)"; \ + exit 1; \ + fi; \ + if [ ! -f "$(TOPDIR)/.config" ]; then \ + echo "The nuttx directory (TOPDIR) has not been configured"; \ + echo "Please configure NuttX and try again"; \ + exit 1; \ + fi; \ + ) + +$(BIN): check_nuttx $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f $(BIN) *.a *.o *~ .*.sw* + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +export: $(BIN) + zip -r nxwidgets-export.zip include $(BIN) COPYING + +-include Make.dep diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 607538e12..984f03b46 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -43,6 +43,12 @@ #include #include "cnxtkwindow.hxx" +#include "cnxtoolbar.hxx" +#include "cwidgeteventargs.hxx" +#include "cwidgeteventhandler.hxx" +#include "cimage.hxx" +#include "clabel.hxx" +#include "crlepalettebitmap.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -56,8 +62,6 @@ namespace NxWM { - class CNxtkWindow; - /** * This callback class is used by the application to get notification of toolbar * related events. @@ -85,44 +89,43 @@ namespace NxWM * and close buttions and passes these to the application via callbacks. */ - class CApplicationWindow : public INxApplication + class CApplicationWindow : private NXWidgets::CWidgetEventHandler { protected: - NxWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ - NxWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ - NxWidgets::CImage *m_minimizeImage; /**< The minimize icon */ - NxWidgets::CImage *m_stopImage; /**< The close icon */ - NxWidgets::CLabel *m_windowLabel; /**< The window title */ - NxWidgets::CRlePaletteBitmap *m_minimizeBitmap; /**< The minimize icon bitmap */ - NxWidgets::CRlePaletteBitmap *m_stopBitmap; /**< The stop icon bitmap */ - NxWidgets::CRlePaletteBitmap *m_minimizeBitmap; /**< The minimize icon bitmap */ - NxWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ + NXWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ + NXWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ + NXWidgets::CImage *m_minimizeImage; /**< The minimize icon */ + NXWidgets::CImage *m_stopImage; /**< The close icon */ + NXWidgets::CLabel *m_windowLabel; /**< The window title */ + NXWidgets::CRlePaletteBitmap *m_minimizeBitmap; /**< The minimize icon bitmap */ + NXWidgets::CRlePaletteBitmap *m_stopBitmap; /**< The stop icon bitmap */ + NXWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ IApplicationCallback *m_callback; /**< Toolbar action callbacks */ /** - * Configure the standard application toolbar + * Handle a mouse button click event. * - * @return True if the toolcar was successfully initialized. + * @param e The event data. */ - - bool configureToolbar(void); + + void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); /** - * CNxApplicationWindow Destructor + * CApplicationWindow Destructor */ - ~CNxApplicationWindow(void); + ~CApplicationWindow(void); public: /** - * CNxApplicationWindow Constructor + * CApplicationWindow Constructor * * @param taskbar. A pointer to the parent task bar instance * @param window. The window to be used by this application. */ - CNxApplicationWindow(NxWidgets::CNxTkWindow *window); + CApplicationWindow(NXWidgets::CNxTkWindow *window); /** * Initialize window. Window initialization is separate from @@ -139,7 +142,7 @@ namespace NxWM * @return. The window used by this application */ - inline NxWidgets::CNxTkWindow *getWindow(void) const + inline NXWidgets::CNxTkWindow *getWindow(void) const { return m_window; } @@ -150,7 +153,7 @@ namespace NxWM * @param appname. The name of the application to place on the window */ - inline void setWindowLabel(NxWidgets::CNxString &appname) + inline void setWindowLabel(NXWidgets::CNxString &appname) { m_windowLabel->setText(appname); } @@ -161,7 +164,7 @@ namespace NxWM void registerCallbacks(IApplicationCallback *callback) { - m_callback = callback + m_callback = callback; } }; } diff --git a/nxwm/include/cnxbackimage.hxx b/nxwm/include/cnxbackimage.hxx index 903a4880d..cc56e6519 100644 --- a/nxwm/include/cnxbackimage.hxx +++ b/nxwm/include/cnxbackimage.hxx @@ -64,10 +64,10 @@ namespace NxWM * This class describes the NX windo manager's background image. */ - class CNxBackImage : public NxWidgets::CImage + class CNxBackImage : public NXWidgets::CImage { private: - NxWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window + NXWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window public: /** diff --git a/nxwm/include/cnxtaskbar.hxx b/nxwm/include/cnxtaskbar.hxx index 5f1a81527..3809e17ff 100644 --- a/nxwm/include/cnxtaskbar.hxx +++ b/nxwm/include/cnxtaskbar.hxx @@ -60,11 +60,11 @@ namespace NxWM * This class describes the NX window manager's task bar */ - class CNxTaskBar : public NxWidgets::CNxServer + class CNxTaskBar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler { private: - NxWidgets:INxWindow *m_taskbar; /**< The toolbar window */ - NxWidgets:INxWindow *m_background; /**< The background window */ + NXWidgets:INxWindow *m_taskbar; /**< The toolbar window */ + NXWidgets:INxWindow *m_background; /**< The background window */ INxApplication *m_start; /**< The start window */ /** @@ -110,7 +110,7 @@ namespace NxWM * @param window. The window to be resized and repositioned */ - void setApplicationGeometry(NxWidgets::INxWindow *window); + void setApplicationGeometry(NXWidgets::INxWindow *window); /** * Create the toolbar window. @@ -128,6 +128,15 @@ namespace NxWM bool createBackgroundWindow(void); + + /** + * Handle a mouse button click event. + * + * @param e The event data. + */ + + void handleClickEvent(const CWidgetEventArgs &e); + /** * CNxTaskBar Destructor */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 1400d41a4..dc6c2acf2 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NXWM_CONFIG_HXX -#define __INCLUDE_NXWM_CONFIG_HXX +#ifndef __INCLUDE_NXWMCONFIG_HXX +#define __INCLUDE_NXWMCONFIG_HXX /**************************************************************************** * Included Files @@ -43,6 +43,7 @@ #include #include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -141,6 +142,12 @@ # define CONFIG_NXWM_TASKBAR_TOP 1 #endif +/* Tool Bar Configuration ***************************************************/ + +#ifndef CONFIG_NXWM_TOOLBAR_HEIGHT +# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH +#endif + /* Colors *******************************************************************/ -#endif // __INCLUDE_NXWM_CONFIG_HXX +#endif // __INCLUDE_NXWMCONFIG_HXX diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index a311155b0..bacd35891 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NXWM_CONFIG_HXX -#define __INCLUDE_NXWM_CONFIG_HXX +#ifndef __INCLUDE_NXWMGLYPHS_HXX +#define __INCLUDE_NXWMGLYPHS_HXX /**************************************************************************** * Included Files @@ -56,11 +56,11 @@ namespace NxWM { - extern const struct NxWidgets::SRlePaletteBitmap g_nshBitmap; - extern const struct NxWidgets::SRlePaletteBitmap g_minimizeBitmap; - extern const struct NxWidgets::SRlePaletteBitmap g_startBitmap; - extern const struct NxWidgets::SRlePaletteBitmap g_stopBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } #endif // __cplusplus -#endif // __INCLUDE_NXWM_CONFIG_HXX +#endif // __INCLUDE_NXWMGLYPHS_HXX diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 6ffb1dd53..a753cec3e 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -39,28 +39,30 @@ #include +#include + #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" -#include "cappliationwinow.hxx" +#include "capplicationwindow.hxx" /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ /******************************************************************************************** - * CNxApplicationWindow Method Implementations + * CApplicationWindow Method Implementations ********************************************************************************************/ using namespace NxWM; /** - * CNxApplicationWindow Constructor + * CApplicationWindow Constructor * * @param taskbar. A pointer to the parent task bar instance * @param window. The window to be used by this application. */ -CNxApplicationWindow::CNxApplicationWindow(NxWidgets::CNxTkWindow *window); +CApplicationWindow::CApplicationWindow(NXWidgets::CNxTkWindow *window) { // Save the window for later use @@ -68,16 +70,16 @@ CNxApplicationWindow::CNxApplicationWindow(NxWidgets::CNxTkWindow *window); // These will be created with the open method is called - m_toolbar = (NxWidgets::CNxToolbar *)0; + m_toolbar = (NXWidgets::CNxToolbar *)0; - m_minimizeImage = (NxWidgets::CImage *)0; - m_stopImage = (NxWidgets::CImage *)0; - m_windowLabel = (NxWidgets::CLabel *)0; + m_minimizeImage = (NXWidgets::CImage *)0; + m_stopImage = (NXWidgets::CImage *)0; + m_windowLabel = (NXWidgets::CLabel *)0; - m_minimizeBitmap = (NxWidgets::CRlePaletteBitmap *)0; - m_stopBitmap = (NxWidgets::CRlePaletteBitmap *)0; + m_minimizeBitmap = (NXWidgets::CRlePaletteBitmap *)0; + m_stopBitmap = (NXWidgets::CRlePaletteBitmap *)0; - m_windowFont = (NxWidgets::CNxFont *)0; + m_windowFont = (NXWidgets::CNxFont *)0; // This will be initialized when the registerCallbacks() method is called @@ -85,10 +87,10 @@ CNxApplicationWindow::CNxApplicationWindow(NxWidgets::CNxTkWindow *window); } /** - * CNxApplicationWindow Destructor + * CApplicationWindow Destructor */ -CNxApplicationWindow::~CNxApplicationWindow(void) +CApplicationWindow::~CApplicationWindow(void) { // Free the resources that we are responsible for @@ -143,29 +145,11 @@ CNxApplicationWindow::~CNxApplicationWindow(void) * @return True if the window was successfully initialized. */ -bool CNxApplicationWindow::open(void) -{ - /* Configure the toolbar */ - - if (!configureToolbar()) - { - return false; - } - - return true; -} - -/** - * Configure the standard application toolbar - * - * @return True if the toolcar was successfully initialized. - */ - -bool configureToolbar(void) +bool CApplicationWindow::open(void) { // Open the toolbar - m_toolbar = m_window->openToolbar(); + m_toolbar = m_window->openToolbar(CONFIG_NXWM_TOOLBAR_HEIGHT); if (!m_toolbar) { // We failed to open the toolbar @@ -183,7 +167,7 @@ bool configureToolbar(void) // Get the CWidgetControl associated with this window - NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); if (control) { return false; @@ -191,7 +175,7 @@ bool configureToolbar(void) // Create STOP bitmap container - m_stopBitmap = new NxWidgets::CRlePaletteBitmap(&g_stopBitmap); + m_stopBitmap = new NXWidgets::CRlePaletteBitmap(&g_stopBitmap); if (!m_stopBitmap) { return false; @@ -199,8 +183,8 @@ bool configureToolbar(void) // Create the STOP application icon at the right of the toolbar - nxgl_point_t iconPos; - nxgl_size_t iconSize; + struct nxgl_point_s iconPos; + struct nxgl_size_s iconSize; // Get the height and width of the stop bitmap @@ -218,7 +202,7 @@ bool configureToolbar(void) // Pick an X/Y position such that the image will position at the right of // the toolbar and centered vertically. - iconPos.x = windowSize.w - iconsize.w; + iconPos.x = windowSize.w - iconSize.w; if (iconSize.h >= windowSize.h) { @@ -231,15 +215,20 @@ bool configureToolbar(void) // Now we have enough information to create the image - m_stopImage = new CImage(control, iconPos.x, iconPos.y, iconSize.w, iconSize.h, m_stopBitmap); + m_stopImage = new NXWidgets::CImage(control, iconPos.x, iconPos.y, iconSize.w, + iconSize.h, m_stopBitmap); if (!m_stopImage) { return false; } + // Configure 'this' to receive mouse click inputs from the image + + m_stopImage->addWidgetEventHandler(this); + // Create MINIMIZE application bitmap container - m_minimizeBitmap = new NxWidgets::CRlePaletteBitmap(&g_minimizeBitmap); + m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&g_minimizeBitmap); if (!m_minimizeBitmap) { return false; @@ -261,7 +250,7 @@ bool configureToolbar(void) // Pick an X/Y position such that the image will position at the right of // the toolbar and centered vertically. - iconPos.x -= iconsize.w; + iconPos.x -= iconSize.w; if (iconSize.h >= windowSize.h) { @@ -274,42 +263,40 @@ bool configureToolbar(void) // Now we have enough information to create the image - m_minimizeImage = new CImage(control, iconPos.x, iconPos.y, iconSize.w, iconSize.h, m_minimizeBitmap); + m_minimizeImage = new NXWidgets::CImage(control, iconPos.x, iconPos.y, iconSize.w, + iconSize.h, m_minimizeBitmap); if (!m_minimizeImage) { return false; } + // Configure 'this' to receive mouse click inputs from the image + + m_minimizeImage->addWidgetEventHandler(this); + // The rest of the toolbar will hold the left-justified application label // Create the default font instance - m_windowFont = new CNxFont(CONFIG_NXWM_DEFAULT_FONTID, - CONFIG_NXWM_DEFAULT_FONTCOLOR, - CONFIG_NXWM_TRANSPARENT_COLOR); + m_windowFont = new NXWidgets::CNxFont(CONFIG_NXWM_DEFAULT_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, + CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_windowFont) { return false; } - // Get the width of the display - - struct nxgl_size_s windowSize; - if (!m_bgWindow->getSize(&windowSize)) - { - printf("CLabelTest::createGraphics: Failed to get window size\n"); - return (CLabel *)NULL; - } // Get the height and width of the text display area - size.w = pos.x - size.h = windowSize.h; + iconSize.w = iconPos.x; + iconSize.h = windowSize.h; - pos.x = 0; - pos.y = 0; + iconPos.x = 0; + iconPos.y = 0; // Now we have enough information to create the label - m_windowLabel = new CLabel(control, pos.x, pos.y, size.w, size.h, ""); + m_windowLabel = new NXWidgets::CLabel(control, iconPos.x, iconPos.y, + iconSize.w, iconSize.h, ""); if (!m_windowLabel) { return false; @@ -317,10 +304,42 @@ bool configureToolbar(void) // Configure the label - m_windowLabel->setBorderLess(true); - m_windowLabel->setTextAlignmentHoriz(NxWidgets::TEXT_ALIGNMENT_HORIZ_LEFT); - m_windowLabel->setTextAlignmentVert(NxWidgets::TEXT_ALIGNMENT_VERT_CENTER); + m_windowLabel->setBorderless(true); + m_windowLabel->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_LEFT); + m_windowLabel->setTextAlignmentVert(NXWidgets::CLabel::TEXT_ALIGNMENT_VERT_CENTER); + m_windowLabel->setRaisesEvents(false); return true; } +/** + * Handle a mouse button click event. + * + * @param e The event data. + */ + +void CApplicationWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +{ + // Ignore the event if no callback is registered + + if (m_callback) + { + // Check the stop application image + + if (m_stopImage->isClicked()) + { + // Notify the controlling logic that the application should be stopped + + m_callback->close(); + } + + // Check the minimize image (only if the stop application image is not pressed) + + else if (m_minimizeImage->isClicked()) + { + // Notify the controlling logic that the application should be miminsed + + m_callback->minimize(); + } + } +} diff --git a/nxwm/src/cnxtaskbar.cxx b/nxwm/src/cnxtaskbar.cxx index b230c6785..6b93bc793 100644 --- a/nxwm/src/cnxtaskbar.cxx +++ b/nxwm/src/cnxtaskbar.cxx @@ -202,7 +202,7 @@ void CNxTaskBar::disconnect(void) // Close the windows - NxWidgets::CWidgetControl *control; + NXWidgets::CWidgetControl *control; if (m_taskbar) { // Delete the contained widget control. We are responsible for it @@ -273,12 +273,12 @@ NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void) { // Initialize the widget control using the default style - NxWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NxWidgets::CNxWindow window = createRawWindow(widgetControl); + NXWidgets::CNxWindow window = createRawWindow(widgetControl); if (!window) { message("CNxwm::createGraphics: Failed to create background window\n"); @@ -312,12 +312,12 @@ NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) { // Initialize the widget control using the default style - NxWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NxWidgets:CNxTkWindow window = createRawWindow(widgetControl); + NXWidgets:CNxTkWindow window = createRawWindow(widgetControl); if (!window) { message("CNxwm::createGraphics: Failed to create background window\n"); @@ -347,12 +347,12 @@ NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) * @return true on success */ -bool CNxTaskBar::setApplicationGeometry(NxWidgets::INxWindow *window) +bool CNxTaskBar::setApplicationGeometry(NXWidgets::INxWindow *window) { // Get the widget control from the toolbar window. The physical window geometry // should be the same for all windows. - NxWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Now position and size the application. This will depend on the position and // orientation of the toolbar. @@ -415,7 +415,7 @@ bool CNxTaskBar::createToolbarWindow(void) // Get the contained widget control - NxWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Get the size of the window from the widget control @@ -490,7 +490,7 @@ bool CNxTaskBar::createBackgroundWindow(void) // Set the geometry to fit in the application window space - setApplicationGeometry(static_cast(m_background)); + setApplicationGeometry(static_cast(m_background)); /* And lower the background window to the bottom of the display */ @@ -518,7 +518,7 @@ bool CNxTaskBar::createStartWindow(void) // Set the geometry to fit in the application window space - setApplicationGeometry(static_cast(m_start)); + setApplicationGeometry(static_cast(m_start)); /* And lower the background window to the top of the display */ @@ -530,3 +530,16 @@ bool CNxTaskBar::createStartWindow(void) // m_start return true; } + +/** + * Handle a mouse button click event. + * + * @param e The event data. + */ + +void CNxApplicationWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +{ +#warning "Missing logic" +} + + From b4e9aa7fbf38996262743a3c3f5d6e13827eac05 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 30 Apr 2012 01:21:26 +0000 Subject: [PATCH 014/390] NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4677 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/Makefile | 2 +- nxwm/include/capplicationwindow.hxx | 2 +- ...{cnxbackimage.hxx => cbackgroundimage.hxx} | 16 +- nxwm/include/cnxconsole.hxx | 12 +- .../{cnxstart.hxx => cstartwindow.hxx} | 44 ++-- nxwm/include/{cnxtaskbar.hxx => ctaskbar.hxx} | 84 ++++--- .../{inxapplication.hxx => iapplication.hxx} | 31 +-- nxwm/include/nxwmconfig.hxx | 12 +- nxwm/src/capplicationwindow.cxx | 2 +- nxwm/src/cnxconsole.cxx | 11 +- nxwm/src/{cnxtaskbar.cxx => ctaskbar.cxx} | 212 ++++++++---------- nxwm/src/glyph_minimize.cxx | 6 +- nxwm/src/glyph_nsh.cxx | 7 +- nxwm/src/glyph_start.cxx | 7 +- nxwm/src/glyph_stop.cxx | 7 +- 15 files changed, 217 insertions(+), 238 deletions(-) rename nxwm/include/{cnxbackimage.hxx => cbackgroundimage.hxx} (90%) rename nxwm/include/{cnxstart.hxx => cstartwindow.hxx} (72%) rename nxwm/include/{cnxtaskbar.hxx => ctaskbar.hxx} (70%) rename nxwm/include/{inxapplication.hxx => iapplication.hxx} (82%) rename nxwm/src/{cnxtaskbar.cxx => ctaskbar.cxx} (70%) diff --git a/nxwm/Makefile b/nxwm/Makefile index 5197d03d6..0dea92d62 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -42,7 +42,7 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = # Window Manager -CXXSRCS = capplicationwindow.cxx cnxconsole.cxx cnxtaskbar.cxx +CXXSRCS = capplicationwindow.cxx cnxconsole.cxx ctaskbar.cxx # Images CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 984f03b46..805df4184 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Abstract Base Classes + * Implementation Classes ****************************************************************************/ #if defined(__cplusplus) diff --git a/nxwm/include/cnxbackimage.hxx b/nxwm/include/cbackgroundimage.hxx similarity index 90% rename from nxwm/include/cnxbackimage.hxx rename to nxwm/include/cbackgroundimage.hxx index cc56e6519..89ca469cd 100644 --- a/nxwm/include/cnxbackimage.hxx +++ b/nxwm/include/cbackgroundimage.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NXWM_INCLUDE_CNXBACKIMAGE_HXX -#define __NXWM_INCLUDE_CNXBACKIMAGE_HXX +#ifndef __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX +#define __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX /**************************************************************************** * Included Files @@ -64,25 +64,25 @@ namespace NxWM * This class describes the NX windo manager's background image. */ - class CNxBackImage : public NXWidgets::CImage + class CBackgroundImage : public NXWidgets::CImage { private: NXWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window public: /** - * CNxBackImage Constructor + * CBackgroundImage Constructor */ - CNxBackImage(void); + CBackgroundImage(void); /** - * CNxBackImage Destructor + * CBackgroundImage Destructor */ - ~CNxBackImage(void); + ~CBackgroundImage(void); }; } #endif // __cplusplus -#endif // __NXWM_INCLUDE_CNXBACKIMAGE_HXX +#endif // __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 891ac8884..4009eb8b9 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -42,9 +42,7 @@ #include -#include "crlepalettebitmap.hxx" -#include "inxwindow.hxx" -#include "cnxapplication.hxx" +#include "iapplication.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -62,7 +60,7 @@ namespace NxWM * This class implements the NxConsole application. */ - class CNxConsole : public CNxApplication + class CNxConsole : public IApplication { protected: /** @@ -83,12 +81,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must * be deleted by the caller when it is no long needed. */ - NXWidgets::INxBitmap *getIcon(void); + NXWidgets::IBitmap *getIcon(void); }; } #endif // __cplusplus diff --git a/nxwm/include/cnxstart.hxx b/nxwm/include/cstartwindow.hxx similarity index 72% rename from nxwm/include/cnxstart.hxx rename to nxwm/include/cstartwindow.hxx index fbfb9c54b..c47b85d83 100644 --- a/nxwm/include/cnxstart.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CNXSTART_NXX -#define __INCLUDE_CNXSTART_NXX +#ifndef __INCLUDE_CSTARTWINDOW_NXX +#define __INCLUDE_CSTARTWINDOW_NXX /**************************************************************************** * Included Files @@ -42,7 +42,8 @@ #include -#include "cnxapplication.hxx" +#include "iapplication.hxx" +#include "tnxarray.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -56,33 +57,34 @@ namespace NxWM { - class CNxTaskbar; + class CTaskbar; class CApplicationWindow; - class CNxStart : public INxApplication + class CStartWindow : public IApplication { protected: - CNxTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + TNxArray m_applications; /**< List of apps in the start window */ /** - * CNxStart Constructor + * CStartWindow Constructor */ - ~CNxStart(void); + ~CStartWindow(void); public: /** - * CNxStart Constructor + * CStartWindow Constructor * * @param taskbar. A pointer to the parent task bar instance * @param window. The window to be used by this application. */ - CNxStart(CNxTaskbar *taskbar, CApplicationWindow *window); + CStartWindow(CTaskbar *taskbar, CApplicationWindow *window); /** - * Each implementation of INxApplication must provide a method to recover + * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. */ @@ -91,12 +93,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must * be deleted by the caller when it is no long needed. */ - NXWidgets::INxBitmap *getIcon(void); + NXWidgets::IBitmap *getIcon(void); /** * Get the name string associated with the application @@ -119,17 +121,23 @@ namespace NxWM stop(void); /** - * Add the application to the start window + * Add the application to the start window. The general sequence for + * setting up the start window is: + * + * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, + * 2. Call CStartMenu::addApplication numerous times to install applications + * in the start window. + * 3. Call CTaskBar::startApplication (initially minimized) to start the start + * window application. * * @param application. The new application to add to the start window * @return true on success */ - bool addApplication(INxApplication *application); - + bool addApplication(IApplication *application); }; } #endif // __cplusplus -#endif // __INCLUDE_CNXSTART_NXX +#endif // __INCLUDE_CSTARTWINDOW_NXX diff --git a/nxwm/include/cnxtaskbar.hxx b/nxwm/include/ctaskbar.hxx similarity index 70% rename from nxwm/include/cnxtaskbar.hxx rename to nxwm/include/ctaskbar.hxx index 3809e17ff..0c420a0e2 100644 --- a/nxwm/include/cnxtaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NXWM_INCLUDE_CNXTASKBAR_HXX -#define __NXWM_INCLUDE_CNXTASKBAR_HXX +#ifndef __NXWM_INCLUDE_CTASKBAR_HXX +#define __NXWM_INCLUDE_CTASKBAR_HXX /**************************************************************************** * Included Files @@ -43,6 +43,13 @@ #include #include "nxconfig.hxx" +#include "tnxarray.hxx" +#include "inxwindow.hxx" +#include "cnxserver.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgeteventargs.hxx" + +#include "iapplication.hxx" /**************************************************************************** * Pre-processor Definitions @@ -60,12 +67,12 @@ namespace NxWM * This class describes the NX window manager's task bar */ - class CNxTaskBar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler + class CTaskbar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler { private: - NXWidgets:INxWindow *m_taskbar; /**< The toolbar window */ - NXWidgets:INxWindow *m_background; /**< The background window */ - INxApplication *m_start; /**< The start window */ + NXWidgets::INxWindow *m_taskbar; /**< The toolbar window */ + NXWidgets::INxWindow *m_background; /**< The background window */ + TNxArray m_applications; /**< List of apps in the task bar */ /** * Connect to the server @@ -97,7 +104,7 @@ namespace NxWM /** * Create a framed application window * - * This may be used to provide the window parater to the INxApplication constructor + * This may be used to provide the window parater to the IApplication constructor * * @return A partially initialized application window instance. */ @@ -135,66 +142,50 @@ namespace NxWM * @param e The event data. */ - void handleClickEvent(const CWidgetEventArgs &e); + void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); /** - * CNxTaskBar Destructor + * CTaskbar Destructor */ - ~CNxTaskBar(void); + ~CTaskbar(void); public: /** - * CNxTaskBar Constructor + * CTaskbar Constructor * * @param hWnd - NX server handle */ - CNxTaskBar(void); - - /** - * Add the application to the start window. The window manager start-up - * sequence is: - * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display - * - * @param application. The new application to add to the start window - * @return true on success - */ - - bool addApplication(INxApplication *application); + CTaskbar(void); /** * Start the window manager and present the initial displays. The window * manager start-up sequence is: * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display + * 1. Create the CTaskbar instance, + * 2. Call CTaskBar::startApplication repeatedly to add applications to the task bar + * 3. Call CTaskBar::startWindowManager to start the display with applications in place * * startWindowManager will present the taskar and the background image. The * initial taskbar will contain only the start window icon. - * - * @param application. The new application to add to the start window - * @return true on success */ - bool startWindowManager(start); + bool startWindowManager(void); /** - * Create an application window. Creating a new applicatino in the start + * Create an application window. Creating a new application in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, + * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the + * start window. * * When the application is selected from the start window: * - * 4. Call startApplication start the application and bring its window to + * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. */ @@ -202,24 +193,25 @@ namespace NxWM /** * Start an application and add its icon to the taskbar. The applications's - * window is brought to the top. Creating a new applicatino in the start + * window is brought to the top. Creating a new application in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, + * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the start window. * * When the application is selected from the start window: * - * 4. Call startApplication start the application and bring its window to + * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. * - * @param application. The new application to add to the task bar + * @param app. The new application to add to the task bar + * @param minimized. The new application starts in the minimized state * @return true on success */ - bool startApplication(INxApplication *application); + bool startApplication(IApplication *app, bool minimized); /** * Hide an application by moving its window to the bottom. @@ -228,7 +220,7 @@ namespace NxWM * @return true on success */ - bool hideApplication(INxApplication *application); + bool hideApplication(IApplication *application); /** * Destroy an application. Move its window to the bottom and remove its @@ -238,9 +230,9 @@ namespace NxWM * @return true on success */ - bool stopApplication(INxApplication *application); + bool stopApplication(IApplication *application); }; } #endif // __cplusplus -#endif // __NXWM_INCLUDE_CNXTASKBAR_HXX +#endif // __NXWM_INCLUDE_CTASKBAR_HXX diff --git a/nxwm/include/inxapplication.hxx b/nxwm/include/iapplication.hxx similarity index 82% rename from nxwm/include/inxapplication.hxx rename to nxwm/include/iapplication.hxx index 70d4ac104..1056e18c0 100644 --- a/nxwm/include/inxapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/include/inxapplication.hxx + * NxWidgets/nxwm/include/iapplication.hxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_INXAPPLICATION_NXX -#define __INCLUDE_INXAPPLICATION_NXX +#ifndef __INCLUDE_IAPPLICATION_NXX +#define __INCLUDE_IAPPLICATION_NXX /**************************************************************************** * Included Files @@ -42,6 +42,10 @@ #include +#include "cnxstring.hxx" +#include "ibitmap.hxx" +#include "capplicationwindow.hxx" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -54,18 +58,15 @@ namespace NxWM { - class CApplicationWindow; - class NxWidget::CNxString; - /** - * INxApplication provides the abstract base class for each NxWM application. + * IApplication provides the abstract base class for each NxWM application. */ - class INxApplication + class IApplication { public: /** - * Each implementation of INxApplication must provide a method to recover + * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. */ @@ -74,12 +75,12 @@ namespace NxWM /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must * be deleted by the caller when it is no long needed. */ - virtual NXWidgets::INxBitmap *getIcon(void) = 0; + virtual NXWidgets::IBitmap *getIcon(void) = 0; /** * Get the name string associated with the application @@ -93,16 +94,16 @@ namespace NxWM * Start the application. */ - virtual run(void) = 0; + virtual void run(void) = 0; /** * Stop the application. */ - virtual stop(void) = 0; + virtual void stop(void) = 0; }; } #endif // __cplusplus -#endif // __INCLUDE_INXAPPLICATION_NXX +#endif // __INCLUDE_IAPPLICATION_NXX diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index dc6c2acf2..178cc37a2 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -71,7 +71,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160) #endif /** @@ -79,7 +79,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR +# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192) #endif /** @@ -127,18 +127,18 @@ #if defined(CONFIG_NXWM_TASKBAR_TOP) # if defined(CONFIG_NXWM_TASKBAR_BOTTOM) || defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) # if defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif defined(CONFIG_NXWM_TASKBAR_LEFT) # if defined defined (CONFIG_NXWM_TASKBAR_RIGHT) -# warning "Multiple task positions specified" +# warning "Multiple task bar positions specified" # endif #elif !defined(CONFIG_NXWM_TASKBAR_RIGHT) -# warning "No task positions specified" +# warning "No task bar position specified" # define CONFIG_NXWM_TASKBAR_TOP 1 #endif diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index a753cec3e..8fd578c1a 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cnxtaskbar.cxx + * NxWidgets/nxwm/src/capplicationwindow.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index d4e4b15c6..a127a8a5a 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -41,6 +41,7 @@ #include "nxwmconfig.hxx" #include "cnxconsole.hxx" +#include "nxwmglyphs.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -50,6 +51,8 @@ * CNxConsole Method Implementations ********************************************************************************************/ +using namespace NxWM; + /** * CNxConsole constructor * @@ -63,14 +66,14 @@ CNxConsole::CNxConsole(NXWidgets::INxWindow *window) /** * Get the icon associated with the application * - * @return An instance if INxBitmap that may be used to rend the - * application's icon. This is an new INxBitmap instance that must + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must * be deleted by the caller when it is no long needed. */ -NXWidgets::INxBitmap *CNxConsole::getIcon(void) +NXWidgets::IBitmap *CNxConsole::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = new NXWidgets::CRlePaletteBitmap(&g_nshBitmap); - return static_cast(bitmap); + return static_cast(bitmap); } diff --git a/nxwm/src/cnxtaskbar.cxx b/nxwm/src/ctaskbar.cxx similarity index 70% rename from nxwm/src/cnxtaskbar.cxx rename to nxwm/src/ctaskbar.cxx index 6b93bc793..407396ee5 100644 --- a/nxwm/src/cnxtaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cnxtaskbar.cxx + * NxWidgets/nxwm/src/ctaskbar.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -39,8 +39,14 @@ #include +#include + +#include "crect.hxx" +#include "cwidgetcontrol.hxx" +#include "cnxtkwindow.hxx" + #include "nxwmconfig.hxx" -#include "cnxconsole.hxx" +#include "ctaskbar.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -53,49 +59,33 @@ using namespace NxWM; /** - * CNxTaskBar Constructor + * CTaskbar Constructor * * @param hWnd - NX server handle */ -CNxTaskBar::CNxTaskBar(void) +CTaskbar::CTaskbar(void) { - m_taskbar = (INxWindow *)NULL; - m_background = (INxWindow *)NULL; - m_start = (INxWindow *)NULL; + m_taskbar = (NXWidgets::INxWindow *)0; + m_background = (NXWidgets::INxWindow *)0; } /** - * CNxTaskBar Destructor + * CTaskbar Destructor */ -CNxTaskBar::~CNxTaskBar(void) +CTaskbar::~CTaskbar(void) { disconnect(); } -/** - * Add the application to the start window. The window manager start-up - * sequence is: - * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display - * - * @param application. The new application to add to the start window - * @return true on success - */ - -bool CNxTaskBar::addApplication(INxApplication *application) -{ -} /** * Start the window manager and present the initial displays. The window * manager start-up sequence is: * - * 1. Create the CNxTaskBar instance, - * 2. Call addApplication repeatedly to add applications to the start window - * 3. Call startWindowManager to start the display + * 1. Create the CTaskbar instance, + * 2. Call startApplication repeatedly to add applications to the task bar + * 3. Call startWindowManager to start the display with applications in place * * startWindowManager will present the taskar and the background image. The * initial taskbar will contain only the start window icon. @@ -104,10 +94,14 @@ bool CNxTaskBar::addApplication(INxApplication *application) * @return true on success */ -bool CNxTaskBar::startWindowManager(start); +bool CTaskbar::startWindowManager(void) +{ +#warning "Missing logic" + return false; +} /** - * Create an application window. Creating a new applicatino in the start + * Create an application window. Creating a new application in the start * window requires three steps: * * 1. Call openApplicationWindow to create a window for the application, @@ -121,29 +115,35 @@ bool CNxTaskBar::startWindowManager(start); * the top. */ -CApplicationWindow *CNxTaskBar::openApplicationWindow(void); +CApplicationWindow *CTaskbar::openApplicationWindow(void) +{ +#warning "Missing logic" + return (CApplicationWindow *)0; +} /** * Start an application and add its icon to the taskbar. The applications's * window is brought to the top. Creating a new applicatino in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, - * 2. Instantiate the application, providing the window to the application's - * constructor, - * 3. Then call addApplication to add the application to the start window. + * 1. Create the CTaskbar instance, + * 2. Call startApplication repeatedly to add applications to the task bar + * 3. Call startWindowManager to start the display with applications in place * * When the application is selected from the start window: * * 4. Call startApplication start the application and bring its window to * the top. * - * @param application. The new application to add to the task bar + * @param app. The new application to add to the task bar + * @param minimized. The new application starts in the minimized state * @return true on success */ -bool CNxTaskBar::startApplication(INxApplication *application) +bool CTaskbar::startApplication(IApplication *app, bool minimized) { +#warning "Missing logic" + return false; } /** @@ -153,8 +153,23 @@ bool CNxTaskBar::startApplication(INxApplication *application) * @return true on success */ -bool CNxTaskBar::hideApplication(INxApplication *application) +bool CTaskbar::hideApplication(IApplication *application) { + // Every application provides a method to obtain its applicatin window + + CApplicationWindow *appWindow = application->getWindow(); + + // Each application window provides a method to get the underlying NX window + + NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + + // Lower the window + + window->lower(); + + // Grey out the image in task bar +#warning "Missing logic" + return true; } /** @@ -165,15 +180,17 @@ bool CNxTaskBar::hideApplication(INxApplication *application) * @return true on success */ -bool CNxTaskBar::stopApplication(INxApplication *application) +bool CTaskbar::stopApplication(IApplication *application) { +#warning "Missing logic" + return false; } /** * Connect to the server */ -bool CNxTaskBar::connect(void) +bool CTaskbar::connect(void) { // Connect to the server @@ -182,9 +199,9 @@ bool CNxTaskBar::connect(void) { // Set the background color - if (!setBackgroundColor(CONFIG_CNXWM_BGCOLOR)) + if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR)) { - message("CNxwm::connect: setBackgroundColor failed\n"); + // Failed } } @@ -195,10 +212,17 @@ bool CNxTaskBar::connect(void) * Disconnect from the server */ -void CNxTaskBar::disconnect(void) +void CTaskbar::disconnect(void) { - // Delete all applications -#warning "Missing logic + // Stop all applications and remove them from the task bar. Clearly, there + // are some ordering issues here... On an orderly system shutdown, disconnection + // should really occur priority to deleting instances + + while (!m_applications.empty()) + { + IApplication *app = m_applications.at(0); + stopApplication(app); + } // Close the windows @@ -235,22 +259,6 @@ void CNxTaskBar::disconnect(void) delete m_background; } - if (m_start) - { - // Delete the contained widget control. We are responsible for it - // because we created it - - control = m_start->getWidgetControl(); - if (control) - { - delete control; - } - - // Then delete the start window - - delete m_start; - } - // And disconnect from the server CNxServer::disconnect(); @@ -269,19 +277,18 @@ void CNxTaskBar::disconnect(void) * widget constructor */ -NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void) +NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { // Initialize the widget control using the default style - NXWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *widgetControl = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NXWidgets::CNxWindow window = createRawWindow(widgetControl); + NXWidgets::CNxWindow *window = createRawWindow(widgetControl); if (!window) { - message("CNxwm::createGraphics: Failed to create background window\n"); delete widgetControl; return false; } @@ -291,9 +298,8 @@ NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void) bool success = window->open(); if (!success) { - message("CNxwm::createGraphics: Failed to open background window\n"); delete window; - window = (NXWidgets::INxWindow *)0; + window = (NXWidgets::CNxWindow *)0; return false; } @@ -303,24 +309,23 @@ NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void) /** * Create a framed application window * - * This may be used to provide the window parater to the INxApplication constructor + * This may be used to provide the window parater to the IApplication constructor * * @return A partially initialized application window instance. */ -NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) +NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { // Initialize the widget control using the default style - NXWidgets::CWidgetControl *widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *widgetControl = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NXWidgets:CNxTkWindow window = createRawWindow(widgetControl); + NXWidgets::CNxTkWindow *window = createFramedWindow(widgetControl); if (!window) { - message("CNxwm::createGraphics: Failed to create background window\n"); delete widgetControl; return false; } @@ -330,9 +335,8 @@ NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) bool success = window->open(); if (!success) { - message("CNxwm::createGraphics: Failed to open background window\n"); delete window; - window = (NXWidgets::INxWindow *)0; + window = (NXWidgets::CNxTkWindow *)0; return false; } @@ -347,18 +351,22 @@ NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void) * @return true on success */ -bool CNxTaskBar::setApplicationGeometry(NXWidgets::INxWindow *window) +void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) { // Get the widget control from the toolbar window. The physical window geometry // should be the same for all windows. NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + // Get the size of the window from the widget control + + NXWidgets::CRect rect = control->getWindowBoundingBox(); + // Now position and size the application. This will depend on the position and // orientation of the toolbar. - nxgl_point_t pos; - nxgl_size_t size; + struct nxgl_point_s pos; + struct nxgl_size_s size; #if defined(CONFIG_NXWM_TASKBAR_TOP) pos.x = 0; @@ -402,14 +410,13 @@ bool CNxTaskBar::setApplicationGeometry(NXWidgets::INxWindow *window) * @return true on success */ -bool CNxTaskBar::createToolbarWindow(void) +bool CTaskbar::createToolbarWindow(void) { // Create a raw window to present the toolbar m_taskbar = openRawWindow(); if (!m_taskbar) { - message("CNxwm::createGraphics: Failed to create CBgWindow instance\n"); return false; } @@ -419,13 +426,13 @@ bool CNxTaskBar::createToolbarWindow(void) // Get the size of the window from the widget control - CRect rect = control->getWindowBoundingBox(); + NXWidgets::CRect rect = control->getWindowBoundingBox(); // Now position and size the toolbar. This will depend on the position and // orientation of the toolbar. - nxgl_point_t pos; - nxgl_size_t size; + struct nxgl_point_s pos; + struct nxgl_size_s size; #if defined(CONFIG_NXWM_TASKBAR_TOP) pos.x = 0; @@ -464,7 +471,7 @@ bool CNxTaskBar::createToolbarWindow(void) /* And raise the window to the top of the display */ - m_taskbar->raise(void); + m_taskbar->raise(); // Add the start menu's icon to the toolbar #warning "Missing logic" @@ -477,67 +484,34 @@ bool CNxTaskBar::createToolbarWindow(void) * @return true on success */ -bool CNxTaskBar::createBackgroundWindow(void) +bool CTaskbar::createBackgroundWindow(void) { // Create a raw window to present the background image m_background = openRawWindow(); if (!m_background) { - message("CNxwm::createGraphics: Failed to create background window\n"); return false; } // Set the geometry to fit in the application window space - setApplicationGeometry(static_cast(m_background)); + setApplicationGeometry(static_cast(m_background)); /* And lower the background window to the bottom of the display */ - m_background->lower(void); + m_background->lower(); return true; } -/** - * Create the start window. - * - * @return true on success - */ - -bool CNxTaskBar::createStartWindow(void) -{ - // Create a raw window to present the background image - - m_start = openFramedWindow(); - if (!m_start) - { - message("CNxwm::createGraphics: Failed to create start window\n"); - return false; - } - - // Set the geometry to fit in the application window space - - setApplicationGeometry(static_cast(m_start)); - - /* And lower the background window to the top of the display */ - - m_start->raise(void); - - // Now create the start up application -#warning "Missing logic" - - // m_start - return true; -} - /** * Handle a mouse button click event. * * @param e The event data. */ -void CNxApplicationWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +void CTaskbar::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) { #warning "Missing logic" } diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 25521ee35..8c4228279 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -49,7 +49,7 @@ #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" -#include "glyphs.hxx" +#include "nxwmglyphs.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -121,7 +121,7 @@ static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = # error "Unsupport pixel format" #endif -static const struct SRlePaletteBitmapEntry g_minimizeRleEntries[] = +static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = { { 25, 0}, /* Row 0 */ { 25, 0}, /* Row 1 */ @@ -170,7 +170,7 @@ static const struct SRlePaletteBitmapEntry g_minimizeRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_minimizeBitmap = +const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 54a91b581..8e9b0746d 100755 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -49,7 +49,8 @@ #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" -#include "glyphs.hxx" + +#include "nxwmglyphs.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -125,7 +126,7 @@ static const nxgl_mxpixel_t g_nshLut[BITMAP_NLUTCODES] = # error "Unsupport pixel format" #endif -static const struct SRlePaletteBitmapEntry g_nshRleEntries[] = +static const struct NXWidgets::SRlePaletteBitmapEntry g_nshRleEntries[] = { { 11, 0}, { 1, 1}, { 1, 2}, { 1, 1}, { 11, 0}, /* Row 0 */ { 11, 0}, { 3, 3}, { 11, 0}, /* Row 1 */ @@ -195,7 +196,7 @@ static const struct SRlePaletteBitmapEntry g_nshRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_nshBitmap = +const struct NXWidgets::SRlePaletteBitmap g_nshBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index 95a22e611..a81d6b19f 100755 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -49,7 +49,8 @@ #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" -#include "glyphs.hxx" + +#include "nxwmglyphs.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -125,7 +126,7 @@ static const nxgl_mxpixel_t g_startLut[BITMAP_NLUTCODES] = # error "Unsupport pixel format" #endif -static const struct SRlePaletteBitmapEntry g_startRleEntries[] = +static const struct NXWidgets::SRlePaletteBitmapEntry g_startRleEntries[] = { { 7, 0}, { 1, 1}, { 3, 2}, { 1, 3}, { 4, 2}, { 1, 4}, { 1, 5}, { 7, 0}, /* Row 0 */ { 5, 0}, { 1, 6}, { 2, 7}, { 1, 8}, { 1, 9}, { 2, 1}, { 1, 10}, { 2, 9}, /* Row 1 */ @@ -196,7 +197,7 @@ static const struct SRlePaletteBitmapEntry g_startRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_startBitmap = +const struct NXWidgets::SRlePaletteBitmap g_startBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index 3e1568b98..5c4c5477e 100755 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -49,7 +49,8 @@ #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" -#include "glyphs.hxx" + +#include "nxwmglyphs.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -136,7 +137,7 @@ static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = # error "Unsupport pixel format" #endif -static const struct SRlePaletteBitmapEntry g_stopRleEntries[] = +static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] = { { 25, 0}, /* Row 0 */ { 25, 0}, /* Row 1 */ @@ -208,7 +209,7 @@ static const struct SRlePaletteBitmapEntry g_stopRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct SRlePaletteBitmap NXWidgets::g_stopBitmap = +const struct NXWidgets::SRlePaletteBitmap g_stopBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format From a880cf62867609a93698d7deaf193834e630db6d Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 30 Apr 2012 20:38:44 +0000 Subject: [PATCH 015/390] Completes first cut at task bar git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4678 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +- UnitTests/nxwm/Makefile | 172 ++++++++ UnitTests/nxwm/main.cxx | 262 ++++++++++++ nxwm/include/capplicationwindow.hxx | 13 +- nxwm/include/cbackgroundimage.hxx | 88 ---- nxwm/include/cstartwindow.hxx | 5 +- nxwm/include/ctaskbar.hxx | 142 ++++++- nxwm/include/iapplication.hxx | 61 ++- nxwm/include/nxwmconfig.hxx | 51 ++- nxwm/include/nxwmglyphs.hxx | 1 + nxwm/src/ctaskbar.cxx | 618 ++++++++++++++++++++++++++-- 11 files changed, 1252 insertions(+), 165 deletions(-) create mode 100644 UnitTests/nxwm/Makefile create mode 100644 UnitTests/nxwm/main.cxx delete mode 100644 nxwm/include/cbackgroundimage.hxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 8064137e0..d9dfda7b2 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -11,5 +11,5 @@ * CImage: If selected, uses different LUTs based, different borders. CImage is now basically a button type. * CImage: Add logic to hightlight an CImage (using the selected LUT). -* nxwm: This directory will, hopefully, eventually hold the NX tiny - desktop (NxWM). +* nxwm: The tiny NX window manager (NxWM) is being developed in this directory. +* UnitTests/nxwm: A unit test for the NX window manager. diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile new file mode 100644 index 000000000..d9cf2d051 --- /dev/null +++ b/UnitTests/nxwm/Makefile @@ -0,0 +1,172 @@ +################################################################################# +# NxWidgets/Unitests/nxwm/Makefile +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" + +INCDIR=$(TOPDIR)/tools/incdir.sh +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)/../../tools" +ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = main.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = nxwm +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + @( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $(BIN), $${obj}); \ + done ; ) +ifeq ($(WINTOOL),y) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + @touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + @touch $@ + +context: .context + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + @rm -f *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx new file mode 100644 index 000000000..dffa7b600 --- /dev/null +++ b/UnitTests/nxwm/main.cxx @@ -0,0 +1,262 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/nxwm/main.cxx +// +// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include "ctaskbar.hxx" +#include "cstartwindow.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Pre-processor Definitions +///////////////////////////////////////////////////////////////////////////// + +// What is the entry point called? + +#ifdef CONFIG_NSH_BUILTIN_APPS +# define MAIN_NAME nxwm_main +# define MAIN_STRING "nxwm_main: " +#else +# define MAIN_NAME user_start +# define MAIN_STRING "user_start: " +#endif + +///////////////////////////////////////////////////////////////////////////// +// Private Types +///////////////////////////////////////////////////////////////////////////// + +struct nxwm_test_s +{ + NxWM::CTaskbar *taskbar; // The task bar + NxWM::CStartWindow *startwindow; // The start window +}; + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static struct nxwm_test_s g_nxwmtest; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int MAIN_NAME(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// user_start/nxwm_main +///////////////////////////////////////////////////////////////////////////// + +int MAIN_NAME(int argc, char *argv[]) +{ + // Create an instance of the Task Bar. + // + // The general sequence for initializing the task bar is: + // + // 1. Create the CTaskbar instance, + // 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar + // inherits the connect method from CNxServer), + // 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. + // 3. Call CTaskBar::startApplication repeatedly to add applications to the task bar + // 4. Call CTaskBar::startWindowManager to start the display with applications in place + + printf(MAIN_STRING "Create CTaskbar instance\n"); + g_nxwmtest.taskbar = new CTaskbar(); + if (!g_nxwmtest.taskbar) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); + return EXIT_FAILURE; + } + + // Connect to the NX server + + printf(MAIN_STRING "Connect the CTaskbar instance to the NX server\n"); + if (!g_nxwmtest.taskbar->connect()) + { + printf(MAIN_STRING "ERROR: Failed to connect the CTaskbar instance to the NX server\n"); + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + + // Initialize the task bar + // + // Taskbar::initWindowManager() prepares the task bar to receive applications. + // CTaskBar::startWindowManager() brings the window manager up with those applications + // in place. + + printf(MAIN_STRING "Initialize the CTaskbar instance\n"); + if (!g_nxwmtest.taskbar->initWindowManager()) + { + printf(MAIN_STRING "ERROR: Failed to intialize the CTaskbar instance\n"); + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + + // Create the start window. The general sequence for setting up the start window is: + // + // 1. Call CTaskBar::openApplicationWindow to create a window for the start window, + // 2. Use the window to instantiate Cstartwindow + // 3. Call Cstartwindow::addApplication numerous times to install applications + // in the start window. + // 4. Call CTaskBar::startApplication (initially minimized) to start the start + // window application. + + printf(MAIN_STRING "Opening the start window application window\n"); + CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + + printf(MAIN_STRING "Creating the start window application\n"); + g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); + if (!g_nxwmtest.taskbar) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); + delete window; + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + + // Add the NxConsole application to the start window + +#if 0 + printf(MAIN_STRING "Opening the NxConsole application window\n"); + window = g_nxwmtest.taskbar->openApplicationWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the NxConsole\n"); + goto noconsole; + } + + printf(MAIN_STRING "Creating the NxConsole application\n"); + NxWM::CNxConsole *console = new CNxConsole(window); + if (!console) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); + delete window; + goto noconsole; + } + + printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(console)) + { + printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start menu\n"); + delete window; + } + +noconsole: +#endif + + // Add the calculator application to the start window + +#if 0 + printf(MAIN_STRING "Opening the calculator application window\n"); + window = g_nxwmtest.taskbar->openApplicationWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the calculator\n"); + goto nocalculator; + } + + printf(MAIN_STRING "Creating the calculator application\n"); + NxWM::CCalculator *calculator = new CCalculator(window); + if (!calculator) + { + printf(MAIN_STRING "ERROR: Failed to instantiate calculator\n"); + delete window; + goto nocalculator; + } + + printf(MAIN_STRING "Adding the calculator application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calculator)) + { + printf(MAIN_STRING "ERROR: Failed to add calculator to the start menu\n"); + delete window; + } + +nocalculator: +#endif + + // Call CTaskBar::startApplication to start the start window application. The initial + // state of the start window is minimized. + + printf(MAIN_STRING "Start the start window application\n"); + if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.startwindow, true)) + { + printf(MAIN_STRING "ERROR: Failed to start the start window application\n"); + + // Delete the task bar then the start window. the order is important because + // we must bet all of the application references out of the task bar before + // deleting the start window. When the start window is deleted, it will + // also delete of of the resouces contained within the start window. + + delete g_nxwmtest.taskbar; + delete g_nxwmtest.startwindow; + return EXIT_FAILURE; + } + + // Call CTaskBar::startWindowManager to start the display with applications in place. + // This method will not return but will enter the task bar's modal loop. + + printf(MAIN_STRING "Start the window manager\n"); + if (!g_nxwmtest.taskbar->startWindowManager()) + { + printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + + // Delete the task bar then the start window. the order is important because + // we must bet all of the application references out of the task bar before + // deleting the start window. When the start window is deleted, it will + // also delete of of the resouces contained within the start window. + + delete g_nxwmtest.taskbar; + delete g_nxwmtest.startwindow; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 805df4184..3d868e576 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -110,23 +110,22 @@ namespace NxWM void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); - /** - * CApplicationWindow Destructor - */ - - ~CApplicationWindow(void); - public: /** * CApplicationWindow Constructor * - * @param taskbar. A pointer to the parent task bar instance * @param window. The window to be used by this application. */ CApplicationWindow(NXWidgets::CNxTkWindow *window); + /** + * CApplicationWindow Destructor + */ + + ~CApplicationWindow(void); + /** * Initialize window. Window initialization is separate from * object instantiation so that failures can be reported. diff --git a/nxwm/include/cbackgroundimage.hxx b/nxwm/include/cbackgroundimage.hxx deleted file mode 100644 index 89ca469cd..000000000 --- a/nxwm/include/cbackgroundimage.hxx +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - * NxWidgets/nxwm/include/cnxbackimage.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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 __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX -#define __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include "nxconfig.hxx" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Class Definition - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NxWM -{ - /** - * This class describes the NX windo manager's background image. - */ - - class CBackgroundImage : public NXWidgets::CImage - { - private: - NXWidgets::CWidgetControl *m_widgetControl; // The controlling widget for the window - - public: - /** - * CBackgroundImage Constructor - */ - - CBackgroundImage(void); - - /** - * CBackgroundImage Destructor - */ - - ~CBackgroundImage(void); - }; -} - -#endif // __cplusplus -#endif // __NXWM_INCLUDE_CBACKGROUNDIMAGE_HXX diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index c47b85d83..2a1dac088 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -125,9 +125,10 @@ namespace NxWM * setting up the start window is: * * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - * 2. Call CStartMenu::addApplication numerous times to install applications + * 2. Use the window to instantiate CStartMenu + * 3. Call CStartMenu::addApplication numerous times to install applications * in the start window. - * 3. Call CTaskBar::startApplication (initially minimized) to start the start + * 4. Call CTaskBar::startApplication (initially minimized) to start the start * window application. * * @param application. The new application to add to the start window diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 0c420a0e2..ef25fd563 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -44,7 +44,7 @@ #include "nxconfig.hxx" #include "tnxarray.hxx" -#include "inxwindow.hxx" +#include "cnxwindow.hxx" #include "cnxserver.hxx" #include "cwidgeteventhandler.hxx" #include "cwidgeteventargs.hxx" @@ -64,15 +64,41 @@ namespace NxWM { /** - * This class describes the NX window manager's task bar + * This class describes the NX window manager's task bar. That task bar is, + * of course, used to dock active applications. But in NxWM, it is also + * the heart of the window manager: It inherits for CNxServer and, hence, + * represents the NX server itself. It also then serves as the NxWM + * window factory. + * + * Why do it this way? The only reason is so that if you have an instance + * of CTaskbar, you have everything you need to manage new applications. + * It might have been a better decision to separate the window factory into + * a separate class instead of making the task bar of such central importance + * (and I may still do that someday) */ class CTaskbar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler { private: - NXWidgets::INxWindow *m_taskbar; /**< The toolbar window */ - NXWidgets::INxWindow *m_background; /**< The background window */ - TNxArray m_applications; /**< List of apps in the task bar */ + /** + * This structgure represents an application and its associated icon image + */ + + struct STaskbarSlot + { + IApplication *app; /**< A reference to the icon */ + NXWidgets::CImage *image; /**< The icon image that goes with the application */ + }; + + /** + * Taskbar state + */ + + NXWidgets::CNxWindow *m_taskbar; /**< The task bar window */ + NXWidgets::CNxWindow *m_background; /**< The background window */ + NXWidgets::CImage *m_backImage; /**< The background image */ + IApplication *m_topapp; /**< The top application in the hierarchy */ + TNxArray m_slots; /**< List of application slots in the task bar */ /** * Connect to the server @@ -120,12 +146,12 @@ namespace NxWM void setApplicationGeometry(NXWidgets::INxWindow *window); /** - * Create the toolbar window. + * Create the task bar window. * * @return true on success */ - bool createToolbarWindow(void); + bool createTaskbarWindow(void); /** * Create the background window. @@ -135,6 +161,38 @@ namespace NxWM bool createBackgroundWindow(void); + /** + * Create the background image. + * + * @return true on success + */ + + bool createBackgroundImage(void); + + /** + * (Re-)draw the task bar window. + * + * @return true on success + */ + + bool redrawTaskbarWindow(void); + + /** + * (Re-)draw the background window. + * + * @return true on success + */ + + bool redrawBackgroundWindow(void); + + /** + * Redraw the last application in the list of application maintained by + * the task bar. + * + * @return true on success + */ + + bool redrawApplicationWindow(void); /** * Handle a mouse button click event. @@ -159,16 +217,46 @@ namespace NxWM CTaskbar(void); + /** + * Initialize task bar. Task bar initialization is separate from + * object instantiation so that failures can be reported. The window + * manager start-up sequence is: + * + * 1. Create the CTaskbar instance, + * 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar + * inherits the connect method from CNxServer), + * 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. + * 4. Call CTaskBar::startApplication repeatedly to add applications to the task bar + * 5. Call CTaskBar::startWindowManager() to start the display with applications in place + * + * CTaskbar::initWindowManager() prepares the task bar to receive applications. + * CTaskBar::startWindowManager() brings the window manager up with those applications + * in place. + * + * @return True if the window was successfully initialized. + */ + + bool initWindowManager(void); + /** * Start the window manager and present the initial displays. The window * manager start-up sequence is: * * 1. Create the CTaskbar instance, - * 2. Call CTaskBar::startApplication repeatedly to add applications to the task bar - * 3. Call CTaskBar::startWindowManager to start the display with applications in place + * 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar + * inherits the connect method from CNxServer), + * 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. + * 4. Call CTaskBar::startApplication repeatedly to add applications to the task bar + * 5. Call CTaskBar::startWindowManager to start the display with applications in place * - * startWindowManager will present the taskar and the background image. The - * initial taskbar will contain only the start window icon. + * CTaskbar::initWindowManager() prepares the task bar to receive applications. + * CTaskBar::startWindowManager() brings the window manager up with those applications + * in place. + * + * CTaskBar::startWindowManager() will present the task bar and the background image. + * The The initial taskbar will contain only the start window icon. + * + * @return true on success */ bool startWindowManager(void); @@ -214,23 +302,45 @@ namespace NxWM bool startApplication(IApplication *app, bool minimized); /** - * Hide an application by moving its window to the bottom. + * Move window to the top of the hierarchy and re-draw it. This method + * does nothing if the application is minimized. * - * @param application. The new application to add to the task bar + * @param app. The new application to show * @return true on success */ - bool hideApplication(IApplication *application); + bool topApplication(IApplication *app); + + /** + * Maximize an application by moving its window to the top of the hierarchy + * and re-drawing it. If the application was already maximized, then this + * method is equivalent to topApplication(). + * + * @param app. The new application to add to the task bar + * @return true on success + */ + + bool maximizeApplication(IApplication *app); + + /** + * Minimize an application by moving its window to the bottom of the + * and redrawing the next visible appliation. + * + * @param app. The new application to add to the task bar + * @return true on success + */ + + bool minimizeApplication(IApplication *app); /** * Destroy an application. Move its window to the bottom and remove its * icon from the task bar. * - * @param application. The new application to remove from the task bar + * @param app. The new application to remove from the task bar * @return true on success */ - bool stopApplication(IApplication *application); + bool stopApplication(IApplication *app); }; } diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 1056e18c0..88583d4c5 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -64,6 +64,14 @@ namespace NxWM class IApplication { + protected: + // These values (and the accessors that go with them) violate the "purity" + // of the base class. These are really part of the task bar implementation: + // Each application provides this state information needed by the taskbar. + + bool m_minimized; /**< True if the application is minimized */ + bool m_topapp; /**< True if this application is at the top in the hiearchy */ + public: /** * Each implementation of IApplication must provide a method to recover @@ -91,7 +99,7 @@ namespace NxWM virtual NXWidgets::CNxString getName(void) = 0; /** - * Start the application. + * Start the application (pehaps in the minimized state). */ virtual void run(void) = 0; @@ -101,6 +109,57 @@ namespace NxWM */ virtual void stop(void) = 0; + + /** + * Re-draw the application window. This method is call from CTaskbar + * when the application window must be displayed + */ + + virtual void redraw(void) = 0; + + /** + * Set the application's minimized state + * + * @param minimized. True if the application is minimized + */ + + inline void setMinimized(bool minimized) + { + m_minimized = minimized; + } + + /** + * Set the application's top state + * + * @param topapp. True if the application is the new top application + */ + + inline void setTopApplication(bool topapp) + { + m_topapp = topapp; + } + + /** + * Get the application's minimized state + * + * @return True if the application is minimized + */ + + inline bool isMinimized(void) const + { + return m_minimized; + } + + /** + * Return true if this is the top application + * + * @return True if the application is the new top application + */ + + inline bool isTopApplication(void) const + { + return m_topapp; + } }; } diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 178cc37a2..d416bf8f0 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -91,13 +91,25 @@ #endif /** - * Default selected forecround color + * Default selected foreground color */ #ifndef CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR # define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248) #endif +/** + * Border colors + */ + +#ifndef CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR +# define CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR MKRGB(248,248,248) +#endif + +#ifndef CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR +# define CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR MKRGB(0,0,0) +#endif + /** * The default font color */ @@ -115,15 +127,21 @@ #endif /* Task Bar Configuation ***************************************************/ -/* At present, all icons are 25 pixels in "widgth" and, hence require a - * task bar of at least that size. +/** + * Horizontal and vertical spacing of icons in the task bar. */ -#ifndef CONFIG_NXWM_TASKBAR_WIDTH -# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*2) +#ifndef CONFIG_NXWM_TASKBAR_VSPACING +# define CONFIG_NXWM_TASKBAR_VSPACING (2) #endif -/* Check task bar location */ +#ifndef CONFIG_NXWM_TASKBAR_HSPACING +# define CONFIG_NXWM_TASKBAR_HSPACING (2) +#endif + +/** + * Check task bar location + */ #if defined(CONFIG_NXWM_TASKBAR_TOP) # if defined(CONFIG_NXWM_TASKBAR_BOTTOM) || defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT) @@ -142,12 +160,29 @@ # define CONFIG_NXWM_TASKBAR_TOP 1 #endif +/** + * At present, all icons are 25 pixels in "widgth" and, hence require a + * task bar of at least that size. + */ + +#ifndef CONFIG_NXWM_TASKBAR_WIDTH +# if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) +# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*CONFIG_NXWM_TASKBAR_HSPACING) +# else +# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*CONFIG_NXWM_TASKBAR_VSPACING) +# endif +#endif + +/* Background Image **********************************************************/ + +#ifndef CONFIG_NXWM_BACKGROUND_IMAGE +# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap +#endif + /* Tool Bar Configuration ***************************************************/ #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT # define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH #endif -/* Colors *******************************************************************/ - #endif // __INCLUDE_NXWMCONFIG_HXX diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index bacd35891..198fe9f26 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -43,6 +43,7 @@ #include #include "nxconfig.hxx" +#include "glyphs.hxx" /**************************************************************************** * Pre-Processor Definitions diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 407396ee5..42cb41087 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -46,6 +46,7 @@ #include "cnxtkwindow.hxx" #include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -66,8 +67,10 @@ using namespace NxWM; CTaskbar::CTaskbar(void) { - m_taskbar = (NXWidgets::INxWindow *)0; - m_background = (NXWidgets::INxWindow *)0; + m_taskbar = (NXWidgets::CNxWindow *)0; + m_background = (NXWidgets::CNxWindow *)0; + m_backImage = (NXWidgets::CImage *)0; + m_topapp = (IApplication *)0; } /** @@ -79,6 +82,51 @@ CTaskbar::~CTaskbar(void) disconnect(); } +/** + * Initialize task bar. Task bar initialization is separate from + * object instantiation so that failures can be reported. The window + * manager start-up sequence is: + * + * 1. Create the CTaskbar instance, + * 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar + * inherits the connect method from CNxServer), + * 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. + * 4. Call CTaskBar::startApplication repeatedly to add applications to the task bar + * 5. Call CTaskBar::startWindowManager to start the display with applications in place + * + * CTaskbar::initWindowManager() prepares the task bar to receive applications. + * CTaskBar::startWindowManager() brings the window manager up with those applications + * in place. + * + * @return True if the window was successfully initialized. + */ + +bool CTaskbar::initWindowManager(void) +{ + // Create the taskbar window + + if (!createTaskbarWindow()) + { + return false; + } + + // Create the background window + + if (!createBackgroundWindow()) + { + return false; + } + + // Create the background image + + if (!createBackgroundImage()) + { + return false; + } + + return true; +} + /** * Start the window manager and present the initial displays. The window * manager start-up sequence is: @@ -87,17 +135,28 @@ CTaskbar::~CTaskbar(void) * 2. Call startApplication repeatedly to add applications to the task bar * 3. Call startWindowManager to start the display with applications in place * - * startWindowManager will present the taskar and the background image. The + * CTaskbar::initWindowManager() prepares the task bar to receive applications. + * CTaskBar::startWindowManager() brings the window manager up with those applications + * in place. + * + * startWindowManager will present the task bar and the background image. The * initial taskbar will contain only the start window icon. * - * @param application. The new application to add to the start window * @return true on success */ bool CTaskbar::startWindowManager(void) { -#warning "Missing logic" - return false; + // Draw the taskbar + + if (!redrawTaskbarWindow()) + { + return false; + } + + // Draw the application window + + return redrawApplicationWindow(); } /** @@ -117,8 +176,27 @@ bool CTaskbar::startWindowManager(void) CApplicationWindow *CTaskbar::openApplicationWindow(void) { -#warning "Missing logic" - return (CApplicationWindow *)0; + // Create a framed window for the application + + NXWidgets::CNxTkWindow *window = openFramedWindow(); + if (!window) + { + return (CApplicationWindow *)0; + } + + // Set size and position of a window in the application area. + + setApplicationGeometry(window); + + // Use this window to instantiate the application window + + CApplicationWindow *appwindow = new CApplicationWindow(window); + if (!appwindow) + { + delete window; + } + + return appwindow; } /** @@ -142,48 +220,204 @@ CApplicationWindow *CTaskbar::openApplicationWindow(void) bool CTaskbar::startApplication(IApplication *app, bool minimized) { -#warning "Missing logic" + // Get the widget control associated with the task bar window + + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + + // Get the bitmap icon that goes with this application + + NXWidgets::IBitmap *bitmap = app->getIcon(); + + // Create a CImage instance to manage the applications icon + + NXWidgets::CImage *image = + new NXWidgets::CImage(control, 0, 0, bitmap->getWidth(), + bitmap->getHeight(), bitmap, 0); + if (!image) + { + return false; + } + + // Configure the image, disabling drawing for now + + image->setBorderless(true); + image->disableDrawing(); + + // Register to get events from the mouse clicks on the image + + image->addWidgetEventHandler(this); + + // Add the application to end of the list of applications managed by + // the task bar + + struct STaskbarSlot slot; + slot.app = app; + slot.image = image; + m_slots.push_back(slot); + + // Mark the application as minimized (or not) + + app->setMinimized(minimized); + + // Assume for now that this is not the top application (we will + // know when drawApplicationWindow() runs. + + app->setTopApplication(false); + + // Then start the application (whatever that means) + + app->run(); + return true; +} + +/** + * Move window to the top of the hierarchy and re-draw it. This method + * does nothing if the application is minimized. + * + * @param app. The new application to show + * @return true on success + */ + +bool CTaskbar::topApplication(IApplication *app) +{ + // Verify that the application is not minimized + + if (!app->isMinimized()) + { + // Every application provides a method to obtain its application window + + CApplicationWindow *appWindow = app->getWindow(); + + // Each application window provides a method to get the underlying NX window + + NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + + // Mark the window as the top application + + m_topapp = app; + app->setTopApplication(true); + + // Raise the window to the top of the hierarchy + + window->raise(); + + // And re-draw it + + app->redraw(); + return true; + } + return false; } /** - * Hide an application by moving its window to the bottom. + * Maximize an application by moving its window to the top of the hierarchy + * and re-drawing it. If the application was already maximized, then this + * method is equivalent to topApplication(). * - * @param application. The new application to add to the task bar + * @param app. The new application to add to the task bar * @return true on success */ -bool CTaskbar::hideApplication(IApplication *application) +bool CTaskbar::maximizeApplication(IApplication *app) { - // Every application provides a method to obtain its applicatin window + // Mark that the application is no longer minimized - CApplicationWindow *appWindow = application->getWindow(); + app->setMinimized(false); - // Each application window provides a method to get the underlying NX window + // Then bring the appliation to the top of the hieararchy - NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + return topApplication(app); +} - // Lower the window +/** + * Minimize an application by moving its window to the bottom of the and + * redrawing the next visible appliation. + * + * @param app. The new application to add to the task bar + * @return true on success + */ - window->lower(); +bool CTaskbar::minimizeApplication(IApplication *app) +{ + // Verify that the application is not already minimized - // Grey out the image in task bar -#warning "Missing logic" - return true; + if (!app->isMinimized()) + { + // Every application provides a method to obtain its application window + + CApplicationWindow *appWindow = app->getWindow(); + + // Each application window provides a method to get the underlying NX window + + NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + + // Mark the window as minimized + + app->setMinimized(true); + + // And it certainly is no longer the top application. If it was before + // then redrawApplicationWindow() will pick a new one (rather arbitrarily). + + if (app->isTopApplication()) + { + m_topapp = (IApplication *)0; + app->setTopApplication(false); + } + + // Lower the window to the bottom of the hierarchy + + window->lower(); + + // And re-draw the next non-minimized application + + return redrawApplicationWindow(); + } + + return false; } /** * Destroy an application. Move its window to the bottom and remove its * icon from the task bar. * - * @param application. The new application to remove from the task bar + * @param app. The new application to remove from the task bar * @return true on success */ -bool CTaskbar::stopApplication(IApplication *application) +bool CTaskbar::stopApplication(IApplication *app) { -#warning "Missing logic" - return false; + // First, minimize the application. That will move the application + // to the bottom of the hiearachy and redraw the next application + // (If the application is already minimized, it does nothing) + + minimizeApplication(app); + + // Stop the appliation + + app->stop(); + + // Find the application in the list of applications + + for (int i = 0; i < m_slots.size(); i++) + { + // Is this it? + + IApplication *candidate = m_slots.at(i).app; + if (candidate == app) + { + // Yes.. found it. Delete the icon image and remove it + // from the list of applications + + delete m_slots.at(i).image; + m_slots.erase(i); + break; + } + } + + // And redraw the task bar (without the icon for this task) + + return redrawTaskbarWindow(); } /** @@ -218,9 +452,9 @@ void CTaskbar::disconnect(void) // are some ordering issues here... On an orderly system shutdown, disconnection // should really occur priority to deleting instances - while (!m_applications.empty()) + while (!m_slots.empty()) { - IApplication *app = m_applications.at(0); + IApplication *app = m_slots.at(0).app; stopApplication(app); } @@ -238,7 +472,7 @@ void CTaskbar::disconnect(void) delete control; } - // Then delete the toolbar + // Then delete the task bar window delete m_taskbar; } @@ -353,7 +587,7 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) { - // Get the widget control from the toolbar window. The physical window geometry + // Get the widget control from the task bar window. The physical window geometry // should be the same for all windows. NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); @@ -363,7 +597,7 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) NXWidgets::CRect rect = control->getWindowBoundingBox(); // Now position and size the application. This will depend on the position and - // orientation of the toolbar. + // orientation of the task bar. struct nxgl_point_s pos; struct nxgl_size_s size; @@ -405,14 +639,14 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) } /** - * Create the toolbar window. + * Create the task bar window. * * @return true on success */ -bool CTaskbar::createToolbarWindow(void) +bool CTaskbar::createTaskbarWindow(void) { - // Create a raw window to present the toolbar + // Create a raw window to present the task bar m_taskbar = openRawWindow(); if (!m_taskbar) @@ -428,8 +662,8 @@ bool CTaskbar::createToolbarWindow(void) NXWidgets::CRect rect = control->getWindowBoundingBox(); - // Now position and size the toolbar. This will depend on the position and - // orientation of the toolbar. + // Now position and size the task bar. This will depend on the position and + // orientation of the task bar. struct nxgl_point_s pos; struct nxgl_size_s size; @@ -472,9 +706,6 @@ bool CTaskbar::createToolbarWindow(void) /* And raise the window to the top of the display */ m_taskbar->raise(); - - // Add the start menu's icon to the toolbar -#warning "Missing logic" return true; } @@ -498,13 +729,285 @@ bool CTaskbar::createBackgroundWindow(void) setApplicationGeometry(static_cast(m_background)); - /* And lower the background window to the bottom of the display */ + /* The background window starts at the top display */ - m_background->lower(); + m_background->raise(); + return true; +} + +/** + * Create the background image. + * + * @return true on success + */ + +bool CTaskbar::createBackgroundImage(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_background->getSize(&windowSize)) + { + return false; + } + + // Get the widget control from the background window + + NXWidgets::CWidgetControl *control = m_background->getWidgetControl(); + + // Create the bitmap object + + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_BACKGROUND_IMAGE); + + if (!bitmap) + { + return false; + } + + // Get the size of the bitmap image + + struct nxgl_size_s imageSize; + imageSize.w = bitmap->getWidth(); + imageSize.h = (nxgl_coord_t)bitmap->getHeight(); + + // Pick an X/Y position such that the image will be centered in the display + + struct nxgl_point_s imagePos; + if (imageSize.w >= windowSize.w) + { + imagePos.x = 0; + } + else + { + imagePos.x = (windowSize.w - imageSize.w) >> 1; + } + + if (imageSize.h >= windowSize.h) + { + imagePos.y = 0; + } + else + { + imagePos.y = (windowSize.h - imageSize.h) >> 1; + } + + // Now we have enough information to create the image + + m_backImage = new NXWidgets::CImage(control, imagePos.x, imagePos.y, + imageSize.w, imageSize.h, bitmap); + if (!m_backImage) + { + delete bitmap; + return false; + } + + // Configure the background image + + m_backImage->setBorderless(true); + m_backImage->setRaisesEvents(false); + return true; +} + +/** + * (Re-)draw the task bar window. + * + * @return true on success + */ + +bool CTaskbar::redrawTaskbarWindow(void) +{ + // Get the widget control from the task bar + + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_taskbar->getSize(&windowSize)) + { + return false; + } + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Add a border to the task bar to delineate it from the background window + + port->drawBevelledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR, + CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR); + + // Begin adding icons in the upper left corner + + struct nxgl_point_s taskbarPos; +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + taskbarPos.x = CONFIG_NXWM_TASKBAR_HSPACING; + taskbarPos.y = 0; +#else + taskbarPos.x = 0; + taskbarPos.y = CONFIG_NXWM_TASKBAR_VSPACING; +#endif + + // Add each icon in the list of applications + + for (int i = 0; i < m_slots.size(); i++) + { + // Get the icon associated with this application + + NXWidgets::CImage *image = m_slots.at(i).image; + + // Disable drawing of the icon image + + image->disableDrawing(); + + // Get the size of the icon image + + NXWidgets::CRect rect; + image->getPreferredDimensions(rect); + + // Position the icon + + struct nxgl_point_s iconPos; + +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + // For horizontal task bars, the icons will be aligned at the top of + // the task bar + + iconPos.x = taskbarPos.x; + iconPos.y = taskbarPos.y + CONFIG_NXWM_TASKBAR_VSPACING; +#else + // For vertical task bars, the icons will be centered horizontally + + iconPos.x = (windowSize.w - rect.getWidth()) >> 1; + iconPos.y = taskbarPos.y +#endif + + // Set the position of the icon bitmap + + (void)image->moveTo(iconPos.x, iconPos.y); + + // Then re-draw the icon at the new position + + (void)image->enableDrawing(); + (void)image->redraw(); + + // Do we add icons left-to-right? Or top-to-bottom? + + bool moveTo(nxgl_coord_t x, nxgl_coord_t y); +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + // left-to-right ... increment the X display position + + taskbarPos.x += rect.getWidth() + CONFIG_NXWM_TASKBAR_HSPACING; + if (taskbarPos.x > windowSize.w) + { + break; + } +#else + // top-to-bottom ... increment the Y display position + + taskbarPos.y += rect.getHeight() + CONFIG_NXWM_TASKBAR_VSPACING; + if (taskbarPos.y > windowSize.h) + { + break; + } +#endif + } return true; } +/** + * (Re-)draw the background window. + * + * @return true on success + */ + +bool CTaskbar::redrawBackgroundWindow(void) +{ + // Get the widget control from the background window + + NXWidgets::CWidgetControl *control = m_background->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_background->getSize(&windowSize)) + { + return false; + } + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Then re-draw the background image on the window + + m_backImage->redraw(); + return true; +} + +/** + * Redraw the last application in the list of application maintained by + * the task bar. + * + * @return true on success + */ + +bool CTaskbar::redrawApplicationWindow(void) +{ + // Check if there is already a top application + + IApplication *app = m_topapp; + if (!app) + { + // No.. Search for that last, non-minimized application + + for (int i = m_slots.size() - 1; i > 0; i--) + { + IApplication *candidate = m_slots.at(i).app; + if (!candidate->isMinimized()) + { + app = candidate; + break; + } + } + } + + // Did we find one? + + if (app) + { + // Yes.. Then this is the new top application + + m_topapp = app; + app->setTopApplication(true); + + // And.. Draw the application + + app->redraw(); + return true; + } + else + { + // Otherwise, re-draw the background + + m_topapp = (IApplication *)0; + return redrawBackgroundWindow(); + } +} + /** * Handle a mouse button click event. * @@ -513,7 +1016,40 @@ bool CTaskbar::createBackgroundWindow(void) void CTaskbar::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) { -#warning "Missing logic" + // icon was clicked? + + for (int i = 0; i < m_slots.size(); i++) + { + // Is this it? + + NXWidgets::CImage *image = m_slots.at(i).image; + if (image->isClicked()) + { + // Was the icon minimized + + IApplication *app = m_slots.at(i).app; + if (app->isMinimized()) + { + // Maximize the application by moving its window to the top of + // the hierarchy and re-drawing it. + + (void)maximizeApplication(app); + } + + // No, it is not minimized. Is it already the top application? + + else if (!app->isTopApplication()) + { + /* Move window to the top of the hierarchy and re-draw it. */ + + (void)topApplication(app); + } + + // Then break out of the loop + + break; + } + } } From 289f0a16fee6fab4f58ca9247648639133903691 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 30 Apr 2012 22:51:34 +0000 Subject: [PATCH 016/390] More NX window manager updates git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4679 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/crect.hxx | 12 + nxwm/Makefile | 2 +- nxwm/include/cstartwindow.hxx | 83 +++++- nxwm/include/ctaskbar.hxx | 2 +- nxwm/include/iapplication.hxx | 12 +- nxwm/include/nxwmconfig.hxx | 25 +- nxwm/src/cstartwindow.cxx | 452 +++++++++++++++++++++++++++++++++ nxwm/src/ctaskbar.cxx | 19 +- nxwm/src/glyph_nsh.cxx | 0 nxwm/src/glyph_start.cxx | 0 nxwm/src/glyph_stop.cxx | 0 11 files changed, 579 insertions(+), 28 deletions(-) create mode 100644 nxwm/src/cstartwindow.cxx mode change 100755 => 100644 nxwm/src/glyph_nsh.cxx mode change 100755 => 100644 nxwm/src/glyph_start.cxx mode change 100755 => 100644 nxwm/src/glyph_stop.cxx diff --git a/libnxwidgets/include/crect.hxx b/libnxwidgets/include/crect.hxx index e3a73a392..7ce233fed 100644 --- a/libnxwidgets/include/crect.hxx +++ b/libnxwidgets/include/crect.hxx @@ -183,6 +183,18 @@ namespace NXWidgets return m_size.w; } + /** + * Get the size of the rectangle + * + * @return The rectangle's size + */ + + inline void getSize(struct nxgl_size_s &size) const + { + size.h = m_size.h; + size.w = m_size.w; + } + /** * Get the rectangle's height. * diff --git a/nxwm/Makefile b/nxwm/Makefile index 0dea92d62..4f13ca362 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -42,7 +42,7 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = # Window Manager -CXXSRCS = capplicationwindow.cxx cnxconsole.cxx ctaskbar.cxx +CXXSRCS = capplicationwindow.cxx cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx # Images CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 2a1dac088..fca886e8d 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -42,9 +42,11 @@ #include -#include "iapplication.hxx" #include "tnxarray.hxx" +#include "iapplication.hxx" +#include "capplicationwindow.hxx" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -58,13 +60,61 @@ namespace NxWM { class CTaskbar; - class CApplicationWindow; - class CStartWindow : public IApplication + class CStartWindow : public IApplication, private IApplicationCallback, + private NXWidgets::CWidgetEventHandler { protected: - CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ - TNxArray m_applications; /**< List of apps in the start window */ + /** + * This structure represents an application and its associated icon image + */ + + struct SStartWindowSlot + { + IApplication *app; /**< A reference to the icon */ + NXWidgets::CImage *image; /**< The icon image that goes with the application */ + }; + + /** + * CStartWindow state data + */ + + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + TNxArray m_slots; /**< List of apps in the start window */ + struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ + + /** + * Called when the window minimize button is pressed. + */ + + void minimize(void); + + /** + * Called when the window minimize close is pressed. + */ + + void close(void); + + /** + * Calculate the icon bounding box + */ + + void getIconBounds(void); + + /** + * Stop all applications + */ + + void stopAllApplications(void); + + /** + * Handle a mouse button click event. + * + * @param e The event data. + */ + + void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); /** * CStartWindow Constructor @@ -112,13 +162,28 @@ namespace NxWM * Start the application. */ - run(void); + void run(void); /** * Stop the application. */ - stop(void); + void stop(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + void hide(void); + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hiearchy. This method is call from + * CTaskbar when the application window must be displayed + */ + + virtual void redraw(void) = 0; /** * Add the application to the start window. The general sequence for @@ -131,11 +196,11 @@ namespace NxWM * 4. Call CTaskBar::startApplication (initially minimized) to start the start * window application. * - * @param application. The new application to add to the start window + * @param app. The new application to add to the start window * @return true on success */ - bool addApplication(IApplication *application); + bool addApplication(IApplication *app); }; } diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index ef25fd563..1de4a7491 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -81,7 +81,7 @@ namespace NxWM { private: /** - * This structgure represents an application and its associated icon image + * This structure represents an application and its associated icon image */ struct STaskbarSlot diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 88583d4c5..885b85710 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -111,8 +111,16 @@ namespace NxWM virtual void stop(void) = 0; /** - * Re-draw the application window. This method is call from CTaskbar - * when the application window must be displayed + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + virtual void hide(void) = 0; + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed */ virtual void redraw(void) = 0; diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index d416bf8f0..cdbcee564 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -173,16 +173,29 @@ # endif #endif -/* Background Image **********************************************************/ - -#ifndef CONFIG_NXWM_BACKGROUND_IMAGE -# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap -#endif - /* Tool Bar Configuration ***************************************************/ #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT # define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH #endif +/* Background Image **********************************************************/ + +#ifndef CONFIG_NXWM_BACKGROUND_IMAGE +# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap +#endif + +/* Start Window Configuration ***********************************************/ +/** + * Horizontal and vertical spacing of icons in the task bar. + */ + +#ifndef CONFIG_NXWM_STARTWINDOW_VSPACING +# define CONFIG_NXWM_STARTWINDOW_VSPACING (2) +#endif + +#ifndef CONFIG_NXWM_STARTWINDOW_HSPACING +# define CONFIG_NXWM_STARTWINDOW_HSPACING (2) +#endif + #endif // __INCLUDE_NXWMCONFIG_HXX diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx new file mode 100644 index 000000000..4213c33cb --- /dev/null +++ b/nxwm/src/cstartwindow.cxx @@ -0,0 +1,452 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cnxconsole.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include "cwidgetcontrol.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "ctaskbar.hxx" +#include "cstartwindow.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CNxConsole Method Implementations + ********************************************************************************************/ + +using namespace NxWM; + +/** + * CStartWindow Constructor + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + +CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) +{ + // Save the constructor data + + m_taskbar = taskbar; + m_window = window; + + // Add out callbacks to the application window + + window->registerCallbacks(static_cast(this)); +} + +/** + * CStartWindow Constructor + */ + +CStartWindow::~CStartWindow(void) +{ + // Although we didn't create it, we are responsible for deleting the + // application window + + if (m_window) + { + delete m_window; + } + + // Then stop and delete all applications + + stopAllApplications(); +} + +/** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + +CApplicationWindow *CStartWindow::getWindow(void) const +{ + return m_window; +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CStartWindow::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&g_startBitmap); + + return bitmap; +} + +/** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + +NXWidgets::CNxString CStartWindow::getName(void) +{ + return NXWidgets::CNxString("Start Window"); +} + +/** + * Start the application. + */ + +void CStartWindow::run(void) +{ + // We don't have a thread of execution. We only respond to button presses +} + +/** + * Stop the application. + */ + +void CStartWindow::stop(void) +{ + // We don't have a thread of execution. We only respond to button presses +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + +void CStartWindow::hide(void) +{ + // Disable drawing and events on all icons + + for (int i = 0; i < m_slots.size(); i++) + { + NXWidgets::CImage *image = m_slots.at(i).image; + image->disableDrawing(); + image->setRaisesEvents(false); + } +} + +/** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hiearchy + */ + +void CStartWindow::redraw(void) +{ + // Recover the NXTK window instance contained in the application window + + NXWidgets::CNxTkWindow *window = m_window->getWindow(); + + // Get the widget control associated with the NXTK window + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + + // Get the graphics port for drawing on the widget control + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the application window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + return; + } + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Begin adding icons in the upper left corner + + struct nxgl_point_s iconPos; + iconPos.x = CONFIG_NXWM_STARTWINDOW_HSPACING; + iconPos.y = CONFIG_NXWM_STARTWINDOW_VSPACING; + + // Add each icon in the list of applications + + for (int i = 0; i < m_slots.size(); i++) + { + // Get the icon associated with this application + + NXWidgets::CImage *image = m_slots.at(i).image; + + // Disable drawing of the icon image; disable events from the icon + + image->disableDrawing(); + image->setRaisesEvents(false); + + // Get the size of the icon image + + NXWidgets::CRect rect; + image->getPreferredDimensions(rect); + + // Center the image in the region defined by the maximum icon size + + struct nxgl_point_s imagePos; + imagePos.x = iconPos.x; + imagePos.y = iconPos.y; + + if (rect.getWidth() < m_iconSize.w) + { + imagePos.x += ((m_iconSize.w - rect.getWidth()) >> 1); + } + + if (rect.getHeight() < m_iconSize.h) + { + imagePos.y += ((m_iconSize.h - rect.getHeight()) >> 1); + } + + // Set the position of the icon bitmap + + image->moveTo(imagePos.x, imagePos.y); + + // Then re-draw the icon at the new position + + image->enableDrawing(); + image->redraw(); + image->setRaisesEvents(true); + + // Advance the next icon position to the left + + iconPos.x += m_iconSize.w + CONFIG_NXWM_TASKBAR_HSPACING; + + // If there is insufficient space on on this row for the next + // max-sized icon, then advance to the next row + + if (iconPos.x + m_iconSize.w >= windowSize.w) + { + iconPos.x = CONFIG_NXWM_STARTWINDOW_HSPACING; + iconPos.y += m_iconSize.h + CONFIG_NXWM_TASKBAR_VSPACING; + + // Don't try drawing past the bottom of the window + + if (iconPos.y >= windowSize.w) + { + break; + } + } + } +} + +/** + * Add the application to the start window. The general sequence for + * setting up the start window is: + * + * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, + * 2. Use the window to instantiate CStartMenu + * 3. Call CStartMenu::addApplication numerous times to install applications + * in the start window. + * 4. Call CTaskBar::startApplication (initially minimized) to start the start + * window application. + * + * @param app. The new application to add to the start window + * @return true on success + */ + +bool CStartWindow::addApplication(IApplication *app) +{ + // Recover the NXTK window instance contained in the application window + + NXWidgets::CNxTkWindow *window = m_window->getWindow(); + + // Get the widget control associated with the NXTK window + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + + // Get the bitmap icon that goes with this application + + NXWidgets::IBitmap *bitmap = app->getIcon(); + + // Create a CImage instance to manage the application icon + + NXWidgets::CImage *image = + new NXWidgets::CImage(control, 0, 0, bitmap->getWidth(), + bitmap->getHeight(), bitmap, 0); + if (!image) + { + return false; + } + + // Configure the image, disabling drawing for now + + image->setBorderless(true); + image->disableDrawing(); + + // Register to get events from the mouse clicks on the image + + image->addWidgetEventHandler(this); + + // Add the application to end of the list of applications managed by + // the start window + + struct SStartWindowSlot slot; + slot.app = app; + slot.image = image; + m_slots.push_back(slot); + + // Re-calculate the icon bounding box + + getIconBounds(); + return true; +} + +/** + * Called when the window minimize button is pressed. + */ + +void CStartWindow::minimize(void) +{ + m_taskbar->minimizeApplication(static_cast(this)); +} + +/** + * Called when the window minimize close is pressed. + */ + +void CStartWindow::close(void) +{ + m_taskbar->stopApplication(static_cast(this)); +} + +/** + * Calculate the icon bounding box + */ + +void CStartWindow::getIconBounds(void) +{ + // Visit each icon + + struct nxgl_size_s maxSize; + maxSize.w = 0; + maxSize.h = 0; + + for (int i = 0; i < m_slots.size(); i++) + { + // Get the icon associated with this application + + NXWidgets::CImage *image = m_slots.at(i).image; + + // Get the size of the icon image + + NXWidgets::CRect rect; + image->getPreferredDimensions(rect); + + // Keep the maximum height and width + + if (rect.getWidth() > maxSize.h) + { + maxSize.w = rect.getWidth() ; + } + + if (rect.getHeight() > maxSize.h) + { + maxSize.h = rect.getHeight(); + } + } + + // And save the new maximum size + + m_iconSize.w = maxSize.w; + m_iconSize.h = maxSize.h; +} + +/** + * Stop all applications + */ + +void CStartWindow::stopAllApplications(void) +{ + // Stop all applications and remove them from the task bar. Clearly, there + // are some ordering issues here... On an orderly system shutdown, disconnection + // should really occur priority to deleting instances + + while (!m_slots.empty()) + { + // Stop the application (and remove it from the task bar) + + IApplication *app = m_slots.at(0).app; + m_taskbar->stopApplication(app); + + // Now, delete the image and the application + + delete app; + delete m_slots.at(0).image; + + // And discard the data in this slot + + m_slots.erase(0); + } +} + +/** + * Handle a mouse button click event. + * + * @param e The event data. + */ + +void CStartWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +{ + // icon was clicked? + + for (int i = 0; i < m_slots.size(); i++) + { + // Is this the clicked icon? + + NXWidgets::CImage *image = m_slots.at(i).image; + if (image->isClicked()) + { + // Start a new copy of the application + + m_taskbar->startApplication(m_slots.at(i).app, false); + + // Then break out of the loop + + break; + } + } +} + + + diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 42cb41087..3791ee0f6 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -163,14 +163,14 @@ bool CTaskbar::startWindowManager(void) * Create an application window. Creating a new application in the start * window requires three steps: * - * 1. Call openApplicationWindow to create a window for the application, + * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the start window. * * When the application is selected from the start window: * - * 4. Call startApplication start the application and bring its window to + * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. */ @@ -242,6 +242,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) image->setBorderless(true); image->disableDrawing(); + image->setRaisesEvents(false); // Register to get events from the mouse clicks on the image @@ -393,7 +394,7 @@ bool CTaskbar::stopApplication(IApplication *app) minimizeApplication(app); - // Stop the appliation + // Stop the application app->stop(); @@ -863,9 +864,10 @@ bool CTaskbar::redrawTaskbarWindow(void) NXWidgets::CImage *image = m_slots.at(i).image; - // Disable drawing of the icon image + // Disable drawing of the icon image; disable events from the icon image->disableDrawing(); + image->setRaisesEvents(false); // Get the size of the icon image @@ -895,8 +897,9 @@ bool CTaskbar::redrawTaskbarWindow(void) // Then re-draw the icon at the new position - (void)image->enableDrawing(); - (void)image->redraw(); + image->enableDrawing(); + image->redraw(); + image->setRaisesEvents(true); // Do we add icons left-to-right? Or top-to-bottom? @@ -1051,5 +1054,3 @@ void CTaskbar::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) } } } - - diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx old mode 100755 new mode 100644 diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx old mode 100755 new mode 100644 diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx old mode 100755 new mode 100644 From d4f2f575221e5f554985e9cc04a8ed34bb7d9cf5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 14:52:54 +0000 Subject: [PATCH 017/390] Add beginning of NxWM NxConsole application git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4681 42af7a65-404d-4744-a932-0658087f49c3 --- README.txt | 40 ++++ UnitTests/nxwm/main.cxx | 7 + nxwm/include/cnxconsole.hxx | 121 +++++++++-- nxwm/include/cstartwindow.hxx | 4 +- nxwm/include/iapplication.hxx | 6 +- nxwm/include/nxwmconfig.hxx | 22 ++ nxwm/src/cnxconsole.cxx | 372 +++++++++++++++++++++++++++++++++- nxwm/src/cstartwindow.cxx | 8 +- nxwm/src/ctaskbar.cxx | 7 +- 9 files changed, 557 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 380051a22..99b1d8fda 100755 --- a/README.txt +++ b/README.txt @@ -49,3 +49,43 @@ o Many Graphic Objects Note: Many of the fundamental classed in NxWidgets derive from the Antony Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style license. See the COPYING file for details. + +Directory Structure +=================== + +libnxwidgets + + The source code, header files, and build environment for NxWidgets is + provided in this directory. + +UnitTests + + Provides a collection of unit-level tests for many of the individual + widgets provided by libnxwidgets. + +nxwm + + This directory holds a tiny desktop for small embedded devices with a + touchscreen,. NxWM. NxWM is truly multiple window manager but only one + window is displayed at a time. This simplification helps performance on + LCD based products (in the same way that a tiled window manager helps) + and also makes the best use of small displays. It is awkward from a + human factors point-of-view trying to manage multiple windows on a + small display. + + The window manager consists of a task bar with icons representing the + running tasks. If you touch the tasks icon, it comes to the top. Each + window has a toolbar with (1) a title, (2) a minimize button, and (3) a + stop application button using the standard icons for these things. + + There is always a start window that is available in the task bar. When + you touch the start window icon, it brings up the start window containing + icons representing all of the available applications. If you touch an + icon in the start window, it will be started and added to the task bar. + + There is a base class that defines an add-on application and an + interface that supports incorporation of new application. The only + application that is provided is NxConsole. This is an NSH session + running in a window. I should be able to select the NX icon in the start + menu and create as many NSH sessions in windows as I want. (keybard input + still comes through serial). diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index dffa7b600..b0792c1f4 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -38,6 +38,7 @@ ///////////////////////////////////////////////////////////////////////////// #include +#include #include "ctaskbar.hxx" #include "cstartwindow.hxx" @@ -90,6 +91,12 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); int MAIN_NAME(int argc, char *argv[]) { + // Call all C++ static constructors + +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + up_cxxinitialize(); +#endif + // Create an instance of the Task Bar. // // The general sequence for initializing the task bar is: diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 4009eb8b9..99a9b92f2 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -42,7 +42,13 @@ #include +#include +#include +#include + #include "iapplication.hxx" +#include "capplicationwindow.hxx" +#include "ctaskbar.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -56,37 +62,110 @@ namespace NxWM { + /** + * One time NSH initialization. This function must be called exactly + * once during the boot-up sequence to initialize the NSH library. + * + * @return True on successful initialization + */ + + bool nshlibInitialize(void); + /** * This class implements the NxConsole application. */ - class CNxConsole : public IApplication + class CNxConsole : public IApplication, private IApplicationCallback { - protected: - /** - * CNxConsole destructor - */ + protected: + 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 */ - ~CNxConsole(void); + /** + * Called when the window minimize button is pressed. + */ - public: - /** - * CNxConsole constructor - * - * @param window. The application window - */ + void minimize(void); - CNxConsole(NXWidgets::INxWindow *window); + /** + * Called when the window minimize close is pressed. + */ - /** - * Get the icon associated with the application - * - * @return An instance if IBitmap that may be used to rend the - * application's icon. This is an new IBitmap instance that must - * be deleted by the caller when it is no long needed. - */ + void close(void); - NXWidgets::IBitmap *getIcon(void); + /** + * CNxConsole destructor + */ + + ~CNxConsole(void); + + public: + /** + * CNxConsole constructor + * + * @param window. The application window + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + + CNxConsole(CTaskbar *taskbar, CApplicationWindow *window); + + /** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + + CApplicationWindow *getWindow(void) const; + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + NXWidgets::CNxString getName(void); + + /** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + + bool run(void); + + /** + * Stop the application. + */ + + void stop(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + void hide(void); + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + + void redraw(void); }; } #endif // __cplusplus diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index fca886e8d..ab6b6f926 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -160,9 +160,11 @@ namespace NxWM /** * Start the application. + * + * @return True if the application was successfully started. */ - void run(void); + bool run(void); /** * Stop the application. diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 885b85710..be9a96fe5 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -99,10 +99,12 @@ namespace NxWM virtual NXWidgets::CNxString getName(void) = 0; /** - * Start the application (pehaps in the minimized state). + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. */ - virtual void run(void) = 0; + virtual bool run(void) = 0; /** * Stop the application. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index cdbcee564..a683dbd5f 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -198,4 +198,26 @@ # define CONFIG_NXWM_STARTWINDOW_HSPACING (2) #endif +/* NxConsole Window *********************************************************/ + +#ifndef CONFIG_NXWM_NXCONSOLE_PRIO +# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT +#endif + +#ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE +# define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 +#endif + +#ifndef CONFIG_NXWM_NXCONSOLE_WCOLOR +# define CONFIG_NXWM_NXCONSOLE_WCOLOR MKRGB(192,192,192) +#endif + +#ifndef CONFIG_NXWM_NXCONSOLE_FONTCOLOR +# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR MKRGB(0,0,0) +#endif + +#ifndef CONFIG_NXWM_NXCONSOLE_FONTID +# define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID +#endif + #endif // __INCLUDE_NXWMCONFIG_HXX diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index a127a8a5a..857b67983 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -39,6 +39,19 @@ #include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "cwidgetcontrol.hxx" + #include "nxwmconfig.hxx" #include "cnxconsole.hxx" #include "nxwmglyphs.hxx" @@ -47,6 +60,125 @@ * Pre-Processor Definitions ********************************************************************************************/ +/******************************************************************************************** + * Private Types + ********************************************************************************************/ + +namespace NxWM +{ + /** + * This structure is used to pass start up parameters to nxcon_task and to assure the + * the NxConsole is successfully started. + */ + + struct nxcon_task_s + { + sem_t sem; // Sem that will be posted when the task is successfully initialized + NXTKWINDOW hwnd; // Window handle + NXCONSOLE nxcon; // NxConsole handle + int minor; // Next device minor number + bool result; // True if successfully initialized + }; + +/******************************************************************************************** + * Private Data + ********************************************************************************************/ + + /** + * This global data structure is used to pass start parameters to nxcon_task and to + * assure that the NxConsole is successfully started. + */ + + static struct nxcon_task_s g_nxconvars; + +/******************************************************************************************** + * Private Functions + ********************************************************************************************/ + + /** + * This is the NxConsole task. This function first redirects output to the console window. + */ + + static int nxcon_task(int argc, char *argv[]) + { + // Configure NxConsole + + struct nxcon_window_s wndo; /* Describes the window */ + wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; + wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; + wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; + + // To stop compiler complaining about "jump to label crosses initialization of 'int fd' + + int fd = -1; + + // Use the window handle to create the NX console + + g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor); + if (!g_nxconvars.nxcon) + { + goto errout; + } + + // Construct the driver name using this minor number + + char devname[32]; + snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor); + + // Increment the minor number while it is protect by the semaphore + + g_nxconvars.minor++; + + // Open the NxConsole driver + + fd = open(devname, O_WRONLY); + if (fd < 0) + { + goto errout_with_nxcon; + } + + // Now re-direct stdout and stderr so that they use the NX console driver. + // Note that stdin is retained (file descriptor 0, probably the the serial console). + + (void)fflush(stdout); + (void)fflush(stderr); + + (void)fclose(stdout); + (void)fclose(stderr); + + (void)dup2(fd, 1); + (void)dup2(fd, 2); + + // And we can close our original driver file descriptor + + close(fd); + + // Inform the parent thread that we successfully initialize + + g_nxconvars.result = true; + sem_post(&g_nxconvars.sem); + + // Run the NSH console + +#ifdef CONFIG_NSH_CONSOLE + (void)nsh_consolemain(argc, argv); +#endif + + // We get here if console exits +#warning "Missing logic" + return EXIT_SUCCESS; + + errout_with_nxcon: + nxcon_unregister(g_nxconvars.nxcon); + + errout: + g_nxconvars.nxcon = 0; + g_nxconvars.result = false; + sem_post(&g_nxconvars.sem); + return EXIT_FAILURE; + } +} + /******************************************************************************************** * CNxConsole Method Implementations ********************************************************************************************/ @@ -59,8 +191,80 @@ using namespace NxWM; * @param window. The application window */ -CNxConsole::CNxConsole(NXWidgets::INxWindow *window) +CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) { + // Save the constructor data + + m_taskbar = taskbar; + m_window = window; + + // The NxConsole is not runing + + m_pid = -1; + m_nxcon = 0; + + // Add our callbacks to the application window + + window->registerCallbacks(static_cast(this)); +} + +/** + * CNxConsole destructor + * + * @param window. The application window + */ + +CNxConsole::~CNxConsole(void) +{ + // Although we didn't create it, we are responsible for deleting the + // application window + + if (m_window) + { + delete m_window; + } +} + +/** + * One time NSH initialization. This function must be called exactly + * once during the boot-up sequence to initialize the NSH library. + * + * @return True on successful initialization + */ + +bool nshlibInitialize(void) +{ + // Initialize the global data structure + + sem_init(&g_nxconvars.sem, 0, 0); + + // Initialize the NSH library + + nsh_initialize(); + + // If the Telnet console is selected as a front-end, then start the + // Telnet daemon. + +#ifdef CONFIG_NSH_TELNET + int ret = nsh_telnetstart(); + if (ret < 0) + { + // The daemon is NOT running! + + return false; + } +#endif + return true; +} + +/** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + +CApplicationWindow *CNxConsole::getWindow(void) const +{ + return m_window; } /** @@ -73,7 +277,169 @@ CNxConsole::CNxConsole(NXWidgets::INxWindow *window) NXWidgets::IBitmap *CNxConsole::getIcon(void) { - NXWidgets::CRlePaletteBitmap *bitmap = new NXWidgets::CRlePaletteBitmap(&g_nshBitmap); - return static_cast(bitmap); + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&g_nshBitmap); + + return bitmap; } +/** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + +NXWidgets::CNxString CNxConsole::getName(void) +{ + return NXWidgets::CNxString("NuttShell"); +} + +/** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + +bool CNxConsole::run(void) +{ + // Some sanity checking + + if (m_pid >= 0 || m_nxcon != 0) + { + return false; + } + + // Recover the NXTK window instance contained in the application window + + NXWidgets::CNxTkWindow *window = m_window->getWindow(); + + // Get the widget control associated with the NXTK window + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + + // Get the window handle from the widget control + + g_nxconvars.hwnd = control->getWindowHandle(); + + // Start the NxConsole task + + g_nxconvars.result = false; + g_nxconvars.nxcon = 0; + + sched_lock(); + m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, + CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxcon_task, + (FAR const char **)0); + + // Did we successfully start the NxConsole task? + + if (m_pid < 0) + { + return false; + } + + // Wait for up to two second for the task to initialize + + struct timespec abstime; + clock_gettime(CLOCK_REALTIME, &abstime); + abstime.tv_sec += 2; + + int ret = sem_timedwait(&g_nxconvars.sem, &abstime); + if (ret == OK && g_nxconvars.result) + { + // Save the handle to use in the stop method + + m_nxcon = g_nxconvars.nxcon; + return true; + } + else + { + // Stop the application + + stop(); + return false; + } +} + +/** + * Stop the application. + */ + +void CNxConsole::stop(void) +{ + // Delete the NxConsole task if it is still running (this could strand resources) + + if (m_pid >= 0) + { + task_delete(m_pid); + m_pid = -1; + } + + // Destroy the NX console device + + if (m_nxcon) + { + nxcon_unregister(m_nxcon); + m_nxcon = 0; + } +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + +void CNxConsole::hide(void) +{ + // Disable drawing and events +#warning "Missing logic" +} + +/** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + +void CNxConsole::redraw(void) +{ + // Recover the NXTK window instance contained in the application window + + NXWidgets::CNxTkWindow *window = m_window->getWindow(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + (void)window->getSize(&windowSize); + + // Redraw the entire NxConsole window + + struct nxgl_rect_s rect; + rect.pt1.x = 0; + rect.pt1.y = 0; + rect.pt2.x = windowSize.w - 1; + rect.pt2.y = windowSize.h - 1; + + nxcon_redraw(m_nxcon, &rect, false); +} + +/** + * Called when the window minimize button is pressed. + */ + +void CNxConsole::minimize(void) +{ + m_taskbar->minimizeApplication(static_cast(this)); +} + +/** + * Called when the window minimize close is pressed. + */ + +void CNxConsole::close(void) +{ + m_taskbar->stopApplication(static_cast(this)); +} + + + diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 4213c33cb..6949b90db 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -70,7 +70,7 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) m_taskbar = taskbar; m_window = window; - // Add out callbacks to the application window + // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); } @@ -133,11 +133,15 @@ NXWidgets::CNxString CStartWindow::getName(void) /** * Start the application. + * + * @return True if the application was successfully started. */ -void CStartWindow::run(void) +bool CStartWindow::run(void) { // We don't have a thread of execution. We only respond to button presses + + return true; } /** diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 3791ee0f6..8d2907266 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -267,7 +267,12 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) // Then start the application (whatever that means) - app->run(); + if (!app->run()) + { + stopApplication(app); + return false; + } + return true; } From 0bab68e8a5b5e59fa3334799d654074bd1993baf Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 20:36:19 +0000 Subject: [PATCH 018/390] More NxWM support git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4682 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/README.txt | 28 +++- UnitTests/nxwm/Makefile | 40 +++++- UnitTests/nxwm/main.cxx | 22 +-- libnxwidgets/include/cnxserver.hxx | 20 ++- libnxwidgets/include/nxconfig.hxx | 44 ++++-- libnxwidgets/src/cnxserver.cxx | 89 ++++++++++-- nxwm/include/capplicationwindow.hxx | 22 ++- nxwm/include/cnxconsole.hxx | 15 +- nxwm/include/cstartwindow.hxx | 27 +++- nxwm/include/ctaskbar.hxx | 49 ++++--- nxwm/include/nxwmconfig.hxx | 97 ++++++++++++- nxwm/src/cnxconsole.cxx | 203 ++++++++++++++-------------- nxwm/src/ctaskbar.cxx | 158 +++++++++++----------- nxwm/src/glyph_minimize.cxx | 2 +- nxwm/src/glyph_nsh.cxx | 2 +- nxwm/src/glyph_start.cxx | 2 +- nxwm/src/glyph_stop.cxx | 2 +- 17 files changed, 564 insertions(+), 258 deletions(-) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 8534efb9d..b19ed4462 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -35,6 +35,9 @@ Installing and Building the Unit Tests for the STM3210E-EVAL available. However, the unit test can be run on other configurations (see steps d and e below). + NOTE: The special configuratin sim/nxwm is recommended for unit-leveling + testing of NxWM because the configuration is more complex in that case. + We will assume the sim/nsh2 configuration in this discussion. The sim/nsh2 configuration is installed as follows: @@ -48,7 +51,7 @@ Installing and Building the Unit Tests is the full, absolute path to the NuttX build directory If you are using the sim/nsh2 or stm3210e-eval configurations, then skip - to step 2. + to step 2 (Hmmm.. better check 1d) too). There may be certain requirements for the configuration that you select... for example, certain widget tests may require touchscreen support or special @@ -77,7 +80,12 @@ Installing and Building the Unit Tests Then you can run the simulation using GDB or DDD which is a very powerful debugging environment! - d) Other nuttx/.config changes -- NSH configurations only. + d) Special configuration requirements for the nxwm unit test: + + CONFIG_NXCONSOLE=y + CONFIG_NX_MULTIUSER=y + + e) Other nuttx/.config changes -- NSH configurations only. If the configuration that you are using supports NSH and NSH built-in tasks then all is well. If it is an NSH configuration, then you will have to define @@ -89,7 +97,7 @@ Installing and Building the Unit Tests to change anything further in the nuttx/.config file if you are using either of these configurations. - e) Other apps/.config changes -- NON-NSH configurations only. + f) Other apps/.config changes -- NON-NSH configurations only. For non-NSH configurations (such as the sim/touchscreen) you will have to remove the CONFIGURED_APPS seting that contains the user_start function so @@ -147,7 +155,15 @@ Installing and Building the Unit Tests cd /libnxwidgets make TOPDIR= -6. Build NuttX including the unit test and the NXWidgets library +6. Build the NxWM library. + + The NxWM library (libnxwm.a) is required only for the NxWM unit test at + NxWidgets/UnitTests/nxwm. For other unit tests, skip to step 7. + + cd /nxwm + make TOPDIR= + +7. Build NuttX including the unit test and the NXWidgets library cd . ./setenv.sh @@ -268,6 +284,10 @@ CTextBox Exercises the CTextBox widget Depends on CLabel +nxwm + Exercises the NxWM window manager. + Use the special configuration nuttx/configs/sim/nxwm + Example ======= diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index d9cf2d051..9648ad807 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -54,12 +54,26 @@ else CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} endif +# Add the path to the NxWM include directory to the CFLAGS + +NXWM_DIR="$(TESTDIR)/../../nxwm" +NXWM_INC="$(NXWM_DIR)/include" +NXWM_LIB="$(NXWM_DIR)/libnxwm$(LIBEXT)" + +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWM_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWM_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWM_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWM_INC)"} +endif + # Get the path to the archiver tool TESTTOOL_DIR="$(TESTDIR)/../../tools" ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh -# Hello, World! C++ Example +# NxWM unit test ASRCS = CSRCS = @@ -92,7 +106,7 @@ STACKSIZE = 2048 VPATH = all: .built -.PHONY: clean depend context disclean chkcxx chklib +.PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm # Object file creation targets @@ -121,7 +135,7 @@ endif # Verify that the NXWidget library has been built -chklib: +chklibnxwidgets: @( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ @@ -131,18 +145,34 @@ chklib: fi; \ ) +# Verify that the NxWM library has been built + +chklibnxwm: + @( \ + if [ ! -e "$(NXWM_LIB)" ]; then \ + echo "$(NXWM_LIB) does not exist."; \ + echo "Please go to $(NXWM_LIB)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + # Library creation targets -$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. +$(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work. -.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) +$(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. + +.built: chkcxx chklibnxwidgets chklibnxwm $(OBJS) $(NXWIDGETS_LIB) @( for obj in $(OBJS) ; do \ $(call ARCHIVE, $(BIN), $${obj}); \ done ; ) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) else @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) endif @touch .built diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index b0792c1f4..d93d9b391 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -40,8 +40,12 @@ #include #include +#include +#include + #include "ctaskbar.hxx" #include "cstartwindow.hxx" +#include "cnxconsole.hxx" ///////////////////////////////////////////////////////////////////////////// // Pre-processor Definitions @@ -61,7 +65,7 @@ // Private Types ///////////////////////////////////////////////////////////////////////////// -struct nxwm_test_s +struct SNxWmTest { NxWM::CTaskbar *taskbar; // The task bar NxWM::CStartWindow *startwindow; // The start window @@ -71,7 +75,7 @@ struct nxwm_test_s // Private Data ///////////////////////////////////////////////////////////////////////////// -static struct nxwm_test_s g_nxwmtest; +static struct SNxWmTest g_nxwmtest; ///////////////////////////////////////////////////////////////////////////// // Public Function Prototypes @@ -109,7 +113,7 @@ int MAIN_NAME(int argc, char *argv[]) // 4. Call CTaskBar::startWindowManager to start the display with applications in place printf(MAIN_STRING "Create CTaskbar instance\n"); - g_nxwmtest.taskbar = new CTaskbar(); + g_nxwmtest.taskbar = new NxWM::CTaskbar(); if (!g_nxwmtest.taskbar) { printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); @@ -150,7 +154,7 @@ int MAIN_NAME(int argc, char *argv[]) // window application. printf(MAIN_STRING "Opening the start window application window\n"); - CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); if (!window) { printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); @@ -170,7 +174,8 @@ int MAIN_NAME(int argc, char *argv[]) // Add the NxConsole application to the start window -#if 0 + NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint + printf(MAIN_STRING "Opening the NxConsole application window\n"); window = g_nxwmtest.taskbar->openApplicationWindow(); if (!window) @@ -180,7 +185,7 @@ int MAIN_NAME(int argc, char *argv[]) } printf(MAIN_STRING "Creating the NxConsole application\n"); - NxWM::CNxConsole *console = new CNxConsole(window); + console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); if (!console) { printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); @@ -196,11 +201,12 @@ int MAIN_NAME(int argc, char *argv[]) } noconsole: -#endif // Add the calculator application to the start window #if 0 + NxWM::CCalculator *calculator = (NxWM::CCalculator *)0; // Avoid compiler complaint + printf(MAIN_STRING "Opening the calculator application window\n"); window = g_nxwmtest.taskbar->openApplicationWindow(); if (!window) @@ -210,7 +216,7 @@ noconsole: } printf(MAIN_STRING "Creating the calculator application\n"); - NxWM::CCalculator *calculator = new CCalculator(window); + calculator = new NxWM::CCalculator(g_nxwmtest.taskbar, window); if (!calculator) { printf(MAIN_STRING "ERROR: Failed to instantiate calculator\n"); diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index 3043fd9e0..c6ca21bfc 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -44,6 +44,7 @@ #include #include +#include #include @@ -79,21 +80,28 @@ namespace NXWidgets class CNxServer { private: -#ifndef CONFIG_NX_MULTIUSER FAR NX_DRIVERTYPE *m_hDevice; /**< LCD/Framebuffer device handle */ -#endif NXHANDLE m_hNxServer; /**< NX server handle */ #ifdef CONFIG_NX_MULTIUSER - voilatile bool m_running; /**< True: The listener thread is running */ - voilatile bool m_connected; /**< True: Connected to the server */ + volatile bool m_running; /**< True: The listener thread is running */ + volatile bool m_connected; /**< True: Connected to the server */ volatile bool m_stop; /**< True: Waiting for the listener thread to stop */ sem_t m_connsem; /**< Wait for server connection */ #endif static uint8_t m_nServers; /**< The number of NX server instances */ /** - * This is the entry point of a thread that listeners for and dispatches - * events from the NX server. + * NX server thread. This is the entry point into the server thread that + * serializes the multi-threaded accesses to the display. + */ + +#ifdef CONFIG_NX_MULTIUSER + static int server(int argc, char *argv[]); +#endif + + /** + * NX listener thread. This is the entry point of a thread that listeners for and + * dispatches events from the NX server. */ #ifdef CONFIG_NX_MULTIUSER diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 2f38c7c26..682eadb82 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -52,13 +52,20 @@ * Pre-Processor Definitions ****************************************************************************/ /* NX Configuration *********************************************************/ +/** + * C++ support is required + */ + +#ifndef CONFIG_HAVE_CXX +# error "C++ support is required (CONFIG_HAVE_CXX)" +#endif /** * Required to enabled NX graphics support */ #ifndef CONFIG_NX -# error "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" +# error "NX graphics support is required (CONFIG_NX)" #endif /** @@ -112,7 +119,19 @@ */ #ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO 50 +# define CONFIG_NXWIDGETS_SERVERPRIO SCHED_PRIORITY_DEFAULT +#endif + +#ifndef CONFIG_NXWIDGETS_CLIENTPRIO +# define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT +#endif + +/** + * NX server thread stack size (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_SERVERSTACK +# define CONFIG_NXWIDGETS_SERVERSTACK 2048 #endif /** @@ -120,30 +139,35 @@ */ #ifndef CONFIG_NXWIDGETS_LISTENERPRIO -# define CONFIG_NXWIDGETS_LISTENERPRIO 50 +# define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT #endif /** - * NX server/listener thread stack size (in multi-user mode) + * NX listener thread stack size (in multi-user mode) */ -#ifndef CONFIG_NXWIDGETS_STACKSIZE -# define CONFIG_NXWIDGETS_STACKSIZE 4096 +#ifndef CONFIG_NXWIDGETS_LISTENERSTACK +# define CONFIG_NXWIDGETS_LISTENERSTACK 2048 #endif /* NXWidget Configuration ***************************************************/ -/* NX Server/Device Configuration +/** + * NX Server/Device Configuration * * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than * one LCDs connected. Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode). * Default: 50 - * CONFIG_NXWIDGETS_SERVERPRIO + * CONFIG_NXWIDGETS_CLIENTPRIO * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in * multi-user mode). Default: 50 - * CONFIG_NXWIDGETS_STACKSIZE - Priority of the NX server/listener thread - * stack size (in multi-user mode). Default: 4096 + * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display + * initialization. + * CONFIG_NXWIDGETS_SERVERSTACK - NX server thread stack size (in multi-user + * mode). Default 2048 + * CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user + * mode). Default 2048 * * NXWidget Configuration * diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index ef71deb44..69b1c5c4e 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -212,12 +214,12 @@ bool CNxServer::connect(void) // Start the server task - message("NxServer::connect: Starting nx_servertask task\n"); + gvdbg("NxServer::connect: Starting server task\n"); serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, - CONFIG_NXWIDGETS_STACKSIZE, nx_servertask, NULL); + CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0); if (serverId < 0) { - message("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); return false; } @@ -239,7 +241,7 @@ bool CNxServer::connect(void) (void)pthread_attr_init(&attr); param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; (void)pthread_attr_setschedparam(&attr, ¶m); - (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_STACKSIZE); + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK); m_stop = false; m_running = true; @@ -247,7 +249,7 @@ bool CNxServer::connect(void) ret = pthread_create(&thread, &attr, listener, (FAR void *)this); if (ret != 0) { - printf("NxServer::connect: pthread_create failed: %d\n", ret); + gdbg("NxServer::connect: pthread_create failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -266,7 +268,7 @@ bool CNxServer::connect(void) // In the successful case, the listener is still running (m_running) // and the server is connected (m_connected). Anything else is a failure. - if (!m_connected !! !m_running) + if (!m_connected || !m_running) { disconnect(); return false; @@ -332,6 +334,75 @@ void CNxServer::disconnect(void) } #endif +/** + * NX server thread. This is the entry point into the server thread that + * serializes the multi-threaded accesses to the display. + */ + +#ifdef CONFIG_NX_MULTIUSER +int CNxServer::server(int argc, char *argv[]) +{ + FAR NX_DRIVERTYPE *dev; + int ret; + +#if defined(CONFIG_NXWIDGETS_EXTERNINIT) + /* Use external graphics driver initialization */ + + dev = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); + if (!dev) + { + gdbg("up_nxdrvinit failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + return EXIT_FAILURE; + } + +#elif defined(CONFIG_NX_LCDDRIVER) + /* Initialize the LCD device */ + + ret = up_lcdinitialize(); + if (ret < 0) + { + gdbg("up_lcdinitialize failed: %d\n", -ret); + return EXIT_FAILURE; + } + + /* Get the device instance */ + + dev = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO); + if (!dev) + { + gdbg("up_lcdgetdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + return EXIT_FAILURE; + } + + /* Turn the LCD on at 75% power */ + + (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); +#else + /* Initialize the frame buffer device */ + + ret = up_fbinitialize(); + if (ret < 0) + { + gdbg("nxcon_server: up_fbinitialize failed: %d\n", -ret); + return EXIT_FAILURE; + } + + dev = up_fbgetvplane(CONFIG_NXWIDGETS_VPLANE); + if (!dev) + { + gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); + return 2; + } +#endif + + /* Then start the server */ + + ret = nx_run(dev); + gvdbg("nx_run returned: %d\n", errno); + return EXIT_FAILURE; +} +#endif + /** * This is the entry point of a thread that listeners for and dispatches * events from the NX server. @@ -342,7 +413,7 @@ FAR void *CNxServer::listener(FAR void *arg) { // The argument must be the CNxServer instance - CNxServer *This = (CNxServer*)pvArg; + CNxServer *This = (CNxServer*)arg; // Process events forever @@ -361,7 +432,7 @@ FAR void *CNxServer::listener(FAR void *arg) // An error occurred... assume that we have lost connection with // the server. - gdbg("CNxServer::listener: Lost server connection: %d\n", errno); + gdbg("Lost server connection: %d\n", errno); break; } @@ -371,7 +442,7 @@ FAR void *CNxServer::listener(FAR void *arg) { This->m_connected = true; sem_post(&This->m_connsem); - gdbg("CNxServer::listener: Connected\n"); + gvdbg("Connected\n"); } } diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 3d868e576..adeac30dc 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/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/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 99a9b92f2..7754276a7 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/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/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index ab6b6f926..649bf3247 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -116,12 +116,6 @@ namespace NxWM void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); - /** - * CStartWindow Constructor - */ - - ~CStartWindow(void); - public: /** @@ -133,6 +127,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/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 1de4a7491..f5bef2054 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -100,18 +100,6 @@ namespace NxWM IApplication *m_topapp; /**< The top application in the hierarchy */ TNxArray 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. * @@ -202,12 +190,6 @@ namespace NxWM void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); - /** - * CTaskbar Destructor - */ - - ~CTaskbar(void); - public: /** * CTaskbar Constructor @@ -217,6 +199,24 @@ namespace NxWM CTaskbar(void); + /** + * CTaskbar Destructor + */ + + ~CTaskbar(void); + + /** + * Connect to the server + */ + + bool connect(void); + + /** + * Disconnect from the server + */ + + void disconnect(void); + /** * Initialize task bar. Task bar initialization is separate from * object instantiation so that failures can be reported. The window @@ -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/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index a683dbd5f..d76b08098 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -49,12 +49,42 @@ * Pre-Processor Definitions ****************************************************************************/ /* 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 /** @@ -66,6 +96,27 @@ #endif /* 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 */ @@ -127,6 +178,23 @@ #endif /* 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. */ @@ -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 diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 857b67983..5fe81d844 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -41,9 +41,9 @@ #include #include +#include #include -#include #include #include #include @@ -53,8 +53,8 @@ #include "cwidgetcontrol.hxx" #include "nxwmconfig.hxx" -#include "cnxconsole.hxx" #include "nxwmglyphs.hxx" +#include "cnxconsole.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -66,119 +66,36 @@ namespace NxWM { - /** - * This structure is used to pass start up parameters to nxcon_task and to assure the - * the NxConsole is successfully started. - */ + /** + * This structure is used to pass start up parameters to the NxConsole task and to assure the + * the NxConsole is successfully started. + */ - struct nxcon_task_s - { - sem_t sem; // Sem that will be posted when the task is successfully initialized - NXTKWINDOW hwnd; // Window handle - NXCONSOLE nxcon; // NxConsole handle - int minor; // Next device minor number - bool result; // True if successfully initialized - }; + struct SNxConsole + { + sem_t sem; /**< Sem that will be posted when the task is successfully initialized */ + NXTKWINDOW hwnd; /**< Window handle */ + NXCONSOLE nxcon; /**< NxConsole handle */ + int minor; /**< Next device minor number */ + bool result; /**< True if successfully initialized */ + }; /******************************************************************************************** * Private Data ********************************************************************************************/ /** - * This global data structure is used to pass start parameters to nxcon_task and to + * This global data structure is used to pass start parameters to NxConsole task and to * assure that the NxConsole is successfully started. */ - static struct nxcon_task_s g_nxconvars; + static struct SNxConsole g_nxconvars; +} /******************************************************************************************** * Private Functions ********************************************************************************************/ - /** - * This is the NxConsole task. This function first redirects output to the console window. - */ - - static int nxcon_task(int argc, char *argv[]) - { - // Configure NxConsole - - struct nxcon_window_s wndo; /* Describes the window */ - wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; - wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; - wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; - - // To stop compiler complaining about "jump to label crosses initialization of 'int fd' - - int fd = -1; - - // Use the window handle to create the NX console - - g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor); - if (!g_nxconvars.nxcon) - { - goto errout; - } - - // Construct the driver name using this minor number - - char devname[32]; - snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor); - - // Increment the minor number while it is protect by the semaphore - - g_nxconvars.minor++; - - // Open the NxConsole driver - - fd = open(devname, O_WRONLY); - if (fd < 0) - { - goto errout_with_nxcon; - } - - // Now re-direct stdout and stderr so that they use the NX console driver. - // Note that stdin is retained (file descriptor 0, probably the the serial console). - - (void)fflush(stdout); - (void)fflush(stderr); - - (void)fclose(stdout); - (void)fclose(stderr); - - (void)dup2(fd, 1); - (void)dup2(fd, 2); - - // And we can close our original driver file descriptor - - close(fd); - - // Inform the parent thread that we successfully initialize - - g_nxconvars.result = true; - sem_post(&g_nxconvars.sem); - - // Run the NSH console - -#ifdef CONFIG_NSH_CONSOLE - (void)nsh_consolemain(argc, argv); -#endif - - // We get here if console exits -#warning "Missing logic" - return EXIT_SUCCESS; - - errout_with_nxcon: - nxcon_unregister(g_nxconvars.nxcon); - - errout: - g_nxconvars.nxcon = 0; - g_nxconvars.result = false; - sem_post(&g_nxconvars.sem); - return EXIT_FAILURE; - } -} - /******************************************************************************************** * CNxConsole Method Implementations ********************************************************************************************/ @@ -328,7 +245,7 @@ bool CNxConsole::run(void) sched_lock(); m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, - CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxcon_task, + CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxconsole, (FAR const char **)0); // Did we successfully start the NxConsole task? @@ -423,6 +340,90 @@ void CNxConsole::redraw(void) nxcon_redraw(m_nxcon, &rect, false); } +/** + * This is the NxConsole task. This function first redirects output to the + * console window. + */ + +int CNxConsole::nxconsole(int argc, char *argv[]) +{ + // Configure NxConsole + + struct nxcon_window_s wndo; /* Describes the window */ + wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; + wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; + wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; + + // To stop compiler complaining about "jump to label crosses initialization of 'int fd' + + int fd = -1; + + // Use the window handle to create the NX console + + g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor); + if (!g_nxconvars.nxcon) + { + goto errout; + } + + // Construct the driver name using this minor number + + char devname[32]; + snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor); + + // Increment the minor number while it is protect by the semaphore + + g_nxconvars.minor++; + + // Open the NxConsole driver + + fd = open(devname, O_WRONLY); + if (fd < 0) + { + goto errout_with_nxcon; + } + + // Now re-direct stdout and stderr so that they use the NX console driver. + // Note that stdin is retained (file descriptor 0, probably the the serial console). + + (void)std::fflush(stdout); + (void)std::fflush(stderr); + + (void)std::fclose(stdout); + (void)std::fclose(stderr); + + (void)std::dup2(fd, 1); + (void)std::dup2(fd, 2); + + // And we can close our original driver file descriptor + + std::close(fd); + + // Inform the parent thread that we successfully initialize + + g_nxconvars.result = true; + sem_post(&g_nxconvars.sem); + + // Run the NSH console + +#ifdef CONFIG_NSH_CONSOLE + (void)nsh_consolemain(argc, argv); +#endif + + // We get here if console exits +#warning "Missing logic" + return EXIT_SUCCESS; + +errout_with_nxcon: + nxcon_unregister(g_nxconvars.nxcon); + +errout: + g_nxconvars.nxcon = 0; + g_nxconvars.result = false; + sem_post(&g_nxconvars.sem); + return EXIT_FAILURE; +} + /** * Called when the window minimize button is pressed. */ diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 8d2907266..faac2fa76 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -82,6 +82,84 @@ CTaskbar::~CTaskbar(void) disconnect(); } +/** + * Connect to the server + */ + +bool CTaskbar::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR)) + { + // Failed + } + } + + return nxConnected; +} + +/** + * Disconnect from the server + */ + +void CTaskbar::disconnect(void) +{ + // Stop all applications and remove them from the task bar. Clearly, there + // are some ordering issues here... On an orderly system shutdown, disconnection + // should really occur priority to deleting instances + + while (!m_slots.empty()) + { + IApplication *app = m_slots.at(0).app; + stopApplication(app); + } + + // Close the windows + + NXWidgets::CWidgetControl *control; + if (m_taskbar) + { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_taskbar->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the task bar window + + delete m_taskbar; + } + + if (m_background) + { + // Delete the contained widget control. We are responsible for it + // because we created it + + control = m_background->getWidgetControl(); + if (control) + { + delete control; + } + + // Then delete the background + + delete m_background; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + /** * Initialize task bar. Task bar initialization is separate from * object instantiation so that failures can be reported. The window @@ -426,84 +504,6 @@ bool CTaskbar::stopApplication(IApplication *app) return redrawTaskbarWindow(); } -/** - * Connect to the server - */ - -bool CTaskbar::connect(void) -{ - // Connect to the server - - bool nxConnected = CNxServer::connect(); - if (nxConnected) - { - // Set the background color - - if (!setBackgroundColor(CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR)) - { - // Failed - } - } - - return nxConnected; -} - -/** - * Disconnect from the server - */ - -void CTaskbar::disconnect(void) -{ - // Stop all applications and remove them from the task bar. Clearly, there - // are some ordering issues here... On an orderly system shutdown, disconnection - // should really occur priority to deleting instances - - while (!m_slots.empty()) - { - IApplication *app = m_slots.at(0).app; - stopApplication(app); - } - - // Close the windows - - NXWidgets::CWidgetControl *control; - if (m_taskbar) - { - // Delete the contained widget control. We are responsible for it - // because we created it - - control = m_taskbar->getWidgetControl(); - if (control) - { - delete control; - } - - // Then delete the task bar window - - delete m_taskbar; - } - - if (m_background) - { - // Delete the contained widget control. We are responsible for it - // because we created it - - control = m_background->getWidgetControl(); - if (control) - { - delete control; - } - - // Then delete the background - - delete m_background; - } - - // And disconnect from the server - - CNxServer::disconnect(); -} - /** * Create a raw window. * @@ -893,7 +893,7 @@ bool CTaskbar::redrawTaskbarWindow(void) // For vertical task bars, the icons will be centered horizontally iconPos.x = (windowSize.w - rect.getWidth()) >> 1; - iconPos.y = taskbarPos.y + iconPos.y = taskbarPos.y; #endif // Set the position of the icon bitmap diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 8c4228279..f86015367 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -170,7 +170,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 8e9b0746d..5ddeb9008 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -196,7 +196,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_nshRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap g_nshBitmap = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_nshBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index a81d6b19f..85457799d 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -197,7 +197,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_startRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap g_startBitmap = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_startBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index 5c4c5477e..fdb08fa51 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -209,7 +209,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap g_stopBitmap = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format From 830ff2848935c49c7234ff03992277a1a717888a Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 22:31:26 +0000 Subject: [PATCH 019/390] NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4683 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 11 +++++ libnxwidgets/include/cwidgetcontrol.hxx | 33 ++++++++++++- libnxwidgets/src/cimage.cxx | 2 +- libnxwidgets/src/cwidgetcontrol.cxx | 27 +++++++++++ nxwm/src/cnxconsole.cxx | 62 ++++++++++++------------- nxwm/src/ctaskbar.cxx | 11 +++-- 6 files changed, 109 insertions(+), 37 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index d93d9b391..f07cdb19c 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -172,6 +172,17 @@ int MAIN_NAME(int argc, char *argv[]) return EXIT_FAILURE; } + // Initialize the NSH library + + printf(MAIN_STRING "Initialize the NSH library\n"); + if (!NxWM::nshlibInitialize()) + { + printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); + delete window; + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + // Add the NxConsole application to the start window NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 9fedd4618..0a894eae8 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -193,6 +193,9 @@ namespace NXWidgets struct nxgl_size_s m_size; /**< Size of the window */ struct nxgl_point_s m_pos; /**< Position in display space */ struct nxgl_rect_s m_bounds; /**< Size of the display */ +#ifdef CONFIG_NX_MULTIUSER + sem_t m_geosem; /**< Posted when geometry is valid */ +#endif /** * Style @@ -279,6 +282,27 @@ namespace NXWidgets void wakeupModalLoop(void); + /** + * Take the geometry semaphore (handling signal interruptions) + */ + +#ifdef CONFIG_NX_MULTIUSER + void takeGeoSem(void); +#else + inline void takeGeoSem(void) {} +#endif + + /** + * Give the geometry semaphore + */ + + inline void giveGeoSem(void) + { +#ifdef CONFIG_NX_MULTIUSER + sem_post(&m_geosem); +#endif + } + /** * Clear all mouse events */ @@ -553,7 +577,10 @@ namespace NXWidgets inline CRect getWindowBoundingBox(void) { - return CRect(&m_bounds); + takeGeoSem(); + CRect rect(&m_bounds); + giveGeoSem(); + return rect; } /** @@ -564,8 +591,10 @@ namespace NXWidgets inline bool getWindowPosition(FAR struct nxgl_point_s *pPos) { + takeGeoSem(); pPos->x = m_pos.x; pPos->x = m_pos.y; + giveGeoSem(); return true; } @@ -577,8 +606,10 @@ namespace NXWidgets inline bool getWindowSize(FAR struct nxgl_size_s *pSize) { + takeGeoSem(); pSize->h = m_size.h; pSize->w = m_size.w; + giveGeoSem(); return true; } diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index c905737fd..0ca6f571e 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -272,7 +272,7 @@ void CImage::drawContents(CGraphicsPort *port) } else { - port->drawBitmapGreyScale(rect.getX(),displayRow, + port->drawBitmapGreyScale(rect.getX(), displayRow, rect.getWidth(), 1, &bitmap, 0, 0); } diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 5ea672a2f..a6807dad5 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include "nxconfig.hxx" #include "cnxserver.hxx" @@ -427,6 +428,13 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, m_hWindow = hWindow; nxgl_rectcopy(&m_bounds, bounds); + + // Wake up any threads waiting for initial position information. + // REVISIT: If the window is moved or repositioned, then the + // position and size data will be incorrect for a period of time. + // That case should be handled here as well. + + giveGeoSem(); } } @@ -864,6 +872,25 @@ bool CWidgetControl::pollCursorControlEvents(void) return cursorControlEvent; } +/** + * Take the geometry semaphore (handling signal interruptions) + */ + +#ifdef CONFIG_NX_MULTIUSER +void CWidgetControl::takeGeoSem(void) +{ + // Take the geometry semaphore. Retry is an error occurs (only if + // the error is due to a signal interruption). + + int ret; + do + { + ret = sem_wait(&m_geosem); + } + while (ret < 0 && errno == EINTR); +} +#endif + /** * Clear all mouse events */ diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 5fe81d844..3652364c7 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -142,38 +142,6 @@ CNxConsole::~CNxConsole(void) } } -/** - * One time NSH initialization. This function must be called exactly - * once during the boot-up sequence to initialize the NSH library. - * - * @return True on successful initialization - */ - -bool nshlibInitialize(void) -{ - // Initialize the global data structure - - sem_init(&g_nxconvars.sem, 0, 0); - - // Initialize the NSH library - - nsh_initialize(); - - // If the Telnet console is selected as a front-end, then start the - // Telnet daemon. - -#ifdef CONFIG_NSH_TELNET - int ret = nsh_telnetstart(); - if (ret < 0) - { - // The daemon is NOT running! - - return false; - } -#endif - return true; -} - /** * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. @@ -442,5 +410,35 @@ void CNxConsole::close(void) m_taskbar->stopApplication(static_cast(this)); } +/** + * One time NSH initialization. This function must be called exactly + * once during the boot-up sequence to initialize the NSH library. + * + * @return True on successful initialization + */ +bool NxWM::nshlibInitialize(void) +{ + // Initialize the global data structure + + sem_init(&g_nxconvars.sem, 0, 0); + + // Initialize the NSH library + + nsh_initialize(); + + // If the Telnet console is selected as a front-end, then start the + // Telnet daemon. + +#ifdef CONFIG_NSH_TELNET + int ret = nsh_telnetstart(); + if (ret < 0) + { + // The daemon is NOT running! + + return false; + } +#endif + return true; +} diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index faac2fa76..1dba90c5a 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -867,7 +867,7 @@ bool CTaskbar::redrawTaskbarWindow(void) { // Get the icon associated with this application - NXWidgets::CImage *image = m_slots.at(i).image; + NXWidgets::CImage *image = m_slots.at(i).image; // Disable drawing of the icon image; disable events from the icon @@ -962,6 +962,7 @@ bool CTaskbar::redrawBackgroundWindow(void) // Then re-draw the background image on the window + m_backImage->enableDrawing(); m_backImage->redraw(); return true; } @@ -982,7 +983,7 @@ bool CTaskbar::redrawApplicationWindow(void) { // No.. Search for that last, non-minimized application - for (int i = m_slots.size() - 1; i > 0; i--) + for (int i = m_slots.size() - 1; i >= 0; i--) { IApplication *candidate = m_slots.at(i).app; if (!candidate->isMinimized()) @@ -1002,6 +1003,10 @@ bool CTaskbar::redrawApplicationWindow(void) m_topapp = app; app->setTopApplication(true); + // Disable drawing of the background image. + + m_backImage->disableDrawing(); + // And.. Draw the application app->redraw(); @@ -1009,7 +1014,7 @@ bool CTaskbar::redrawApplicationWindow(void) } else { - // Otherwise, re-draw the background + // Otherwise, re-draw the background image m_topapp = (IApplication *)0; return redrawBackgroundWindow(); From 97c1ad879f583261b84a14a22e53ffdbaf62e500 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 1 May 2012 23:31:47 +0000 Subject: [PATCH 020/390] Missed Calypso file git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4685 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/nxconfig.hxx | 30 ++++++++++++++++++++++++------ nxwm/include/nxwmconfig.hxx | 10 +++++++++- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 682eadb82..1c7b6a3f0 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -119,13 +119,18 @@ */ #ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO SCHED_PRIORITY_DEFAULT +# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1) #endif #ifndef CONFIG_NXWIDGETS_CLIENTPRIO # define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" +# warning" -- This can result in data overrun errors" +#endif + /** * NX server thread stack size (in multi-user mode) */ @@ -142,6 +147,11 @@ # define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" +# warning" -- This can result in data overrun errors" +#endif + /** * NX listener thread stack size (in multi-user mode) */ @@ -157,11 +167,19 @@ * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than * one LCDs connected. Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 - * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server (in multi-user mode). - * Default: 50 - * CONFIG_NXWIDGETS_CLIENTPRIO - * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread (in - * multi-user mode). Default: 50 + * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server. This applies + * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). + * Default: SCHED_PRIORITY_DEFAULT+1. NOTE: Of the three priority + * definitions here, CONFIG_NXWIDGETS_SERVERPRIO should have the highest + * priority to avoid data overrun race conditions. Such errors would most + * likely appear as duplicated rows of data on the display. + * CONFIG_NXWIDGETS_CLIENTPRIO - The thread that calls CNxServer::connect() + * will be re-prioritized to this priority. This applies only if NX is + * configured in multi-user mode (CONFIG_NX_MULTIUSER=y). Default: + * SCHED_PRIORITY_DEFAULT + * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread. + * This applies only if NX is configured in multi-user mode + * (CONFIG_NX_MULTIUSER=y). Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display * initialization. * CONFIG_NXWIDGETS_SERVERSTACK - NX server thread stack size (in multi-user diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index d76b08098..cfdd7510e 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -282,7 +282,10 @@ * NxConsole Window Configuration * * CONFIG_NXWM_NXCONSOLE_PRIO - Priority of the NxConsole task. Default: - * SCHED_PRIORITY_DEFAULT + * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than + * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. + * Such errors would most likely appear as duplicated rows of data on the + * display. * 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. @@ -297,6 +300,11 @@ # define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT #endif +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO" +# warning" -- This can result in data overrun errors" +#endif + #ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE # define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 #endif From c1d00502a9a61461e9b04ad1c2867def8ff26f4f Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 00:10:18 +0000 Subject: [PATCH 021/390] NxWM update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4686 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 4 +-- nxwm/include/cstartwindow.hxx | 4 +-- nxwm/src/cstartwindow.cxx | 4 +-- nxwm/src/glyph_minimize.cxx | 28 ++++++++++------- nxwm/src/glyph_nsh.cxx | 36 +++++++++++---------- nxwm/src/glyph_start.cxx | 36 +++++++++++---------- nxwm/src/glyph_stop.cxx | 59 +++++++++++++++++++---------------- 7 files changed, 94 insertions(+), 77 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index f07cdb19c..d0050b2bd 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -207,7 +207,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(console)) { - printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start menu\n"); + printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start window\n"); delete window; } @@ -238,7 +238,7 @@ noconsole: printf(MAIN_STRING "Adding the calculator application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(calculator)) { - printf(MAIN_STRING "ERROR: Failed to add calculator to the start menu\n"); + printf(MAIN_STRING "ERROR: Failed to add calculator to the start window\n"); delete window; } diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 649bf3247..86245c427 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -192,8 +192,8 @@ namespace NxWM * setting up the start window is: * * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - * 2. Use the window to instantiate CStartMenu - * 3. Call CStartMenu::addApplication numerous times to install applications + * 2. Use the window to instantiate CStartWindow + * 3. Call CStartWindow::addApplication numerous times to install applications * in the start window. * 4. Call CTaskBar::startApplication (initially minimized) to start the start * window application. diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 6949b90db..c7a3b27f8 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -279,8 +279,8 @@ void CStartWindow::redraw(void) * setting up the start window is: * * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - * 2. Use the window to instantiate CStartMenu - * 3. Call CStartMenu::addApplication numerous times to install applications + * 2. Use the window to instantiate CStartWindow + * 3. Call CStartWindow::addApplication numerous times to install applications * in the start window. * 4. Call CTaskBar::startApplication (initially minimized) to start the start * window application. diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index f86015367..350f188f9 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -47,8 +47,9 @@ #include #include -#include "nxconfig.hxx" #include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" /******************************************************************************************** @@ -71,10 +72,10 @@ using namespace NxWM; static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = { - 0xffffff, 0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, /* Codes 0-7 */ - 0x002492, 0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, /* Codes 8-15 */ - 0x4949b6, 0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, /* Codes 16-23 */ - 0x4949ff /* Codes 24-24 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 9 */ + 0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, 0x002492, /* Codes 1-8 */ + 0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, 0x4949b6, /* Codes 9-17 */ + 0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, 0x4949ff /* Codes 17-24 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -83,9 +84,10 @@ static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = { - 0xffff, 0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, /* Codes 0-9 */ - 0x2136, 0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, /* Codes 10-19 */ - 0xdedf, 0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 20-24 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, 0x2136, /* Codes 1-10 */ + 0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, 0xdedf, /* Codes 11-20 */ + 0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 21-24 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -102,8 +104,9 @@ static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = { - 0xff, 0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, 0x6a, 0x5f, /* Codes 0-15 */ - 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 16-24 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, /* Codes 1-13 */ + 0x6a, 0x5f, 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 14-24 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ @@ -112,8 +115,9 @@ static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = { - 0xff, 0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, 0x4e, 0x2e, /* Codes 0-15 */ - 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 16-24 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, /* Codes 1-13 */ + 0x4e, 0x2e, 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 14-24 */ }; # endif diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 5ddeb9008..69bccd344 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -47,9 +47,9 @@ #include #include -#include "nxconfig.hxx" #include "crlepalettebitmap.hxx" +#include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" /******************************************************************************************** @@ -72,11 +72,12 @@ using namespace NxWM; static const uint32_t g_nshLut[BITMAP_NLUTCODES] = { - 0xdbdbdb, 0xffffdb, 0x4949db, 0x2424db, 0x4924db, 0xdbdbff, 0x6d6ddb, 0x6d92db, /* Codes 0-7 */ - 0x2424b6, 0xffdbdb, 0xdbffff, 0x4992db, 0x24246d, 0xffffff, 0x6db6db, 0x242492, /* Codes 8-15 */ - 0x4924ff, 0x49b6db, 0x6d6db6, 0x92b6db, 0xb6dbdb, 0xb6dbff, 0x2424ff, 0x9292db, /* Codes 16-23 */ - 0x9292b6, 0x00006d, 0x9292ff, 0x240092, 0x24006d, 0x4949ff, 0x494992, 0x92b6ff, /* Codes 24-31 */ - 0xb6b6db, 0x4924b6, 0x92dbdb, 0x926ddb /* Codes 32-35 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffffdb, 0x4949db, 0x2424db, 0x4924db, 0xdbdbff, 0x6d6ddb, 0x6d92db, 0x2424b6, /* Codes 1-8 */ + 0xffdbdb, 0xdbffff, 0x4992db, 0x24246d, 0xffffff, 0x6db6db, 0x242492, 0x4924ff, /* Codes 9-16 */ + 0x49b6db, 0x6d6db6, 0x92b6db, 0xb6dbdb, 0xb6dbff, 0x2424ff, 0x9292db, 0x9292b6, /* Codes 17-24 */ + 0x00006d, 0x9292ff, 0x240092, 0x24006d, 0x4949ff, 0x494992, 0x92b6ff, 0xb6b6db, /* Codes 25-32 */ + 0x4924b6, 0x92dbdb, 0x926ddb /* Codes 33-35 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -85,10 +86,11 @@ static const uint32_t g_nshLut[BITMAP_NLUTCODES] = static const uint16_t g_nshLut[BITMAP_NLUTCODES] = { - 0xdedb, 0xfffb, 0x4a5b, 0x213b, 0x493b, 0xdedf, 0x6b7b, 0x6c9b, 0x2136, 0xfedb, /* Codes 0-9 */ - 0xdfff, 0x4c9b, 0x212d, 0xffff, 0x6dbb, 0x2132, 0x493f, 0x4dbb, 0x6b76, 0x95bb, /* Codes 10-19 */ - 0xb6db, 0xb6df, 0x213f, 0x949b, 0x9496, 0x000d, 0x949f, 0x2012, 0x200d, 0x4a5f, /* Codes 20-29 */ - 0x4a52, 0x95bf, 0xb5bb, 0x4936, 0x96db, 0x937b /* Codes 30-35 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfffb, 0x4a5b, 0x213b, 0x493b, 0xdedf, 0x6b7b, 0x6c9b, 0x2136, 0xfedb, 0xdfff, /* Codes 1-10 */ + 0x4c9b, 0x212d, 0xffff, 0x6dbb, 0x2132, 0x493f, 0x4dbb, 0x6b76, 0x95bb, 0xb6db, /* Codes 11-20 */ + 0xb6df, 0x213f, 0x949b, 0x9496, 0x000d, 0x949f, 0x2012, 0x200d, 0x4a5f, 0x4a52, /* Codes 21-30 */ + 0x95bf, 0xb5bb, 0x4936, 0x96db, 0x937b /* Codes 31-35 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -105,9 +107,10 @@ static const uint16_t g_nshLut[BITMAP_NLUTCODES] = static const uint8_t g_nshLut[BITMAP_NLUTCODES] = { - 0xdb, 0xfa, 0x59, 0x38, 0x43, 0xdf, 0x79, 0x8f, 0x34, 0xe5, 0xf4, 0x84, 0x2c, 0xff, 0xa4, 0x30, /* Codes 0-15 */ - 0x48, 0x99, 0x75, 0xaf, 0xcf, 0xd4, 0x3c, 0x9a, 0x96, 0x0c, 0x9e, 0x1b, 0x17, 0x5d, 0x51, 0xb3, /* Codes 16-31 */ - 0xba, 0x3f, 0xc5, 0x84 /* Codes 32-35 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfa, 0x59, 0x38, 0x43, 0xdf, 0x79, 0x8f, 0x34, 0xe5, 0xf4, 0x84, 0x2c, 0xff, /* Codes 1-13 */ + 0xa4, 0x30, 0x48, 0x99, 0x75, 0xaf, 0xcf, 0xd4, 0x3c, 0x9a, 0x96, 0x0c, 0x9e, /* Codes 14-16 */ + 0x1b, 0x17, 0x5d, 0x51, 0xb3, 0xba, 0x3f, 0xc5, 0x84 /* Codes 27-35 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ @@ -116,9 +119,10 @@ static const uint8_t g_nshLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_nshLut[BITMAP_NLUTCODES] = { - 0xdb, 0xff, 0x4b, 0x27, 0x47, 0xdb, 0x6f, 0x73, 0x26, 0xfb, 0xdf, 0x53, 0x25, 0xff, 0x77, 0x26, /* Codes 0-15 */ - 0x47, 0x57, 0x6e, 0x97, 0xbb, 0xbb, 0x27, 0x93, 0x92, 0x01, 0x93, 0x22, 0x21, 0x4b, 0x4a, 0x97, /* Codes 16-31 */ - 0xb7, 0x46, 0x9b, 0x8f /* Codes 32-35 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0x4b, 0x27, 0x47, 0xdb, 0x6f, 0x73, 0x26, 0xfb, 0xdf, 0x53, 0x25, 0xff, /* Codes 1-13 */ + 0x77, 0x26, 0x47, 0x57, 0x6e, 0x97, 0xbb, 0xbb, 0x27, 0x93, 0x92, 0x01, 0x93, /* Codes 14-16 */ + 0x22, 0x21, 0x4b, 0x4a, 0x97, 0xb7, 0x46, 0x9b, 0x8f /* Codes 27-35 */ }; # endif diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index 85457799d..e7937faea 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -47,9 +47,9 @@ #include #include -#include "nxconfig.hxx" #include "crlepalettebitmap.hxx" +#include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" /******************************************************************************************** @@ -72,11 +72,12 @@ using namespace NxWM; static const uint32_t g_startLut[BITMAP_NLUTCODES] = { - 0xdbdbdb, 0x6db66d, 0x006d00, 0x246d00, 0x6d9249, 0xdbffb6, 0xb6b692, 0x246d24, /* Codes 0-7 */ - 0x249224, 0x49b649, 0x6db649, 0x499249, 0xdbffdb, 0x92b692, 0xb6dbb6, 0x6ddb6d, /* Codes 8-15 */ - 0x92b66d, 0x6d926d, 0x92db92, 0x49926d, 0x49b624, 0x92db6d, 0xb6ffb6, 0xffffff, /* Codes 16-23 */ - 0x496d49, 0x92ff92, 0x24b624, 0x496d24, 0xb6db92, 0x499224, 0x249200, 0x92dbb6, /* Codes 24-31 */ - 0x004900, 0x009200 /* Codes 32-33 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x6db66d, 0x006d00, 0x246d00, 0x6d9249, 0xdbffb6, 0xb6b692, 0x246d24, 0x249224, /* Codes 1-8 */ + 0x49b649, 0x6db649, 0x499249, 0xdbffdb, 0x92b692, 0xb6dbb6, 0x6ddb6d, 0x92b66d, /* Codes 9-16 */ + 0x6d926d, 0x92db92, 0x49926d, 0x49b624, 0x92db6d, 0xb6ffb6, 0xffffff, 0x496d49, /* Codes 17-24 */ + 0x92ff92, 0x24b624, 0x496d24, 0xb6db92, 0x499224, 0x249200, 0x92dbb6, 0x004900, /* Codes 25-32 */ + 0x009200 /* Code 33 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -85,10 +86,11 @@ static const uint32_t g_startLut[BITMAP_NLUTCODES] = static const uint16_t g_startLut[BITMAP_NLUTCODES] = { - 0xdedb, 0x6dad, 0x0360, 0x2360, 0x6c89, 0xdff6, 0xb5b2, 0x2364, 0x2484, 0x4da9, /* Codes 0-9 */ - 0x6da9, 0x4c89, 0xdffb, 0x95b2, 0xb6d6, 0x6ecd, 0x95ad, 0x6c8d, 0x96d2, 0x4c8d, /* Codes 10-19 */ - 0x4da4, 0x96cd, 0xb7f6, 0xffff, 0x4b69, 0x97f2, 0x25a4, 0x4b64, 0xb6d2, 0x4c84, /* Codes 20-29 */ - 0x2480, 0x96d6, 0x0240, 0x0480 /* Codes 30-33 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x6dad, 0x0360, 0x2360, 0x6c89, 0xdff6, 0xb5b2, 0x2364, 0x2484, 0x4da9, 0x6da9, /* Codes 0-10 */ + 0x4c89, 0xdffb, 0x95b2, 0xb6d6, 0x6ecd, 0x95ad, 0x6c8d, 0x96d2, 0x4c8d, 0x4da4, /* Codes 11-20 */ + 0x96cd, 0xb7f6, 0xffff, 0x4b69, 0x97f2, 0x25a4, 0x4b64, 0xb6d2, 0x4c84, 0x2480, /* Codes 21-30 */ + 0x96d6, 0x0240, 0x0480 /* Codes 31-33 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -105,9 +107,10 @@ static const uint16_t g_startLut[BITMAP_NLUTCODES] = static const uint8_t g_startLut[BITMAP_NLUTCODES] = { - 0xdb, 0x97, 0x3f, 0x4a, 0x7e, 0xeb, 0xb1, 0x4e, 0x64, 0x88, 0x93, 0x73, 0xf0, 0xa7, 0xcb, 0xad, /* Codes 0-15 */ - 0xa2, 0x82, 0xbc, 0x77, 0x84, 0xb8, 0xe0, 0xff, 0x5e, 0xd1, 0x79, 0x59, 0xc7, 0x6f, 0x60, 0xc0, /* Codes 16-31 */ - 0x2a, 0x55 /* Codes 32-33 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x97, 0x3f, 0x4a, 0x7e, 0xeb, 0xb1, 0x4e, 0x64, 0x88, 0x93, 0x73, 0xf0, 0xa7, /* Codes 1-13 */ + 0xcb, 0xad, 0xa2, 0x82, 0xbc, 0x77, 0x84, 0xb8, 0xe0, 0xff, 0x5e, 0xd1, 0x79, /* Codes 14-26 */ + 0x59, 0xc7, 0x6f, 0x60, 0xc0, 0x2a, 0x55 /* Codes 27-33 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ @@ -116,9 +119,10 @@ static const uint8_t g_startLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_startLut[BITMAP_NLUTCODES] = { - 0xdb, 0x75, 0x0c, 0x2c, 0x71, 0xde, 0xb6, 0x2c, 0x30, 0x55, 0x75, 0x51, 0xdf, 0x96, 0xba, 0x79, /* Codes 0-15 */ - 0x95, 0x71, 0x9a, 0x51, 0x54, 0x99, 0xbe, 0xff, 0x4d, 0x9e, 0x34, 0x4c, 0xba, 0x50, 0x30, 0x9a, /* Codes 16-31 */ - 0x08, 0x10 /* Codes 32-33 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x75, 0x0c, 0x2c, 0x71, 0xde, 0xb6, 0x2c, 0x30, 0x55, 0x75, 0x51, 0xdf, 0x96, /* Codes 1-13 */ + 0xba, 0x79, 0x95, 0x71, 0x9a, 0x51, 0x54, 0x99, 0xbe, 0xff, 0x4d, 0x9e, 0x34, /* Codes 14-26 */ + 0x4c, 0xba, 0x50, 0x30, 0x9a, 0x08, 0x10 /* Codes 27-33 */ }; # endif diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index fdb08fa51..bd11d88e8 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -47,9 +47,9 @@ #include #include -#include "nxconfig.hxx" #include "crlepalettebitmap.hxx" +#include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" /******************************************************************************************** @@ -72,15 +72,16 @@ using namespace NxWM; static const uint32_t g_stopLut[BITMAP_NLUTCODES] = { - 0xffffff, 0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, /* Codes 0-7 */ - 0xb64949, 0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, /* Codes 8-15 */ - 0xff9292, 0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, /* Codes 16-23 */ - 0xff2424, 0xffffdb, 0xdbb692, 0xdb2424, 0xff4924, 0xffb6db, 0xffdbb6, 0xff6d49, /* Codes 24-31 */ - 0xffb692, 0xdb4924, 0xb64924, 0xdbdb92, 0xb69292, 0xb62424, 0xdb496d, 0xb6926d, /* Codes 32-39 */ - 0xdbffff, 0xdbffdb, 0xb6496d, 0xdb0024, 0xdb6d92, 0xff2400, 0xb66d49, 0xdb2400, /* Codes 40-47 */ - 0xb62400, 0x922424, 0xb60000, 0x922449, 0xff92b6, 0x920000, 0xdb0049, 0xb60024, /* Codes 48-55 */ - 0xdb0000, 0x922400, 0x924949, 0x924924, 0x920024, 0xff6d92, 0x6d4924, 0x6d2400, /* Codes 56-63 */ - 0x6d2424, 0x6d0000 /* Codes 64-65 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, 0xb64949, /* Codes 1-8 */ + 0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, 0xff9292, /* Codes 9-16 */ + 0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, 0xff2424, /* Codes 17-24 */ + 0xffffdb, 0xdbb692, 0xdb2424, 0xff4924, 0xffb6db, 0xffdbb6, 0xff6d49, 0xffb692, /* Codes 25-32 */ + 0xdb4924, 0xb64924, 0xdbdb92, 0xb69292, 0xb62424, 0xdb496d, 0xb6926d, 0xdbffff, /* Codes 33-40 */ + 0xdbffdb, 0xb6496d, 0xdb0024, 0xdb6d92, 0xff2400, 0xb66d49, 0xdb2400, 0xb62400, /* Codes 41-48 */ + 0x922424, 0xb60000, 0x922449, 0xff92b6, 0x920000, 0xdb0049, 0xb60024, 0xdb0000, /* Codes 49-56 */ + 0x922400, 0x924949, 0x924924, 0x920024, 0xff6d92, 0x6d4924, 0x6d2400, 0x6d2424, /* Codes 57-64 */ + 0x6d0000 /* Code 65 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -89,13 +90,14 @@ static const uint32_t g_stopLut[BITMAP_NLUTCODES] = static const uint16_t g_stopLut[BITMAP_NLUTCODES] = { - 0xffff, 0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, /* Codes 0-9 */ - 0xd92d, 0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, /* Codes 10-19 */ - 0xf92d, 0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, /* Codes 20-29 */ - 0xfed6, 0xfb69, 0xfdb2, 0xda44, 0xb244, 0xded2, 0xb492, 0xb124, 0xda4d, 0xb48d, /* Codes 30-39 */ - 0xdfff, 0xdffb, 0xb24d, 0xd804, 0xdb72, 0xf920, 0xb369, 0xd920, 0xb120, 0x9124, /* Codes 40-49 */ - 0xb000, 0x9129, 0xfc96, 0x9000, 0xd809, 0xb004, 0xd800, 0x9120, 0x9249, 0x9244, /* Codes 50-59 */ - 0x9004, 0xfb72, 0x6a44, 0x6920, 0x6924, 0x6800 /* Codes 60-65 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, 0xd92d, /* Codes 1-10 */ + 0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, 0xf92d, /* Codes 11-20 */ + 0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, 0xfed6, /* Codes 21-30 */ + 0xfb69, 0xfdb2, 0xda44, 0xb244, 0xded2, 0xb492, 0xb124, 0xda4d, 0xb48d, 0xdfff, /* Codes 31-40 */ + 0xdffb, 0xb24d, 0xd804, 0xdb72, 0xf920, 0xb369, 0xd920, 0xb120, 0x9124, 0xb000, /* Codes 41-50 */ + 0x9129, 0xfc96, 0x9000, 0xd809, 0xb004, 0xd800, 0x9120, 0x9249, 0x9244, 0x9004, /* Codes 51-60 */ + 0xfb72, 0x6a44, 0x6920, 0x6924, 0x6800 /* Codes 61-65 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -112,11 +114,13 @@ static const uint16_t g_stopLut[BITMAP_NLUTCODES] = static const uint8_t g_stopLut[BITMAP_NLUTCODES] = { - 0xff, 0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, 0xe9, 0xe5, /* Codes 0-15 */ - 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, 0x5a, 0x7b, 0xd0, 0xe1, 0x94, /* Codes 16-31 */ - 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, 0xf4, 0xf0, 0x6d, 0x45, 0x92, 0x61, 0x7e, 0x56, /* Codes 32-47 */ - 0x4b, 0x44, 0x36, 0x49, 0xb6, 0x2b, 0x49, 0x3a, 0x41, 0x40, 0x5e, 0x5a, 0x2f, 0x9c, 0x4f, 0x35, /* Codes 48-63 */ - 0x39, 0x20 /* Codes 64-65 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, /* Codes 1-13 */ + 0xe9, 0xe5, 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, /* Codes 14-26 */ + 0x5a, 0x7b, 0xd0, 0xe1, 0x94, 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, /* Codes 27-39 */ + 0xf4, 0xf0, 0x6d, 0x45, 0x92, 0x61, 0x7e, 0x56, 0x4b, 0x44, 0x36, 0x49, 0xb6, /* Codes 40-52 */ + 0x2b, 0x49, 0x3a, 0x41, 0x40, 0x5e, 0x5a, 0x2f, 0x9c, 0x4f, 0x35, 0x39, 0x20 /* Codes 53-65 */ + }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ @@ -125,11 +129,12 @@ static const uint8_t g_stopLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = { - 0xff, 0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, 0xfb, 0xfb, /* Codes 0-15 */ - 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, 0xc4, 0xe8, 0xf7, 0xfa, 0xed, /* Codes 16-31 */ - 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, 0xdf, 0xdf, 0xa9, 0xc0, 0xce, 0xe4, 0xad, 0xc4, /* Codes 32-47 */ - 0xa4, 0x84, 0xa0, 0x85, 0xf2, 0x80, 0xc1, 0xa0, 0xc0, 0x84, 0x89, 0x88, 0x80, 0xee, 0x68, 0x64, /* Codes 48-63 */ - 0x64, 0x60 /* Codes 64-65 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, /* Codes 1-13 */ + 0xfb, 0xfb, 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, /* Codes 14-26 */ + 0xc4, 0xe8, 0xf7, 0xfa, 0xed, 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, /* Codes 27-39 */ + 0xdf, 0xdf, 0xa9, 0xc0, 0xce, 0xe4, 0xad, 0xc4, 0xa4, 0x84, 0xa0, 0x85, 0xf2, /* Codes 40-52 */ + 0x80, 0xc1, 0xa0, 0xc0, 0x84, 0x89, 0x88, 0x80, 0xee, 0x68, 0x64, 0x64, 0x60 /* Codes 53-65 */ }; # endif From 0f2440d891f4fd01b55d5242034bedd60409343a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 14:38:54 +0000 Subject: [PATCH 022/390] NxWM initial displays come up okay git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4687 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 29 ++- libnxwidgets/include/cwidgetcontrol.hxx | 6 +- libnxwidgets/include/nxconfig.hxx | 228 ++++++++++++------------ libnxwidgets/src/cnxtkwindow.cxx | 19 +- libnxwidgets/src/cwidgetcontrol.cxx | 21 ++- nxwm/include/ctaskbar.hxx | 11 +- nxwm/include/nxwmconfig.hxx | 28 +-- nxwm/src/capplicationwindow.cxx | 2 +- nxwm/src/ctaskbar.cxx | 179 ++++++++++--------- 9 files changed, 276 insertions(+), 247 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index d0050b2bd..8da6839a6 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -162,9 +162,18 @@ int MAIN_NAME(int argc, char *argv[]) return EXIT_FAILURE; } + printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + delete window; + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + printf(MAIN_STRING "Creating the start window application\n"); g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); - if (!g_nxwmtest.taskbar) + if (!g_nxwmtest.startwindow) { printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); delete window; @@ -195,6 +204,15 @@ int MAIN_NAME(int argc, char *argv[]) goto noconsole; } + printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + delete window; + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + printf(MAIN_STRING "Creating the NxConsole application\n"); console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); if (!console) @@ -226,6 +244,15 @@ noconsole: goto nocalculator; } + printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + delete window; + delete g_nxwmtest.taskbar; + return EXIT_FAILURE; + } + printf(MAIN_STRING "Creating the calculator application\n"); calculator = new NxWM::CCalculator(g_nxwmtest.taskbar, window); if (!calculator) diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 0a894eae8..7725dec2c 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -166,7 +166,7 @@ namespace NXWidgets TNxArray m_widgets; /**< List of controlled widgets. */ bool m_modal; /**< True: in modal loop */ - sem_t m_modalsem; /**< Modal loops waits for + sem_t m_modalSem; /**< Modal loops waits for events on this semaphore */ /** * I/O @@ -194,7 +194,7 @@ namespace NXWidgets struct nxgl_point_s m_pos; /**< Position in display space */ struct nxgl_rect_s m_bounds; /**< Size of the display */ #ifdef CONFIG_NX_MULTIUSER - sem_t m_geosem; /**< Posted when geometry is valid */ + sem_t m_geoSem; /**< Posted when geometry is valid */ #endif /** @@ -299,7 +299,7 @@ namespace NXWidgets inline void giveGeoSem(void) { #ifdef CONFIG_NX_MULTIUSER - sem_post(&m_geosem); + sem_post(&m_geoSem); #endif } diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 1c7b6a3f0..5d3752fd0 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -53,115 +53,14 @@ ****************************************************************************/ /* NX Configuration *********************************************************/ /** - * C++ support is required - */ - -#ifndef CONFIG_HAVE_CXX -# error "C++ support is required (CONFIG_HAVE_CXX)" -#endif - -/** - * Required to enabled NX graphics support - */ - -#ifndef CONFIG_NX -# error "NX graphics support is required (CONFIG_NX)" -#endif - -/** - * Required to enabled NX mouse/touchscreen support - */ - -#ifndef CONFIG_NX_MOUSE -# warning "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" -#endif - -/** - * Required to enabled NX keyboard support - */ - -#ifndef CONFIG_NX_KBD -# warning "NX keyboard support is required (CONFIG_NX_KBD)" -#endif - -/** - * Only a single video plane is supported - */ - -#ifndef CONFIG_NX_NPLANES -# define CONFIG_NX_NPLANES 1 -#endif - -#if CONFIG_NX_NPLANES != 1 -# error "Only a single color plane is supported (CONFIG_NX_NPLANES)" -#endif - -/* NX Server/Device Configuration *******************************************/ - -/** - * LCD device number (in case there are more than one LCDs connected) - */ - -#ifndef CONFIG_NXWIDGETS_DEVNO -# define CONFIG_NXWIDGETS_DEVNO 0 -#endif - -/** - * Only a single video plane is supported - */ - -#ifndef CONFIG_NXWIDGETS_VPLANE -# define CONFIG_NXWIDGETS_VPLANE 0 -#endif - -/** - * Priority of the NX server (in multi-user mode) - */ - -#ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1) -#endif - -#ifndef CONFIG_NXWIDGETS_CLIENTPRIO -# define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT -#endif - -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" -# warning" -- This can result in data overrun errors" -#endif - -/** - * NX server thread stack size (in multi-user mode) - */ - -#ifndef CONFIG_NXWIDGETS_SERVERSTACK -# define CONFIG_NXWIDGETS_SERVERSTACK 2048 -#endif - -/** - * Priority of the NX event listener thread (in multi-user mode) - */ - -#ifndef CONFIG_NXWIDGETS_LISTENERPRIO -# define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT -#endif - -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" -# warning" -- This can result in data overrun errors" -#endif - -/** - * NX listener thread stack size (in multi-user mode) - */ - -#ifndef CONFIG_NXWIDGETS_LISTENERSTACK -# define CONFIG_NXWIDGETS_LISTENERSTACK 2048 -#endif - -/* NXWidget Configuration ***************************************************/ -/** + * Prerequisites: + * + * CONFIG_HAVE_CXX=y : C++ support is required + * CONFIG_NX=y : NX graphics support must be enabled + * CONFIG_NX_MOUSE=y : Required to enable NX mouse/touchscreen support + * CONFIG_NX_KBD=y : Required to enabled NX keyboard support + * CONFIG_NX_NPLANES=1 : Only a single video plane is supported + * * NX Server/Device Configuration * * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than @@ -236,6 +135,115 @@ * entered by NX polling cycles without losing data. Default: 4 */ +/* Prerequisites ************************************************************/ +/** + * C++ support is required + */ + +#ifndef CONFIG_HAVE_CXX +# error "C++ support is required (CONFIG_HAVE_CXX)" +#endif + +/** + * NX graphics support must be enabled + */ + +#ifndef CONFIG_NX +# error "NX graphics support is required (CONFIG_NX)" +#endif + +/** + * Required to enable NX mouse/touchscreen support + */ + +#ifndef CONFIG_NX_MOUSE +# warning "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" +#endif + +/** + * Required to enabled NX keyboard support + */ + +#ifndef CONFIG_NX_KBD +# warning "NX keyboard support is required (CONFIG_NX_KBD)" +#endif + +/** + * Only a single video plane is supported + */ + +#ifndef CONFIG_NX_NPLANES +# define CONFIG_NX_NPLANES 1 +#endif + +#if CONFIG_NX_NPLANES != 1 +# error "Only a single color plane is supported (CONFIG_NX_NPLANES)" +#endif + +/* NX Server/Device Configuration *******************************************/ +/** + * LCD device number (in case there are more than one LCDs connected) + */ + +#ifndef CONFIG_NXWIDGETS_DEVNO +# define CONFIG_NXWIDGETS_DEVNO 0 +#endif + +/** + * Only a single video plane is supported + */ + +#ifndef CONFIG_NXWIDGETS_VPLANE +# define CONFIG_NXWIDGETS_VPLANE 0 +#endif + +/** + * Priority of the NX server (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_SERVERPRIO +# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1) +#endif + +#ifndef CONFIG_NXWIDGETS_CLIENTPRIO +# define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT +#endif + +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" +# warning" -- This can result in data overrun errors" +#endif + +/** + * NX server thread stack size (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_SERVERSTACK +# define CONFIG_NXWIDGETS_SERVERSTACK 2048 +#endif + +/** + * Priority of the NX event listener thread (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_LISTENERPRIO +# define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT +#endif + +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" +# warning" -- This can result in data overrun errors" +#endif + +/** + * NX listener thread stack size (in multi-user mode) + */ + +#ifndef CONFIG_NXWIDGETS_LISTENERSTACK +# define CONFIG_NXWIDGETS_LISTENERSTACK 2048 +#endif + +/* NXWidget Configuration ***************************************************/ /** * Bits per pixel */ @@ -317,7 +325,6 @@ #endif /* NXWidget Default Values **************************************************/ - /** * Default font ID */ @@ -409,7 +416,6 @@ #endif /* Keypad behavior **********************************************************/ - /** * Time taken before a key starts repeating (in milliseconds). */ diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index ba62ee435..bae9cb815 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -133,23 +133,12 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) { if (m_hNxTkWindow && !m_toolbar) { - // Get current window style from the widget control - - CWidgetStyle style; - m_widgetControl->getWidgetStyle(&style); - - // Create a new controlling widget for the window - - CWidgetControl *widgetControl = new CWidgetControl(&style); - - // And create the toolcar + // Create the toolbar. Note that we use the SAME underlying + // widget control. That is because the tool bar really resides + // in the same "physical" window. m_toolbar = new CNxToolbar(this, m_hNxTkWindow, - widgetControl, height); - if (!m_toolbar) - { - delete widgetControl; - } + m_widgetControl, height); } return m_toolbar; } diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index a6807dad5..1e1c9ce87 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -104,10 +104,17 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) m_nCh = 0; m_nCc = 0; - // Enable the semaphore that will wake up the modal loop on mouse or - // keypress events + // Intialize semaphores: + // + // m_modalSem. The semaphore that will wake up the modal loop on mouse or + // keypress events + // m_geoSem. The semaphore that will synchronize window size and position + // informatin. - sem_init(&m_modalsem, 0, 0); + sem_init(&m_modalSem, 0, 0); +#ifdef CONFIG_NX_MULTIUSER + sem_init(&m_geoSem, 0, 0); +#endif // Do we need to fetch the default style? @@ -197,7 +204,7 @@ void CWidgetControl::waitForModalEvent(void) { // Wait for an interesting event (like a mouse or keyboard event) - (void)sem_wait(&m_modalsem); + (void)sem_wait(&m_modalSem); } } @@ -209,7 +216,7 @@ void CWidgetControl::wakeupModalLoop(void) { if (m_modal) { - (void)sem_post(&m_modalsem); + (void)sem_post(&m_modalSem); } } @@ -227,7 +234,7 @@ void CWidgetControl::stopModal(void) // Wake up the modal loop so that it can terminate properly - (void)sem_post(&m_modalsem); + (void)sem_post(&m_modalSem); } } @@ -885,7 +892,7 @@ void CWidgetControl::takeGeoSem(void) int ret; do { - ret = sem_wait(&m_geosem); + ret = sem_wait(&m_geoSem); } while (ret < 0 && errno == EINTR); } diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index f5bef2054..994b918ae 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -165,6 +165,14 @@ namespace NxWM bool redrawTaskbarWindow(void); + /** + * Redraw the window at the top of the heirarchy. + * + * @return true on success + */ + + bool redrawTopWindow(void); + /** * (Re-)draw the background window. * @@ -177,10 +185,11 @@ namespace NxWM * Redraw the last application in the list of application maintained by * the task bar. * + * @param app. The new top application to draw * @return true on success */ - bool redrawApplicationWindow(void); + bool redrawApplicationWindow(IApplication *app); /** * Handle a mouse button click event. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index cfdd7510e..59ae1e79d 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -100,13 +100,9 @@ * Color configuration * * CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default: - * MKRGB(160,160,160) + * MKRGB(148,189,215) * 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) + * Default: MKRGB(206,227,241) * 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. @@ -122,7 +118,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160) +# define CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR MKRGB(148,189,215) #endif /** @@ -130,23 +126,7 @@ */ #ifndef CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192) -#endif - -/** - * Default foreground color - */ - -#ifndef CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR MKRGB(192,192,192) -#endif - -/** - * Default selected foreground color - */ - -#ifndef CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR -# define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248) +# define CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(206,227,241) #endif /** diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 8fd578c1a..c11f40090 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -168,7 +168,7 @@ bool CApplicationWindow::open(void) // Get the CWidgetControl associated with this window NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); - if (control) + if (!control) { return false; } diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 1dba90c5a..7630a29b5 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -232,9 +232,9 @@ bool CTaskbar::startWindowManager(void) return false; } - // Draw the application window + // Draw the top application window - return redrawApplicationWindow(); + return redrawTopWindow(); } /** @@ -368,27 +368,9 @@ bool CTaskbar::topApplication(IApplication *app) if (!app->isMinimized()) { - // Every application provides a method to obtain its application window + // It is not... Make the application the top application and redraw it - CApplicationWindow *appWindow = app->getWindow(); - - // Each application window provides a method to get the underlying NX window - - NXWidgets::CNxTkWindow *window = appWindow->getWindow(); - - // Mark the window as the top application - - m_topapp = app; - app->setTopApplication(true); - - // Raise the window to the top of the hierarchy - - window->raise(); - - // And re-draw it - - app->redraw(); - return true; + return redrawApplicationWindow(app); } return false; @@ -441,7 +423,7 @@ bool CTaskbar::minimizeApplication(IApplication *app) app->setMinimized(true); // And it certainly is no longer the top application. If it was before - // then redrawApplicationWindow() will pick a new one (rather arbitrarily). + // then redrawTopWindow() will pick a new one (rather arbitrarily). if (app->isTopApplication()) { @@ -453,9 +435,9 @@ bool CTaskbar::minimizeApplication(IApplication *app) window->lower(); - // And re-draw the next non-minimized application + // And re-draw the new top, non-minimized application - return redrawApplicationWindow(); + return redrawTopWindow(); } return false; @@ -708,10 +690,6 @@ bool CTaskbar::createTaskbarWindow(void) m_taskbar->setPosition(&pos); m_taskbar->setSize(&size); - - /* And raise the window to the top of the display */ - - m_taskbar->raise(); return true; } @@ -734,10 +712,6 @@ bool CTaskbar::createBackgroundWindow(void) // Set the geometry to fit in the application window space setApplicationGeometry(static_cast(m_background)); - - /* The background window starts at the top display */ - - m_background->raise(); return true; } @@ -932,49 +906,12 @@ bool CTaskbar::redrawTaskbarWindow(void) } /** - * (Re-)draw the background window. + * Redraw the window at the top of the heirarchy. * * @return true on success */ -bool CTaskbar::redrawBackgroundWindow(void) -{ - // Get the widget control from the background window - - NXWidgets::CWidgetControl *control = m_background->getWidgetControl(); - - // Get the graphics port for drawing on the background window - - NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); - - // Get the size of the window - - struct nxgl_size_s windowSize; - if (!m_background->getSize(&windowSize)) - { - return false; - } - - // Fill the entire window with the background color - - port->drawFilledRect(0, 0, windowSize.w, windowSize.h, - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); - - // Then re-draw the background image on the window - - m_backImage->enableDrawing(); - m_backImage->redraw(); - return true; -} - -/** - * Redraw the last application in the list of application maintained by - * the task bar. - * - * @return true on success - */ - -bool CTaskbar::redrawApplicationWindow(void) +bool CTaskbar::redrawTopWindow(void) { // Check if there is already a top application @@ -998,29 +935,103 @@ bool CTaskbar::redrawApplicationWindow(void) if (app) { - // Yes.. Then this is the new top application + // Yes.. make it the top application window and redraw it - m_topapp = app; - app->setTopApplication(true); - - // Disable drawing of the background image. - - m_backImage->disableDrawing(); - - // And.. Draw the application - - app->redraw(); + return redrawApplicationWindow(app); return true; } else { - // Otherwise, re-draw the background image + // Otherwise, there is no top application. Re-draw the background image. m_topapp = (IApplication *)0; return redrawBackgroundWindow(); } } +/** + * (Re-)draw the background window. + * + * @return true on success + */ + +bool CTaskbar::redrawBackgroundWindow(void) +{ + // Get the widget control from the background window + + NXWidgets::CWidgetControl *control = m_background->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_background->getSize(&windowSize)) + { + return false; + } + + // Raise the background window to the top of the display + + m_background->raise(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Add a border to the task bar to delineate it from the task bar + + port->drawBevelledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR, + CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR); + + // Then re-draw the background image on the window + + m_backImage->enableDrawing(); + m_backImage->redraw(); + return true; +} + +/** + * Redraw the last application in the list of application maintained by + * the task bar. + * + * @param app. The new top application to draw + * @return true on success + */ + +bool CTaskbar::redrawApplicationWindow(IApplication *app) +{ + // Every application provides a method to obtain its application window + + CApplicationWindow *appWindow = app->getWindow(); + + // Each application window provides a method to get the underlying NX window + + NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + + // Mark the window as the top application + + m_topapp = app; + app->setTopApplication(true); + + // Disable drawing of the background image. + + m_backImage->disableDrawing(); + + // Raise the window to the top of the hierarchy + + window->raise(); + + // And re-draw it + + app->redraw(); + return true; +} + /** * Handle a mouse button click event. * From af51ac3fb351af054cd9b8d7956ffcc630e914b7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 15:36:19 +0000 Subject: [PATCH 023/390] Fix some warnings and fix some simulator builds git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4688 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index b19ed4462..f501f30f6 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -35,7 +35,7 @@ Installing and Building the Unit Tests for the STM3210E-EVAL available. However, the unit test can be run on other configurations (see steps d and e below). - NOTE: The special configuratin sim/nxwm is recommended for unit-leveling + NOTE: Another special configuration, sim/nxwm, is recommended for unit-leveling testing of NxWM because the configuration is more complex in that case. We will assume the sim/nsh2 configuration in this discussion. The From 25ffe5946c255a06c507c5a0b48f085c0702dee9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 22:03:05 +0000 Subject: [PATCH 024/390] NxWM updates (with some NX and NxWidget fixes too) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4689 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 + UnitTests/nxwm/main.cxx | 18 +++- libnxwidgets/include/cnxtkwindow.hxx | 5 +- libnxwidgets/include/cnxwidget.hxx | 35 +++++++ libnxwidgets/src/cnxtkwindow.cxx | 43 +++++++-- libnxwidgets/src/cnxtoolbar.cxx | 6 ++ nxwm/include/capplicationwindow.hxx | 39 +++++++- nxwm/include/cstartwindow.hxx | 18 +++- nxwm/include/ctaskbar.hxx | 29 +++++- nxwm/src/capplicationwindow.cxx | 69 ++++++++++++++ nxwm/src/cnxconsole.cxx | 5 + nxwm/src/cstartwindow.cxx | 5 + nxwm/src/ctaskbar.cxx | 132 +++++++++++++++++---------- 13 files changed, 340 insertions(+), 67 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d9dfda7b2..452ba1deb 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,3 +13,6 @@ * CImage: Add logic to hightlight an CImage (using the selected LUT). * nxwm: The tiny NX window manager (NxWM) is being developed in this directory. * UnitTests/nxwm: A unit test for the NX window manager. +* During integration of NxWM, corrected numerous problems with NxWidgets + running on toolbars and framed windows. That capability was commented + out in the 1.0 release but is verfied functional in 1.1. \ No newline at end of file diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 8da6839a6..068452cff 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -42,6 +42,7 @@ #include #include +#include #include "ctaskbar.hxx" #include "cstartwindow.hxx" @@ -154,7 +155,7 @@ int MAIN_NAME(int argc, char *argv[]) // window application. printf(MAIN_STRING "Opening the start window application window\n"); - NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); if (!window) { printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); @@ -308,6 +309,21 @@ nocalculator: return EXIT_FAILURE; } + // Wait a little bit for the display to stabilize. The simulation pressing of + // the 'start window' icon in the task bar + + sleep(2); + g_nxwmtest.taskbar->clickIcon(0); + + // Wait bit to see the result of the button press. The press the first icon + // in the start menu. That should be the NxConsole icon. + + sleep(2); + g_nxwmtest.startwindow->clickIcon(0); + + // Wait bit to see the result of the button press. + + sleep(2); return EXIT_SUCCESS; } diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index b6915a6c1..32d634182 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -139,8 +139,9 @@ namespace NXWidgets CWidgetControl *getWidgetControl(void) const; /** - * Open a toolbar on the framed window. Toolbar creation is separate - * from object instantion so that errors can be reported + * Open a toolbar on the framed window. This method both instantiates + * the toolbar object AND calls the INxWindow::open() method to + * create the toolbar. The toolbar is ready for use upon return. * * @return True if the toolbar was successfully created. */ diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index eb1b18710..f46c2e73a 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -695,6 +695,41 @@ namespace NXWidgets return m_rect.getHeight(); } + /** + * Get the size of the widget + * + * @return The widgets's size + */ + + inline void getSize(struct nxgl_size_s &size) const + { + size.h = m_rect.getHeight(); + size.w = m_rect.getWidth(); + } + + /** + * Get the position of the widget + * + * @return The widgets's position + */ + + inline void getPos(struct nxgl_point_s &pos) const + { + pos.x = m_rect.getX(); + pos.y = m_rect.getY(); + } + + /** + * Get the window bounding box in physical display coordinated. + * + * @return This function returns the window handle. + */ + + inline CRect getBoundingBox(void) + { + return CRect(m_rect); + } + /** * Get the dimensions of the border * diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index bae9cb815..520896fa2 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -124,7 +124,9 @@ CWidgetControl *CNxTkWindow::getWidgetControl(void) const } /** - * Open a toolbar on the framed window + * Open a toolbar on the framed window. This method both instantiates + * the toolbar object AND calls the INxWindow::open() method to + * create the toolbar. The toolbar is ready for use upon return. * * @param height Height of the toolbar */ @@ -133,13 +135,42 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) { if (m_hNxTkWindow && !m_toolbar) { - // Create the toolbar. Note that we use the SAME underlying - // widget control. That is because the tool bar really resides - // in the same "physical" window. - + // Get current window style from the widget control + + CWidgetStyle style; + m_widgetControl->getWidgetStyle(&style); + + // Set the background color to the color of the toolbar + + style.colors.background = CONFIG_NXTK_BORDERCOLOR1; + + // Create a new controlling widget for the window + + CWidgetControl *widgetControl = new CWidgetControl(&style); + + // And create the toolbar + m_toolbar = new CNxToolbar(this, m_hNxTkWindow, - m_widgetControl, height); + widgetControl, height); + if (!m_toolbar) + { + delete widgetControl; + return (CNxToolbar *)0; + } + + // Create the new toolbar. Toolbar creation is separate from + // object instantiation so that failures can be reported. + + if (!m_toolbar->open()) + { + // Failed to create the toolbar. Clean-up and return NULL + + delete m_toolbar; + delete widgetControl; + return (CNxToolbar *)0; + } } + return m_toolbar; } diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 1c560deb1..b14a0b611 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -69,10 +69,16 @@ CNxToolbar::CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, CWidgetControl *pWidgetControl, nxgl_coord_t height) : CCallback(pWidgetControl) { + // Initialize toolbar state data + m_nxTkWindow = pNxTkWindow; m_hNxTkWindow = hNxTkWindow; m_widgetControl = pWidgetControl; m_height = height; + + // Create the CGraphicsPort instance for this window + + m_widgetControl->createGraphicsPort(static_cast(this)); } /** diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index adeac30dc..167f51997 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -135,6 +135,19 @@ namespace NxWM bool open(void); + /** + * Re-draw the application window + */ + + void redraw(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + + void hide(void); + /** * Recover the contained NXTK window instance * @@ -173,7 +186,17 @@ namespace NxWM inline void clickMinimizeIcon(int index) { - m_minimizeImage->click(0,0); + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_minimizeImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_minimizeImage->getPos(imagePos); + + // And click the image at its center + + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } /** @@ -183,9 +206,19 @@ namespace NxWM inline void clickStopIcon(int index) { - m_stopImage->click(0,0); + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_stopImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_stopImage->getPos(imagePos); + + // And click the image at its center + + m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } - }; + }; } #endif // __cplusplus diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 86245c427..5eeb51781 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -174,7 +174,7 @@ namespace NxWM /** * The application window is hidden (either it is minimized or it is - * maximized, but not at the top of the hierarchy + * maximized, but not at the top of the hierarchy) */ void hide(void); @@ -213,7 +213,21 @@ namespace NxWM { if (index < m_slots.size()) { - m_slots.at(index).image->click(0,0); + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click the image at its center + + image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } }; diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 994b918ae..7a6812901 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -97,7 +97,7 @@ namespace NxWM NXWidgets::CNxWindow *m_taskbar; /**< The task bar window */ NXWidgets::CNxWindow *m_background; /**< The background window */ NXWidgets::CImage *m_backImage; /**< The background image */ - IApplication *m_topapp; /**< The top application in the hierarchy */ + IApplication *m_topApp; /**< The top application in the hierarchy */ TNxArray m_slots; /**< List of application slots in the task bar */ /** @@ -191,6 +191,15 @@ namespace NxWM bool redrawApplicationWindow(IApplication *app); + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + * + * @param app. The application to hide + */ + + void hideApplicationWindow(IApplication *app); + /** * Handle a mouse button click event. * @@ -353,14 +362,28 @@ namespace NxWM /** * Simulate a mouse click on the icon at index. This inline method is only - * used duringautomated testing of NxWM. + * used during automated testing of NxWM. */ inline void clickIcon(int index) { if (index < m_slots.size()) { - m_slots.at(index).image->click(0,0); + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click the image at its center + + image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } }; diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index c11f40090..8395c93ab 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -41,6 +41,10 @@ #include +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "cgraphicsport.hxx" + #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" #include "capplicationwindow.hxx" @@ -224,6 +228,7 @@ bool CApplicationWindow::open(void) // Configure 'this' to receive mouse click inputs from the image + m_stopImage->setBorderless(true); m_stopImage->addWidgetEventHandler(this); // Create MINIMIZE application bitmap container @@ -272,6 +277,7 @@ bool CApplicationWindow::open(void) // Configure 'this' to receive mouse click inputs from the image + m_minimizeImage->setBorderless(true); m_minimizeImage->addWidgetEventHandler(this); // The rest of the toolbar will hold the left-justified application label @@ -311,6 +317,69 @@ bool CApplicationWindow::open(void) return true; } +/** + * Re-draw the application window + */ + +void CApplicationWindow::redraw(void) +{ + // Get the widget control from the task bar + + NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_toolbar->getSize(&windowSize)) + { + return; + } + + // Fill the entire tool bar with the non-shadowed border color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXTK_BORDERCOLOR1); + + // Then draw the images + + m_stopImage->enableDrawing(); + m_stopImage->redraw(); + m_stopImage->setRaisesEvents(true); + + m_minimizeImage->enableDrawing(); + m_minimizeImage->redraw(); + m_minimizeImage->setRaisesEvents(true); + + // And draw the window label + + m_windowLabel->enableDrawing(); + m_windowLabel->redraw(); +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + +void CApplicationWindow::hide(void) +{ + // Disable the images + + m_stopImage->disableDrawing(); + m_stopImage->setRaisesEvents(false); + + m_minimizeImage->disableDrawing(); + m_minimizeImage->setRaisesEvents(false); + + // Disable the window label + + m_windowLabel->disableDrawing(); +} + /** * Handle a mouse button click event. * diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 3652364c7..3cf5e13b9 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -120,6 +120,11 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) m_pid = -1; m_nxcon = 0; + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index c7a3b27f8..3190f50d9 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -70,6 +70,11 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) m_taskbar = taskbar; m_window = window; + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 7630a29b5..1d754c0d5 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -70,7 +70,7 @@ CTaskbar::CTaskbar(void) m_taskbar = (NXWidgets::CNxWindow *)0; m_background = (NXWidgets::CNxWindow *)0; m_backImage = (NXWidgets::CImage *)0; - m_topapp = (IApplication *)0; + m_topApp = (IApplication *)0; } /** @@ -279,7 +279,7 @@ CApplicationWindow *CTaskbar::openApplicationWindow(void) /** * Start an application and add its icon to the taskbar. The applications's - * window is brought to the top. Creating a new applicatino in the start + * window is brought to the top. Creating a new application in the start * window requires three steps: * * 1. Create the CTaskbar instance, @@ -334,14 +334,9 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) slot.image = image; m_slots.push_back(slot); - // Mark the application as minimized (or not) + // Assume for now that this is not the top application - app->setMinimized(minimized); - - // Assume for now that this is not the top application (we will - // know when drawApplicationWindow() runs. - - app->setTopApplication(false); + hideApplicationWindow(app); // Then start the application (whatever that means) @@ -366,9 +361,19 @@ bool CTaskbar::topApplication(IApplication *app) { // Verify that the application is not minimized - if (!app->isMinimized()) + if (!app->isMinimized() && !app->isTopApplication()) { - // It is not... Make the application the top application and redraw it + // It is not minimized. We are going to bring it to the top of the display. + // Is there already a top application? + + if (m_topApp) + { + // Yes.. then disable it + + hideApplicationWindow(m_topApp); + } + + // Make the application the top application and redraw it return redrawApplicationWindow(app); } @@ -410,32 +415,12 @@ bool CTaskbar::minimizeApplication(IApplication *app) if (!app->isMinimized()) { - // Every application provides a method to obtain its application window + // No, then we are going to minimize it but disabling its components, + // marking it as minized, then raising a new window to the top window. - CApplicationWindow *appWindow = app->getWindow(); + hideApplicationWindow(app); - // Each application window provides a method to get the underlying NX window - - NXWidgets::CNxTkWindow *window = appWindow->getWindow(); - - // Mark the window as minimized - - app->setMinimized(true); - - // And it certainly is no longer the top application. If it was before - // then redrawTopWindow() will pick a new one (rather arbitrarily). - - if (app->isTopApplication()) - { - m_topapp = (IApplication *)0; - app->setTopApplication(false); - } - - // Lower the window to the bottom of the hierarchy - - window->lower(); - - // And re-draw the new top, non-minimized application + // Re-draw the new top, non-minimized application return redrawTopWindow(); } @@ -882,7 +867,8 @@ bool CTaskbar::redrawTaskbarWindow(void) // Do we add icons left-to-right? Or top-to-bottom? - bool moveTo(nxgl_coord_t x, nxgl_coord_t y); + bool moveTo(nxgl_coord_t x, nxgl_coord_t y); + #if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) // left-to-right ... increment the X display position @@ -915,7 +901,7 @@ bool CTaskbar::redrawTopWindow(void) { // Check if there is already a top application - IApplication *app = m_topapp; + IApplication *app = m_topApp; if (!app) { // No.. Search for that last, non-minimized application @@ -944,7 +930,7 @@ bool CTaskbar::redrawTopWindow(void) { // Otherwise, there is no top application. Re-draw the background image. - m_topapp = (IApplication *)0; + m_topApp = (IApplication *)0; return redrawBackgroundWindow(); } } @@ -973,7 +959,7 @@ bool CTaskbar::redrawBackgroundWindow(void) return false; } - // Raise the background window to the top of the display + // Raise the background window to the top of the hierarchy m_background->raise(); @@ -1005,6 +991,15 @@ bool CTaskbar::redrawBackgroundWindow(void) bool CTaskbar::redrawApplicationWindow(IApplication *app) { + // Mark the window as the top application + + m_topApp = app; + app->setTopApplication(true); + + // Disable drawing of the background image. + + m_backImage->disableDrawing(); + // Every application provides a method to obtain its application window CApplicationWindow *appWindow = app->getWindow(); @@ -1013,25 +1008,62 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) NXWidgets::CNxTkWindow *window = appWindow->getWindow(); - // Mark the window as the top application - - m_topapp = app; - app->setTopApplication(true); - - // Disable drawing of the background image. - - m_backImage->disableDrawing(); - - // Raise the window to the top of the hierarchy + // Raise the application window to the top of the hierarchy window->raise(); - // And re-draw it + // Re-draw the application window toolbar + + appWindow->redraw(); + + // And re-draw the application window itself app->redraw(); return true; } +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + * + * @param app. The application to hide + */ + +void CTaskbar::hideApplicationWindow(IApplication *app) +{ + // The hidden window is certainly not the top application any longer + // If it was before then redrawTopWindow() will pick a new one (rather + // arbitrarily). + + if (app->isTopApplication()) + { + m_topApp = (IApplication *)0; + app->setTopApplication(false); + } + + // Make sure that the application is marked as minimized. + + app->setMinimized(true); + + // We do not need to lower the application to the back.. the new top + // window will be raised instead. + // + // So all that we really have to do is to make sure that all of the + // components of the hidden window are inactive. + + // Every application provides a method to obtain its application window + + CApplicationWindow *appWindow = app->getWindow(); + + // Hide the application window toolbar + + appWindow->hide(); + + // The hide the application window itself + + app->hide(); +} + /** * Handle a mouse button click event. * From 953e8908375608a032f69fe9aeec5032de58a807 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 3 May 2012 13:29:07 +0000 Subject: [PATCH 025/390] Minor task bar fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4691 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/include/ctaskbar.hxx | 1 + nxwm/src/ctaskbar.cxx | 62 +++++++++++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 7a6812901..c290cb8ae 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -99,6 +99,7 @@ namespace NxWM NXWidgets::CImage *m_backImage; /**< The background image */ IApplication *m_topApp; /**< The top application in the hierarchy */ TNxArray m_slots; /**< List of application slots in the task bar */ + bool m_started; /**< True if window manager has been started */ /** * Create a raw window. diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 1d754c0d5..2ba0c4b08 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -71,6 +71,7 @@ CTaskbar::CTaskbar(void) m_background = (NXWidgets::CNxWindow *)0; m_backImage = (NXWidgets::CImage *)0; m_topApp = (IApplication *)0; + m_started = false; } /** @@ -225,16 +226,27 @@ bool CTaskbar::initWindowManager(void) bool CTaskbar::startWindowManager(void) { - // Draw the taskbar + // Have we already been started - if (!redrawTaskbarWindow()) + if (!m_started) { - return false; + // We are now started + + m_started = true; + + // Draw the taskbar + + if (!redrawTaskbarWindow()) + { + return false; + } + + // Draw the top application window + + return redrawTopWindow(); } - // Draw the top application window - - return redrawTopWindow(); + return false; } /** @@ -334,18 +346,40 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) slot.image = image; m_slots.push_back(slot); - // Assume for now that this is not the top application - - hideApplicationWindow(app); - - // Then start the application (whatever that means) + // Start the application (whatever that means). if (!app->run()) { stopApplication(app); + image->disable(); return false; } + // Has the window manager been started? Or were we ask to start + // the application minimized? + + if (minimized || !m_started) + { + // Bring the application up in the minimized state + + hideApplicationWindow(app); + } + else + { + // Bring up the application as the new top application + + app->setTopApplication(false); + app->setMinimized(false); + topApplication(app); + } + + // Redraw the task bar with the new icon (if we have been started) + + if (m_started) + { + redrawTaskbarWindow(); + } + return true; } @@ -359,7 +393,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) bool CTaskbar::topApplication(IApplication *app) { - // Verify that the application is not minimized + // Verify that the application is not minimized and is not already the top application if (!app->isMinimized() && !app->isTopApplication()) { @@ -396,7 +430,7 @@ bool CTaskbar::maximizeApplication(IApplication *app) app->setMinimized(false); - // Then bring the appliation to the top of the hieararchy + // Then bring the application to the top of the hierarchy return topApplication(app); } @@ -867,8 +901,6 @@ bool CTaskbar::redrawTaskbarWindow(void) // Do we add icons left-to-right? Or top-to-bottom? - bool moveTo(nxgl_coord_t x, nxgl_coord_t y); - #if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) // left-to-right ... increment the X display position From 48e54a14ae2a4abf2b3415a07644e9a60a3658e4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 3 May 2012 19:46:37 +0000 Subject: [PATCH 026/390] Upated NxWM comments git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4692 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 150 +++++++++++++++++++++++++++- nxwm/include/capplicationwindow.hxx | 4 + nxwm/include/cstartwindow.hxx | 2 + nxwm/include/ctaskbar.hxx | 2 + nxwm/include/nxwmconfig.hxx | 19 ++++ nxwm/src/cnxconsole.cxx | 6 +- nxwm/src/cstartwindow.cxx | 2 - nxwm/src/ctaskbar.cxx | 2 +- 8 files changed, 181 insertions(+), 6 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 068452cff..c202e6443 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -62,6 +62,15 @@ # define MAIN_STRING "user_start: " #endif +#ifdef CONFIG_HAVE_FILENAME +# define showTestStepMemory(msg) \ + _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# define showTestCaseMemory(msg) \ + _showTestCaseMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# define showTestMemory(msg) \ + _showTestMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +#endif + ///////////////////////////////////////////////////////////////////////////// // Private Types ///////////////////////////////////////////////////////////////////////////// @@ -70,6 +79,9 @@ struct SNxWmTest { NxWM::CTaskbar *taskbar; // The task bar NxWM::CStartWindow *startwindow; // The start window + unsigned int mmInitial; // Initial memory usage + unsigned int mmStep; // Memory Usage at beginning of test step + unsigned int mmSubStep; // Memory Usage at beginning of test sub-step }; ///////////////////////////////////////////////////////////////////////////// @@ -90,6 +102,118 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // Public Functions ///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_HAVE_FILENAME +static void updateMemoryUsage(unsigned int *previous, + FAR const char *file, int line, + FAR const char *msg) +#else +static void updateMemoryUsage(unsigned int *previous, + FAR const char *msg) +#endif +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + +#ifdef CONFIG_HAVE_FILENAME + printf("File: %s Line: %d : %s\n", file, line, msg); +#else + printf("\n%s:\n", msg); +#endif + printf(" Before: %8u After: %8u Change: %8d\n", + *previous, mmcurrent.uordblks, (int)mmcurrent.uordblks - (int)*previous); + + /* Set up for the next test */ + + *previous = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: showTestCaseMemory +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_HAVE_FILENAME +static void _showTestCaseMemory(FAR const char *file, int line, FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmStep, file, line, msg); + g_nxwmtest.mmSubStep = g_nxwmtest.mmInitial; +} +#else +static void showTestCaseMemory(FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmStep, msg); + g_nxwmtest.mmSubStep = g_nxwmtest.mmInitial; +} +#endif + +///////////////////////////////////////////////////////////////////////////// +// Name: showTestMemory +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_HAVE_FILENAME +static void _showTestMemory(FAR const char *file, int line, FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmInitial, file, line, msg); +} +#else +static void showTestMemory(FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmInitial, msg); +} +#endif + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_nxwmtest.mmInitial = mmcurrent.uordblks; + g_nxwmtest.mmStep = mmcurrent.uordblks; + g_nxwmtest.mmSubStep = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: showTestStepMemory +///////////////////////////////////////////////////////////////////////////// +// Called by ad hoc instrumentation in the NxWM/NxWidgets code + +#ifdef CONFIG_HAVE_FILENAME +void _showTestStepMemory(FAR const char *file, int line, FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmSubStep, file, line, msg); +} +#else +void showTestStepMemory(FAR const char *msg) +{ + updateMemoryUsage(&g_nxwmtest.mmSubStep, msg); +} +#endif + ///////////////////////////////////////////////////////////////////////////// // user_start/nxwm_main ///////////////////////////////////////////////////////////////////////////// @@ -102,6 +226,10 @@ int MAIN_NAME(int argc, char *argv[]) up_cxxinitialize(); #endif + // Initialize memory monitor logic + + initMemoryUsage(); + // Create an instance of the Task Bar. // // The general sequence for initializing the task bar is: @@ -120,6 +248,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); return EXIT_FAILURE; } + showTestCaseMemory("After create taskbar"); // Connect to the NX server @@ -130,6 +259,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After connecting to the server"); // Initialize the task bar // @@ -144,7 +274,8 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } - + showTestCaseMemory("After initializing memory menager"); + // Create the start window. The general sequence for setting up the start window is: // // 1. Call CTaskBar::openApplicationWindow to create a window for the start window, @@ -162,6 +293,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After creating start window application window"); printf(MAIN_STRING "Initialize the CApplicationWindow\n"); if (!window->open()) @@ -171,6 +303,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After initializing the start window application window"); printf(MAIN_STRING "Creating the start window application\n"); g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); @@ -181,6 +314,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After create the start window application"); // Initialize the NSH library @@ -192,6 +326,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After initializing the NSH library"); // Add the NxConsole application to the start window @@ -204,6 +339,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the NxConsole\n"); goto noconsole; } + showTestCaseMemory("After creating the NxConsole application window"); printf(MAIN_STRING "Initialize the CApplicationWindow\n"); if (!window->open()) @@ -213,6 +349,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After initializing the NxConsole application window"); printf(MAIN_STRING "Creating the NxConsole application\n"); console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); @@ -222,6 +359,7 @@ int MAIN_NAME(int argc, char *argv[]) delete window; goto noconsole; } + showTestCaseMemory("After creating the NxConsole application"); printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(console)) @@ -229,6 +367,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start window\n"); delete window; } + showTestCaseMemory("After adding the NxConsole application"); noconsole: @@ -244,6 +383,7 @@ noconsole: printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the calculator\n"); goto nocalculator; } + showTestCaseMemory("After creating the calculator application window"); printf(MAIN_STRING "Initialize the CApplicationWindow\n"); if (!window->open()) @@ -253,6 +393,7 @@ noconsole: delete g_nxwmtest.taskbar; return EXIT_FAILURE; } + showTestCaseMemory("After creating the initializing application window"); printf(MAIN_STRING "Creating the calculator application\n"); calculator = new NxWM::CCalculator(g_nxwmtest.taskbar, window); @@ -262,6 +403,7 @@ noconsole: delete window; goto nocalculator; } + showTestCaseMemory("After creating the calculator application"); printf(MAIN_STRING "Adding the calculator application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(calculator)) @@ -269,6 +411,7 @@ noconsole: printf(MAIN_STRING "ERROR: Failed to add calculator to the start window\n"); delete window; } + showTestCaseMemory("After adding the calculator application"); nocalculator: #endif @@ -290,6 +433,7 @@ nocalculator: delete g_nxwmtest.startwindow; return EXIT_FAILURE; } + showTestCaseMemory("After starting the start window application"); // Call CTaskBar::startWindowManager to start the display with applications in place. // This method will not return but will enter the task bar's modal loop. @@ -308,22 +452,26 @@ nocalculator: delete g_nxwmtest.startwindow; return EXIT_FAILURE; } + showTestCaseMemory("After starting the window manager"); // Wait a little bit for the display to stabilize. The simulation pressing of // the 'start window' icon in the task bar sleep(2); g_nxwmtest.taskbar->clickIcon(0); + showTestCaseMemory("After clicking the start window icon"); // Wait bit to see the result of the button press. The press the first icon // in the start menu. That should be the NxConsole icon. sleep(2); g_nxwmtest.startwindow->clickIcon(0); + showTestCaseMemory("After clicking the NxConsole icon"); // Wait bit to see the result of the button press. sleep(2); + showTestMemory("Final memory usage"); return EXIT_SUCCESS; } diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 167f51997..924389709 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -184,6 +184,7 @@ namespace NxWM * used during automated testing of NxWM. */ +#ifdef CONFIG_NXWM_UNITTEST inline void clickMinimizeIcon(int index) { // Get the size and position of the widget @@ -198,12 +199,14 @@ namespace NxWM m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } +#endif /** * Simulate a mouse click on the stop applicaiton icon. This inline method is only * used during automated testing of NxWM. */ +#ifdef CONFIG_NXWM_UNITTEST inline void clickStopIcon(int index) { // Get the size and position of the widget @@ -218,6 +221,7 @@ namespace NxWM m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } +#endif }; } diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 5eeb51781..924cc7d05 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -209,6 +209,7 @@ namespace NxWM * used during automated testing of NxWM. */ +#ifdef CONFIG_NXWM_UNITTEST inline void clickIcon(int index) { if (index < m_slots.size()) @@ -230,6 +231,7 @@ namespace NxWM image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } +#endif }; } diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index c290cb8ae..4e12fdb2c 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -366,6 +366,7 @@ namespace NxWM * used during automated testing of NxWM. */ +#ifdef CONFIG_NXWM_UNITTEST inline void clickIcon(int index) { if (index < m_slots.size()) @@ -387,6 +388,7 @@ namespace NxWM image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); } } +#endif }; } diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 59ae1e79d..99383fe02 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -301,4 +301,23 @@ # define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID #endif +/**************************************************************************** + * Global Function Prototypes + ****************************************************************************/ +/** + * Hook to support monitoring of memory usage by the NxWM unit test. + */ + +#ifdef CONFIG_NXWM_UNITTEST +# ifdef CONFIG_HAVE_FILENAME +void _showTestStepMemory(FAR const char *file, int line, FAR const char *msg); +# define showTestStepMemory(msg) \ + _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# else +void showTestStepMemory(FAR const char *msg); +# endif +#else +# define showTestStepMemory(msg) +#endif + #endif // __INCLUDE_NXWMCONFIG_HXX diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 3cf5e13b9..fb6ca680a 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -357,7 +357,9 @@ int CNxConsole::nxconsole(int argc, char *argv[]) } // Now re-direct stdout and stderr so that they use the NX console driver. - // Note that stdin is retained (file descriptor 0, probably the the serial console). + // Notes: (1) stdin is retained (file descriptor 0, probably the the serial + // console). (2) Don't bother trying to put debug instrumentation in the + // following becaue it will end up in the NxConsole window. (void)std::fflush(stdout); (void)std::fflush(stderr); @@ -372,7 +374,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) std::close(fd); - // Inform the parent thread that we successfully initialize + // Inform the parent thread that we successfully initialized g_nxconvars.result = true; sem_post(&g_nxconvars.sem); diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 3190f50d9..f25ed8d2b 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -457,5 +457,3 @@ void CStartWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) } } - - diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 2ba0c4b08..2c6bf660b 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -706,7 +706,7 @@ bool CTaskbar::createTaskbarWindow(void) * @param pPos The new position of the window. * @return True on success, false on failure. */ - + m_taskbar->setPosition(&pos); m_taskbar->setSize(&size); return true; From 6a69813e351ff16f822fb41cf176886af6eca4dc Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 3 May 2012 22:31:48 +0000 Subject: [PATCH 027/390] Fix an NxWidgets bug; Update NxWM (it kind of works now) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4693 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 6 +++- libnxwidgets/src/crlepalettebitmap.cxx | 2 +- nxwm/src/cnxconsole.cxx | 39 +++++++++++++++++--------- nxwm/src/glyph_minimize.cxx | 8 +++--- nxwm/src/glyph_stop.cxx | 8 +++--- 5 files changed, 39 insertions(+), 24 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 452ba1deb..18bbffd6c 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,6 +13,10 @@ * CImage: Add logic to hightlight an CImage (using the selected LUT). * nxwm: The tiny NX window manager (NxWM) is being developed in this directory. * UnitTests/nxwm: A unit test for the NX window manager. +* CWidgetControl: Add a semaphore to force clients to wait if the + size or position of the window is not yet known (multi-user mode only). * During integration of NxWM, corrected numerous problems with NxWidgets running on toolbars and framed windows. That capability was commented - out in the 1.0 release but is verfied functional in 1.1. \ No newline at end of file + out in the 1.0 release but is verfied functional in 1.1. +* CRlePalettBitmap: Fix an error in the text that determines if we + need to "rewind" to the beginning of the image. diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 79a614349..31e300269 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -315,7 +315,7 @@ bool CRlePaletteBitmap::seekRow(nxgl_coord_t row) { // Is the current position already past the requested position? - if (row > m_row || (row == m_row && m_col != 0)) + if (row < m_row || (row == m_row && m_col != 0)) { // Yes.. rewind to the beginning of the image diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index fb6ca680a..de44ab7f0 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -73,11 +73,12 @@ namespace NxWM struct SNxConsole { - sem_t sem; /**< Sem that will be posted when the task is successfully initialized */ - NXTKWINDOW hwnd; /**< Window handle */ - NXCONSOLE nxcon; /**< NxConsole handle */ - int minor; /**< Next device minor number */ - bool result; /**< True if successfully initialized */ + sem_t sem; /**< Sem that posted when the task is initialized */ + NXTKWINDOW hwnd; /**< Window handle */ + NXCONSOLE nxcon; /**< NxConsole handle */ + int minor; /**< Next device minor number */ + struct nxcon_window_s wndo; /**< Describes the NxConsole window */ + bool result; /**< True if successfully initialized */ }; /******************************************************************************************** @@ -211,6 +212,16 @@ bool CNxConsole::run(void) g_nxconvars.hwnd = control->getWindowHandle(); + // Describe the NxConsole + + g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; + g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; + g_nxconvars.wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; + + // Get the size of the window + + (void)window->getSize(&g_nxconvars.wndo.wsize); + // Start the NxConsole task g_nxconvars.result = false; @@ -235,6 +246,8 @@ bool CNxConsole::run(void) abstime.tv_sec += 2; int ret = sem_timedwait(&g_nxconvars.sem, &abstime); + sched_unlock(); + if (ret == OK && g_nxconvars.result) { // Save the handle to use in the stop method @@ -320,20 +333,15 @@ void CNxConsole::redraw(void) int CNxConsole::nxconsole(int argc, char *argv[]) { - // Configure NxConsole - - struct nxcon_window_s wndo; /* Describes the window */ - wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; - wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; - wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; - - // To stop compiler complaining about "jump to label crosses initialization of 'int fd' + // To stop compiler complaining about "jump to label crosses initialization + // of 'int fd' int fd = -1; // Use the window handle to create the NX console - g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &wndo, g_nxconvars.minor); + g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &g_nxconvars.wndo, + g_nxconvars.minor); if (!g_nxconvars.nxcon) { goto errout; @@ -370,6 +378,9 @@ int CNxConsole::nxconsole(int argc, char *argv[]) (void)std::dup2(fd, 1); (void)std::dup2(fd, 2); + (void)std::fdopen(1, "w"); + (void)std::fdopen(2, "w"); + // And we can close our original driver file descriptor std::close(fd); diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 350f188f9..1029ec0b3 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -72,7 +72,7 @@ using namespace NxWM; static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 9 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 9 */ 0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, 0x002492, /* Codes 1-8 */ 0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, 0x4949b6, /* Codes 9-17 */ 0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, 0x4949ff /* Codes 17-24 */ @@ -84,7 +84,7 @@ static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, 0x2136, /* Codes 1-10 */ 0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, 0xdedf, /* Codes 11-20 */ 0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 21-24 */ @@ -104,7 +104,7 @@ static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, /* Codes 1-13 */ 0x6a, 0x5f, 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 14-24 */ }; @@ -115,7 +115,7 @@ static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, /* Codes 1-13 */ 0x4e, 0x2e, 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 14-24 */ }; diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index bd11d88e8..828e5266c 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -72,7 +72,7 @@ using namespace NxWM; static const uint32_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, 0xb64949, /* Codes 1-8 */ 0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, 0xff9292, /* Codes 9-16 */ 0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, 0xff2424, /* Codes 17-24 */ @@ -90,7 +90,7 @@ static const uint32_t g_stopLut[BITMAP_NLUTCODES] = static const uint16_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, 0xd92d, /* Codes 1-10 */ 0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, 0xf92d, /* Codes 11-20 */ 0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, 0xfed6, /* Codes 21-30 */ @@ -114,7 +114,7 @@ static const uint16_t g_stopLut[BITMAP_NLUTCODES] = static const uint8_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, /* Codes 1-13 */ 0xe9, 0xe5, 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, /* Codes 14-26 */ 0x5a, 0x7b, 0xd0, 0xe1, 0x94, 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, /* Codes 27-39 */ @@ -129,7 +129,7 @@ static const uint8_t g_stopLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ 0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, /* Codes 1-13 */ 0xfb, 0xfb, 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, /* Codes 14-26 */ 0xc4, 0xe8, 0xf7, 0xfa, 0xed, 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, /* Codes 27-39 */ From c7868d0bbf1a2f9426754e0dfcdbbe1b6d7f1d89 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 3 May 2012 23:06:37 +0000 Subject: [PATCH 028/390] Fix a positioning problem in CRlePaletteBitmap git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4694 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ UnitTests/nxwm/main.cxx | 2 +- libnxwidgets/src/crlepalettebitmap.cxx | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 18bbffd6c..000fe2cda 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -20,3 +20,5 @@ out in the 1.0 release but is verfied functional in 1.1. * CRlePalettBitmap: Fix an error in the text that determines if we need to "rewind" to the beginning of the image. +* CRlePalettBitmap: Fixe a positioning problem. It was actually losing + the last row of every image! diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index c202e6443..6a6266141 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -274,7 +274,7 @@ int MAIN_NAME(int argc, char *argv[]) delete g_nxwmtest.taskbar; return EXIT_FAILURE; } - showTestCaseMemory("After initializing memory menager"); + showTestCaseMemory("After initializing window manager"); // Create the start window. The general sequence for setting up the start window is: // diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 31e300269..4c781e2c9 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -242,12 +242,22 @@ void CRlePaletteBitmap::startOfImage(void) bool CRlePaletteBitmap::advancePosition(nxgl_coord_t npixels) { + // Advance to the next column after consuming 'npixels' on this colum int newcol = m_col + npixels; + // Have we consumed the entire row? + while (newcol >= m_bitmap->width) { + // Advance to the next row + newcol -= m_bitmap->width; - if (++m_row >= m_bitmap->height) + m_row++; + + // If we still have pixels to account for but we have exceeded the + // the size of the bitmap, then return false + + if (newcol > 0 && m_row >= m_bitmap->height) { return false; } From f1a16490fce63e645d0b9dd542853078b1c85e2e Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 4 May 2012 00:55:52 +0000 Subject: [PATCH 029/390] NxWM: Cleaned up a couple of icon images git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4697 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/images/minimize.png | Bin 462 -> 284 bytes nxwm/images/stop.png | Bin 732 -> 381 bytes nxwm/include/nxwmconfig.hxx | 7 +- nxwm/src/glyph_minimize.cxx | 86 ++++++++-------------- nxwm/src/glyph_stop.cxx | 138 +++++++++++------------------------- 5 files changed, 73 insertions(+), 158 deletions(-) diff --git a/nxwm/images/minimize.png b/nxwm/images/minimize.png index 7671547f8716b7bb902d4166303e37cba50225cd..7080533dd3812d68c9cf08112a86a5b453a76e10 100755 GIT binary patch delta 232 zcmX@dJcmiKGr-TCmrII^fq{Y7)59eQNQ;6n2OE%FDZX^tL`A!LRu%?LVZERY&wyfc zJY5_^EKaYz;>dSIfrIrz{N=?56899?^4wV(dq!u?!lg<%ru;t)^FsP3cTSA77G7*> z*tf>*QOPaM^5Q*yI@&lOR<6L|f7E^57$5s7 gS_~IOCUh1uzSU5do_Mc=8|Y95Pgg&ebxsLQ08Wcn7XSbN delta 411 zcmV;M0c8H10?q>=iBL{Q4GJ0x0000DNk~Le0000P0000P2nGNE0L1BqW04^~e*_&6 z6dyrbCZ+%Y0ZvIoK~zY`-Im>vgD?z)zhqL1RE*QhrI-|R6tn7ud%%DJ8^}zOhto`k zKUpj9E+Ut{?|VKRSH2Lp@x<>P&=rpyG#sYT{AdwV-k6YZbAF$;1c8pwV_Q*`)&vmw z!ZvwEW^YTlq^6MPO{kd`ZFL~8Eu>~cA%M=z)8qbH(8ojx4)!ASqJh<^z;O`_A{5WG0-k zB$FZ*iv>Xa7-J0n@c7AJ7$4_@BuJ=Bn|DB(Z{#(V>wH4Ppy}Fa7<32sXAl5uc0G#* znV8u$xBycCmdob(Z0CB!7a*q_e=oZvVfoC;05TVcPA9pd5dwb=*X<=>R)!1|LRkP8 z&&(&ow(r+Iw(Um!48o#Gf_eGa43r?y^!@}hZxxd1k>UWwr>MMSS5`E&De}Xfd^RMz?|+P5~O@m=MEPM815T*pV^k|e-TyvYXEHOmLm3; z4OGxO?p_goC%getkiTLkTh115ca@)42{S_yn{Rk)rAMAjzi5!&oKz5Ni;(JQrS4bO zX&$k&spd?a^F%g-ww$sTi1lq|S={-4@|HdQ*TVfW)$Zf@?$9-U{5PLOzX6$wgt`kw S<$M4D002ovPDHLk0$_p)3pu9% diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 99383fe02..8ac45fc72 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -209,7 +209,7 @@ #endif /** - * At present, all icons are 25 pixels in "widgth" and, hence require a + * At present, all icons are 25 pixels in "width" and, hence require a * task bar of at least that size. */ @@ -224,11 +224,12 @@ /* 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. + * application window. At present, all icons are 21 pixels in height and, + * hence require a task bar of at least that size. */ #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT -# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH +# define CONFIG_NXWM_TOOLBAR_HEIGHT (21+2*CONFIG_NXWM_TASKBAR_HSPACING) #endif /* Background Image **********************************************************/ diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 1029ec0b3..1f375ab13 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -56,9 +56,9 @@ * Pre-Processor Definitions ********************************************************************************************/ -#define BITMAP_NROWS 25 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 25 +#define BITMAP_NROWS 21 +#define BITMAP_NCOLUMNS 21 +#define BITMAP_NLUTCODES 8 /******************************************************************************************** * Private Bitmap Data @@ -72,10 +72,7 @@ using namespace NxWM; static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 9 */ - 0x2449b6, 0x24496d, 0x244992, 0x242492, 0x496ddb, 0x0024db, 0x0024b6, 0x002492, /* Codes 1-8 */ - 0x0000b6, 0x2424b6, 0x0024ff, 0x0000db, 0x4949db, 0x496db6, 0x246db6, 0x4949b6, /* Codes 9-17 */ - 0x2449db, 0xb6dbff, 0xb6b6db, 0xdbdbff, 0xdbffff, 0x496dff, 0x246dff, 0x4949ff /* Codes 17-24 */ + 0x2448b4, 0x486cd8, 0x0024b4, 0x0024d8, 0x242490, 0x0000b4, 0xfcfcfc, 0xd8fcfc /* Codes 0-7 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -84,10 +81,7 @@ static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0x2256, 0x224d, 0x2252, 0x2132, 0x4b7b, 0x013b, 0x0136, 0x0132, 0x0016, 0x2136, /* Codes 1-10 */ - 0x013f, 0x001b, 0x4a5b, 0x4b76, 0x2376, 0x4a56, 0x225b, 0xb6df, 0xb5bb, 0xdedf, /* Codes 11-20 */ - 0xdfff, 0x4b7f, 0x237f, 0x4a5f /* Codes 21-24 */ + 0x2256, 0x4b7b, 0x0136, 0x013b, 0x2132, 0x0016, 0xffff, 0xdfff /* Codes 0-7 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -104,9 +98,7 @@ static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0x4a, 0x42, 0x46, 0x30, 0x6e, 0x2e, 0x29, 0x25, 0x14, 0x34, 0x32, 0x18, 0x59, /* Codes 1-13 */ - 0x6a, 0x5f, 0x55, 0x4e, 0xd4, 0xba, 0xdf, 0xf4, 0x72, 0x67, 0x5d /* Codes 14-24 */ + 0x49, 0x6d, 0x29, 0x2d, 0x30, 0x14, 0xfc, 0xf1 /* Codes 0-7 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ @@ -115,9 +107,7 @@ static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0x2a, 0x29, 0x2a, 0x26, 0x4f, 0x07, 0x06, 0x06, 0x02, 0x26, 0x07, 0x03, 0x4b, /* Codes 1-13 */ - 0x4e, 0x2e, 0x4a, 0x2b, 0xbb, 0xb7, 0xdb, 0xdf, 0x4f, 0x2f, 0x4b /* Codes 14-24 */ + 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; # endif @@ -127,47 +117,27 @@ static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = { - { 25, 0}, /* Row 0 */ - { 25, 0}, /* Row 1 */ - { 2, 0}, { 1, 1}, { 3, 2}, { 1, 3}, { 1, 4}, { 3, 3}, { 2, 4}, { 4, 3}, /* Row 2 */ - { 1, 4}, { 1, 3}, { 2, 2}, { 1, 1}, { 1, 5}, { 2, 0}, - { 2, 0}, { 1, 2}, { 3, 6}, { 8, 7}, { 2, 8}, { 3, 7}, { 2, 8}, { 1, 4}, /* Row 3 */ - { 1, 1}, { 2, 0}, - { 2, 0}, { 1, 4}, { 11, 6}, { 3, 7}, { 1, 6}, { 4, 7}, { 1, 2}, { 2, 0}, /* Row 4 */ - { 2, 0}, { 1, 7}, { 11, 6}, { 3, 7}, { 1, 6}, { 4, 7}, { 1, 3}, { 2, 0}, /* Row 5 */ - { 2, 0}, { 1, 4}, { 9, 6}, { 10, 7}, { 1, 1}, { 2, 0}, /* Row 6 */ - { 2, 0}, { 1, 4}, { 9, 6}, { 2, 7}, { 1, 8}, { 7, 7}, { 1, 1}, { 2, 0}, /* Row 7 */ - { 2, 0}, { 1, 4}, { 8, 6}, { 4, 7}, { 1, 8}, { 6, 7}, { 1, 1}, { 2, 0}, /* Row 8 */ - { 2, 0}, { 1, 4}, { 9, 6}, { 8, 7}, { 1, 9}, { 1, 7}, { 1, 1}, { 2, 0}, /* Row 9 */ - { 2, 0}, { 1, 10}, { 9, 6}, { 1, 7}, { 1, 6}, { 6, 7}, { 1, 9}, { 1, 7}, /* Row 10 */ - { 1, 1}, { 2, 0}, - { 2, 0}, { 1, 10}, { 7, 6}, { 1, 7}, { 2, 6}, { 6, 7}, { 2, 9}, { 1, 7}, /* Row 11 */ - { 1, 10}, { 2, 0}, - { 2, 0}, { 1, 10}, { 6, 6}, { 3, 7}, { 1, 6}, { 6, 7}, { 3, 9}, { 1, 10}, /* Row 12 */ - { 2, 0}, - { 2, 0}, { 1, 10}, { 4, 6}, { 8, 7}, { 3, 9}, { 1, 7}, { 3, 9}, { 1, 10}, /* Row 13 */ - { 2, 0}, - { 2, 0}, { 1, 4}, { 1, 7}, { 1, 6}, { 1, 7}, { 2, 6}, { 2, 7}, { 3, 9}, /* Row 14 */ - { 1, 7}, { 6, 9}, { 1, 7}, { 1, 9}, { 1, 4}, { 2, 0}, - { 2, 0}, { 1, 10}, { 2, 6}, { 1, 7}, { 1, 6}, { 3, 7}, { 2, 9}, { 1, 7}, /* Row 15 */ - { 6, 9}, { 1, 7}, { 1, 6}, { 1, 9}, { 1, 10}, { 2, 0}, - { 2, 0}, { 1, 10}, { 1, 11}, { 2, 6}, { 5, 7}, { 1, 6}, { 3, 7}, { 3, 9}, /* Row 16 */ - { 2, 7}, { 2, 9}, { 1, 10}, { 2, 0}, - { 2, 0}, { 1, 10}, { 3, 11}, { 5, 6}, { 3, 9}, { 5, 7}, { 1, 6}, { 1, 7}, /* Row 17 */ - { 1, 9}, { 1, 10}, { 2, 0}, - { 2, 0}, { 1, 10}, { 1, 6}, { 1, 12}, { 1, 13}, { 1, 14}, { 1, 1}, { 2, 15}, /* Row 18 */ - { 1, 1}, { 1, 14}, { 2, 16}, { 3, 14}, { 1, 1}, { 1, 15}, { 1, 17}, { 2, 9}, - { 1, 4}, { 2, 0}, - { 2, 0}, { 1, 4}, { 2, 10}, { 1, 18}, { 13, 0}, { 1, 18}, { 1, 10}, { 1, 4}, /* Row 19 */ - { 1, 2}, { 2, 0}, - { 2, 0}, { 1, 4}, { 1, 10}, { 1, 9}, { 1, 19}, { 3, 20}, { 2, 21}, { 7, 20}, /* Row 20 */ - { 1, 21}, { 1, 18}, { 1, 13}, { 1, 4}, { 1, 2}, { 2, 0}, - { 2, 0}, { 1, 1}, { 3, 6}, { 1, 17}, { 2, 22}, { 1, 5}, { 1, 23}, { 2, 22}, /* Row 21 */ - { 3, 5}, { 2, 22}, { 1, 5}, { 1, 22}, { 1, 24}, { 1, 7}, { 1, 1}, { 2, 0}, - { 2, 0}, { 1, 5}, { 1, 1}, { 1, 6}, { 1, 7}, { 2, 10}, { 3, 7}, { 2, 6}, /* Row 22 */ - { 6, 7}, { 2, 10}, { 1, 1}, { 1, 5}, { 2, 0}, - { 25, 0}, /* Row 23 */ - { 25, 0} /* Row 24 */ + { 1, 0}, { 20, 1}, /* Row 0 */ + { 1, 1}, { 5, 2}, { 5, 3}, { 8, 2}, { 1, 4}, { 1, 0}, /* Row 1 */ + { 1, 1}, { 3, 2}, { 8, 3}, { 8, 2}, { 1, 4}, /* Row 2 */ + { 1, 1}, { 2, 2}, { 10, 3}, { 7, 2}, { 1, 4}, /* Row 3 */ + { 1, 1}, { 1, 2}, { 10, 3}, { 8, 2}, { 1, 4}, /* Row 4 */ + { 1, 1}, { 1, 2}, { 9, 3}, { 9, 2}, { 1, 4}, /* Row 5 */ + { 1, 1}, { 9, 3}, { 9, 2}, { 1, 5}, { 1, 4}, /* Row 6 */ + { 1, 1}, { 8, 3}, { 10, 2}, { 1, 5}, { 1, 4}, /* Row 7 */ + { 1, 1}, { 7, 3}, { 11, 2}, { 1, 5}, { 1, 4}, /* Row 8 */ + { 1, 1}, { 1, 2}, { 4, 3}, { 12, 2}, { 2, 5}, { 1, 4}, /* Row 9 */ + { 1, 1}, { 2, 2}, { 1, 3}, { 14, 2}, { 2, 5}, { 1, 4}, /* Row 10 */ + { 1, 1}, { 16, 2}, { 3, 5}, { 1, 4}, /* Row 11 */ + { 1, 1}, { 15, 2}, { 4, 5}, { 1, 4}, /* Row 12 */ + { 1, 1}, { 13, 2}, { 6, 5}, { 1, 4}, /* Row 13 */ + { 1, 1}, { 11, 2}, { 8, 5}, { 1, 4}, /* Row 14 */ + { 1, 1}, { 8, 2}, { 11, 5}, { 1, 4}, /* Row 15 */ + { 1, 1}, { 4, 2}, { 15, 5}, { 1, 4}, /* Row 16 */ + { 1, 1}, { 2, 2}, { 14, 6}, { 1, 7}, { 2, 5}, { 1, 4}, /* Row 17 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 15, 7}, { 2, 5}, { 1, 4}, /* Row 18 */ + { 1, 1}, { 19, 5}, { 1, 0}, /* Row 19 */ + { 1, 1}, { 1, 0}, { 17, 4}, { 1, 0}, { 1, 1}, /* Row 20 */ }; /******************************************************************************************** diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index 828e5266c..9081b48a2 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -56,9 +56,9 @@ * Pre-Processor Definitions ********************************************************************************************/ -#define BITMAP_NROWS 25 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 66 +#define BITMAP_NROWS 21 +#define BITMAP_NCOLUMNS 21 +#define BITMAP_NLUTCODES 11 /******************************************************************************************** * Private Bitmap Data @@ -72,16 +72,8 @@ using namespace NxWM; static const uint32_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0xdbdbdb, 0xdbb6db, 0xdbb6b6, 0xdb9292, 0xdb926d, 0xdb6d6d, 0xb66d6d, 0xb64949, /* Codes 1-8 */ - 0xb62449, 0xdb246d, 0xdb4949, 0xff496d, 0xffb6b6, 0xffdbff, 0xffdbdb, 0xff9292, /* Codes 9-16 */ - 0xff6d6d, 0xdb6d49, 0xff2449, 0xff246d, 0xdb2449, 0xdbdbb6, 0xff4949, 0xff2424, /* Codes 17-24 */ - 0xffffdb, 0xdbb692, 0xdb2424, 0xff4924, 0xffb6db, 0xffdbb6, 0xff6d49, 0xffb692, /* Codes 25-32 */ - 0xdb4924, 0xb64924, 0xdbdb92, 0xb69292, 0xb62424, 0xdb496d, 0xb6926d, 0xdbffff, /* Codes 33-40 */ - 0xdbffdb, 0xb6496d, 0xdb0024, 0xdb6d92, 0xff2400, 0xb66d49, 0xdb2400, 0xb62400, /* Codes 41-48 */ - 0x922424, 0xb60000, 0x922449, 0xff92b6, 0x920000, 0xdb0049, 0xb60024, 0xdb0000, /* Codes 49-56 */ - 0x922400, 0x924949, 0x924924, 0x920024, 0xff6d92, 0x6d4924, 0x6d2400, 0x6d2424, /* Codes 57-64 */ - 0x6d0000 /* Code 65 */ + 0xd8d8d8, 0xfc6c6c, 0xfcb4b4, 0xd80000, 0xfc0000, 0x902424, 0xfcfcfc, 0xd8fcfc, /* Codes 0-7 */ + 0xb40000, 0xb40024, 0xfcd8d8 /* Codes 8-10 */ }; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ @@ -90,14 +82,8 @@ static const uint32_t g_stopLut[BITMAP_NLUTCODES] = static const uint16_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0xdedb, 0xddbb, 0xddb6, 0xdc92, 0xdc8d, 0xdb6d, 0xb36d, 0xb249, 0xb129, 0xd92d, /* Codes 1-10 */ - 0xda49, 0xfa4d, 0xfdb6, 0xfedf, 0xfedb, 0xfc92, 0xfb6d, 0xdb69, 0xf929, 0xf92d, /* Codes 11-20 */ - 0xd929, 0xded6, 0xfa49, 0xf924, 0xfffb, 0xddb2, 0xd924, 0xfa44, 0xfdbb, 0xfed6, /* Codes 21-30 */ - 0xfb69, 0xfdb2, 0xda44, 0xb244, 0xded2, 0xb492, 0xb124, 0xda4d, 0xb48d, 0xdfff, /* Codes 31-40 */ - 0xdffb, 0xb24d, 0xd804, 0xdb72, 0xf920, 0xb369, 0xd920, 0xb120, 0x9124, 0xb000, /* Codes 41-50 */ - 0x9129, 0xfc96, 0x9000, 0xd809, 0xb004, 0xd800, 0x9120, 0x9249, 0x9244, 0x9004, /* Codes 51-60 */ - 0xfb72, 0x6a44, 0x6920, 0x6924, 0x6800 /* Codes 61-65 */ + 0xdedb, 0xfb6d, 0xfdb6, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb000, 0xb004, /* Codes 0-9 */ + 0xfedb /* Codes 10-10 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -114,12 +100,7 @@ static const uint16_t g_stopLut[BITMAP_NLUTCODES] = static const uint8_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0xdb, 0xc5, 0xc1, 0xa7, 0xa3, 0x8d, 0x82, 0x69, 0x53, 0x63, 0x74, 0x83, 0xcb, /* Codes 1-13 */ - 0xe9, 0xe5, 0xb2, 0x98, 0x89, 0x69, 0x6d, 0x5e, 0xd6, 0x7f, 0x65, 0xfa, 0xbc, /* Codes 14-26 */ - 0x5a, 0x7b, 0xd0, 0xe1, 0x94, 0xc7, 0x70, 0x65, 0xd2, 0x9c, 0x4f, 0x78, 0x98, /* Codes 27-39 */ - 0xf4, 0xf0, 0x6d, 0x45, 0x92, 0x61, 0x7e, 0x56, 0x4b, 0x44, 0x36, 0x49, 0xb6, /* Codes 40-52 */ - 0x2b, 0x49, 0x3a, 0x41, 0x40, 0x5e, 0x5a, 0x2f, 0x9c, 0x4f, 0x35, 0x39, 0x20 /* Codes 53-65 */ + 0xd8, 0x97, 0xc9, 0x40, 0x4b, 0x44, 0xfc, 0xf1, 0x35, 0x39, 0xe2 /* Codes 0-10 */ }; @@ -129,12 +110,7 @@ static const uint8_t g_stopLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = { - CONFIG_NXTK_BORDERCOLOR1, /* Code 0 */ - 0xdb, 0xd7, 0xd6, 0xd2, 0xd1, 0xcd, 0xad, 0xa9, 0xa5, 0xc5, 0xc9, 0xe9, 0xf6, /* Codes 1-13 */ - 0xfb, 0xfb, 0xf2, 0xed, 0xcd, 0xe5, 0xe5, 0xc5, 0xda, 0xe9, 0xe4, 0xff, 0xd6, /* Codes 14-26 */ - 0xc4, 0xe8, 0xf7, 0xfa, 0xed, 0xf6, 0xc8, 0xa8, 0xda, 0xb2, 0xa4, 0xc9, 0xb1, /* Codes 27-39 */ - 0xdf, 0xdf, 0xa9, 0xc0, 0xce, 0xe4, 0xad, 0xc4, 0xa4, 0x84, 0xa0, 0x85, 0xf2, /* Codes 40-52 */ - 0x80, 0xc1, 0xa0, 0xc0, 0x84, 0x89, 0x88, 0x80, 0xee, 0x68, 0x64, 0x64, 0x60 /* Codes 53-65 */ + 0xdb, 0xed, 0xf6, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xa0, 0xfb /* Codes 0-10 */ }; # endif @@ -144,70 +120,38 @@ static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] = { - { 25, 0}, /* Row 0 */ - { 25, 0}, /* Row 1 */ - { 2, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 2}, { 2, 3}, { 2, 4}, { 1, 5}, /* Row 2 */ - { 2, 6}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 1, 8}, { 1, 11}, - { 1, 12}, { 1, 13}, { 2, 0}, - { 2, 0}, { 1, 1}, { 1, 14}, { 2, 15}, { 1, 1}, { 1, 3}, { 1, 13}, { 2, 16}, /* Row 3 */ - { 2, 17}, { 1, 18}, { 1, 11}, { 2, 19}, { 1, 20}, { 1, 19}, { 1, 21}, { 2, 19}, - { 1, 17}, { 2, 0}, - { 2, 0}, { 1, 2}, { 1, 14}, { 2, 15}, { 1, 22}, { 1, 3}, { 1, 4}, { 2, 17}, /* Row 4 */ - { 3, 23}, { 3, 24}, { 2, 21}, { 1, 23}, { 1, 19}, { 1, 24}, { 1, 8}, { 2, 0}, - { 2, 0}, { 1, 3}, { 2, 15}, { 1, 0}, { 2, 25}, { 1, 26}, { 1, 6}, { 1, 11}, /* Row 5 */ - { 2, 23}, { 1, 24}, { 2, 27}, { 1, 28}, { 2, 15}, { 1, 0}, { 1, 17}, { 1, 23}, - { 1, 8}, { 2, 0}, - { 2, 0}, { 1, 3}, { 1, 29}, { 1, 13}, { 1, 30}, { 1, 0}, { 1, 25}, { 1, 22}, /* Row 6 */ - { 1, 5}, { 1, 11}, { 2, 27}, { 1, 24}, { 1, 27}, { 1, 31}, { 1, 32}, { 1, 25}, - { 1, 0}, { 1, 26}, { 1, 33}, { 1, 27}, { 1, 34}, { 2, 0}, - { 2, 0}, { 1, 3}, { 1, 13}, { 2, 16}, { 1, 30}, { 1, 0}, { 1, 25}, { 1, 26}, /* Row 7 */ - { 1, 8}, { 2, 21}, { 1, 27}, { 1, 11}, { 1, 26}, { 1, 25}, { 1, 0}, { 1, 35}, - { 1, 34}, { 1, 33}, { 1, 27}, { 1, 8}, { 2, 0}, - { 2, 0}, { 1, 36}, { 2, 16}, { 2, 6}, { 1, 13}, { 1, 0}, { 1, 25}, { 1, 4}, /* Row 8 */ - { 3, 8}, { 1, 4}, { 1, 25}, { 1, 0}, { 1, 13}, { 1, 8}, { 1, 37}, { 2, 24}, - { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 36}, { 1, 4}, { 1, 17}, { 1, 12}, { 1, 11}, { 1, 38}, { 1, 15}, /* Row 9 */ - { 2, 0}, { 2, 36}, { 1, 7}, { 1, 15}, { 1, 0}, { 1, 15}, { 1, 23}, { 1, 27}, - { 3, 24}, { 1, 27}, { 2, 0}, - { 2, 0}, { 1, 39}, { 1, 6}, { 2, 23}, { 1, 19}, { 1, 37}, { 1, 38}, { 1, 15}, /* Row 10 */ - { 1, 0}, { 2, 40}, { 1, 41}, { 1, 0}, { 1, 29}, { 1, 42}, { 1, 43}, { 1, 27}, - { 3, 24}, { 1, 27}, { 2, 0}, - { 2, 0}, { 1, 7}, { 1, 18}, { 1, 21}, { 2, 24}, { 1, 21}, { 1, 9}, { 1, 44}, /* Row 11 */ - { 1, 0}, { 3, 40}, { 1, 0}, { 1, 44}, { 1, 9}, { 3, 27}, { 1, 45}, { 1, 24}, - { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 7}, { 1, 18}, { 1, 21}, { 2, 24}, { 1, 21}, { 1, 9}, { 1, 44}, /* Row 12 */ - { 1, 0}, { 3, 40}, { 1, 0}, { 1, 44}, { 1, 9}, { 3, 27}, { 1, 45}, { 1, 24}, - { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 46}, { 1, 11}, { 4, 27}, { 1, 9}, { 1, 44}, { 5, 0}, { 1, 44}, /* Row 13 */ - { 1, 9}, { 1, 27}, { 2, 37}, { 1, 47}, { 1, 27}, { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 8}, { 3, 27}, { 1, 48}, { 1, 37}, { 1, 6}, { 1, 15}, { 1, 0}, /* Row 14 */ - { 3, 15}, { 1, 0}, { 1, 15}, { 1, 7}, { 1, 37}, { 1, 49}, { 1, 37}, { 1, 48}, - { 1, 27}, { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 8}, { 1, 37}, { 1, 27}, { 2, 48}, { 1, 46}, { 1, 15}, { 1, 0}, /* Row 15 */ - { 1, 15}, { 3, 7}, { 1, 15}, { 1, 0}, { 1, 30}, { 1, 23}, { 1, 37}, { 2, 48}, - { 1, 27}, { 1, 37}, { 2, 0}, - { 2, 0}, { 1, 49}, { 1, 37}, { 1, 27}, { 1, 50}, { 1, 34}, { 1, 30}, { 1, 0}, /* Row 16 */ - { 1, 25}, { 1, 7}, { 2, 51}, { 1, 9}, { 1, 7}, { 1, 25}, { 1, 0}, { 1, 52}, - { 1, 27}, { 1, 53}, { 1, 47}, { 1, 27}, { 1, 49}, { 2, 0}, - { 2, 0}, { 1, 37}, { 1, 54}, { 1, 55}, { 1, 9}, { 1, 30}, { 1, 0}, { 1, 15}, /* Row 17 */ - { 1, 17}, { 1, 56}, { 2, 43}, { 1, 37}, { 1, 57}, { 1, 17}, { 1, 15}, { 1, 0}, - { 1, 30}, { 1, 58}, { 1, 53}, { 1, 37}, { 1, 58}, { 2, 0}, - { 2, 0}, { 1, 9}, { 1, 53}, { 1, 37}, { 1, 32}, { 1, 0}, { 1, 25}, { 1, 5}, /* Row 18 */ - { 1, 37}, { 1, 55}, { 2, 50}, { 1, 53}, { 1, 49}, { 1, 59}, { 1, 5}, { 1, 25}, - { 1, 0}, { 1, 16}, { 1, 9}, { 1, 60}, { 1, 49}, { 2, 0}, - { 2, 0}, { 1, 49}, { 1, 60}, { 1, 61}, { 1, 0}, { 1, 25}, { 1, 30}, { 1, 62}, /* Row 19 */ - { 1, 57}, { 1, 53}, { 2, 50}, { 1, 57}, { 1, 63}, { 1, 57}, { 1, 49}, { 1, 30}, - { 1, 15}, { 1, 0}, { 1, 61}, { 1, 37}, { 1, 49}, { 2, 0}, - { 2, 0}, { 1, 49}, { 1, 55}, { 1, 11}, { 1, 8}, { 1, 58}, { 1, 64}, { 1, 65}, /* Row 20 */ - { 1, 55}, { 1, 50}, { 2, 55}, { 1, 37}, { 1, 53}, { 1, 37}, { 1, 53}, { 1, 64}, - { 1, 8}, { 1, 11}, { 1, 21}, { 1, 60}, { 1, 51}, { 2, 0}, - { 2, 0}, { 1, 38}, { 1, 55}, { 1, 60}, { 2, 49}, { 1, 65}, { 1, 60}, { 1, 50}, /* Row 21 */ - { 1, 43}, { 3, 50}, { 1, 55}, { 2, 50}, { 1, 64}, { 1, 49}, { 2, 60}, { 1, 37}, - { 1, 38}, { 2, 0}, - { 2, 0}, { 1, 29}, { 1, 38}, { 2, 49}, { 2, 64}, { 1, 49}, { 2, 55}, { 2, 37}, /* Row 22 */ - { 3, 49}, { 1, 37}, { 1, 64}, { 1, 58}, { 2, 49}, { 1, 6}, { 1, 13}, { 2, 0}, - { 25, 0}, /* Row 23 */ - { 25, 0} /* Row 24 */ + { 1, 0}, { 1, 1}, { 17, 2}, { 1, 1}, { 1, 2}, /* Row 0 */ + { 1, 1}, { 4, 3}, { 6, 4}, { 9, 3}, { 1, 1}, /* Row 1 */ + { 1, 2}, { 2, 3}, { 9, 4}, { 8, 3}, { 1, 5}, /* Row 2 */ + { 1, 2}, { 1, 3}, { 1, 4}, { 2, 6}, { 1, 7}, { 7, 4}, { 2, 3}, { 2, 6}, /* Row 3 */ + { 1, 7}, { 2, 3}, { 1, 5}, + { 1, 2}, { 1, 3}, { 1, 4}, { 3, 6}, { 1, 7}, { 5, 4}, { 2, 3}, { 3, 6}, /* Row 4 */ + { 1, 7}, { 2, 3}, { 1, 5}, + { 1, 2}, { 3, 4}, { 3, 6}, { 1, 7}, { 4, 4}, { 1, 3}, { 3, 6}, { 1, 7}, /* Row 5 */ + { 3, 3}, { 1, 5}, + { 1, 2}, { 4, 4}, { 3, 6}, { 1, 7}, { 2, 4}, { 1, 3}, { 3, 6}, { 1, 7}, /* Row 6 */ + { 4, 3}, { 1, 5}, + { 1, 2}, { 5, 4}, { 3, 6}, { 1, 7}, { 1, 3}, { 3, 6}, { 1, 7}, { 4, 3}, /* Row 7 */ + { 1, 8}, { 1, 5}, + { 1, 2}, { 6, 4}, { 6, 6}, { 1, 7}, { 5, 3}, { 1, 8}, { 1, 5}, /* Row 8 */ + { 1, 2}, { 1, 3}, { 4, 4}, { 2, 3}, { 2, 6}, { 3, 7}, { 6, 3}, { 1, 8}, /* Row 9 */ + { 1, 5}, + { 1, 2}, { 2, 3}, { 1, 4}, { 4, 3}, { 2, 6}, { 3, 7}, { 5, 3}, { 2, 8}, /* Row 10 */ + { 1, 5}, + { 1, 2}, { 7, 3}, { 4, 6}, { 1, 7}, { 5, 3}, { 2, 8}, { 1, 5}, /* Row 11 */ + { 1, 2}, { 6, 3}, { 6, 6}, { 1, 7}, { 3, 3}, { 3, 8}, { 1, 5}, /* Row 12 */ + { 1, 2}, { 5, 3}, { 2, 6}, { 2, 7}, { 1, 3}, { 2, 6}, { 2, 7}, { 1, 3}, /* Row 13 */ + { 4, 8}, { 1, 5}, + { 1, 2}, { 4, 3}, { 3, 6}, { 1, 7}, { 3, 3}, { 3, 6}, { 1, 7}, { 4, 8}, /* Row 14 */ + { 1, 5}, + { 1, 2}, { 3, 3}, { 3, 6}, { 1, 7}, { 5, 3}, { 3, 6}, { 1, 7}, { 3, 8}, /* Row 15 */ + { 1, 5}, + { 1, 2}, { 2, 3}, { 3, 6}, { 1, 7}, { 4, 3}, { 3, 8}, { 3, 6}, { 1, 7}, /* Row 16 */ + { 2, 8}, { 1, 5}, + { 1, 2}, { 2, 3}, { 3, 7}, { 3, 3}, { 6, 8}, { 3, 7}, { 2, 8}, { 1, 5}, /* Row 17 */ + { 1, 2}, { 6, 3}, { 2, 8}, { 1, 9}, { 10, 8}, { 1, 5}, /* Row 18 */ + { 1, 1}, { 1, 3}, { 10, 8}, { 1, 9}, { 8, 8}, /* Row 19 */ + { 1, 10}, { 1, 1}, { 17, 5}, { 1, 8}, { 1, 1}, /* Row 20 */ }; /******************************************************************************************** From ad5146fbef9ae82d014345c2e02f8d35779e18ca Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 4 May 2012 02:56:02 +0000 Subject: [PATCH 030/390] Update NxWM colors; remove NxWidgets shelving git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4698 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 + libnxwidgets/include/cnxwidget.hxx | 72 +---- libnxwidgets/include/cwidgeteventhandler.hxx | 16 -- .../include/cwidgeteventhandlerlist.hxx | 12 - libnxwidgets/src/cnxwidget.cxx | 249 +----------------- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 34 --- nxwm/include/nxwmconfig.hxx | 6 +- 7 files changed, 20 insertions(+), 372 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 000fe2cda..570942828 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -22,3 +22,6 @@ need to "rewind" to the beginning of the image. * CRlePalettBitmap: Fixe a positioning problem. It was actually losing the last row of every image! +* CNxWidget: Removed support for "shelving" widgets. I will be removing + some lesser used feature over time in order to reduce the NxWidgets + footprint. diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index f46c2e73a..99e748f38 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -131,8 +131,7 @@ namespace NXWidgets enum CloseType { CLOSE_TYPE_CLOSE = 0, /**< Widgets should call the close() method */ - CLOSE_TYPE_HIDE = 1, /**< Widgets should call the hide() method */ - CLOSE_TYPE_SHELVE = 2 /**< Widgets should call the shelve() method */ + CLOSE_TYPE_HIDE = 1 /**< Widgets should call the hide() method */ }; /** @@ -158,7 +157,6 @@ namespace NXWidgets uint8_t hasFocus : 1; /**< True if the widget has focus. */ uint8_t dragging : 1; /**< True if the widget is being dragged. */ uint8_t deleted : 1; /**< True if the widget has been deleted. */ - uint8_t shelved : 1; /**< True if the widget has been shelved. */ uint8_t borderless : 1; /**< True if the widget is borderless. */ uint8_t draggable : 1; /**< True if the widget can be dragged. */ uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */ @@ -219,7 +217,6 @@ namespace NXWidgets CNxWidget *m_parent; /**< Pointer to the widget's parent. */ CNxWidget *m_focusedChild; /**< Pointer to the child widget that has focus. */ TNxArray m_children; /**< List of child widgets. */ - TNxArray m_shelvedWidgets; /**< List of shelved child widgets. */ // Visible regions @@ -281,16 +278,6 @@ namespace NXWidgets void closeChild(CNxWidget *widget); - /** - * Erase the supplied child widget and move it out of the main child - * list into the shelved list. The widget remains in memory and can - * be restored by calling "unshelve()" on the widget. - * - * @param widget The widget to hide. - */ - - void shelveChild(CNxWidget *widget); - /** * Redraws all regions of child widgets that fall within the invalidRects * regions. @@ -654,17 +641,6 @@ namespace NXWidgets return m_flags.dragging; } - /** - * Is the widget shelved? - * - * @return True if the widget is shelved. - */ - - inline const bool isShelved(void) const - { - return m_flags.shelved; - } - /** * Is the widget modal? Only true if the Widget singleton is also modal. * @@ -1171,27 +1147,6 @@ namespace NXWidgets void close(void); - /** - * Erases the widget, removes it from the main hierarchy and sets it to - * invisible. Widgets hidden in this way will be partioned off from - * other widgets and will no longer be processed. - * - * @return True if the widget was shelved. - * @see unshelve() - */ - - bool shelve(void); - - /** - * Moves the widget back into the hierarchy and redraws it. Widgets shown - * in this way will be unpartioned and will be processed again. - * - * @return True if the widget was unshelved. - * @see shelve() - */ - - bool unshelve(void); - /** * Draws the widget and makes it visible. * Does not steal focus from other widgets. @@ -1391,31 +1346,6 @@ namespace NXWidgets void moveChildToDeleteQueue(CNxWidget *widget); - /** - * Moves the supplied child widget to the shelved widget list. - * For framework use only. - * - * @param widget A pointer to the child widget. - * @return True if the widget was moved successfully. - * @see moveShelvedToChildList() - * @see hide() - */ - - bool moveChildToShelvedList(CNxWidget *widget); - - /** - * Moves the supplied child widget from the shelved list back - * to the child widget list. - * For framework use only. - * - * @param widget A pointer to the shelved widget. - * @return True if the widget was moved successfully. - * @see moveChildtoShelvedList() - * @see show() - */ - - bool moveShelvedToChildList(CNxWidget *widget); - /** * Sets the supplied widget as the focused child. The widget must * be a child of this widget. diff --git a/libnxwidgets/include/cwidgeteventhandler.hxx b/libnxwidgets/include/cwidgeteventhandler.hxx index 965b29f0f..d9f39ddf9 100644 --- a/libnxwidgets/include/cwidgeteventhandler.hxx +++ b/libnxwidgets/include/cwidgeteventhandler.hxx @@ -269,22 +269,6 @@ namespace NXWidgets virtual void handleDoubleClickEvent(const CWidgetEventArgs &e) { } - /** - * Handle a widget shelve event. - * - * @param e The event data. - */ - - virtual void handleShelveEvent(const CWidgetEventArgs &e) { } - - /** - * Handle a widget unshelve event. - * - * @param e The event data. - */ - - virtual void handleUnshelveEvent(const CWidgetEventArgs &e) { } - /** * Handle a widget action event. * diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx index 45e304554..ae9e17847 100644 --- a/libnxwidgets/include/cwidgeteventhandlerlist.hxx +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -305,18 +305,6 @@ namespace NXWidgets void raiseShowEvent(void); - /** - * Raise a shelve event to the event handler. - */ - - void raiseShelveEvent(void); - - /** - * Raise a unshelve event to the event handler. - */ - - void raiseUnshelveEvent(void); - /** * Raise an enable event to the event handler. */ diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index de84f1393..8b5d0cb57 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -173,7 +173,6 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_flags.drawingEnabled = false; m_flags.enabled = true; m_flags.erased = true; - m_flags.shelved = false; m_flags.visibleRegionCacheInvalid = true; m_flags.hidden = false; m_flags.modal = false; @@ -236,13 +235,6 @@ CNxWidget::~CNxWidget(void) m_children[0]->destroy(); } - // Delete shelved children - - while (m_shelvedWidgets.size() > 0) - { - m_shelvedWidgets[0]->destroy(); - } - // Remove ourselve from the controlled widget list m_widgetControl->removeControlledWidget(this); @@ -346,14 +338,14 @@ const bool CNxWidget::isDrawingEnabled(void) const { if (m_parent->isDrawingEnabled()) { - // Drawing is enabled if the widget is drawable, not deleted, and not shelved + // Drawing is enabled if the widget is drawable and not deleted - return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden)); } } else { - return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden)); } return false; @@ -373,14 +365,14 @@ const bool CNxWidget::isHidden(void) const { if (!m_parent->isHidden()) { - // Hidden if the widget is deleted, shelved or hidden + // Hidden if the widget is deleted or hidden - return (m_flags.deleted || m_flags.shelved || m_flags.hidden); + return (m_flags.deleted || m_flags.hidden); } } else { - return (m_flags.deleted || m_flags.shelved || m_flags.hidden); + return (m_flags.deleted || m_flags.hidden); } return true; @@ -400,14 +392,14 @@ const bool CNxWidget::isEnabled() const { if (m_parent->isEnabled()) { - // Enabled if the widget is enabled, not deleted, not shelved and not hidden + // Enabled if the widget is enabled, not deleted and not hidden - return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.hidden)); } } else { - return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.shelved) && (!m_flags.hidden)); + return (m_flags.enabled && (!m_flags.deleted) && (!m_flags.hidden)); } return false; @@ -682,79 +674,6 @@ void CNxWidget::close(void) } } -/** - * Erases the widget, removes it from the main hierarchy and sets it to - * invisible. Widgets hidden in this way will be partioned off from - * other widgets and will no longer be processed. - * - * @return True if the widget was shelved. - * @see unshelve() - */ - -bool CNxWidget::shelve(void) -{ - if (!m_flags.shelved) - { - m_widgetEventHandlers->raiseShelveEvent(); - m_widgetEventHandlers->disable(); - - m_flags.shelved = true; - m_flags.drawingEnabled = false; - - // Unset clicked widget if necessary - - CNxWidget *clickedWidget = m_widgetControl->getClickedWidget(); - if (clickedWidget == this) - { - release(clickedWidget->getX(), clickedWidget->getY()); - } - - // Ensure the widget isn't running modally - - stopModal(); - erase(); - - if (m_parent != (CNxWidget *)NULL) - { - m_parent->shelveChild(this); - } - return true; - } - - return false; -} - -/** - * Moves the widget back into the hierarchy and redraws it. Widgets shown - * in this way will be unpartioned and will be processed again. - * - * @return True if the widget was unshelved. - * @see shelve() - */ - -bool CNxWidget::unshelve(void) -{ - if (m_flags.shelved) - { - m_widgetEventHandlers->enable(); - m_widgetEventHandlers->raiseUnshelveEvent(); - - m_flags.drawingEnabled = true; - m_flags.shelved = false; - - if (m_parent != (CNxWidget *)NULL) - { - m_parent->moveShelvedToChildList(this); - m_parent->invalidateVisibleRectCache(); - } - - redraw(); - return true; - } - - return false; -} - /** * Draws the widget and makes it visible. * Does not steal focus from other widgets. @@ -1495,71 +1414,6 @@ void CNxWidget::moveChildToDeleteQueue(CNxWidget *widget) } } -/** - * Moves the supplied child widget to the shelved widget list. - * For framework use only. - * - * @param widget A pointer to the child widget. - * @return True if the widget was moved successfully. - * @see moveShelvedToChildList() - * @see hide() - */ - -bool CNxWidget::moveChildToShelvedList(CNxWidget *widget) -{ - // Locate widget in main vector - - for (int i = 0; i < m_children.size(); i++) - { - if (m_children[i] == widget) - { - // Add widget to shelved vector - - m_shelvedWidgets.push_back(widget); - - // Remove widget from main vector - - m_children.erase(i); - return true; - } - } - - return false; -} - -/** - * Moves the supplied child widget from the shelved list back - * to the child widget list. - * For framework use only. - * - * @param widget A pointer to the shelved widget. - * @return True if the widget was moved successfully. - * @see moveChildtoShelvedList() - * @see show() - */ - -bool CNxWidget::moveShelvedToChildList(CNxWidget *widget) -{ - // Locate widget in shelved vector - - for (int i = 0; i < m_shelvedWidgets.size(); i++) - { - if (m_shelvedWidgets[i] == widget) - { - // Add widget to end of main vector - - m_children.push_back(widget); - - // Remove widget from shelved vector - - m_shelvedWidgets.erase(i); - return true; - } - } - - return false; -} - /** * Sets the supplied widget as the focused child. The widget must * be a child of this widget. @@ -2037,24 +1891,6 @@ bool CNxWidget::removeChild(CNxWidget *widget) } } - // Try to locate in shelved vector - - for (int i = 0; i < m_shelvedWidgets.size(); i++) - { - if (m_shelvedWidgets[i] == widget) - { - // Divorce child from parent - - m_shelvedWidgets[i]->setParent((CNxWidget *)NULL); - - // Remove widget from shelved vector - - m_shelvedWidgets.erase(i); - widget->disableDrawing(); - return true; - } - } - return false; } @@ -2263,72 +2099,13 @@ void CNxWidget::closeChild(CNxWidget *widget) } /** - * Erase the supplied child widget and move it out of the main child - * list into the shelved list. The widget remains in memory and can - * be restored by calling "unshelve()" on the widget. + * Redraws all regions of child widgets that fall within the invalidRects + * regions. * - * @param widget The widget to hide. + * @param invalidRects List of invalid regions that need to be redrawn. + * @param sender Pointer to the widget that initiated the redraw. */ -void CNxWidget::shelveChild(CNxWidget *widget) -{ - if (widget == NULL) - { - return; - } - - // Ensure widget knows it is being shelved - - widget->shelve(); - - // Do we need to give another widget focus? - - if (m_focusedChild == widget) - { - m_focusedChild = (CNxWidget *)NULL; - m_widgetControl->clearFocusedWidget(this); - - // Try to choose highest widget - - for (int i = m_children.size() - 1; i > -1; i--) - { - if ((m_children[i] != widget) && (!m_children[i]->isHidden())) - { - m_focusedChild = m_children[i]; - } - } - - // Where should the focus go? - - if (m_focusedChild != NULL) - { - // Send focus to the new active widget - - m_focusedChild->focus(); - - // Route keyboard input to the focused widget - - m_widgetControl->setFocusedWidget(this); - } - else - { - // Give focus to this - - setFocusedWidget((CNxWidget *)NULL); - } - } - - moveChildToShelvedList(widget); -} - - /** - * Redraws all regions of child widgets that fall within the invalidRects - * regions. - * - * @param invalidRects List of invalid regions that need to be redrawn. - * @param sender Pointer to the widget that initiated the redraw. - */ - void CNxWidget::redrawDirtyChildren(TNxArray *invalidRects, CNxWidget *sender) { for (int i = m_children.size() - 1; i > -1 ; i--) diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index 48b762d0d..de8a31b4b 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -436,40 +436,6 @@ void CWidgetEventHandlerList::raiseShowEvent(void) } } -/** - * Raise a shelve event to the event handler. - */ - -void CWidgetEventHandlerList::raiseShelveEvent(void) -{ - if (isEnabled()) - { - CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) - { - m_widgetEventHandlers.at(i)->handleShelveEvent(e); - } - } -} - -/** - * Raise a unshelve event to the event handler. - */ - -void CWidgetEventHandlerList::raiseUnshelveEvent(void) -{ - if (isEnabled()) - { - CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) - { - m_widgetEventHandlers.at(i)->handleUnshelveEvent(e); - } - } -} - /** * Raise an enable event to the event handler. */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 8ac45fc72..9387e2713 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -138,7 +138,7 @@ #endif #ifndef CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR -# define CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR MKRGB(0,0,0) +# define CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR MKRGB(35,58,73) #endif /** @@ -291,11 +291,11 @@ #endif #ifndef CONFIG_NXWM_NXCONSOLE_WCOLOR -# define CONFIG_NXWM_NXCONSOLE_WCOLOR MKRGB(192,192,192) +# define CONFIG_NXWM_NXCONSOLE_WCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_NXWM_NXCONSOLE_FONTCOLOR -# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR MKRGB(0,0,0) +# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR CONFIG_NXWM_DEFAULT_FONTCOLOR #endif #ifndef CONFIG_NXWM_NXCONSOLE_FONTID From 3f530a5bb52674e7d9c43b26490d1f6b940aa32f Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 4 May 2012 20:48:52 +0000 Subject: [PATCH 031/390] Updated NxWM widgets, several NX, NxWidgets, and NxWM bug fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4699 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +- libnxwidgets/include/cnxwidget.hxx | 55 -------- libnxwidgets/src/cnxwidget.cxx | 19 --- nxwm/Makefile | 2 +- nxwm/images/cmd.png | Bin 0 -> 264 bytes nxwm/images/play.png | Bin 0 -> 550 bytes nxwm/include/nxwmconfig.hxx | 18 +++ nxwm/include/nxwmglyphs.hxx | 4 +- nxwm/src/cnxconsole.cxx | 2 +- nxwm/src/cstartwindow.cxx | 2 +- nxwm/src/glyph_cmd.cxx | 181 +++++++++++++++++++++++++ nxwm/src/glyph_minimize.cxx | 32 ++++- nxwm/src/glyph_play.cxx | 210 +++++++++++++++++++++++++++++ nxwm/src/glyph_stop.cxx | 33 ++++- 14 files changed, 471 insertions(+), 91 deletions(-) create mode 100755 nxwm/images/cmd.png create mode 100755 nxwm/images/play.png create mode 100644 nxwm/src/glyph_cmd.cxx create mode 100644 nxwm/src/glyph_play.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 570942828..1d4c69c9e 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -22,6 +22,8 @@ need to "rewind" to the beginning of the image. * CRlePalettBitmap: Fixe a positioning problem. It was actually losing the last row of every image! -* CNxWidget: Removed support for "shelving" widgets. I will be removing +* CNxWidget: Removed support for "shelving" widgets. I will be removing some lesser used feature over time in order to reduce the NxWidgets footprint. +* CNxWidget: Removed support for reference constants and close types. + The goal is to ge the base widget class as small as possible. \ No newline at end of file diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 99e748f38..ab44b9d42 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -123,17 +123,6 @@ namespace NXWidgets { public: - /** - * Enum describing the way other widgets should behave when they try to - * close this widget. - */ - - enum CloseType - { - CLOSE_TYPE_CLOSE = 0, /**< Widgets should call the close() method */ - CLOSE_TYPE_HIDE = 1 /**< Widgets should call the hide() method */ - }; - /** * Enum listing flags that can be set in the constructor's "flags" parameter. */ @@ -184,7 +173,6 @@ namespace NXWidgets protected: CWidgetControl *m_widgetControl; /**< The controlling widget for the display */ CRect m_rect; /**< Rectange bounding the widget. */ - uint32_t m_refcon; /**< Identifying number of the widget. */ // Dragging variables @@ -221,7 +209,6 @@ namespace NXWidgets // Visible regions CRectCache *m_rectCache; /**< List of the widget's visible regions. */ - CloseType m_closeType; /**< Type of close method that should be called for the widget. */ WidgetBorderSize m_borderSize; /**< Size of the widget borders. */ /** @@ -507,28 +494,6 @@ namespace NXWidgets const nxgl_coord_t getRelativeY(void) const; - /** - * Get the reference constant for this widget. - * @return The reference constant. - */ - - inline const uint32_t getRefcon(void) const - { - return m_refcon; - } - - /** - * Get the type of close routine that should be called by other widgets - * interacting with this widget. - * - * @return The close type of this widget. - */ - - inline const CloseType getCloseType(void) - { - return m_closeType; - } - /** * Is the widget active? * A value of true indicates that this widget has focus or is an ancestor @@ -900,15 +865,6 @@ namespace NXWidgets return m_style.colors.selectedText; } - /** - * Sets this widget's reference constant. This should be unique, - * at least amongst this widget's siblings. - * - * @param refcon The reference constant. - */ - - uint32_t setRefcon(uint32_t refcon); - /** * Sets this widget's border state. * @@ -1091,17 +1047,6 @@ namespace NXWidgets m_style.colors.selectedText = color; } - /** - * Sets the close type other widgets should use when closing this widget. - * - * @param closeType The close type to use. - */ - - inline void setCloseType(const CloseType closeType) - { - m_closeType = closeType; - } - /** * Sets the font. * diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 8b5d0cb57..483309832 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -189,10 +189,6 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_lastClickY = 0; m_doubleClickBounds = DOUBLE_CLICK_BOUNDS; - // Set other default values - - m_refcon = 0; - // Set border size to 1 line m_borderSize.top = 1; @@ -200,7 +196,6 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_borderSize.bottom = 1; m_borderSize.left = 1; - m_closeType = CLOSE_TYPE_CLOSE; m_rectCache = new CRectCache(this); m_widgetEventHandlers = new CWidgetEventHandlerList(this); } @@ -506,20 +501,6 @@ TNxArray *CNxWidget::getForegroundRegions(void) return m_rectCache->getForegroundRegions(); } -/** - * Sets this widget's reference constant. This should be unique, - * at least amongst this widget's siblings. - * - * @param refcon The reference constant. - */ - -uint32_t CNxWidget::setRefcon(uint32_t refcon) -{ - uint32_t old = m_refcon; - m_refcon = refcon; - return old; -} - /** * Sets this widget's border state. * diff --git a/nxwm/Makefile b/nxwm/Makefile index 4f13ca362..badc5eb21 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -44,7 +44,7 @@ CSRCS = # Window Manager CXXSRCS = capplicationwindow.cxx cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx # Images -CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_start.cxx glyph_stop.cxx +CXXSRCS += glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx glyph_stop.cxx SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/images/cmd.png b/nxwm/images/cmd.png new file mode 100755 index 0000000000000000000000000000000000000000..3e6cf667ce16b174f1ee250bcbff147e310da124 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^l0YoR!2~3C-CghyNHG=%xjQkeJ16rJ$l)yTh%9Dc z;1&j9Muu5)B!GhKC7!;n>~~mM1TD>s3ifXY3eEC#aSX9Iy>-e%US>s(R^6R}Z;aj@ zl6Gq^oMGfspYd+pT8ZW_e+>;kw6;G`elBCf($F-&ugv9{f;Z<^(;YQlJ0sLHBzCQ^ zub2{5wbj~SdU?)-IC10m!nVI%`|4h1mz5WM+0B(E!)t!JO*uD^*W%JM)um4kWG#?b zT-dI*pfi#|D?37vLGY{nF82BjCfVI}Cnp%co_>A$`<3SYAI$`!r|-7_x{|@u)z4*} HQ$iB}Mb=)X literal 0 HcmV?d00001 diff --git a/nxwm/images/play.png b/nxwm/images/play.png new file mode 100755 index 0000000000000000000000000000000000000000..ab7c29249b4c097bd420334358d6e44e4cccf3fa GIT binary patch literal 550 zcmV+>0@?kEP)P000>X1^@s6#OZ}&00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iye& z5hOaqs-J)W00E{+L_t(Y$Gw&@Zo@DPMIVja!=r&5!efDU%OMIRTeI~B>DaA9?vQL5 zI_3~YH0mVmAk~U&Nm0?XoC2F6`N_{ui>fMrY>OHvF#<=xUOjAq6=-+6Mkyf?Bk=A6 z;)0Gg0G~c_5Bge2rWxac@`$p_y2O6#yx$DT*qSr&47$?#cAgz-{m?uTF0OLcC&xo(v|zF4>6d=Y%C<#4%|~ zn8K{Y2y6rEn(LO()i0PF1v#dXX{XSKy;_XBVC$HaN|r>{h4H- za9Ok8N}rq@9#_W@h~MrOH#e7 olSCqDu7bBg1gp;Te|&d+0nr@;tzsH84*&oF07*qoM6N<$f<)fw&j0`b literal 0 HcmV?d00001 diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 9387e2713..57566b2d4 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -248,6 +248,7 @@ * * CONFIG_NXWM_STARTWINDOW_VSPACING - Vertical spacing. Default: 2 pixels * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows + * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon */ #ifndef CONFIG_NXWM_STARTWINDOW_VSPACING @@ -258,6 +259,14 @@ # define CONFIG_NXWM_STARTWINDOW_HSPACING (2) #endif +/** + * The start window glyph + */ + +#ifndef CONFIG_NXWM_STARTWINDOW_ICON +# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap +#endif + /* NxConsole Window *********************************************************/ /** * NxConsole Window Configuration @@ -275,6 +284,7 @@ * 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 + * CONFIG_NXWM_NXCONSOLE_ICON - The glyph to use as the NxConsole icon */ #ifndef CONFIG_NXWM_NXCONSOLE_PRIO @@ -302,6 +312,14 @@ # define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID #endif +/** + * The NxConsole window glyph + */ + +#ifndef CONFIG_NXWM_NXCONSOLE_ICON +# define CONFIG_NXWM_NXCONSOLE_ICON NxWM::g_cmdBitmap +#endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 198fe9f26..6a850179c 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -57,8 +57,10 @@ namespace NxWM { - extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index de44ab7f0..8898b8bcb 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -169,7 +169,7 @@ CApplicationWindow *CNxConsole::getWindow(void) const NXWidgets::IBitmap *CNxConsole::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = - new NXWidgets::CRlePaletteBitmap(&g_nshBitmap); + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXCONSOLE_ICON); return bitmap; } diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index f25ed8d2b..a29f1f785 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -120,7 +120,7 @@ CApplicationWindow *CStartWindow::getWindow(void) const NXWidgets::IBitmap *CStartWindow::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = - new NXWidgets::CRlePaletteBitmap(&g_startBitmap); + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_STARTWINDOW_ICON); return bitmap; } diff --git a/nxwm/src/glyph_cmd.cxx b/nxwm/src/glyph_cmd.cxx new file mode 100644 index 000000000..816c888c5 --- /dev/null +++ b/nxwm/src/glyph_cmd.cxx @@ -0,0 +1,181 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_cmd.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 22 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 8 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x909090, 0x000000, 0xb4fcfc, 0xb4d8fc, 0x6cb4fc, 0x6c6c6c, 0xfcfcfc, 0x484848 +}; + +static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xababab, 0x3f3f3f, 0xc6fcfc, 0xc6e1fc, 0x90c6fc, 0x909090, 0xfcfcfc, 0x757575 +}; +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x9492, 0x0000, 0xb7ff, 0xb6df, 0x6dbf, 0x6b6d, 0xffff, 0x4a49 +}; + +static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xad55, 0x39e7, 0xc7ff, 0xc71f, 0x963f, 0x9492, 0xffff, 0x73ae +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x90, 0x00, 0xe6, 0xd1, 0xa6, 0x6c, 0xfc, 0x48 +}; + +static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xab, 0x3f, 0xeb, 0xdc, 0xbc, 0x90, 0xfc, 0x75 +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x92, 0x00, 0xbf, 0xbb, 0x77, 0x6d, 0xff, 0x49 +}; + +static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xb6, 0x24, 0xdf, 0xdf, 0x9b, 0x92, 0xff, 0x6d +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_cmdRleEntries[] = +{ + { 24, 0}, { 1, 1}, /* Row 0 */ + { 24, 0}, { 1, 1}, /* Row 1 */ + { 2, 0}, { 1, 2}, { 13, 3}, { 7, 4}, { 1, 0}, { 1, 1}, /* Row 2 */ + { 2, 0}, { 3, 3}, { 18, 4}, { 1, 0}, { 1, 1}, /* Row 3 */ + { 2, 0}, { 3, 3}, { 18, 4}, { 1, 0}, { 1, 1}, /* Row 4 */ + { 24, 0}, { 1, 1}, /* Row 5 */ + { 1, 0}, { 22, 1}, { 1, 0}, { 1, 1}, /* Row 6 */ + { 1, 0}, { 1, 1}, { 21, 5}, { 1, 0}, { 1, 1}, /* Row 7 */ + { 1, 0}, { 1, 1}, { 21, 5}, { 1, 0}, { 1, 1}, /* Row 8 */ + { 1, 0}, { 1, 1}, { 2, 5}, { 1, 6}, { 18, 5}, { 1, 0}, { 1, 1}, /* Row 9 */ + { 1, 0}, { 1, 1}, { 3, 5}, { 1, 6}, { 17, 5}, { 1, 0}, { 1, 1}, /* Row 10 */ + { 1, 0}, { 1, 1}, { 4, 5}, { 1, 6}, { 16, 5}, { 1, 0}, { 1, 1}, /* Row 11 */ + { 1, 0}, { 1, 1}, { 5, 5}, { 1, 6}, { 15, 5}, { 1, 0}, { 1, 1}, /* Row 12 */ + { 1, 0}, { 1, 1}, { 6, 5}, { 1, 6}, { 14, 5}, { 1, 0}, { 1, 1}, /* Row 13 */ + { 1, 0}, { 1, 1}, { 5, 5}, { 1, 6}, { 1, 7}, { 14, 5}, { 1, 0}, { 1, 1}, /* Row 14 */ + { 1, 0}, { 1, 1}, { 4, 5}, { 1, 6}, { 1, 7}, { 15, 5}, { 1, 0}, { 1, 1}, /* Row 15 */ + { 1, 0}, { 1, 1}, { 3, 5}, { 1, 6}, { 1, 7}, { 4, 5}, { 9, 6}, { 3, 5}, /* Row 16 */ + { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 2, 5}, { 1, 6}, { 1, 7}, { 6, 5}, { 9, 7}, { 2, 5}, /* Row 17 */ + { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 2, 5}, { 1, 7}, { 18, 5}, { 1, 0}, { 1, 1}, /* Row 18 */ + { 1, 0}, { 1, 1}, { 21, 5}, { 1, 0}, { 1, 1}, /* Row 19 */ + { 24, 0}, { 1, 1}, /* Row 20 */ + { 25, 1}, /* Row 21 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_cmdNormalLut, // Index 0: Unselected LUT + g_cmdBrightlLut, // Index 1: Selected LUT + }, + g_cmdRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 1f375ab13..4dd95f9f2 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -70,20 +70,30 @@ using namespace NxWM; #if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -static const uint32_t g_minimizeLut[BITMAP_NLUTCODES] = +static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { 0x2448b4, 0x486cd8, 0x0024b4, 0x0024d8, 0x242490, 0x0000b4, 0xfcfcfc, 0xd8fcfc /* Codes 0-7 */ }; +static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = +{ + 0x5a75c6, 0x7590e1, 0x3f5ac6, 0x3f5ae1, 0x5a5aab, 0x3f3fc6, 0xfcfcfc, 0xe1fcfc /* Codes 0-7 */ +}; + /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ #elif CONFIG_NXWIDGETS_BPP == 16 -static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = +static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { 0x2256, 0x4b7b, 0x0136, 0x013b, 0x2132, 0x0016, 0xffff, 0xdfff /* Codes 0-7 */ }; +static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = +{ + 0x5bb8, 0x749c, 0x3ad8, 0x3adc, 0x5ad5, 0x39f8, 0xffff, 0xe7ff /* Codes 0-7 */ +}; + /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used * to lookup an 8-bit value. There is no savings in that! It would be better to just put * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these @@ -96,20 +106,30 @@ static const uint16_t g_minimizeLut[BITMAP_NLUTCODES] = /* 8-bit Greyscale */ -static const uint8_t g_minimizeLut[BITMAP_NLUTCODES] = +static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { 0x49, 0x6d, 0x29, 0x2d, 0x30, 0x14, 0xfc, 0xf1 /* Codes 0-7 */ }; +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = +{ + 0x76, 0x91, 0x5e, 0x61, 0x63, 0x4e, 0xfc, 0xf3 /* Codes 0-7 */ +}; + # else /* CONFIG_NXWIDGETS_GREYSCALE */ /* RGB8 (332) Colors */ -static const nxgl_mxpixel_t g_minimizeLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = +{ + 0x4f, 0x73, 0x2b, 0x2b, 0x4a, 0x27, 0xff, 0xff /* Codes 0-7 */ +}; + # endif #else # error "Unsupport pixel format" @@ -152,8 +172,8 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_minimizeLut, // Index 0: Unselected LUT - g_minimizeLut, // Index 1: Selected LUT + g_minimizeNormalLut, // Index 0: Unselected LUT + g_minimizeBrightLut, // Index 1: Selected LUT }, g_minimizeRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_play.cxx b/nxwm/src/glyph_play.cxx new file mode 100644 index 000000000..a6970b2e0 --- /dev/null +++ b/nxwm/src/glyph_play.cxx @@ -0,0 +1,210 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_play.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 25 +#define BITMAP_NLUTCODES 6 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00d800, 0x008400, 0x006800, 0x00ac00, 0x004800, /* Codes 1-5 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3fe13f, 0x3fa23f, 0x3f8d3f, 0x3fc03f, 0x3f753f /* Codes 1-5 */ +}; +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x06c0, 0x0420, 0x0340, 0x0560, 0x0240, /* Codes 0-5 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3f07, 0x3d07, 0x3c67, 0x3e07, 0x3ba7, /* Codes 0-5 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x7e, 0x4d, 0x3d, 0x64, 0x2a /* Codes 1-5 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x9e, 0x79, 0x6c, 0x8a, 0x5e /* Codes 1-5 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x18, 0x10, 0x0c, 0x14, 0x08 /* Codes 0-5 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3c, 0x34, 0x30, 0x38, 0x2c /* Codes 0-5 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = +{ + { 25, 0}, /* Row 0 */ + { 9, 0}, { 1, 1}, { 1, 2}, { 3, 3}, { 1, 2}, { 1, 1}, { 9, 0}, /* Row 1 */ + { 7, 0}, { 1, 1}, { 1, 3}, { 2, 2}, { 3, 1}, { 1, 4}, { 1, 3}, { 1, 5}, /* Row 2 */ + { 1, 2}, { 7, 0}, + { 6, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 7, 0}, { 1, 1}, { 1, 5}, { 1, 3}, /* Row 3 */ + { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 4}, { 9, 0}, { 1, 1}, { 1, 2}, /* Row 4 */ + { 1, 5}, { 1, 3}, { 4, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 0}, { 1, 1}, { 10, 0}, /* Row 5 */ + { 1, 4}, { 1, 5}, { 1, 2}, { 3, 0}, + { 3, 0}, { 1, 3}, { 1, 5}, { 3, 0}, { 2, 1}, { 10, 0}, { 2, 3}, { 1, 4}, /* Row 6 */ + { 2, 0}, + { 2, 0}, { 1, 1}, { 1, 5}, { 1, 4}, { 3, 0}, { 1, 1}, { 1, 4}, { 2, 1}, /* Row 7 */ + { 8, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 2, 0}, + { 2, 0}, { 1, 3}, { 1, 2}, { 4, 0}, { 1, 1}, { 5, 4}, { 7, 0}, { 1, 1}, /* Row 8 */ + { 1, 5}, { 1, 2}, { 1, 0}, + { 1, 0}, { 1, 1}, { 1, 3}, { 1, 4}, { 4, 0}, { 1, 1}, { 7, 4}, { 6, 0}, /* Row 9 */ + { 1, 2}, { 1, 3}, { 1, 0}, + { 1, 1}, { 1, 3}, { 1, 5}, { 5, 0}, { 1, 1}, { 9, 4}, { 4, 0}, { 1, 4}, /* Row 10 */ + { 1, 2}, { 1, 4}, + { 1, 1}, { 1, 3}, { 1, 4}, { 5, 0}, { 1, 1}, { 11, 4}, { 2, 0}, { 1, 4}, /* Row 11 */ + { 1, 2}, { 1, 4}, + { 1, 1}, { 1, 5}, { 1, 1}, { 5, 0}, { 1, 4}, { 9, 2}, { 2, 3}, { 1, 5}, /* Row 12 */ + { 1, 0}, { 1, 4}, { 1, 2}, { 1, 4}, + { 1, 1}, { 1, 3}, { 1, 1}, { 5, 0}, { 1, 4}, { 7, 2}, { 3, 3}, { 1, 5}, /* Row 13 */ + { 2, 0}, { 1, 4}, { 1, 2}, { 1, 4}, + { 1, 1}, { 1, 3}, { 1, 4}, { 5, 0}, { 1, 4}, { 5, 2}, { 3, 3}, { 1, 5}, /* Row 14 */ + { 4, 0}, { 1, 2}, { 1, 3}, { 1, 4}, + { 1, 0}, { 1, 2}, { 1, 3}, { 5, 0}, { 1, 4}, { 3, 2}, { 3, 3}, { 1, 5}, /* Row 15 */ + { 5, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 1, 0}, + { 2, 0}, { 1, 5}, { 1, 4}, { 4, 0}, { 1, 4}, { 2, 2}, { 2, 3}, { 1, 5}, /* Row 16 */ + { 7, 0}, { 1, 2}, { 1, 5}, { 2, 0}, + { 2, 0}, { 1, 2}, { 1, 5}, { 1, 1}, { 3, 0}, { 1, 4}, { 2, 3}, { 1, 5}, /* Row 17 */ + { 8, 0}, { 1, 1}, { 1, 3}, { 1, 2}, { 2, 0}, + { 3, 0}, { 1, 2}, { 1, 3}, { 3, 0}, { 1, 3}, { 1, 5}, { 9, 0}, { 1, 1}, /* Row 18 */ + { 2, 3}, { 3, 0}, + { 3, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 2, 0}, { 1, 5}, { 9, 0}, { 1, 1}, /* Row 19 */ + { 1, 4}, { 1, 5}, { 4, 0}, + { 4, 0}, { 1, 1}, { 1, 5}, { 1, 3}, { 10, 0}, { 1, 1}, { 1, 3}, { 1, 5}, /* Row 20 */ + { 5, 0}, + { 6, 0}, { 1, 2}, { 1, 5}, { 1, 4}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 21 */ + { 1, 2}, { 6, 0}, + { 7, 0}, { 1, 3}, { 3, 5}, { 3, 3}, { 2, 5}, { 1, 3}, { 1, 2}, { 7, 0}, /* Row 22 */ + { 9, 0}, { 1, 4}, { 2, 2}, { 1, 3}, { 2, 2}, { 1, 4}, { 9, 0}, /* Row 23 */ + { 25, 0}, /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_playNormalLut, // Index 0: Unselected LUT + g_playBrightlLut, // Index 1: Selected LUT + }, + g_playRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index 9081b48a2..a60b75ce8 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -70,22 +70,34 @@ using namespace NxWM; #if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -static const uint32_t g_stopLut[BITMAP_NLUTCODES] = +static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = { 0xd8d8d8, 0xfc6c6c, 0xfcb4b4, 0xd80000, 0xfc0000, 0x902424, 0xfcfcfc, 0xd8fcfc, /* Codes 0-7 */ 0xb40000, 0xb40024, 0xfcd8d8 /* Codes 8-10 */ }; +static const uint32_t g_stopBrightLut[BITMAP_NLUTCODES] = +{ + 0xe1e1e1, 0xfc9090, 0xfcc6c6, 0xe13f3f, 0xfc3f3f, 0xab5a5a, 0xfcfcfc, 0xe1fcfc, /* Codes 0-7 */ + 0xc63f3f, 0xc63f5a, 0xfce1e1 /* Codes 8-10 */ +}; + /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ #elif CONFIG_NXWIDGETS_BPP == 16 -static const uint16_t g_stopLut[BITMAP_NLUTCODES] = +static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = { 0xdedb, 0xfb6d, 0xfdb6, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb000, 0xb004, /* Codes 0-9 */ 0xfedb /* Codes 10-10 */ }; +static const uint16_t g_stopBrightLut[BITMAP_NLUTCODES] = +{ + 0xe71c, 0xfc92, 0xfe38, 0xe1e7, 0xf9e7, 0xaacb, 0xffff, 0xe7ff, 0xc1e7, 0xc1eb, /* Codes 0-9 */ + 0xff1c /* Codes 10-10 */ +}; + /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used * to lookup an 8-bit value. There is no savings in that! It would be better to just put * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these @@ -98,21 +110,30 @@ static const uint16_t g_stopLut[BITMAP_NLUTCODES] = /* 8-bit Greyscale */ -static const uint8_t g_stopLut[BITMAP_NLUTCODES] = +static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = { 0xd8, 0x97, 0xc9, 0x40, 0x4b, 0x44, 0xfc, 0xf1, 0x35, 0x39, 0xe2 /* Codes 0-10 */ +}; +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = +{ + 0xe1, 0xb0, 0xd6, 0x6f, 0x77, 0x72, 0xfc, 0xf3, 0x67, 0x6a, 0xe9 /* Codes 0-10 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ /* RGB8 (332) Colors */ -static const nxgl_mxpixel_t g_stopLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = { 0xdb, 0xed, 0xf6, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xa0, 0xfb /* Codes 0-10 */ }; +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xf2, 0xfb, 0xe4, 0xe4, 0xa9, 0xff, 0xff, 0xc4, 0xc5, 0xff /* Codes 0-10 */ +}; + # endif #else # error "Unsupport pixel format" @@ -166,8 +187,8 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap = BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_stopLut, // Index 0: Unselected LUT - g_stopLut, // Index 1: Selected LUT + g_stopNormalLut, // Index 0: Unselected LUT + g_stopBrightLut, // Index 1: Selected LUT }, g_stopRleEntries // data - Pointer to the beginning of the RLE data }; From c27e15cfc659c3a68beb9db82242a2468b84e7e9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 5 May 2012 17:27:03 +0000 Subject: [PATCH 032/390] Beginning of an SMTPE11 touchscreen/IO expander driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4700 42af7a65-404d-4744-a932-0658087f49c3 --- README.txt | 182 ++++++++++++++++++++++++++--------------------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/README.txt b/README.txt index 99b1d8fda..e4ed3be3a 100755 --- a/README.txt +++ b/README.txt @@ -1,91 +1,91 @@ -NXWidgets -========= - -In order to better support NuttX based platforms, a special graphical user -interface has been created called NXWidgets. NXWidgets is written in C++ -and integrates seamlessly with the NuttX NX graphics subsystem in order -to provide graphic objects, or "widgets," in the NX Graphics Subsystem - -Some of the features of NXWidgets include: - -o Conservative C++ - - NXWidgets is written entirely in C++ but using only selected “embedded - friendly” C++ constructs that are fully supported under NuttX. No - additional C++ support libraries are required. - -o NX Integration - - NXWidgets integrate seamlessly with the NX graphics system. Think of the - X server under Linux … the NX graphics system is like a tiny X server - that provides windowing under NuttX. By adding NXWidgets, you can support - graphics objects like buttons and text boxes in the NX windows and toolbars. - -o Small Footprint - - NXWidgets is tailored for use MCUs in embedded applications. It is ideally - suited for mid- and upper-range of most MCU families. A complete NXWidgets - is possible in as little as 40Kb of FLASH and maybe 4Kb of SRAM. - -o Output Devices - - NXWidgets will work on the high-end frame buffer devices as well as on LCDs - connected via serial or parallel ports to a small MCU. - -o Input Devices - - NXWidgets will accept position and selection inputs from a mouse or a - touchscreen. It will also support character input from a keyboard such as a - USB keyboard. NXWidgets supports on very special widget called CKeypad that - will provide keyboard input via an on-screen keypad that can be operated - via mouse or touchscreen inputs. - -o Many Graphic Objects - - Some of the graphic objects supported by NXWidgets include labels, buttons, - text boxes, button arrays, check boxes, cycle buttons, images, sliders, - scrollable list boxes, progress bars, and more. - -Note: Many of the fundamental classed in NxWidgets derive from the Antony -Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style -license. See the COPYING file for details. - -Directory Structure -=================== - -libnxwidgets - - The source code, header files, and build environment for NxWidgets is - provided in this directory. - -UnitTests - - Provides a collection of unit-level tests for many of the individual - widgets provided by libnxwidgets. - -nxwm - - This directory holds a tiny desktop for small embedded devices with a - touchscreen,. NxWM. NxWM is truly multiple window manager but only one - window is displayed at a time. This simplification helps performance on - LCD based products (in the same way that a tiled window manager helps) - and also makes the best use of small displays. It is awkward from a - human factors point-of-view trying to manage multiple windows on a - small display. - - The window manager consists of a task bar with icons representing the - running tasks. If you touch the tasks icon, it comes to the top. Each - window has a toolbar with (1) a title, (2) a minimize button, and (3) a - stop application button using the standard icons for these things. - - There is always a start window that is available in the task bar. When - you touch the start window icon, it brings up the start window containing - icons representing all of the available applications. If you touch an - icon in the start window, it will be started and added to the task bar. - - There is a base class that defines an add-on application and an - interface that supports incorporation of new application. The only - application that is provided is NxConsole. This is an NSH session - running in a window. I should be able to select the NX icon in the start - menu and create as many NSH sessions in windows as I want. (keybard input - still comes through serial). +NXWidgets +========= + +In order to better support NuttX based platforms, a special graphical user +interface has been created called NXWidgets. NXWidgets is written in C++ +and integrates seamlessly with the NuttX NX graphics subsystem in order +to provide graphic objects, or "widgets," in the NX Graphics Subsystem + +Some of the features of NXWidgets include: + +o Conservative C++ + + NXWidgets is written entirely in C++ but using only selected “embedded + friendly” C++ constructs that are fully supported under NuttX. No + additional C++ support libraries are required. + +o NX Integration + + NXWidgets integrate seamlessly with the NX graphics system. Think of the + X server under Linux … the NX graphics system is like a tiny X server + that provides windowing under NuttX. By adding NXWidgets, you can support + graphics objects like buttons and text boxes in the NX windows and toolbars. + +o Small Footprint + + NXWidgets is tailored for use MCUs in embedded applications. It is ideally + suited for mid- and upper-range of most MCU families. A complete NXWidgets + is possible in as little as 40Kb of FLASH and maybe 4Kb of SRAM. + +o Output Devices + + NXWidgets will work on the high-end frame buffer devices as well as on LCDs + connected via serial or parallel ports to a small MCU. + +o Input Devices + + NXWidgets will accept position and selection inputs from a mouse or a + touchscreen. It will also support character input from a keyboard such as a + USB keyboard. NXWidgets supports on very special widget called CKeypad that + will provide keyboard input via an on-screen keypad that can be operated + via mouse or touchscreen inputs. + +o Many Graphic Objects + + Some of the graphic objects supported by NXWidgets include labels, buttons, + text boxes, button arrays, check boxes, cycle buttons, images, sliders, + scrollable list boxes, progress bars, and more. + +Note: Many of the fundamental classed in NxWidgets derive from the Antony +Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style +license. See the COPYING file for details. + +Directory Structure +=================== + +libnxwidgets + + The source code, header files, and build environment for NxWidgets is + provided in this directory. + +UnitTests + + Provides a collection of unit-level tests for many of the individual + widgets provided by libnxwidgets. + +nxwm + + This directory holds a tiny desktop for small embedded devices with a + touchscreen,. NxWM. NxWM is true multiple window manager but only one + window is displayed at a time. This simplification helps performance on + LCD based products (in the same way that a tiled window manager helps) + and also makes the best use of small displays. It is awkward from a + human factors point-of-view trying to manage multiple windows on a + small display. + + The window manager consists of a task bar with icons representing the + running tasks. If you touch the tas'ks icon, it comes to the top. Each + window has a toolbar with (1) a title, (2) a minimize button, and (3) a + stop application button using the standard icons for these things. + + There is always a start window that is available in the task bar. When + you touch the start window icon, it brings up the start window containing + icons representing all of the available applications. If you touch an + icon in the start window, it will be started and added to the task bar. + + There is a base class that defines an add-on application and an + interface that supports incorporation of new application. The only + application that is provided is NxConsole. This is an NSH session + running in a window. You should be able to select the NX icon in the start + menu and create as many NSH sessions in windows as you want. (keybard input + still comes through serial). From 9eaedaec1ee2dfaa1f3a21e0ed3afda7cc2cea2a Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 02:37:24 +0000 Subject: [PATCH 033/390] Fix uninitialized pointer in CNxTKWindow git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4706 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++- libnxwidgets/src/cnxtkwindow.cxx | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1d4c69c9e..cff96bca0 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -26,4 +26,6 @@ some lesser used feature over time in order to reduce the NxWidgets footprint. * CNxWidget: Removed support for reference constants and close types. - The goal is to ge the base widget class as small as possible. \ No newline at end of file + The goal is to ge the base widget class as small as possible. +* CNxTkWindow: Fix uninitialized pointer value. + diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 520896fa2..8b880a618 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -66,9 +66,18 @@ using namespace NXWidgets; */ CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) - : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hNxTkWindow(0), - m_widgetControl(pWidgetControl) + : CCallback(pWidgetControl) { + // Save construction values + + m_hNxServer = hNxServer; + m_widgetControl = pWidgetControl; + + // Nullify uninitilized pointers + + m_hNxTkWindow = (NXTKWINDOW )0; + m_toolbar = (CNxToolbar *)0; + // Create the CGraphicsPort instance for this window m_widgetControl->createGraphicsPort(static_cast(this)); From 4e9d0ebfeabced818152b2fd6093f23a9b70cf33 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 15:05:07 +0000 Subject: [PATCH 034/390] NxWidgets: Fix a potential deadlock that can occur waiting for toolbard geometry data git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4709 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/cwidgetcontrol.hxx | 74 ++++++++++++++++++------- libnxwidgets/src/cnxtkwindow.cxx | 6 ++ libnxwidgets/src/cwidgetcontrol.cxx | 59 ++++++++++++-------- 3 files changed, 96 insertions(+), 43 deletions(-) diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 7725dec2c..e33757a95 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -303,6 +303,16 @@ namespace NXWidgets #endif } + /** + * Wait for geometry data + */ + + inline void waitGeoData(void) + { + takeGeoSem(); + giveGeoSem(); + } + /** * Clear all mouse events */ @@ -535,11 +545,11 @@ namespace NXWidgets /** * This event means that new mouse data is available for the window. * - * @param pPos The (x,y) position of the mouse. + * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. */ - void newMouseEvent(FAR const struct nxgl_point_s *pPos, uint8_t buttons); + void newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons); /** * This event means that keyboard/keypad data is available for the window. @@ -570,71 +580,93 @@ namespace NXWidgets } /** - * Get the window bounding box in physical display coordinated. + * Get the window bounding box in physical display coordinated. This + * method may need to wait until geometry data is available. * * @return This function returns the window handle. */ inline CRect getWindowBoundingBox(void) { - takeGeoSem(); - CRect rect(&m_bounds); - giveGeoSem(); - return rect; + waitGeoData(); + return CRect(&m_bounds); + } + + inline void getWindowBoundingBox(FAR struct nxgl_rect_s *bounds) + { + waitGeoData(); + nxgl_rectcopy(bounds, &m_bounds); } /** - * Get the position of the window (as reported by the last NX callback). + * Get the position of the window (as reported by the last NX callback). This + * method may need to wait until geometry data is available. * * @return The position. */ - inline bool getWindowPosition(FAR struct nxgl_point_s *pPos) + inline bool getWindowPosition(FAR struct nxgl_point_s *pos) { - takeGeoSem(); - pPos->x = m_pos.x; - pPos->x = m_pos.y; - giveGeoSem(); + waitGeoData(); + pos->x = m_pos.x; + pos->x = m_pos.y; return true; } /** - * Get the size of the window (as reported by the last NX callback). + * Get the size of the window (as reported by the last NX callback). This + * method may need to wait until geometry data is available. * * @return The size. */ - inline bool getWindowSize(FAR struct nxgl_size_s *pSize) + inline bool getWindowSize(FAR struct nxgl_size_s *size) { - takeGeoSem(); - pSize->h = m_size.h; - pSize->w = m_size.w; - giveGeoSem(); + waitGeoData(); + size->h = m_size.h; + size->w = m_size.w; return true; } /** - * Get the width of the window (as reported by the last NX callback). + * Get the width of the window (as reported by the last NX callback). This + * method may need to wait until geometry data is available. * * @return The size. */ inline nxgl_coord_t getWindowWidth(void) { + waitGeoData(); return m_size.w; } /** - * Get the height of the window (as reported by the last NX callback). + * Get the height of the window (as reported by the last NX callback). This + * method may need to wait until geometry data is available. * * @return The size. */ inline nxgl_coord_t getWindowHeight(void) { + waitGeoData(); return m_size.h; } + /** + * Set the size of the window. This is normally reported by an NX callback. But + * the toolbar widget control does not get NX callbacks and has to get the + * window size throught this method. This method should not be called by user + * code + * + * @param hWindow The window handle that should be used to communicate + * with the window + * @param bounds. The size of the underlying window. + */ + + void setWindowBounds(NXHANDLE hWindow, FAR const struct nxgl_rect_s *bounds); + /** * The creation sequence is: * diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 8b880a618..3f77254b2 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -178,6 +178,12 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) delete widgetControl; return (CNxToolbar *)0; } + + // Provide parent widget control information to new widget control instance + + struct nxgl_rect_s bounds; + m_widgetControl->getWindowBoundingBox(&bounds); + widgetControl->setWindowBounds(m_widgetControl->getWindowHandle(), &bounds); } return m_toolbar; diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 1e1c9ce87..42cd047fa 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -400,30 +400,18 @@ void CWidgetControl::setFocusedWidget(CNxWidget *widget) } /** - * This event is called from CCallback instance to provide - * notifications of certain NX-server related events. This event, - * in particular, will occur when the position or size of the underlying - * window occurs. + * Set the size of the window. This is normally reported by an NX callback. But + * the toolbar widget control does not get NX callbacks and has to get the + * window size throught this method. This method should not be called by user + * code * * @param hWindow The window handle that should be used to communicate * with the window - * @param pos The position of the window in the physical device space. - * @param size The size of the window. - * @param bounds The size of the underlying display (pixels x rows) + * @param bounds. The size of the underlying window. */ -void CWidgetControl::geometryEvent(NXHANDLE hWindow, - const struct nxgl_size_s *size, - const struct nxgl_point_s *pos, - const struct nxgl_rect_s *bounds) +void CWidgetControl::setWindowBounds(NXHANDLE hWindow, FAR const struct nxgl_rect_s *bounds) { - // Save positional data that may change dynamically - - m_pos.x = pos->x; - m_pos.y = pos->y; - m_size.h = size->h; - m_size.w = size->w; - // The first callback is important. This is the handshake that proves // that we are truly communicating with the servier. This is also // a critical point because this is when we know the physical @@ -445,6 +433,33 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, } } +/** + * This event is called from CCallback instance to provide + * notifications of certain NX-server related events. This event, + * in particular, will occur when the position or size of the underlying + * window occurs. + * + * @param hWindow The window handle that should be used to communicate + * with the window + * @param pos The position of the window in the physical device space. + * @param size The size of the window. + * @param bounds The size of the underlying display (pixels x rows) + */ + +void CWidgetControl::geometryEvent(NXHANDLE hWindow, + FAR const struct nxgl_size_s *size, + FAR const struct nxgl_point_s *pos, + FAR const struct nxgl_rect_s *bounds) +{ + // Save positional data that may change dynamically + + m_pos.x = pos->x; + m_pos.y = pos->y; + m_size.h = size->h; + m_size.w = size->w; + setWindowBounds(hWindow, bounds); +} + /** * This event is called from CCallback instance to provide * notifications of certain NX-server related events. This event, @@ -467,16 +482,16 @@ void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more * certain NX-server related events. This event, in particular, means that * new mouse data is available for the window. * - * @param pPos The (x,y) position of the mouse. + * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. */ -void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pPos, uint8_t buttons) +void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons) { // Save the mouse X/Y position - m_mouse.x = pPos->x; - m_mouse.y = pPos->y; + m_mouse.x = pos->x; + m_mouse.y = pos->y; // Update button press states From fb682a72fbfc9e88ed7dafe8cc5f124e963cc5ec Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 18:19:17 +0000 Subject: [PATCH 035/390] Most fixes to get NxWM working on the STM3240G-EVAL git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4710 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 22 ++++----- libnxwidgets/include/cwidgetcontrol.hxx | 15 +----- libnxwidgets/src/cnxtkwindow.cxx | 51 +++++++++++++++++--- libnxwidgets/src/cwidgetcontrol.cxx | 63 +++++++++++-------------- nxwm/src/capplicationwindow.cxx | 2 +- 5 files changed, 83 insertions(+), 70 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 6a6266141..12c5dc513 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -230,6 +230,16 @@ int MAIN_NAME(int argc, char *argv[]) initMemoryUsage(); + // Initialize the NSH library + + printf(MAIN_STRING "Initialize the NSH library\n"); + if (!NxWM::nshlibInitialize()) + { + printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); + return EXIT_FAILURE; + } + showTestCaseMemory("After initializing the NSH library"); + // Create an instance of the Task Bar. // // The general sequence for initializing the task bar is: @@ -316,18 +326,6 @@ int MAIN_NAME(int argc, char *argv[]) } showTestCaseMemory("After create the start window application"); - // Initialize the NSH library - - printf(MAIN_STRING "Initialize the NSH library\n"); - if (!NxWM::nshlibInitialize()) - { - printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); - delete window; - delete g_nxwmtest.taskbar; - return EXIT_FAILURE; - } - showTestCaseMemory("After initializing the NSH library"); - // Add the NxConsole application to the start window NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index e33757a95..72713f2c4 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -609,7 +609,7 @@ namespace NXWidgets { waitGeoData(); pos->x = m_pos.x; - pos->x = m_pos.y; + pos->y = m_pos.y; return true; } @@ -654,19 +654,6 @@ namespace NXWidgets return m_size.h; } - /** - * Set the size of the window. This is normally reported by an NX callback. But - * the toolbar widget control does not get NX callbacks and has to get the - * window size throught this method. This method should not be called by user - * code - * - * @param hWindow The window handle that should be used to communicate - * with the window - * @param bounds. The size of the underlying window. - */ - - void setWindowBounds(NXHANDLE hWindow, FAR const struct nxgl_rect_s *bounds); - /** * The creation sequence is: * diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 3f77254b2..648cc368f 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -41,6 +41,7 @@ #include #include +#include #include #include "cwidgetcontrol.hxx" @@ -149,11 +150,12 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) CWidgetStyle style; m_widgetControl->getWidgetStyle(&style); - // Set the background color to the color of the toolbar + // Set the background color(s) to the color of the toolbar - style.colors.background = CONFIG_NXTK_BORDERCOLOR1; + style.colors.background = CONFIG_NXTK_BORDERCOLOR1; + style.colors.selectedBackground = CONFIG_NXTK_BORDERCOLOR1; - // Create a new controlling widget for the window + // Create a new controlling widget for the window using these colors CWidgetControl *widgetControl = new CWidgetControl(&style); @@ -179,11 +181,46 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) return (CNxToolbar *)0; } - // Provide parent widget control information to new widget control instance + // Provide parent widget control information to new widget control instance. + // This information is reported by an NX callback for "normal" windows. But + // the toolbar widget control does not get NX callbacks and has to get the + // window size through the setWindowBounds method. - struct nxgl_rect_s bounds; - m_widgetControl->getWindowBoundingBox(&bounds); - widgetControl->setWindowBounds(m_widgetControl->getWindowHandle(), &bounds); + // Disable preemption so that we can be assured that all of the following + // values are synchronized. + + sched_lock(); + + // Get the physical bounding box of the window in display coordinates + + struct nxgl_rect_s windowBounds; + m_widgetControl->getWindowBoundingBox(&windowBounds); + + // Get the position of the parent window in display coordinates + + struct nxgl_point_s windowPos; + m_widgetControl->getWindowPosition(&windowPos); + + // Get the bounding box of the toolbar in parent window coordinates + + struct nxgl_rect_s toolbarBounds; + nxtk_toolbarbounds(m_hNxTkWindow, &toolbarBounds); + + // Get the toolbar size + + struct nxgl_size_s toolbarSize; + nxgl_rectsize(&toolbarSize, &toolbarBounds); + + // Get the toolbar position in display coordinates by adding the window position + + struct nxgl_point_s toolbarPos; + nxgl_vectoradd(&toolbarPos, &toolbarBounds.pt1, &windowPos); + + // Perform the fake NX callback + + widgetControl->geometryEvent(m_hNxTkWindow, &toolbarSize, + &toolbarPos, &windowBounds); + sched_unlock(); } return m_toolbar; diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 42cd047fa..9c90a5bfd 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include "nxconfig.hxx" @@ -396,41 +397,6 @@ void CWidgetControl::setFocusedWidget(CNxWidget *widget) widget->focus(); } -#warning "Widgets with focus need to go on a stack so that focus can be restored" -} - -/** - * Set the size of the window. This is normally reported by an NX callback. But - * the toolbar widget control does not get NX callbacks and has to get the - * window size throught this method. This method should not be called by user - * code - * - * @param hWindow The window handle that should be used to communicate - * with the window - * @param bounds. The size of the underlying window. - */ - -void CWidgetControl::setWindowBounds(NXHANDLE hWindow, FAR const struct nxgl_rect_s *bounds) -{ - // The first callback is important. This is the handshake that proves - // that we are truly communicating with the servier. This is also - // a critical point because this is when we know the physical - // dimensions of the underlying window. - - if (!m_hWindow) - { - // Save one-time server specific information - - m_hWindow = hWindow; - nxgl_rectcopy(&m_bounds, bounds); - - // Wake up any threads waiting for initial position information. - // REVISIT: If the window is moved or repositioned, then the - // position and size data will be incorrect for a period of time. - // That case should be handled here as well. - - giveGeoSem(); - } } /** @@ -451,13 +417,38 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, FAR const struct nxgl_point_s *pos, FAR const struct nxgl_rect_s *bounds) { + // Disable pre-emption so that we can be assured that the following + // operations are atomic + + sched_lock(); + // Save positional data that may change dynamically m_pos.x = pos->x; m_pos.y = pos->y; m_size.h = size->h; m_size.w = size->w; - setWindowBounds(hWindow, bounds); + + // The first callback is important. This is the handshake that proves + // that we are truly communicating with the servier. This is also + // a critical point because this is when we know the physical + // dimensions of the underlying window. + + if (!m_hWindow) + { + // Save one-time server specific information + + m_hWindow = hWindow; + nxgl_rectcopy(&m_bounds, bounds); + + // Wake up any threads waiting for initial position information. + // REVISIT: If the window is moved or repositioned, then the + // position and size data will be incorrect for a period of time. + // That case should be handled here as well. + + giveGeoSem(); + } + sched_unlock(); } /** diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 8395c93ab..0fb6f387a 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -169,7 +169,7 @@ bool CApplicationWindow::open(void) return false; } - // Get the CWidgetControl associated with this window + // Get the CWidgetControl associated with the toolbar NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); if (!control) From b866254cdec548af5201518e8493e436adbdbbf5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 21:25:24 +0000 Subject: [PATCH 036/390] Various fixes for running the NxWM unit test on the STM3240G-EVAL git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4711 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 8 +++++- libnxwidgets/include/cgraphicsport.hxx | 15 ++++++++-- libnxwidgets/include/cwidgetcontrol.hxx | 8 ++---- libnxwidgets/src/cgraphicsport.cxx | 20 ++++++++----- libnxwidgets/src/cwidgetcontrol.cxx | 37 +++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 15 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index cff96bca0..a160399a8 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -28,4 +28,10 @@ * CNxWidget: Removed support for reference constants and close types. The goal is to ge the base widget class as small as possible. * CNxTkWindow: Fix uninitialized pointer value. - +* CNxToolbar: Need to "fake" the fix position callback to avoid + deadlock waits for the callback that won't happen. +* CNxTkWindow: Fix toolbar background color +* CWidgetControl: Don't declare the the geometry is good until a non-NULL + window size is received. +* CGraphicsPort and CWidgetControl: If the underlying graphics device + is write-only, then we have to render fonts a little differently. diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index 404fb1d51..8eea3d689 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -79,6 +79,7 @@ #include #include +#include "nxconfig.hxx" #include "inxwindow.hxx" /**************************************************************************** @@ -105,16 +106,26 @@ namespace NXWidgets class CGraphicsPort { private: - INxWindow *m_pNxWnd; /**< NX window interface. */ + INxWindow *m_pNxWnd; /**< NX window interface. */ +#ifdef CONFIG_NX_WRITEONLY + nxgl_mxpixel_t m_backColor; /**< The background color to use */ +#endif public: /** * Constructor. * - * @param pNxWnd An instance of the underlying window type. + * @param pNxWnd. An instance of the underlying window type. + * @param backColor. The background color is only needed if we + * cannot read from the graphics device. */ +#ifdef CONFIG_NX_WRITEONLY + CGraphicsPort(INxWindow *pNxWnd, + nxgl_mxpixel_t backColor = CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR); +#else CGraphicsPort(INxWindow *pNxWnd); +#endif /** * Destructor. diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 72713f2c4..db7cb06b6 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -166,6 +166,8 @@ namespace NXWidgets TNxArray m_widgets; /**< List of controlled widgets. */ bool m_modal; /**< True: in modal loop */ + bool m_haveGeometry; /**< True: indicates that we + have valid geometry data. */ sem_t m_modalSem; /**< Modal loops waits for events on this semaphore */ /** @@ -669,11 +671,7 @@ namespace NXWidgets * CGraphicsPort instance */ - inline bool createGraphicsPort(INxWindow *window) - { - m_port = new CGraphicsPort(window); - return m_port != (CGraphicsPort *)NULL; - } + bool createGraphicsPort(INxWindow *window); /** * Get the CGraphicsPort instance for drawing on this window diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index 43076e240..d43f3bdfa 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -105,13 +105,23 @@ using namespace NXWidgets; /** * Constructor. * - * @param pNxWnd An instance of the underlying window type. + * @param pNxWnd. An instance of the underlying window type. + * @param backColor. The background color is only needed if we + * cannot read from the graphics device. */ +#ifdef CONFIG_NX_WRITEONLY +CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd, nxgl_mxpixel_t backColor) +{ + m_pNxWnd = pNxWnd; + m_backColor = backColor; +} +#else CGraphicsPort::CGraphicsPort(INxWindow *pNxWnd) { m_pNxWnd = pNxWnd; } +#endif /** * Destructor. @@ -673,10 +683,6 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, // Loop setup -#if 0 - nxwidget_pixel_t backcolor = g_defaultWidgetStyle->colors.back; -#endif - struct SBitmap bitmap; bitmap.bpp = CONFIG_NXWIDGETS_BPP; bitmap.fmt = CONFIG_NXWIDGETS_FMT; @@ -736,14 +742,14 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, // Sometimes a solid background works, sometimes not. But reading // from graphics memory always works. -#if 0 +#ifdef CONFIG_NX_WRITEONLY // Set the glyph memory to the background color nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data; unsigned int npixels = fontWidth * fontHeight; for (unsigned int j = 0; j < npixels; j++) { - *bmPtr++ = backcolor; + *bmPtr++ = m_backColor; } #else // Read the current contents of the destination into the glyph memory diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 9c90a5bfd..afd17e6e2 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -84,6 +84,7 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) m_port = (CGraphicsPort *)NULL; m_modal = false; + m_haveGeometry = false; m_clickedWidget = (CNxWidget *)NULL; m_focusedWidget = (CNxWidget *)NULL; @@ -440,14 +441,25 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, m_hWindow = hWindow; nxgl_rectcopy(&m_bounds, bounds); + } + // In the normal start up sequence, the window is created with zero size + // at position 0,0. The safe thing to do is to set the position (still + // with size 0, then then set the size. Assuming that is what is being + // done, we will not report that we have valid geometry until the size + // becomes nonzero. + + if (!m_haveGeometry && size->h > 0 && size->w > 0) + { // Wake up any threads waiting for initial position information. // REVISIT: If the window is moved or repositioned, then the // position and size data will be incorrect for a period of time. // That case should be handled here as well. + m_haveGeometry = true; giveGeoSem(); } + sched_unlock(); } @@ -649,6 +661,31 @@ void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl) wakeupModalLoop(); } +/** + * The creation sequence is: + * + * 1) Create a dumb CWigetControl instance + * 2) Pass the dumb CWidgetControl instance to the window constructor + * that inherits from INxWindow. + * 3) The call this method with the static_cast to INxWindow to, + * finally, create the CGraphicsPort for this window. + * 4) After that, the fully smartend CWidgetControl instance can + * be used to generate additional widgets. + * + * @param window The instance of INxWindow needed to construct the + * CGraphicsPort instance + */ + +bool CWidgetControl::createGraphicsPort(INxWindow *window) +{ +#ifdef CONFIG_NX_WRITEONLY + m_port = new CGraphicsPort(window, m_style.colors.background); +#else + m_port = new CGraphicsPort(window); +#endif + return m_port != (CGraphicsPort *)NULL; +} + /** * Copy a widget style * From 6a76a5bbd30bd191ab4e496fe69c5dbf5320a8d1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 May 2012 22:49:27 +0000 Subject: [PATCH 037/390] Big NxWidgets simplification. Remove all hierarch logic. Widgets now exist only in a two-dimensional plane git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4712 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 6 + libnxwidgets/Makefile | 6 +- libnxwidgets/include/cnxwidget.hxx | 190 +----- libnxwidgets/include/crectcache.hxx | 222 ------- libnxwidgets/include/cwidgetcontrol.hxx | 8 - libnxwidgets/include/cwidgeteventhandler.hxx | 16 - .../include/cwidgeteventhandlerlist.hxx | 12 - libnxwidgets/src/cnxwidget.cxx | 619 +----------------- libnxwidgets/src/crectcache.cxx | 521 --------------- libnxwidgets/src/cwidgetcontrol.cxx | 39 -- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 34 - 11 files changed, 22 insertions(+), 1651 deletions(-) delete mode 100644 libnxwidgets/include/crectcache.hxx delete mode 100644 libnxwidgets/src/crectcache.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index a160399a8..c9c17cc83 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -35,3 +35,9 @@ window size is received. * CGraphicsPort and CWidgetControl: If the underlying graphics device is write-only, then we have to render fonts a little differently. +* CNxWidgets, CWidgetControl, and CRectCache: Big change! Remove all support + for widgets in a "vertical" hierarchy. Now widgets exist in a flat, + two-dimensional space and should not overlap. This should greatly + reduce the memory requirements and, since, NuttX already supports + a hierarchical windowing system, does not result in loss of functionality. + diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 9a52087ed..b35039e01 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -44,9 +44,9 @@ CSRCS = CXXSRCS = cbitmap.cxx cbgwindow.cxx ccallback.cxx cgraphicsport.cxx CXXSRCS += clistdata.cxx clistdataitem.cxx cnxfont.cxx CXXSRCS += cnxserver.cxx cnxstring.cxx cnxtimer.cxx cnxwidget.cxx cnxwindow.cxx -CXXSRCS += cnxtkwindow.cxx cnxtoolbar.cxx crect.cxx crectcache.cxx -CXXSRCS += crlepalettebitmap.cxx cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx -CXXSRCS += cwidgeteventhandlerlist.cxx singletons.cxx +CXXSRCS += cnxtkwindow.cxx cnxtoolbar.cxx crect.cxx crlepalettebitmap.cxx +CXXSRCS += cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx cwidgeteventhandlerlist.cxx +CXXSRCS += singletons.cxx # Widget APIs CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx CXXSRCS += cglyphbutton.cxx cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index ab44b9d42..d29830c0a 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -111,7 +111,6 @@ namespace NXWidgets class CWidgetControl; class CGraphicsPort; class CNxFont; - class CRectCache; class CWidgetEventHandlerList; /** @@ -206,9 +205,8 @@ namespace NXWidgets CNxWidget *m_focusedChild; /**< Pointer to the child widget that has focus. */ TNxArray m_children; /**< List of child widgets. */ - // Visible regions + // Borders - CRectCache *m_rectCache; /**< List of the widget's visible regions. */ WidgetBorderSize m_borderSize; /**< Size of the widget borders. */ /** @@ -237,18 +235,6 @@ namespace NXWidgets virtual void drawBorder(CGraphicsPort* port) { } - /** - * Checks if the supplied coordinates collide with a portion of this widget - * that is not obscured by its siblings, but that may be obscured by - * its children. - * - * @param x X coordinate of the click. - * @param y Y coordinate of the click. - * @return True if a collision occurred; false if not. - */ - - bool checkCollisionWithForegroundRects(nxgl_coord_t x, nxgl_coord_t y) const; - /** * Draw all visible regions of this widget's children. */ @@ -265,34 +251,6 @@ namespace NXWidgets void closeChild(CNxWidget *widget); - /** - * Redraws all regions of child widgets that fall within the invalidRects - * regions. - * - * @param invalidRects List of invalid regions that need to be redrawn. - * @param sender Pointer to the widget that initiated the redraw. - */ - - void redrawDirtyChildren(TNxArray* invalidRects, CNxWidget *sender); - - /** - * Get the index of the next visible widget higher up the z-order. - * - * @param startIndex The starting index. - * @return The index of the next highest visible widget. - */ - - const int getHigherVisibleWidget(const int startIndex) const; - - /** - * Get the index of the next visible widget lower down the z-order. - * - * @param startIndex The starting index. - * @return The index of the next lowest visible widget. - */ - - const int getLowerVisibleWidget(const int startIndex) const; - /** * Notify this widget that it is being dragged, and set its drag point. * @@ -748,24 +706,6 @@ namespace NXWidgets void getRect(CRect &rect) const; - /** - * Clips the supplied rect to the boundaries defined by this widget and - * this widget's parents. - * - * @param rect Reference to a rect to populate with data. - */ - - void getRectClippedToHierarchy(CRect &rect) const; - - /** - * Gets a pointer to the vector of all of the visible regions of this widget, - * including any covered by children. - * - * @return A pointer to a vector of all visible regions. - */ - - TNxArray *getForegroundRegions(void); - /** * Gets a pointer to the widget's font. * @@ -1061,13 +1001,6 @@ namespace NXWidgets void redraw(void); - /** - * Erases the visible regions of the widget by redrawing the widgets - * behind it. - */ - - void erase(void); - /** * Enables the widget. * @@ -1246,42 +1179,6 @@ namespace NXWidgets bool changeDimensions(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height); - /** - * Raises the widget to the top of its parent's widget stack. - * - * @return True if the raise was successful. - */ - - bool raiseToTop(void); - - /** - * Lowers the widget to the bottom of its parent's widget stack. - * - * @return True if the lower was successful. - */ - - bool lowerToBottom(void); - - /** - * Raises the supplied widget to the top of this widget's child stack. - * The supplied widget pointer must be a child of this widget. - * - * @param widget A pointer to the child widget to raise. - * @return True if the raise was successful. - */ - - bool raiseWidgetToTop(CNxWidget *widget); - - /** - * Lowers the supplied widget to the bottom of this widget's child stack. - * The supplied widget pointer must be a child of this widget. - * - * @param widget A pointer to the child widget to lower. - * @return True if the lower was successful. - */ - - bool lowerWidgetToBottom(CNxWidget *widget); - /** * Moves the supplied child widget to the deletion queue. * For framework use only. @@ -1333,16 +1230,6 @@ namespace NXWidgets bool checkCollision(CNxWidget *widget) const; - /** - * Invalidate the visible region cache for all widgets below the supplied - * widget in this widget's child stack. This will cause those widgets to - * - * recalculate their visible regions next time they try to draw themselves. - * @param widget A pointer to a child widget. - */ - - void invalidateLowerWidgetsVisibleRectCache(CNxWidget *widget); - /** * Adds a widget to this widget's child stack. The widget is added to the * top of the stack. Note that the widget can only be added if it is not @@ -1377,61 +1264,6 @@ namespace NXWidgets m_parent = parent; } - /** - * Rebuild the list of this widget's visible regions - */ - - void cacheVisibleRects(void) const; - - /** - * Mark this widget's visible region cache as invalid, and do the same - * to its child widgets. - */ - - void invalidateVisibleRectCache(void); - - /** - * Erase a child widget by drawing the widgets behind it. - * - * @param widget The child widget to erase. - */ - - void eraseWidget(CNxWidget *widget); - - /** - * Redraw any visible regions of this widget that have become corrupted. - * - * @param invalidRects A list of corrupt regions. - * @param sender A pointer to the widget that corrupted the regions. - */ - - void redrawDirty(TNxArray* invalidRects, CNxWidget *sender); - - /** - * Clips a rectangular region to the dimensions of this widget and its ancestors. - * - * @param rect The region that needs to be clipped. - */ - - void clipRectToHierarchy(CRect &rect) const; - - /** - * Swaps the depth of the supplied child widget. - * - * @param widget A pointer to the child widget that needs to swap depths. - * @return True if the swap was successful. - */ - - virtual bool swapWidgetDepth(CNxWidget *widget); - - /** - * Swap the depth of this widget. - * - * @return True if the swap was successful. - */ - - bool swapDepth(void); - /** * Delete this widget. This should never be called in user code; widget * deletion is handled internally. @@ -1480,15 +1312,6 @@ namespace NXWidgets m_flags.modal = false; } - /** - * Get the index of the specified child widget. - * - * @param widget The widget to get the index of. - * @return The index of the widget. -1 if the widget is not found. - */ - - const int getWidgetIndex(const CNxWidget *widget) const; - /** * Get the child widget at the specified index. * @@ -1509,17 +1332,6 @@ namespace NXWidgets return m_children.size(); } - /** - * Get a pointer to the cache of visible rects. - * - * @return A pointer to the cache of visible rects. - */ - - inline CRectCache *getCRectCache(void) const - { - return m_rectCache; - } - /** * Sets the border size. The border cannot be drawn over in the * drawContents() method. diff --git a/libnxwidgets/include/crectcache.hxx b/libnxwidgets/include/crectcache.hxx deleted file mode 100644 index f38c2313b..000000000 --- a/libnxwidgets/include/crectcache.hxx +++ /dev/null @@ -1,222 +0,0 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/crectcache.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CRECTCACHE_HXX -#define __INCLUDE_CRECTCACHE_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "cnxwidget.hxx" -#include "cwidgetstyle.hxx" -#include "tnxarray.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - /** - * Maintains a list of foreground (ie. above children) and background (with - * child overlapped-rects removed) rectangles representing the visible portions - * of a widget. - */ - - class CRectCache - { - private: - TNxArray m_foregroundRegions; /**< List of the widget's visible regions */ - TNxArray m_backgroundRegions; /**< List of the widget's visible regions with child rects removed */ - const CNxWidget *m_widget; /**< Owning widget */ - bool m_foregroundInvalid; /**< True if the foreground cache needs refreshing */ - bool m_backgroundInvalid; /**< True if the background cache needs refreshing */ - - /** - * Cache the foreground regions. - */ - - void cacheForegroundRegions(void); - - /** - * Cache the background regions. - */ - - void cacheBackgroundRegions(void); - - public: - - /** - * Constructor. - * - * @param widget Widget that contains the rect cache. - */ - - CRectCache(const CNxWidget *widget); - - /** - * Destructor. - */ - - inline ~CRectCache() { } - - /** - * Rebuild the cache if it is invalid. - */ - - void cache(void); - - /** - * Invalidates the cache. - */ - - inline void invalidate(void) - { - m_foregroundInvalid = true; - m_backgroundInvalid = true; - }; - - /** - * Return the list of background regions. These are regions that are not overlapped by - * child widgets. - * - * @return The list of background regions. - */ - - inline TNxArray *getBackgroundRegions(void) - { - return &m_backgroundRegions; - } - - /** - * Return the list of foreground regions. These are regions that represent the entire - * visible surface of the widget - that is, any regions not overlapped by ancestors or - * sublings of the widget - including any regions that are actually overlapped by - * child widgets. - * - * @return The list of foreground regions. - */ - - inline TNxArray *getForegroundRegions(void) - { - return &m_foregroundRegions; - } - - /** - * Works out which rectangles in the invalidRects list overlap this - * widget, then cuts the rectangles into smaller pieces. The overlapping - * pieces are pushed into validRects, and the non-overlapping pieces are - * pushed back into the invalidRects vector. - * - * @param invalidRects A vector of regions that need to be tested - * for collisions against this widget; they represent regions that need - * to be redrawn. - * @param validRects A vector of regions that represents areas of the - * display that do not need to be redrawn. - * @param sender Pointer to the widget that initiated the split. - */ - - void splitRectangles(TNxArray *invalidRects, - TNxArray *validRects, - FAR const CNxWidget *sender) const; - - /** - * Move any rectangles from the visibleRects list that overlap this widget - * into the invisibleRects list. Used during visible region calculations. - * - * @param visibleRects A vector of regions that are not overlapped. - * @param invisibleRects A vector of regions that are overlapped. - * @param widget The widget that requested the lists. - * @see splitRectangles() - */ - - void removeOverlappedRects(TNxArray *visibleRects, - TNxArray *invisibleRects, - FAR const CNxWidget* widget) const; - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CRECTCACHE_HXX - diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index db7cb06b6..aedec610e 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -391,14 +391,6 @@ namespace NXWidgets bool swapWidgetDepth(CNxWidget *widget); - /** - * Redraws any dirty regions within the supplied region. - * - * @param rect The region to redraw - */ - - void eraseRect(CRect rect); - /** * Add another widget to be managed by this control instance * diff --git a/libnxwidgets/include/cwidgeteventhandler.hxx b/libnxwidgets/include/cwidgeteventhandler.hxx index d9f39ddf9..d176d8822 100644 --- a/libnxwidgets/include/cwidgeteventhandler.hxx +++ b/libnxwidgets/include/cwidgeteventhandler.hxx @@ -276,22 +276,6 @@ namespace NXWidgets */ virtual void handleActionEvent(const CWidgetEventArgs &e) { } - - /** - * Handle a widget move forward event. - * - * @param e The event data. - */ - - virtual void handleMoveForwardEvent(const CWidgetEventArgs &e) { } - - /** - * Handle a widget move backward event. - * - * @param e The event data. - */ - - virtual void handleMoveBackwardEvent(const CWidgetEventArgs &e) { } }; } diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx index ae9e17847..8c9ef6738 100644 --- a/libnxwidgets/include/cwidgeteventhandlerlist.hxx +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -247,18 +247,6 @@ namespace NXWidgets void raiseDropEvent(nxgl_coord_t x, nxgl_coord_t y); - /** - * Raise a move forward event to the event handler. - */ - - void raiseMoveForwardEvent(void); - - /** - * Raise a move backward event to the event handler. - */ - - void raiseMoveBackwardEvent(void); - /** * Raise a key press event to the event handler. * diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 483309832..f8eb1efa7 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -82,7 +82,6 @@ #include "cnxfont.hxx" #include "cwidgetstyle.hxx" #include "cwidgeteventargs.hxx" -#include "crectcache.hxx" #include "cwidgetcontrol.hxx" #include "singletons.hxx" @@ -195,8 +194,7 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_borderSize.right = 1; m_borderSize.bottom = 1; m_borderSize.left = 1; - - m_rectCache = new CRectCache(this); + m_widgetEventHandlers = new CWidgetEventHandlerList(this); } @@ -237,7 +235,6 @@ CNxWidget::~CNxWidget(void) // Delete instances. NOTE that we do not delete the controlling // widget. It persists until the window is closed. - delete m_rectCache; delete m_widgetEventHandlers; } @@ -466,41 +463,6 @@ void CNxWidget::getRect(CRect &rect) const rect.setY(rect.getY() + getY()); } -/** - * Clips the supplied rect to the boundaries defined by this widget and - * this widget's parents. - * - * @param rect Reference to a rect to populate with data. - */ - -void CNxWidget::getRectClippedToHierarchy(CRect &rect) const -{ - // Copy the widget's properties into the rect. NOTE that if this is - // a child widget, getX() and getY() will return the actual X and Y - // positions (and not the parent-relative X and Y positions). - - rect.setX(getX()); - rect.setY(getY()); - rect.setWidth(getWidth()); - rect.setHeight(getHeight()); - - // And clip it - - clipRectToHierarchy(rect); -} - -/** - * Gets a pointer to the vector of all of the visible regions of this widget, - * including any covered by children. - * - * @return A pointer to a vector of all visible regions. - */ - -TNxArray *CNxWidget::getForegroundRegions(void) -{ - return m_rectCache->getForegroundRegions(); -} - /** * Sets this widget's border state. * @@ -510,7 +472,6 @@ TNxArray *CNxWidget::getForegroundRegions(void) void CNxWidget::setBorderless(bool borderless) { m_flags.borderless = borderless; - invalidateVisibleRectCache(); } /** @@ -532,53 +493,25 @@ void CNxWidget::redraw(void) { if (isDrawingEnabled()) { - cacheVisibleRects(); + // Get the graphics port needed to draw on this window - if (m_rectCache->getBackgroundRegions()->size() > 0) - { - // Get the graphics port for drawing in this window + CGraphicsPort *port = m_widgetControl->getGraphicsPort(); - CGraphicsPort *port = m_widgetControl->getGraphicsPort(); + // Draw the Widget - // Draw all visible rectangles - - for (int i = 0; i < m_rectCache->getBackgroundRegions()->size(); i++) - { - drawBorder(port); - drawContents(port); - } - } + drawBorder(port); + drawContents(port); // Remember that the widget is no longer erased m_flags.erased = false; + + // Draw the children of the widget + drawChildren(); } } -/** - * Erases the visible regions of the widget by redrawing the widgets - * behind it. - */ - -void CNxWidget::erase(void) -{ - if (!m_flags.erased) - { - cacheVisibleRects(); - - if (m_parent != (CNxWidget *)NULL) - { - m_parent->eraseWidget(this); - } - - // Remember that the widget has been erased - - m_flags.erased = true; - invalidateVisibleRectCache(); - } -} - /** * Enables the widget. * @@ -646,7 +579,6 @@ void CNxWidget::close(void) // Ensure the widget isn't running modally stopModal(); - erase(); if (m_parent != (CNxWidget *)NULL) { @@ -669,10 +601,6 @@ bool CNxWidget::show(void) { m_flags.hidden = false; - // Ensure that widgets behind this do not draw over the - // top of the newly-visible widget - - m_parent->invalidateLowerWidgetsVisibleRectCache(this); m_widgetEventHandlers->raiseShowEvent(); redraw(); return true; @@ -699,7 +627,6 @@ bool CNxWidget::hide(void) stopModal(); m_widgetEventHandlers->raiseHideEvent(); - erase(); return true; } @@ -741,14 +668,6 @@ bool CNxWidget::click(nxgl_coord_t x, nxgl_coord_t y) } } - // Ensure that the click has occurred on a region of this widget - // not obscured by its siblings - - if (!checkCollisionWithForegroundRects(x, y)) - { - return false; - } - // Handle clicks on this m_flags.clicked = true; @@ -834,14 +753,6 @@ bool CNxWidget::doubleClick(nxgl_coord_t x, nxgl_coord_t y) } } - // Ensure that the click has occurred on a region of this widget - // not obscured by its siblings - - if (!checkCollisionWithForegroundRects(x, y)) - { - return false; - } - m_flags.clicked = true; // Record data for double-click @@ -1143,8 +1054,6 @@ bool CNxWidget::moveTo(nxgl_coord_t x, nxgl_coord_t y) if ((m_rect.getX() != x) || (m_rect.getY() != y)) { - erase(); - nxgl_coord_t oldX = m_rect.getX(); nxgl_coord_t oldY = m_rect.getY(); @@ -1205,19 +1114,11 @@ bool CNxWidget::resize(nxgl_coord_t width, nxgl_coord_t height) bool wasDrawEnabled = m_flags.drawingEnabled; m_flags.permeable = true; - erase(); disableDrawing(); m_rect.setWidth(width); m_rect.setHeight(height); - // Handle visible region caching - - if (m_parent != (CNxWidget *)NULL) - { - m_parent->invalidateLowerWidgetsVisibleRectCache(this); - } - onResize(width, height); // Reset the permeable value @@ -1257,117 +1158,6 @@ bool CNxWidget::changeDimensions(nxgl_coord_t x, nxgl_coord_t y, return (resize(width, height) | moved); } -/** - * Raises the widget to the top of its parent's widget stack. - * - * @return True if the raise was successful. - */ - -bool CNxWidget::raiseToTop(void) -{ - if (m_parent != (CNxWidget *)NULL) - { - if (m_parent->raiseWidgetToTop(this)) - { - m_widgetEventHandlers->raiseMoveForwardEvent(); - return true; - } - } - - return false; -} - -/** - * Lowers the widget to the bottom of its parent's widget stack. - * - * @return True if the lower was successful. - */ - -bool CNxWidget::lowerToBottom(void) -{ - if (m_parent != (CNxWidget *)NULL) - { - if (m_parent->lowerWidgetToBottom(this)) - { - m_widgetEventHandlers->raiseMoveBackwardEvent(); - return true; - } - } - - return false; -} - -/** - * Raises the supplied widget to the top of this widget's child stack. - * The supplied widget pointer must be a child of this widget. - * - * @param widget A pointer to the child widget to raise. - * @return True if the raise was successful. - */ - -bool CNxWidget::raiseWidgetToTop(CNxWidget *widget) -{ - // Locate widget in the stack - - int index = getWidgetIndex(widget); - - if ((index > -1) && (index < m_children.size() - 1)) - { - m_children.erase(index); - m_children.push_back(widget); - - widget->invalidateVisibleRectCache(); - - // Invalidate all widgets that collide with the depth-swapped widget - - for (int i = 0; i < m_children.size(); i++) - { - if (m_children[i]->checkCollision(widget)) - { - m_children[i]->invalidateVisibleRectCache(); - } - } - - widget->redraw(); - return true; - } - - return false; -} - -/** - * Lowers the supplied widget to the bottom of this widget's child stack. - * The supplied widget pointer must be a child of this widget. - * - * @param widget A pointer to the child widget to lower. - * @return True if the lower was successful. - */ - -bool CNxWidget::lowerWidgetToBottom(CNxWidget *widget) -{ - // Locate widget in the stack - - int index = getWidgetIndex(widget); - - if (index > 0) - { - widget->erase(); - - // Handle visible region caching - - widget->invalidateVisibleRectCache(); - invalidateLowerWidgetsVisibleRectCache(widget); - - m_children.erase(index); - m_children.insert(0, widget); - - widget->redraw(); - return true; - } - - return false; -} - /** * Moves the supplied child widget to the deletion queue. * For framework use only. @@ -1446,7 +1236,7 @@ bool CNxWidget::checkCollision(nxgl_coord_t x, nxgl_coord_t y) const // Get the clipped rect CRect rect; - getRectClippedToHierarchy(rect); + getRect(rect); return rect.contains(x, y); } @@ -1471,7 +1261,7 @@ bool CNxWidget::checkCollision(nxgl_coord_t x, nxgl_coord_t y, // Get the clipped rect CRect rect; - getRectClippedToHierarchy(rect); + getRect(rect); return rect.intersects(CRect(x, y, width, height)); } @@ -1487,35 +1277,10 @@ bool CNxWidget::checkCollision(CNxWidget *widget) const // Get the clipped rect CRect rect; - widget->getRectClippedToHierarchy(rect); + widget->getRect(rect); return rect.intersects(m_rect); } -/** - * Invalidate the visible region cache for all widgets below the supplied - * widget in this widget's child stack. This will cause those widgets to - * - * recalculate their visible regions next time they try to draw themselves. - * @param widget A pointer to a child widget. - */ - -void CNxWidget::invalidateLowerWidgetsVisibleRectCache(CNxWidget *widget) -{ - // Find the widget - - int widgetIndex = getWidgetIndex(widget); - - // Invalidate lower widgets - - for (int i = widgetIndex - 1; i > -1; i--) - { - if (m_children[i]->checkCollision(widget)) - { - m_children[i]->invalidateVisibleRectCache(); - } - } -} - /** * Adds a widget to this widget's child stack. The widget is added to the * top of the stack. Note that the widget can only be added if it is not @@ -1540,7 +1305,6 @@ void CNxWidget::addWidget(CNxWidget *widget) } widget->enableDrawing(); - invalidateVisibleRectCache(); widget->redraw(); } } @@ -1562,251 +1326,10 @@ void CNxWidget::insertWidget(CNxWidget *widget) m_children.insert(0, widget); widget->enableDrawing(); - invalidateVisibleRectCache(); widget->redraw(); } } -/** - * Rebuild the list of this widget's visible regions - */ - -void CNxWidget::cacheVisibleRects(void) const -{ - m_rectCache->cache(); -} - -/** - * Mark this widget's visible region cache as invalid, and do the same - * to its child widgets. - */ - -void CNxWidget::invalidateVisibleRectCache(void) -{ - m_rectCache->invalidate(); - - // Invalidate child cache - - for (int i = 0; i < m_children.size(); i++) - { - m_children[i]->invalidateVisibleRectCache(); - } -} - -/** - * Erase a child widget by drawing the widgets behind it. - * - * @param widget The child widget to erase. - */ - -void CNxWidget::eraseWidget(CNxWidget *widget) -{ - // Locate the widget - - int widgetIndex = getWidgetIndex(widget); - - // Ensure rect cache is up to date - - widget->cacheVisibleRects(); - - // Order all lower widgets to redraw themselves based on the erased widget's - // visible rect cache - - for (int i = widgetIndex - 1; i > -1; i--) - { - m_children[i]->redrawDirty(widget->getForegroundRegions(), widget); - } - - // Order this widget to redraw itself based on any remaining rectangles - // in the erased widget's rect cache - - redrawDirty(widget->getForegroundRegions(), widget); - invalidateVisibleRectCache(); -} - -/** - * Redraw any visible regions of this widget that have become corrupted. - * - * @param invalidRects A list of corrupt regions. - * @param sender A pointer to the widget that corrupted the regions. - */ - -void CNxWidget::redrawDirty(TNxArray *invalidRects, CNxWidget *sender) -{ - if (isDrawingEnabled()) - { - // Draw any children first - - redrawDirtyChildren(invalidRects, sender); - - // Create an array that will contain all of the rects from the - // original array that overlap this widget - - TNxArray *overlappingRects = new TNxArray(); - - // Remove any non-overlapping rectangles from dirty vector and add to - // overlapping vector - - m_rectCache->splitRectangles(invalidRects, overlappingRects, sender); - - // Create an array that will contain all of the rects that overlap this - // widget clipped to its parent - - TNxArray *rectsToDraw = new TNxArray(); - - // Split from overlappingRects into rectsToDraw, giving us an array - // of rects that overlap only the visible portions of this widget - - m_rectCache->splitRectangles(overlappingRects, rectsToDraw, sender); - - // Get the graphics port for drawing in this window - - CGraphicsPort *port = m_widgetControl->getGraphicsPort(); - - // Draw the dirty rects - - if (rectsToDraw->size() > 0) - { - for (int i = 0; i < rectsToDraw->size(); i++) - { - drawBorder(port); - drawContents(port); - } - } - - // Copy all of the overlapping rects we didn't draw back to the main - // array of rects that need to be drawn by another widget - - for (int i = 0; i < overlappingRects->size(); i++) - { - invalidRects->push_back(overlappingRects->at(i)); - } - - // Clean up - - delete overlappingRects; - delete rectsToDraw; - } -} - -/** - * Clips a rectangular region to the dimensions of this widget and its ancestors. - * - * @param rect The region that needs to be clipped. - */ - -void CNxWidget::clipRectToHierarchy(CRect &rect) const { - - const CNxWidget *parent = m_parent; - const CNxWidget *widget = this; - CRect thisRect; - - while (parent != NULL) - { - // Standard widgets can draw into client space - - parent->getClientRect(thisRect); - - // Adjust rect to screen space - - thisRect.offset(parent->getX(), parent->getY()); - rect.clipToIntersect(thisRect); - - // Send up to parent - - widget = parent; - parent = parent->getParent(); - } -} - - /** - * Swaps the depth of the supplied child widget. - * - * @param widget A pointer to the child widget that needs to swap depths. - * @return True if the swap was successful. - */ - -bool CNxWidget::swapWidgetDepth(CNxWidget *widget) -{ - // Can we swap? - - if (m_children.size() > 1) - { - int widgetSource = 0; - int widgetDest = 0; - - // Locate the widget in the vector - - widgetSource = getWidgetIndex(widget); - - // Attempt to raise up - - int i = getHigherVisibleWidget(widgetSource); - if (i > -1) - { - // Raise - - widgetDest = i; - } - else - { - // Lower to bottom of stack - - widgetDest = 0; - } - - // Erase the widget from the screen - - eraseWidget(widget); - - // Swap - - CNxWidget *tmp = m_children[widgetSource]; - m_children[widgetSource] = m_children[widgetDest]; - m_children[widgetDest] = tmp; - - // Invalidate the widgets below the top affected widget - - if (widgetSource < widgetDest) - { - // Source lower; invalidate from dest down - - m_children[widgetDest]->invalidateVisibleRectCache(); - invalidateLowerWidgetsVisibleRectCache(m_children[widgetDest]); - } - else - { - // Dest lower; invalidate from source down - - m_children[widgetSource]->invalidateVisibleRectCache(); - invalidateLowerWidgetsVisibleRectCache(m_children[widgetSource]); - } - - // Redraw the widget - - widget->redraw(); - return true; - } - - return false; -} - -/** - * Swap the depth of this widget. - * - * @return True if the swap was successful. - */ - -bool CNxWidget::swapDepth(void) -{ - if (m_parent != (CNxWidget *)NULL) - { - return m_parent->swapWidgetDepth(this); - } - - return false; -} - /** * Remove this widget from the widget hierarchy. Returns * responsibility for deleting the widget back to the developer. @@ -1908,26 +1431,6 @@ void CNxWidget::goModal(void) } } -/** - * Get the index of the specified child widget. - * - * @param widget The widget to get the index of. - * @return The index of the widget. -1 if the widget is not found. - */ - -const int CNxWidget::getWidgetIndex(const CNxWidget *widget) const -{ - for (int i = 0; i < m_children.size(); i++) - { - if (m_children[i] == widget) - { - return i; - } - } - - return -1; -} - /** * Get the child widget at the specified index. * @@ -1976,38 +1479,6 @@ void CNxWidget::useWidgetStyle(const CWidgetStyle *style) m_style.font = style->font; } -/** - * Checks if the supplied coordinates collide with a portion of this widget - * that is not obscured by its siblings, but that may be obscured by - * its children. - * - * @param x X coordinate of the click. - * @param y Y coordinate of the click. - * @return True if a collision occurred; false if not. - */ - -bool CNxWidget::checkCollisionWithForegroundRects(nxgl_coord_t x, nxgl_coord_t y) const -{ - if (isHidden()) - { - return false; - } - - cacheVisibleRects(); - - CRect *rect; - for (int i = 0; i < m_rectCache->getForegroundRegions()->size(); ++i) - { - rect = &(m_rectCache->getForegroundRegions()->at(i)); - if (rect->contains(x, y)) - { - return true; - } - } - - return false; -} - /** * Draw all visible regions of this widget's children. */ @@ -2079,72 +1550,6 @@ void CNxWidget::closeChild(CNxWidget *widget) moveChildToDeleteQueue(widget); } -/** - * Redraws all regions of child widgets that fall within the invalidRects - * regions. - * - * @param invalidRects List of invalid regions that need to be redrawn. - * @param sender Pointer to the widget that initiated the redraw. - */ - -void CNxWidget::redrawDirtyChildren(TNxArray *invalidRects, CNxWidget *sender) -{ - for (int i = m_children.size() - 1; i > -1 ; i--) - { - if (invalidRects->size() > 0) - { - if (m_children.at(i) != sender) - { - m_children[i]->redrawDirty(invalidRects, sender); - } - } - else - { - break; - } - } -} - -/** - * Get the index of the next visible widget higher up the z-order. - * - * @param startIndex The starting index. - * @return The index of the next highest visible widget. - */ - -const int CNxWidget::getHigherVisibleWidget(const int startIndex) const -{ - for (int i = startIndex; i < m_children.size(); i++) - { - if (!m_children[i]->isHidden()) - { - return i; - } - } - - return -1; -} - -/** - * Get the index of the next visible widget lower down the z-order. - * - * @param startIndex The starting index. - * @return The index of the next lowest visible widget. - */ - -const int CNxWidget::getLowerVisibleWidget(const int startIndex) const -{ - for (int i = startIndex; i > -1; i--) - { - if (!m_children[i]->isHidden()) - { - return i; - } - } - - return -1; -} - /** * Notify this widget that it is being dragged, and set its drag point. * diff --git a/libnxwidgets/src/crectcache.cxx b/libnxwidgets/src/crectcache.cxx deleted file mode 100644 index 3f74ee75d..000000000 --- a/libnxwidgets/src/crectcache.cxx +++ /dev/null @@ -1,521 +0,0 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/src/crectcache.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include - -#include "crectcache.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * CNxFont Method Implementations - ****************************************************************************/ - -using namespace NXWidgets; - -/** - * Constructor. - * - * @param widget Widget that contains the rect cache. - */ - -CRectCache::CRectCache(const CNxWidget* widget) -{ - m_widget = widget; - m_foregroundInvalid = true; - m_backgroundInvalid = true; -} - -/** - * Rebuild the cache if it is invalid. - */ - -void CRectCache::cache(void) -{ - cacheBackgroundRegions(); -} - -/** - * Works out which rectangles in the invalidRects list overlap this - * widget, then cuts the rectangles into smaller pieces. The overlapping - * pieces are pushed into validRects, and the non-overlapping pieces are - * pushed back into the invalidRects vector. - * - * @param invalidRects A vector of regions that need to be tested - * for collisions against this widget; they represent regions that need - * to be redrawn. - * @param validRects A vector of regions that represents areas of the - * display that do not need to be redrawn. - * @param sender Pointer to the widget that initiated the split. - */ - -void CRectCache::splitRectangles(TNxArray* invalidRects, - TNxArray* validRects, - FAR const CNxWidget *sender) const -{ - // Check for collisions with any rectangles in the vector - - for (int i = 0; i < invalidRects->size(); i++) - { - // Get rectangle to check - - CRect checkRect = invalidRects->at(i); - nxgl_coord_t splitX[4]; - nxgl_coord_t splitY[4]; - unsigned int rectXCount = 0; - unsigned int rectYCount = 0; - unsigned int overlapXRect = 0; - unsigned int overlapYRect = 0; - - nxgl_coord_t width = checkRect.getWidth(); - nxgl_coord_t height = checkRect.getHeight(); - - if (m_widget->checkCollision(checkRect.getX(), checkRect.getY(), width, height)) - { - // Got a collision. We need to split this rectangle - // Get clipped dimensions of widget - - CRect widgetRect; - m_widget->getRectClippedToHierarchy(widgetRect); - - // Vertical split - // Start at left edge of rectangle - - splitX[0] = checkRect.getX(); - - // Check for second split - - if (checkRect.getX() < widgetRect.getX()) - { - // Widget is to the right of the invalid rectangle (or in the centre) - - if (splitX[rectXCount] != widgetRect.getX()) - { - rectXCount++; - splitX[rectXCount] = widgetRect.getX(); - - // The next rectangle is the overlap - - overlapXRect = rectXCount; - } - } - else - { - // Widget rectangle is on the left of the invalid rectangle - - if (splitX[rectXCount] != widgetRect.getX2() + 1) - { - // We've found the start of the overlapping rectangle! - - overlapXRect = rectXCount; - rectXCount++; - - // Split is either the end of the widget or the end of the - // invalid rect, whichever comes first - - if (widgetRect.getX2() <= checkRect.getX2()) - { - splitX[rectXCount] = widgetRect.getX2() + 1; - } - else - { - splitX[rectXCount] = checkRect.getX2() + 1; - } - } - else - { - // Found the start of the overlapping rectangle - - overlapXRect = rectXCount; - } - } - - // Check for third split - - if (widgetRect.getX2() + 1 <= checkRect.getX2() + 1) - { - // Widget ends before the invalid rectangle - - if (splitX[rectXCount] != widgetRect.getX2() + 1) - { - // Record end of overlap - - rectXCount++; - splitX[rectXCount] = widgetRect.getX2() + 1; - } - } - - // Store end of invalid rectangle - - if (splitX[rectXCount] <= checkRect.getX2()) - { - rectXCount++; - splitX[rectXCount] = checkRect.getX2() + 1; - } - - // Horizontal split - // Start at left edge of rectangle - - splitY[0] = checkRect.getY(); - - // Check for second split - - if (checkRect.getY() < widgetRect.getY()) - { - // Widget below the invalid rectangle (or in the centre) - - if (splitY[rectYCount] != widgetRect.getY()) - { - rectYCount++; - splitY[rectYCount] = widgetRect.getY(); - - // The next rectangle is the overlap - - overlapYRect = rectYCount; - } - } - else - { - // Widget rectangle above the invalid rectangle - - if (splitY[rectYCount] != widgetRect.getY2() + 1) - { - // We've found the start of the overlapping rectangle! - - overlapYRect = rectYCount; - rectYCount++; - - // Split is either the end of the widget or the end of the - // invalid rect, whichever comes first - - if (widgetRect.getY2() <= checkRect.getY2()) - { - splitY[rectYCount] = widgetRect.getY2() + 1; - } - else - { - splitY[rectYCount] = checkRect.getY2() + 1; - } - } - else - { - // Found the start of the overlapping rectangle - - overlapYRect = rectYCount; - } - } - - // Check for third split - - if (widgetRect.getY2() < checkRect.getY2()) - { - // Widget ends before the invalid rectangle - - if (splitY[rectYCount] != widgetRect.getY2() + 1) - { - // Record end of overlap - - rectYCount++; - splitY[rectYCount] = widgetRect.getY2() + 1; - } - } - - // Store end of invalid rectangle - - if (splitY[rectYCount] <= checkRect.getY2()) - { - rectYCount++; - splitY[rectYCount] = checkRect.getY() + 1; - } - - // Remove the original rectangle - - invalidRects->erase(i); - - // Force the loop to re-examine the new rectangle at this index - - i--; - - // Add the new rectangles (not the overlap; that's the one we need to draw) - - for (unsigned int xRects = 0; xRects < rectXCount; xRects++) - { - for (unsigned int yRects = 0; yRects < rectYCount; yRects++) - { - // Is this the overlap? - - if ((overlapXRect == xRects) && (overlapYRect == yRects)) - { - // Got the overlap, so set the output values - - CRect overlapRect; - overlapRect.setX(splitX[xRects]); - overlapRect.setY(splitY[yRects]); - overlapRect.setX2(splitX[xRects + 1] - 1); - overlapRect.setY2(splitY[yRects + 1] - 1); - - if (overlapRect.hasDimensions()) - { - validRects->push_back(overlapRect); - } - } - else - { - // Not an overlap; add to vector - - CRect newRect; - newRect.setX(splitX[xRects]); - newRect.setY(splitY[yRects]); - newRect.setX2(splitX[xRects + 1] - 1); - newRect.setY2(splitY[yRects + 1] - 1); - - // Insert the new rectangle at the start so we don't - - if (newRect.hasDimensions()) - { - invalidRects->push_back(newRect); - } - - // Increase iterator to compensate for insertion - - i++; - } - } - } - } - } -} - -/** - * Move any rectangles from the visibleRects list that overlap this widget - * into the invisibleRects list. Used during visible region calculations. - * - * @param visibleRects A vector of regions that are not overlapped. - * @param invisibleRects A vector of regions that are overlapped. - * @param widget The widget that requested the lists. - * @see splitRectangles() - */ - -void CRectCache::removeOverlappedRects(TNxArray *visibleRects, - TNxArray *invisibleRects, - FAR const CNxWidget* widget) const -{ - const CNxWidget* parent = m_widget; - int widgetIndex = -1; - - while ((widget != NULL) && (parent != NULL)) - { - // Locate widget in the list; we add one to the index to - // ensure that we deal with the next widget up in the z-order - - widgetIndex = parent->getWidgetIndex(widget) + 1; - - // Widget should never be the bottom item on the screen - - if (widgetIndex > 0) - { - // Remove any overlapped rectangles - - for (int i = widgetIndex; i < parent->getChildCount(); i++) - { - if (visibleRects->size() > 0) - { - parent->getChild(i)->getCRectCache()->splitRectangles(visibleRects, invisibleRects, widget); - } - else - { - break; - } - } - } - - if (visibleRects->size() > 0) - { - widget = parent; - - if (parent != NULL) - { - parent = parent->getParent(); - } - } - else - { - return; - } - } -} - -/** - * Cache the foreground regions. - */ - -void CRectCache::cacheForegroundRegions(void) -{ - if (m_foregroundInvalid) - { - // Use internal region cache to store the non-overlapped rectangles - // We will use this to clip the widget - - m_foregroundRegions.clear(); - - // Create pointer to a vector to store the overlapped rectangles - // We can discard this later as we don't need it - - TNxArray* invisibleRects = new TNxArray(); - - // Copy the clipped widget dimensions into a rect - - CRect rect; - m_widget->getRectClippedToHierarchy(rect); - - // Do we have a visible region left? - - if (rect.hasDimensions()) - { - // Add rect to list - - m_foregroundRegions.push_back(rect); - - // Request refresh - - if (m_widget->getParent() != NULL) - { - m_widget->getParent()->getCRectCache()->removeOverlappedRects(&m_foregroundRegions, invisibleRects, m_widget); - } - } - - // Tidy up - - delete invisibleRects; - m_foregroundInvalid = false; - } -} - -/** - * Cache the background regions. - */ - -void CRectCache::cacheBackgroundRegions(void) -{ - // Ensure that foreground is up to date - - cacheForegroundRegions(); - - if (m_backgroundInvalid) - { - // Cache visible regions not overlapped by children - - m_backgroundRegions.clear(); - - // Create pointer to a vector to store the overlapped rectangles - // We can discard this later as we don't need it - - TNxArray* invisibleRects = new TNxArray(); - - // Copy all foreground regions into the new vector - - for (int i = 0; i < m_foregroundRegions.size(); i++) - { - m_backgroundRegions.push_back(m_foregroundRegions[i]); - } - - // Remove all child rects from the visible vector - - for (int i = 0; i < m_widget->getChildCount(); i++) - { - if (m_backgroundRegions.size() > 0) - { - m_widget->getChild(i)->getCRectCache()->splitRectangles(&m_backgroundRegions, invisibleRects, m_widget); - } - else - { - break; - } - } - - // Tidy up - - delete invisibleRects; - m_backgroundInvalid = false; - } -} - - diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index afd17e6e2..9c0d67be3 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -290,44 +290,6 @@ const int CWidgetControl::getWidgetIndex(const CNxWidget *widget) const return -1; } -/** - * Redraws any dirty regions within the supplied region. - * - * @param rect The region to redraw - */ - -void CWidgetControl::eraseRect(CRect rect) -{ - // Create pointer to a vector to store the invalid rectangles - - TNxArray *invalidRectangles = new TNxArray(); - - if (invalidRectangles != (TNxArray *)NULL) - { - // Add rectangle into the vector - - invalidRectangles->push_back(rect); - - // Refresh children - - for (int i = m_widgets.size() - 1; i > -1 ; i--) - { - if (invalidRectangles->size() > 0) - { - m_widgets[i]->redrawDirty(invalidRectangles, (CNxWidget *)NULL); - } - else - { - break; - } - } - - // Tidy up - - delete invalidRectangles; - } -} - /** * Remove a controlled widget * @@ -477,7 +439,6 @@ void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more { CRect rect; rect.setNxRect(nxRect); - eraseRect(rect); } /** diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index de8a31b4b..21d21add9 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -279,40 +279,6 @@ void CWidgetEventHandlerList::raiseDropEvent(nxgl_coord_t x, nxgl_coord_t y) } } -/** - * Raise a move forward event to the event handler. - */ - -void CWidgetEventHandlerList::raiseMoveForwardEvent(void) -{ - if (isEnabled()) - { - CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) - { - m_widgetEventHandlers.at(i)->handleMoveForwardEvent(e); - } - } -} - -/** - * Raise a move backward event to the event handler. - */ - -void CWidgetEventHandlerList::raiseMoveBackwardEvent(void) -{ - if (isEnabled()) - { - CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) - { - m_widgetEventHandlers.at(i)->handleMoveBackwardEvent(e); - } - } -} - /** * Raise a key press event to the event handler. * From ef0d5cd9e4afdd8b1e248abc652875b2de542691 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 8 May 2012 15:07:53 +0000 Subject: [PATCH 038/390] Integrate the STMPE11 driver into the STM3240G-EVAL board logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4714 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/src/cnxwidget.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index f8eb1efa7..4d8a97627 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -1492,8 +1492,8 @@ void CNxWidget::drawChildren(void) } /** - * Erase and remove the supplied child widget from this widget and - * send it to the deletion queue. + * Remove the supplied child widget from this widget and send it to + * the deletion queue. * * @param widget The widget to close. * @see close(). From 5804c3ce773252eedcba2575849d975e43f362d6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 9 May 2012 19:31:48 +0000 Subject: [PATCH 039/390] NxWidgets: Remove modal loops, Add CWindowEventHandler*. NxWM: Add support for full screen applications git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4716 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 11 + UnitTests/CButton/cbuttontest.cxx | 2 +- UnitTests/CButtonArray/cbuttonarraytest.cxx | 2 +- UnitTests/CCheckBox/ccheckboxtest.cxx | 2 +- UnitTests/CGlyphButton/cglyphbuttontest.cxx | 2 +- UnitTests/CKeypad/ckeypadtest.cxx | 2 +- UnitTests/CLatchButton/clatchbuttontest.cxx | 2 +- .../clatchbuttonarraytest.cxx | 2 +- UnitTests/CRadioButton/cradiobuttontest.cxx | 2 +- UnitTests/CTextBox/ctextboxtest.cxx | 2 +- UnitTests/nxwm/main.cxx | 1 - libnxwidgets/Makefile | 2 +- libnxwidgets/include/cnxwidget.hxx | 24 -- libnxwidgets/include/cwidgetcontrol.hxx | 128 ++++++--- libnxwidgets/include/cwindoweventhandler.hxx | 113 ++++++++ .../include/cwindoweventhandlerlist.hxx | 168 ++++++++++++ libnxwidgets/include/nxconfig.hxx | 4 + libnxwidgets/src/cnxserver.cxx | 20 +- libnxwidgets/src/cnxwidget.cxx | 53 ---- libnxwidgets/src/cwidgetcontrol.cxx | 189 +++++++------- nxwm/Makefile | 2 +- nxwm/include/capplicationwindow.hxx | 95 +++---- nxwm/include/cfullscreenwindow.hxx | 172 ++++++++++++ nxwm/include/cnxconsole.hxx | 2 +- nxwm/include/cstartwindow.hxx | 2 +- nxwm/include/ctaskbar.hxx | 30 ++- nxwm/include/iapplication.hxx | 2 +- nxwm/include/iapplicationwindow.hxx | 160 ++++++++++++ nxwm/include/nxwmconfig.hxx | 1 + nxwm/src/capplicationwindow.cxx | 158 ++++++++++- nxwm/src/cfullscreenwindow.cxx | 247 ++++++++++++++++++ nxwm/src/cnxconsole.cxx | 8 +- nxwm/src/cstartwindow.cxx | 10 +- nxwm/src/ctaskbar.cxx | 118 ++++++--- nxwm/src/glyph_play.cxx | 71 ++++- 35 files changed, 1470 insertions(+), 339 deletions(-) create mode 100644 libnxwidgets/include/cwindoweventhandler.hxx create mode 100644 libnxwidgets/include/cwindoweventhandlerlist.hxx create mode 100644 nxwm/include/cfullscreenwindow.hxx create mode 100644 nxwm/include/iapplicationwindow.hxx create mode 100644 nxwm/src/cfullscreenwindow.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index c9c17cc83..f7791e99d 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -40,4 +40,15 @@ two-dimensional space and should not overlap. This should greatly reduce the memory requirements and, since, NuttX already supports a hierarchical windowing system, does not result in loss of functionality. +* CNxWidgets and CWidgetControl. Remove specific built-in support for + modal loops. There are too many different control mechanisms that might + be needed. Replace with hooks to control widget events from totally + external logic. +* CWindowEventHandler, CWindowEventHandlerList, CWidgetControl: New + callback classes to receive notifications about window events. +* CFullScreenWindow and CTaskbar: Add support in NxWM for full screen + window applications. +* All application windows now use CWindowEventHandler and CWindowEventHandlerList + to get notifications about mouse and keyboard events. These class will + then automatically handle polling (with no need for a modal loop). diff --git a/UnitTests/CButton/cbuttontest.cxx b/UnitTests/CButton/cbuttontest.cxx index 49f32f551..03411fd6e 100644 --- a/UnitTests/CButton/cbuttontest.cxx +++ b/UnitTests/CButton/cbuttontest.cxx @@ -307,7 +307,7 @@ void CButtonTest::release(void) (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll // then check if the event was processed corredly. diff --git a/UnitTests/CButtonArray/cbuttonarraytest.cxx b/UnitTests/CButtonArray/cbuttonarraytest.cxx index 4e4f4487f..c1ad0e7a4 100644 --- a/UnitTests/CButtonArray/cbuttonarraytest.cxx +++ b/UnitTests/CButtonArray/cbuttonarraytest.cxx @@ -287,7 +287,7 @@ void CButtonArrayTest::release(CButtonArray *buttonArray, int column, int row) (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll // then check if the event was processed corredly. diff --git a/UnitTests/CCheckBox/ccheckboxtest.cxx b/UnitTests/CCheckBox/ccheckboxtest.cxx index 90abf2e67..e9ccc7628 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.cxx +++ b/UnitTests/CCheckBox/ccheckboxtest.cxx @@ -253,7 +253,7 @@ void CCheckBoxTest::clickCheckBox(void) // Poll for mouse events // - // Widget events are normally handled in a modal loop (by calling goModal()). + // Widget events are normally handled in a modal loop. // However, for this case we know that we just pressed the mouse button // so we don't have to poll. We can just perform a one pass poll then // then check if the mouse event was processed corredly. diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.cxx b/UnitTests/CGlyphButton/cglyphbuttontest.cxx index d44238c78..801da7289 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.cxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.cxx @@ -289,7 +289,7 @@ void CGlyphButtonTest::release(void) (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll // then check if the event was processed corredly. diff --git a/UnitTests/CKeypad/ckeypadtest.cxx b/UnitTests/CKeypad/ckeypadtest.cxx index 5d3eeda2a..300148cc3 100644 --- a/UnitTests/CKeypad/ckeypadtest.cxx +++ b/UnitTests/CKeypad/ckeypadtest.cxx @@ -401,7 +401,7 @@ void CKeypadTest::release(CKeypad *keypad, int column, int row) (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll // then check if the event was processed corredly. diff --git a/UnitTests/CLatchButton/clatchbuttontest.cxx b/UnitTests/CLatchButton/clatchbuttontest.cxx index 2b41eca63..c8e02938b 100644 --- a/UnitTests/CLatchButton/clatchbuttontest.cxx +++ b/UnitTests/CLatchButton/clatchbuttontest.cxx @@ -308,7 +308,7 @@ void CLatchButtonTest::release(void) (void)nx_mousein(handle, m_center.x, m_center.y, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll. diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx index 5b1737e06..cf41c1608 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx @@ -287,7 +287,7 @@ void CLatchButtonArrayTest::release(CLatchButtonArray *buttonArray, int column, (void)nx_mousein(handle, buttonX, buttonY, NX_MOUSE_NOBUTTONS); } -// Widget events are normally handled in a modal loop (by calling goModal()). +// Widget events are normally handled in a modal loop. // However, for this case we know when there should be press and release // events so we don't have to poll. We can just perform a one pass poll // then check if the event was processed corredly. diff --git a/UnitTests/CRadioButton/cradiobuttontest.cxx b/UnitTests/CRadioButton/cradiobuttontest.cxx index f97089ce7..09b5af8c2 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.cxx +++ b/UnitTests/CRadioButton/cradiobuttontest.cxx @@ -268,7 +268,7 @@ void CRadioButtonTest::pushButton(CRadioButton *button) // Poll for mouse events // - // Widget events are normally handled in a modal loop (by calling goModal()). + // Widget events are normally handled in a modal loop. // However, for this case we know that we just pressed the mouse button // so we don't have to poll. We can just perform a one pass poll then // then check if the mouse event was processed corredly. diff --git a/UnitTests/CTextBox/ctextboxtest.cxx b/UnitTests/CTextBox/ctextboxtest.cxx index e54bd4e6a..07a1f116d 100644 --- a/UnitTests/CTextBox/ctextboxtest.cxx +++ b/UnitTests/CTextBox/ctextboxtest.cxx @@ -272,7 +272,7 @@ void CTextBoxTest::injectChars(CTextBox *textbox, int nCh, FAR const uint8_t *st (void)nx_kbdchin(handle, string[i]); - // Widget events are normally handled in a modal loop (by calling goModal()). + // Widget events are normally handled in a modal loop. // However, for this case we know when there should be keyboard events pending, // events so we don't have to poll repeatedly. We can just perform a one pass // poll diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 12c5dc513..8125cf9f0 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -434,7 +434,6 @@ nocalculator: showTestCaseMemory("After starting the start window application"); // Call CTaskBar::startWindowManager to start the display with applications in place. - // This method will not return but will enter the task bar's modal loop. printf(MAIN_STRING "Start the window manager\n"); if (!g_nxwmtest.taskbar->startWindowManager()) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index b35039e01..2520e419d 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -46,7 +46,7 @@ CXXSRCS += clistdata.cxx clistdataitem.cxx cnxfont.cxx CXXSRCS += cnxserver.cxx cnxstring.cxx cnxtimer.cxx cnxwidget.cxx cnxwindow.cxx CXXSRCS += cnxtkwindow.cxx cnxtoolbar.cxx crect.cxx crlepalettebitmap.cxx CXXSRCS += cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx cwidgeteventhandlerlist.cxx -CXXSRCS += singletons.cxx +CXXSRCS += cwindoweventhandlerlist.cxx singletons.cxx # Widget APIs CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx CXXSRCS += cglyphbutton.cxx cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index d29830c0a..4c470cfb2 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -154,7 +154,6 @@ namespace NXWidgets uint8_t visibleRegionCacheInvalid : 1; /**< True if the region cache is invalid. */ uint8_t hidden : 1; /**< True if the widget is hidden. */ uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */ - uint8_t modal : 1; /**< True if the widget is modal. */ } Flags; /** @@ -564,14 +563,6 @@ namespace NXWidgets return m_flags.dragging; } - /** - * Is the widget modal? Only true if the Widget singleton is also modal. - * - * @return True if the widget is modal. - */ - - const bool isModal(void) const; - /** * Get the width of the widget. * @@ -1297,21 +1288,6 @@ namespace NXWidgets bool removeChild(CNxWidget *widget); - /** - * Run the widget modally. - */ - - void goModal(void); - - /** - * Stop the widget running modally. - */ - - inline void stopModal(void) - { - m_flags.modal = false; - } - /** * Get the child widget at the specified index. * diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index aedec610e..4a54469d8 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -52,6 +52,8 @@ #include "cnxwidget.hxx" #include "crect.hxx" #include "cwidgetstyle.hxx" +#include "cwindoweventhandler.hxx" +#include "cwindoweventhandlerlist.hxx" #include "tnxarray.hxx" /**************************************************************************** @@ -165,11 +167,15 @@ namespace NXWidgets awaiting deletion. */ TNxArray m_widgets; /**< List of controlled widgets. */ - bool m_modal; /**< True: in modal loop */ bool m_haveGeometry; /**< True: indicates that we have valid geometry data. */ - sem_t m_modalSem; /**< Modal loops waits for +#ifdef CONFIG_NXWIDGET_EVENTWAIT + bool m_waiting; /**< True: Extternal logic waiting for + window event */ + sem_t m_waitSem; /**< External loops waits for events on this semaphore */ +#endif + /** * I/O */ @@ -198,6 +204,7 @@ namespace NXWidgets #ifdef CONFIG_NX_MULTIUSER sem_t m_geoSem; /**< Posted when geometry is valid */ #endif + CWindowEventHandlerList m_eventHandlers; /**< List of event handlers. */ /** * Style @@ -227,15 +234,15 @@ namespace NXWidgets /** * Pass clicks to the widget hierarchy. Closes the context menu if * the clicked widget is not the context menu. If a single widget - * is supplied, only that widget is sent the click. That widget - * should be running modally. + * is supplied, only that widget is sent the click. * * @param x Click xcoordinate. * @param y Click ycoordinate. - * @param widget Pointer to a modally-running widget or NULL. + * @param widget. Specific widget to poll. Use NULL to run the + * all widgets in the window. */ - void handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget* widget); + void handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget *widget); /** * Get the index of the specified controlled widget. @@ -255,8 +262,8 @@ namespace NXWidgets /** * Process mouse/touchscreen events and send throughout the hierarchy. * - * @param widget to process, used for modal widgets; omit this parameter - * to run the whole system. + * @param widget. Specific widget to poll. Use NULL to run the + * all widgets in the window. * @return True means a mouse event occurred */ @@ -279,10 +286,12 @@ namespace NXWidgets bool pollCursorControlEvents(void); /** - * Wake up the modal loop + * Wake up and external logic that is waiting for a window event. */ - void wakeupModalLoop(void); +#ifdef CONFIG_NXWIDGET_EVENTWAIT + void postWindowEvent(void); +#endif /** * Take the geometry semaphore (handling signal interruptions) @@ -340,42 +349,62 @@ namespace NXWidgets ~CWidgetControl(void); /** - * Run the widget modally. This will run the CWidgetControl - * application until stopModal() is called. - */ - - void goModal(void); - - /** - * Wait for an interesting modal event to occur (like a mouse or keyboard event) - */ - - void waitForModalEvent(void); - - /** - * Is the widget modal? Only true if the Widget singleton is also modal. + * Wait for an interesting window event to occur (like a mouse or keyboard event) + * Caller's should exercise care to assure that the test for waiting and this + * call are "atomic" .. perhaps by locking the scheduler like: * - * @return True if the widget is modal. + * sched_lock(); + * + * if () + * { + * window->waitForWindowEvent(); + * } + * sched_unlock(); */ - inline const bool isModal(void) const - { - return m_modal; - } - +#ifdef CONFIG_NXWIDGET_EVENTWAIT + void waitForWindowEvent(void); +#endif + /** - * Stop the widget running modally. + * Is external logic awaiting for a window event? + * + * @return True if the widget if external logic is waiting. */ - void stopModal(void); +#ifdef CONFIG_NXWIDGET_EVENTWAIT + inline const bool isWaiting(void) const + { + return m_waiting; + } +#endif /** * Run all code that needs to take place on a periodic basis. - * This is normally called from and is the main body of goModal() - * with widget == NULL. + * This method normally called externally... either periodically + * or when a window event is detected. If CONFIG_NXWIDGET_EVENTWAIT + * is defined, then external logic want call waitWindow event and + * when awakened, they chould call this function. As an example: * - * @param widget Sub-widget to run, used for modal widgets; omit - * this parameter to run the whole system. + * for (;;) + * { + * sched_lock(); // Make the sequence atomic + * if (!window->pollEvents(0)) + * { + * window->waitWindowEvent(); + * } + * sched_unlock(); + * } + * + * This method is just a wrapper simply calls the followi. + * + * processDeleteQueue() + * pollMouseEvents(widget) + * pollKeyboardEvents() + * pollCursorControlEvents() + * + * @param widget. Specific widget to poll. Use NULL to run the + * all widgets in the window. * @return True means some interesting event occurred */ @@ -551,8 +580,10 @@ namespace NXWidgets * @param nCh The number of characters that are available in pStr[]. * @param pStr The array of characters. */ - + +#ifdef CONFIG_NX_KBD void newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr); +#endif /** * This event means that cursor control data is available for the window. @@ -673,6 +704,29 @@ namespace NXWidgets { return m_port; } + + /** + * Adds a window event handler. The window handler will receive + * notification all NX events received by this window\. + * + * @param eventHandler A pointer to the event handler. + */ + + inline void addWindowEventHandler(CWindowEventHandler *eventHandler) + { + m_eventHandlers.addWindowEventHandler(eventHandler); + } + + /** + * Remove a window event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + + inline void removeWindowEventHandler(CWindowEventHandler *eventHandler) + { + m_eventHandlers.removeWindowEventHandler(eventHandler); + } }; } diff --git a/libnxwidgets/include/cwindoweventhandler.hxx b/libnxwidgets/include/cwindoweventhandler.hxx new file mode 100644 index 000000000..1cea0ba68 --- /dev/null +++ b/libnxwidgets/include/cwindoweventhandler.hxx @@ -0,0 +1,113 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwindoweventhandler.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CWINDOWEVENTHANDLER_HXX +#define __INCLUDE_CWINDOWEVENTHANDLER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "nxconfig.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxWidget; + + /** + * Base CWindowEventHandler class, intended to be subclassed. Any class that + * needs to listen for window events should inherit from this class. + */ + + class CWindowEventHandler + { + public: + /** + * Constructor. + */ + + inline CWindowEventHandler() { } + + /** + * Destructor. + */ + + virtual inline ~CWindowEventHandler() { } + + /** + * Handle a NX window redraw request event + */ + + virtual void handleRedrawEvent(void) { } + + /** + * Handle a NX window position/size change event + */ + + virtual void handleGeometryEvent(void) { } + + /** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE + virtual void handleMouseEvent(void) { } +#endif + + /** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD + virtual void handleKeyboardEvent(void) { } +#endif + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWINDOWEVENTHANDLER_HXX diff --git a/libnxwidgets/include/cwindoweventhandlerlist.hxx b/libnxwidgets/include/cwindoweventhandlerlist.hxx new file mode 100644 index 000000000..582805691 --- /dev/null +++ b/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -0,0 +1,168 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwindoweventhandlerlist.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CWINDOWEVENTHANDLERLIST_HXX +#define __INCLUDE_CWINDOWEVENTHANDLERLIST_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cwindoweventhandler.hxx" +#include "tnxarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CListDataItem; + + /** + * List of window event handlers. + */ + class CWindowEventHandlerList + { + protected: + TNxArray m_eventHandlers; /**< List of event handlers */ + + /** + * Return the index to the window event handler. + */ + + bool findWindowEventHandler(CWindowEventHandler *eventHandler, int &index); + + public: + + /** + * Constructor. + * + * @param widget The owning widget. + */ + + CWindowEventHandlerList(void) { } + + /** + * Destructor. + */ + + inline ~CWindowEventHandlerList(void) { } + + /** + * Get the event handler at the specified index. + * + * @param index The index of the event handler. + * @return The event handler at the specified index. + */ + + inline CWindowEventHandler *at(const int index) const + { + return m_eventHandlers.at(index); + } + + /** + * Get the size of the array. + * + * @return The size of the array. + */ + + inline const nxgl_coord_t size(void) const + { + return m_eventHandlers.size(); + } + + /** + * Adds a window event handler. The event handler will receive + * all events raised by this object. + * @param eventHandler A pointer to the event handler. + */ + + void addWindowEventHandler(CWindowEventHandler *eventHandler); + + /** + * Remove a window event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + + void removeWindowEventHandler(CWindowEventHandler *eventHandler); + + /** + * Raise the NX window redraw event. + */ + + void raiseRedrawEvent(void); + + /** + * Raise an NX window position/size change event. + */ + + void raiseGeometryEvent(void); + + /** + * Raise an NX mouse window input event. + */ + +#ifdef CONFIG_NX_MOUSE + void raiseMouseEvent(void); +#endif + + /** + * Raise an NX keybord input event + */ + +#ifdef CONFIG_NX_KBD + void raiseKeyboardEvent(void); +#endif + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWINDOWEVENTHANDLERLIST_HXX diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 5d3752fd0..5ab883ab1 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -85,6 +85,10 @@ * mode). Default 2048 * CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user * mode). Default 2048 + * CONFIG_NXWIDGET_EVENTWAIT - Build in support for external window event, modal + * loop management logic. This includes methods to wait for windows events + * to occur so that looping logic can sleep until something interesting + * happens with the window. * * NXWidget Configuration * diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 69b1c5c4e..dc6316835 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -215,7 +215,7 @@ bool CNxServer::connect(void) // Start the server task gvdbg("NxServer::connect: Starting server task\n"); - serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, + serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0); if (serverId < 0) { @@ -291,7 +291,7 @@ bool CNxServer::connect(void) #ifndef CONFIG_NX_MULTIUSER void CNxServer::disconnect(void) { - /* Close the server */ + // Close the server if (m_hNxServer) { @@ -324,7 +324,7 @@ void CNxServer::disconnect(void) } } - /* Disconnect from the server */ + // Disconnect from the server if (m_hNxServer) { @@ -346,7 +346,7 @@ int CNxServer::server(int argc, char *argv[]) int ret; #if defined(CONFIG_NXWIDGETS_EXTERNINIT) - /* Use external graphics driver initialization */ + // Use external graphics driver initialization dev = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); if (!dev) @@ -356,7 +356,7 @@ int CNxServer::server(int argc, char *argv[]) } #elif defined(CONFIG_NX_LCDDRIVER) - /* Initialize the LCD device */ + // Initialize the LCD device ret = up_lcdinitialize(); if (ret < 0) @@ -365,7 +365,7 @@ int CNxServer::server(int argc, char *argv[]) return EXIT_FAILURE; } - /* Get the device instance */ + // Get the device instance dev = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO); if (!dev) @@ -374,11 +374,11 @@ int CNxServer::server(int argc, char *argv[]) return EXIT_FAILURE; } - /* Turn the LCD on at 75% power */ + // Turn the LCD on at 75% power (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); #else - /* Initialize the frame buffer device */ + // Initialize the frame buffer device ret = up_fbinitialize(); if (ret < 0) @@ -395,7 +395,7 @@ int CNxServer::server(int argc, char *argv[]) } #endif - /* Then start the server */ + // Then start the server ret = nx_run(dev); gvdbg("nx_run returned: %d\n", errno); @@ -436,7 +436,7 @@ FAR void *CNxServer::listener(FAR void *arg) break; } - /* If we received a message, we must be connected */ + // If we received a message, we must be connected if (!This->m_connected) { diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 4d8a97627..97d24b73c 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -174,7 +174,6 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_flags.erased = true; m_flags.visibleRegionCacheInvalid = true; m_flags.hidden = false; - m_flags.modal = false; // Set hierarchy pointers @@ -397,17 +396,6 @@ const bool CNxWidget::isEnabled() const return false; } -/** - * Is the widget modal? Only true if the Widget singleton is also modal. - * - * @return True if the widget is modal. - */ - -const bool CNxWidget::isModal(void) const -{ - return m_widgetControl->isModal() & m_flags.modal; -} - /** * Insert the dimensions that this widget wants to have into the rect * passed in as a parameter. All coordinates are relative to the widget's @@ -576,10 +564,6 @@ void CNxWidget::close(void) release(clickedWidget->getX(), clickedWidget->getY()); } - // Ensure the widget isn't running modally - - stopModal(); - if (m_parent != (CNxWidget *)NULL) { m_parent->closeChild(this); @@ -622,10 +606,6 @@ bool CNxWidget::hide(void) if (!m_flags.hidden) { m_flags.hidden = true; - - // Ensure the widget isn't running modally - - stopModal(); m_widgetEventHandlers->raiseHideEvent(); return true; } @@ -1398,39 +1378,6 @@ bool CNxWidget::removeChild(CNxWidget *widget) return false; } -/** - * Run the widget modally. - */ - -void CNxWidget::goModal(void) -{ - // Remember that we're running modally - - m_flags.modal = true; - - // Steal focus - - focus(); - - // Loop until no longer modal - - while (isModal()) - { - // Process pending events - - bool interestingEvent = m_widgetControl->pollEvents(this); - - // Did any interesting events occur? - - if (!interestingEvent) - { - // No, give up the CPU until something interesting happens. - - m_widgetControl->waitForModalEvent(); - } - } -} - /** * Get the child widget at the specified index. * diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 9c0d67be3..5ecd8ab22 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -83,7 +83,6 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) // Initialize state m_port = (CGraphicsPort *)NULL; - m_modal = false; m_haveGeometry = false; m_clickedWidget = (CNxWidget *)NULL; m_focusedWidget = (CNxWidget *)NULL; @@ -108,12 +107,15 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) // Intialize semaphores: // - // m_modalSem. The semaphore that will wake up the modal loop on mouse or - // keypress events + // m_waitSem. The semaphore that will wake up the external logic on mouse events, + // keypress events, or widget deletion events. // m_geoSem. The semaphore that will synchronize window size and position - // informatin. + // information. - sem_init(&m_modalSem, 0, 0); +#ifdef CONFIG_NXWIDGET_EVENTWAIT + m_waiting = false; + sem_init(&m_waitSem, 0, 0); +#endif #ifdef CONFIG_NX_MULTIUSER sem_init(&m_geoSem, 0, 0); #endif @@ -141,9 +143,12 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) CWidgetControl::~CWidgetControl(void) { - // Stop any ongoing modal operation + // Notify any external waiters... this should not happen becaue it + // it is probably already too late - stopModal(); +#ifdef CONFIG_NXWIDGET_EVENTWAIT + postWindowEvent(); +#endif // Delete any contained instances @@ -165,88 +170,69 @@ CWidgetControl::~CWidgetControl(void) } /** - * Run the widget modally. This will run the CWidgetControl - * application until stopModal() is called. + * Wait for an interesting window event to occur (like a mouse or keyboard event). + * Caller's should exercise care to assure that the test for waiting and this + * call are "atomic" .. perhaps by locking the scheduler like: + * + * sched_lock(); + * ... + * if (no interesting events) + * { + * window->waitForWindowEvent(); + * } + * sched_unlock(); */ - -void CWidgetControl::goModal(void) + +#ifdef CONFIG_NXWIDGET_EVENTWAIT +void CWidgetControl::waitForWindowEvent(void) { - // Enter modal - - m_modal = true; - - // Loop until stopModal() is called - - while (m_modal) - { - // Process pending events - - bool interestingEvent = pollEvents(); - - // Did any interesting events occur? - - if (!interestingEvent) - { - // No, give up the CPU until something interesting happens. - - waitForModalEvent(); - } - } + m_waiting = true; + (void)sem_wait(&m_waitSem); + m_waiting = false; } +#endif /** - * Wait for an interesting modal event to occur (like a mouse or keyboard event) + * Wake up external logic waiting for a window event */ -void CWidgetControl::waitForModalEvent(void) +#ifdef CONFIG_NXWIDGET_EVENTWAIT +void CWidgetControl::postWindowEvent(void) { - // It would be an error if this were called outside of a modal loop - - if (m_modal) + if (m_waiting) { - // Wait for an interesting event (like a mouse or keyboard event) - - (void)sem_wait(&m_modalSem); - } -} - -/** - * Wake up the modal loop - */ - -void CWidgetControl::wakeupModalLoop(void) -{ - if (m_modal) - { - (void)sem_post(&m_modalSem); - } -} - -/** - * Stop the widget running modally. - */ - -void CWidgetControl::stopModal(void) -{ - if (m_modal) - { - // No longer modal - - m_modal = false; - - // Wake up the modal loop so that it can terminate properly - - (void)sem_post(&m_modalSem); + (void)sem_post(&m_waitSem); } } +#endif /** * Run all code that needs to take place on a periodic basis. - * This is normally called from and is the main body of goModal() - * with widget == NULL. + * This method normally called externally... either periodically + * or when a window event is detected. If CONFIG_NXWIDGET_EVENTWAIT + * is defined, then external logic want call waitWindow event and + * when awakened, they chould call this function. As an example: * - * @param widget Sub-widget to run, used for modal widgets; omit - * this parameter to run the whole system. + * for (;;) + * { + * sched_lock(); // Make the sequence atomic + * if (!window->pollEvents(0)) + * { + * window->waitWindowEvent(); + * } + * sched_unlock(); + * } + * + * This method is just a wrapper simply calls the following methods. + * It can easily be replace with custom, external logic. + * + * processDeleteQueue() + * pollMouseEvents(widget) + * pollKeyboardEvents() + * pollCursorControlEvents() + * + * @param widget. Specific widget to poll. Use NULL to run the + * all widgets in the window. * @return True means some interesting event occurred */ @@ -316,7 +302,15 @@ void CWidgetControl::removeControlledWidget(CNxWidget *widget) void CWidgetControl::addToDeleteQueue(CNxWidget *widget) { + // Add the widget to the delete queue + m_deleteQueue.push_back(widget); + + // Then wake up logic that may be waiting for a window event + +#ifdef CONFIG_NXWIDGET_EVENTWAIT + postWindowEvent(); +#endif } /** @@ -422,6 +416,7 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, giveGeoSem(); } + m_eventHandlers.raiseGeometryEvent(); sched_unlock(); } @@ -439,6 +434,7 @@ void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more { CRect rect; rect.setNxRect(nxRect); + m_eventHandlers.raiseRedrawEvent(); } /** @@ -449,7 +445,8 @@ void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. */ - + +#ifdef CONFIG_NX_MOUSE void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons) { // Save the mouse X/Y position @@ -569,10 +566,17 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b } #endif - // Then wake up the modal loop + // Notify any external logic that a keyboard event has occurred - wakeupModalLoop(); + m_eventHandlers.raiseMouseEvent(); + + // Then wake up logic that may be waiting for a window event + +#ifdef CONFIG_NXWIDGET_EVENTWAIT + postWindowEvent(); +#endif } +#endif /** * This event is called from CCallback instance to provide notifications of @@ -582,7 +586,8 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b * @param nCh The number of characters that are available in pStr[]. * @param pStr The array of characters. */ - + +#ifdef CONFIG_NX_KBD void CWidgetControl::newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr) { FAR uint8_t *pBuffer = &m_kbdbuf[m_nCh]; @@ -596,10 +601,17 @@ void CWidgetControl::newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr) *pBuffer++ = *pStr++; } - // Then wake up the modal loop + // Notify any external logic that a keyboard event has occurred - wakeupModalLoop(); + m_eventHandlers.raiseKeyboardEvent(); + + // Then wake up logic that may be waiting for a window event + +#ifdef CONFIG_NXWIDGET_EVENTWAIT + postWindowEvent(); +#endif } +#endif /** * This event means that cursor control data is available for the window. @@ -617,9 +629,11 @@ void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl) m_nCc++; } - // Then wake up the modal loop + // Then wake up logic that may be waiting for a window event - wakeupModalLoop(); +#ifdef CONFIG_NXWIDGET_EVENTWAIT + postWindowEvent(); +#endif } /** @@ -718,17 +732,16 @@ uint32_t CWidgetControl::elapsedTime(FAR const struct timespec *startTime) /** * Pass clicks to the widget hierarchy. If a single widget - * is supplied, only that widget is sent the click. That widget - * should be running modally. + * is supplied, only that widget is sent the click. * * @param x Click xcoordinate. * @param y Click ycoordinate. - * @param widget Pointer to a modally-running widget or NULL. + * @param widget Pointer to a specific widget or NULL. */ void CWidgetControl::handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget *widget) { - // Working with a modal widget or the whole structure? + // Working with a specific widget or the whole structure? if (widget == (CNxWidget *)NULL) { @@ -769,8 +782,8 @@ void CWidgetControl::processDeleteQueue(void) /** * Process mouse/touchscreen events and send throughout the hierarchy. * - * @param widget to process, used for modal widgets; omit this parameter - * to run the whole system. + * @param widget. Specific widget to poll. Use NULL to run the + * all widgets in the window. * @return True means a mouse event occurred */ diff --git a/nxwm/Makefile b/nxwm/Makefile index badc5eb21..35656408b 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -42,7 +42,7 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = # Window Manager -CXXSRCS = capplicationwindow.cxx cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx +CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx # Images CXXSRCS += glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 924389709..e8ce53740 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -49,6 +49,9 @@ #include "cimage.hxx" #include "clabel.hxx" #include "crlepalettebitmap.hxx" +#include "cwindoweventhandler.hxx" + +#include "iapplicationwindow.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -62,34 +65,15 @@ namespace NxWM { - /** - * This callback class is used by the application to get notification of toolbar - * related events. - */ - - class IApplicationCallback - { - public: - /** - * Called when the window minimize button is pressed. - */ - - virtual void minimize(void) = 0; - - /** - * Called when the window minimize close is pressed. - */ - - virtual void close(void) = 0; - }; - /** * This class represents that application window. This class contains that the * framed window and its toolbar. It manages callbacks from the toolbar minimize * and close buttions and passes these to the application via callbacks. */ - class CApplicationWindow : private NXWidgets::CWidgetEventHandler + class CApplicationWindow : public IApplicationWindow, + private NXWidgets::CWidgetEventHandler, + private NXWidgets::CWindowEventHandler { protected: NXWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ @@ -102,6 +86,24 @@ namespace NxWM NXWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ IApplicationCallback *m_callback; /**< Toolbar action callbacks */ + /** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE + void handleMouseEvent(void); +#endif + + /** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD + void handleKeyboardEvent(void); +#endif + /** * Handle a mouse button click event. * @@ -154,10 +156,7 @@ namespace NxWM * @return. The window used by this application */ - inline NXWidgets::CNxTkWindow *getWindow(void) const - { - return m_window; - } + NXWidgets::INxWindow *getWindow(void) const; /** * Set the window label @@ -165,40 +164,21 @@ namespace NxWM * @param appname. The name of the application to place on the window */ - inline void setWindowLabel(NXWidgets::CNxString &appname) - { - m_windowLabel->setText(appname); - } + void setWindowLabel(NXWidgets::CNxString &appname); /** * Register to receive callbacks when toolbar icons are selected */ - void registerCallbacks(IApplicationCallback *callback) - { - m_callback = callback; - } + void registerCallbacks(IApplicationCallback *callback); /** * Simulate a mouse click on the minimize icon. This inline method is only * used during automated testing of NxWM. */ -#ifdef CONFIG_NXWM_UNITTEST - inline void clickMinimizeIcon(int index) - { - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - m_minimizeImage->getSize(imageSize); - - struct nxgl_point_s imagePos; - m_minimizeImage->getPos(imagePos); - - // And click the image at its center - - m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + void clickMinimizeIcon(int index); #endif /** @@ -206,21 +186,8 @@ namespace NxWM * used during automated testing of NxWM. */ -#ifdef CONFIG_NXWM_UNITTEST - inline void clickStopIcon(int index) - { - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - m_stopImage->getSize(imageSize); - - struct nxgl_point_s imagePos; - m_stopImage->getPos(imagePos); - - // And click the image at its center - - m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + void clickStopIcon(int index); #endif }; } diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx new file mode 100644 index 000000000..41425bf4c --- /dev/null +++ b/nxwm/include/cfullscreenwindow.hxx @@ -0,0 +1,172 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cfullscreenwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CFULLSCREENWINDOW_NXX +#define __INCLUDE_CFULLSCREENWINDOW_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "cnxwindow.hxx" + +#include "iapplicationwindow.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This class represents a generic window. This bland window is used, + * for example, to support full screen displays. + */ + + class CFullScreenWindow : public IApplicationWindow, + private NXWidgets::CWindowEventHandler + { + protected: + NXWidgets::CNxWindow *m_window; /**< The generic window used by the application */ + + /** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE + void handleMouseEvent(void); +#endif + + /** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD + void handleKeyboardEvent(void); +#endif + + public: + + /** + * CFullScreenWindow Constructor + * + * @param window. The raw window to be used by this full screen application. + */ + + CFullScreenWindow(NXWidgets::CNxWindow *window); + + /** + * CFullScreenWindow Destructor + */ + + ~CFullScreenWindow(void); + + /** + * Initialize window. Window initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully initialized. + */ + + bool open(void); + + /** + * Re-draw the application window + */ + + void redraw(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + + void hide(void); + + /** + * Recover the contained NXTK window instance + * + * @return. The window used by this application + */ + + NXWidgets::INxWindow *getWindow(void) const; + + /** + * Set the window label + * + * @param appname. The name of the application to place on the window + */ + + void setWindowLabel(NXWidgets::CNxString &appname); + + /** + * Register to receive callbacks when toolbar icons are selected + */ + + void registerCallbacks(IApplicationCallback *callback); + + /** + * Simulate a mouse click on the minimize icon. This inline method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + void clickMinimizeIcon(int index); +#endif + + /** + * Simulate a mouse click on the stop applicaiton icon. This inline method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + void clickStopIcon(int index); +#endif + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CFULLSCREENWINDOW_NXX diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 7754276a7..7682e6620 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -125,7 +125,7 @@ namespace NxWM * the contained CApplicationWindow instance. */ - CApplicationWindow *getWindow(void) const; + IApplicationWindow *getWindow(void) const; /** * Get the icon associated with the application diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 924cc7d05..12f15566b 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -138,7 +138,7 @@ namespace NxWM * the contained CApplicationWindow instance. */ - CApplicationWindow *getWindow(void) const; + IApplicationWindow *getWindow(void) const; /** * Get the icon associated with the application diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 4e12fdb2c..7043ef3a1 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -49,6 +49,11 @@ #include "cwidgeteventhandler.hxx" #include "cwidgeteventargs.hxx" +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +#include "capplicationwindow.hxx" +#include "cfullscreenwindow.hxx" #include "iapplication.hxx" /**************************************************************************** @@ -130,9 +135,10 @@ namespace NxWM * Set size and position of a window in the application area. * * @param window. The window to be resized and repositioned + * @param fullscreen. True: Use full screen */ - void setApplicationGeometry(NXWidgets::INxWindow *window); + void setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscreen); /** * Create the task bar window. @@ -281,8 +287,8 @@ namespace NxWM bool startWindowManager(void); /** - * Create an application window. Creating a new application in the start - * window requires three steps: + * Create an normal application window. Creating a normal application in the + * start window requires three steps: * * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's @@ -298,6 +304,24 @@ namespace NxWM CApplicationWindow *openApplicationWindow(void); + /** + * Create a full screen application window. Creating a new full screen application + * requires three steps: + * + * 1. Call CTaskBar::FullScreenWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call CStartWindow::addApplication to add the application to the + * start window. + * + * When the application is selected from the start window: + * + * 4. Call CTaskBar::startApplication start the application and bring its window to + * the top. + */ + + CFullScreenWindow *openFullScreenWindow(void); + /** * Start an application and add its icon to the taskbar. The applications's * window is brought to the top. Creating a new application in the start diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index be9a96fe5..e92e1908e 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -78,7 +78,7 @@ namespace NxWM * the contained CApplicationWindow instance. */ - virtual CApplicationWindow *getWindow(void) const = 0; + virtual IApplicationWindow *getWindow(void) const = 0; /** * Get the icon associated with the application diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx new file mode 100644 index 000000000..115998775 --- /dev/null +++ b/nxwm/include/iapplicationwindow.hxx @@ -0,0 +1,160 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/iapplicationwindow.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_IAPPLICATIONWINDOW_NXX +#define __INCLUDE_IAPPLICATIONWINDOW_NXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include "cnxtkwindow.hxx" +#include "cnxtoolbar.hxx" +#include "cwidgeteventargs.hxx" +#include "cwidgeteventhandler.hxx" +#include "cimage.hxx" +#include "clabel.hxx" +#include "crlepalettebitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Abstract Base Class + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This callback class is used by the application to get notification of toolbar + * related events. + */ + + class IApplicationCallback + { + public: + /** + * Called when the window minimize button is pressed. + */ + + virtual void minimize(void) = 0; + + /** + * Called when the window minimize close is pressed. + */ + + virtual void close(void) = 0; + }; + + /** + * This class represents the general application window. The actual window + * may be a contained, framed window or and unframed, fullscreen window. + */ + + class IApplicationWindow + { + public: + /** + * Initialize window. Window initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully initialized. + */ + + virtual bool open(void) = 0; + + /** + * Re-draw the application window + */ + + virtual void redraw(void) = 0; + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + + virtual void hide(void) = 0; + + /** + * Recover the contained window instance + * + * @return. The window used by this application + */ + + virtual NXWidgets::INxWindow *getWindow(void) const = 0; + + /** + * Set the window label + * + * @param appname. The name of the application to place on the window + */ + + virtual void setWindowLabel(NXWidgets::CNxString &appname) = 0; + + /** + * Register to receive callbacks when toolbar icons are selected + */ + + virtual void registerCallbacks(IApplicationCallback *callback) = 0; + + /** + * Simulate a mouse click on the minimize icon. This inline method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + virtual void clickMinimizeIcon(int index) = 0; +#endif + + /** + * Simulate a mouse click on the stop applicaiton icon. This inline method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) + virtual void clickStopIcon(int index) = 0; +#endif + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_IAPPLICATIONWINDOW_NXX diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 57566b2d4..15d0cdad7 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -61,6 +61,7 @@ * * CONFIG_NXWM_DEFAULT_FONTID - the NxWM default font ID. Default: * NXFONT_DEFAULT + * CONFIG_NXWM_TOUCHSCREEN - Define to build in touchscreen support. */ #ifndef CONFIG_HAVE_CXX diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 0fb6f387a..ad57ba4b2 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -62,8 +62,7 @@ /** * CApplicationWindow Constructor * - * @param taskbar. A pointer to the parent task bar instance - * @param window. The window to be used by this application. + * @param taskbar. A pointer to the parent task bar instance. */ CApplicationWindow::CApplicationWindow(NXWidgets::CNxTkWindow *window) @@ -134,7 +133,7 @@ CApplicationWindow::~CApplicationWindow(void) } // We didn't create the window. That was done by the task bar, - // Be we will handle destruction of with window as a courtesy. + // But we will handle destruction of with window as a courtesy. if (m_window) { @@ -314,6 +313,14 @@ bool CApplicationWindow::open(void) m_windowLabel->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_LEFT); m_windowLabel->setTextAlignmentVert(NXWidgets::CLabel::TEXT_ALIGNMENT_VERT_CENTER); m_windowLabel->setRaisesEvents(false); + + // Get the window control + + NXWidgets::CWidgetControl *windowControl = m_window->getWidgetControl(); + + // Register to receive callbacks on a few select window events + + windowControl->addWindowEventHandler(this); return true; } @@ -380,6 +387,151 @@ void CApplicationWindow::hide(void) m_windowLabel->disableDrawing(); } +/** + * Recover the contained NXTK window instance + * + * @return. The window used by this application + */ + +NXWidgets::INxWindow *CApplicationWindow::getWindow(void) const +{ + return static_cast(m_window); +} + +/** + * Set the window label + * + * @param appname. The name of the application to place on the window + */ + +void CApplicationWindow::setWindowLabel(NXWidgets::CNxString &appname) +{ + m_windowLabel->setText(appname); +} + +/** + * Register to receive callbacks when toolbar icons are selected + */ + +void CApplicationWindow::registerCallbacks(IApplicationCallback *callback) +{ + m_callback = callback; +} + +/** + * Simulate a mouse click on the minimize icon. This method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CApplicationWindow::clickMinimizeIcon(int index) +{ + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_minimizeImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_minimizeImage->getPos(imagePos); + + // And click the image at its center + + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); +} +#endif + +/** + * Simulate a mouse click on the stop applicaiton icon. This method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CApplicationWindow::clickStopIcon(int index) +{ + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + m_stopImage->getSize(imageSize); + + struct nxgl_point_s imagePos; + m_stopImage->getPos(imagePos); + + // And click the image at its center + + m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); +} +#endif + +/** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE +void CApplicationWindow::handleMouseEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives mouse input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the mouse input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update mouse information then raise the + // mouse event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the wiget control to process + // the mouse input. + + // Get the CWidgetControl associated with the window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // And perform a poll + + control->pollEvents(); +} +#endif + +/** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD +void CApplicationWindow::handleKeyboardEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives keyboard input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the keyboard input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update keyboard information then raise the + // keyboard event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the wiget control to process + // the keyboard input. + + // Get the CWidgetControl associated with the window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // And perform a poll + + control->pollEvents(); +} +#endif + /** * Handle a mouse button click event. * diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx new file mode 100644 index 000000000..d4fcf23b2 --- /dev/null +++ b/nxwm/src/cfullscreenwindow.cxx @@ -0,0 +1,247 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cfullscreen.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "cgraphicsport.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "cfullscreenwindow.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CFullScreenWindow Method Implementations + ********************************************************************************************/ + + using namespace NxWM; + +/** + * CFullScreenWindow Constructor + * + * @param window. The raw window to be used by this application. + */ + +CFullScreenWindow::CFullScreenWindow(NXWidgets::CNxWindow *window) +{ + // Save the window for later use + + m_window = window; +} + +/** + * CFullScreenWindow Destructor + */ + +CFullScreenWindow::~CFullScreenWindow(void) +{ + // We didn't create the window. That was done by the task bar, + // But we will handle destruction of with window as a courtesy. + + if (m_window) + { + delete m_window; + } +} + +/** + * Initialize window. Window initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the window was successfully initialized. + */ + +bool CFullScreenWindow::open(void) +{ + // Get the window control + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Register to receive callbacks on a few select window events + + control->addWindowEventHandler(this); + return true; +} + +/** + * Re-draw the application window + */ + +void CFullScreenWindow::redraw(void) +{ +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy) + */ + +void CFullScreenWindow::hide(void) +{ +} + +/** + * Recover the contained raw window instance + * + * @return. The window used by this application + */ + +NXWidgets::INxWindow *CFullScreenWindow::getWindow(void) const +{ + return static_cast(m_window); +} + +/** + * Set the window label + * + * @param appname. The name of the application to place on the window + */ + +void CFullScreenWindow::setWindowLabel(NXWidgets::CNxString &appname) +{ +} + +/** + * Register to receive callbacks when toolbar icons are selected + */ + +void CFullScreenWindow::registerCallbacks(IApplicationCallback *callback) +{ +} + +/** + * Simulate a mouse click on the minimize icon. This method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CFullScreenWindow::clickMinimizeIcon(int index) +{ +} +#endif + +/** + * Simulate a mouse click on the stop applicaiton icon. This method is only + * used during automated testing of NxWM. + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CFullScreenWindow::clickStopIcon(int index) +{ +} +#endif + +/** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE +void CFullScreenWindow::handleMouseEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives mouse input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the mouse input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update mouse information then raise the + // mouse event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the wiget control to process + // the mouse input. + + // Get the CWidgetControl associated with the window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // And perform a poll + + control->pollEvents(); +} +#endif + +/** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD +void CFullScreenWindow::handleKeyboardEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives keyboard input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the keyboard input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update keyboard information then raise the + // keyboard event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the wiget control to process + // the keyboard input. + + // Get the CWidgetControl associated with the window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // And perform a poll + + control->pollEvents(); +} +#endif + + diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 8898b8bcb..5ee12d36f 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -153,9 +153,9 @@ CNxConsole::~CNxConsole(void) * the contained CApplicationWindow instance. */ -CApplicationWindow *CNxConsole::getWindow(void) const +IApplicationWindow *CNxConsole::getWindow(void) const { - return m_window; + return static_cast(m_window); } /** @@ -202,7 +202,7 @@ bool CNxConsole::run(void) // Recover the NXTK window instance contained in the application window - NXWidgets::CNxTkWindow *window = m_window->getWindow(); + NXWidgets::INxWindow *window = m_window->getWindow(); // Get the widget control associated with the NXTK window @@ -308,7 +308,7 @@ void CNxConsole::redraw(void) { // Recover the NXTK window instance contained in the application window - NXWidgets::CNxTkWindow *window = m_window->getWindow(); + NXWidgets::INxWindow *window = m_window->getWindow(); // Get the size of the window diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index a29f1f785..8da71b2b5 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -101,12 +101,12 @@ CStartWindow::~CStartWindow(void) /** * Each implementation of IApplication must provide a method to recover - * the contained CApplicationWindow instance. + * the contained IApplicationWindow instance. */ -CApplicationWindow *CStartWindow::getWindow(void) const +IApplicationWindow *CStartWindow::getWindow(void) const { - return m_window; + return static_cast(m_window); } /** @@ -184,7 +184,7 @@ void CStartWindow::redraw(void) { // Recover the NXTK window instance contained in the application window - NXWidgets::CNxTkWindow *window = m_window->getWindow(); + NXWidgets::INxWindow *window = m_window->getWindow(); // Get the widget control associated with the NXTK window @@ -298,7 +298,7 @@ bool CStartWindow::addApplication(IApplication *app) { // Recover the NXTK window instance contained in the application window - NXWidgets::CNxTkWindow *window = m_window->getWindow(); + NXWidgets::INxWindow *window = m_window->getWindow(); // Get the widget control associated with the NXTK window diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 2c6bf660b..34bf53d1a 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -45,8 +45,6 @@ #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" -#include "nxwmconfig.hxx" -#include "nxwmglyphs.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -250,13 +248,14 @@ bool CTaskbar::startWindowManager(void) } /** - * Create an application window. Creating a new application in the start - * window requires three steps: + * Create an normal application window. Creating a normal application in the + * start window requires three steps: * * 1. Call CTaskBar::openApplicationWindow to create a window for the application, * 2. Instantiate the application, providing the window to the application's * constructor, - * 3. Then call CStartWindow::addApplication to add the application to the start window. + * 3. Then call CStartWindow::addApplication to add the application to the + * start window. * * When the application is selected from the start window: * @@ -266,7 +265,7 @@ bool CTaskbar::startWindowManager(void) CApplicationWindow *CTaskbar::openApplicationWindow(void) { - // Create a framed window for the application + // Get a framed window for the application NXWidgets::CNxTkWindow *window = openFramedWindow(); if (!window) @@ -276,17 +275,58 @@ CApplicationWindow *CTaskbar::openApplicationWindow(void) // Set size and position of a window in the application area. - setApplicationGeometry(window); + setApplicationGeometry(window, false); // Use this window to instantiate the application window - CApplicationWindow *appwindow = new CApplicationWindow(window); - if (!appwindow) + CApplicationWindow *appWindow = new CApplicationWindow(window); + if (!appWindow) { delete window; } - return appwindow; + return appWindow; +} + +/** + * Create a full screen application window. Creating a new full screen application + * requires three steps: + * + * 1. Call CTaskBar::FullScreenWindow to create a window for the application, + * 2. Instantiate the application, providing the window to the application's + * constructor, + * 3. Then call CStartWindow::addApplication to add the application to the + * start window. + * + * When the application is selected from the start window: + * + * 4. Call CTaskBar::startApplication start the application and bring its window to + * the top. + */ + +CFullScreenWindow *CTaskbar::openFullScreenWindow(void) +{ + // Get a raw window for the application + + NXWidgets::CNxWindow *window = openRawWindow(); + if (!window) + { + return (CFullScreenWindow *)0; + } + + // Set size and position of a window in the application area. + + setApplicationGeometry(window, true); + + // Use this window to instantiate the generia application window + + CFullScreenWindow *appWindow = new CFullScreenWindow(window); + if (!appWindow) + { + delete window; + } + + return appWindow; } /** @@ -561,7 +601,7 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) NXWidgets::CWidgetControl *widgetControl = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); - // Get an (uninitialized) instance of the background window as a class + // Get an (uninitialized) instance of the framed window as a class // that derives from INxWindow. NXWidgets::CNxTkWindow *window = createFramedWindow(widgetControl); @@ -588,11 +628,12 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) * Set size and position of a window in the application area. * * @param window. The window to be resized and repositioned + * @param fullscreen. True: Use full screen * * @return true on success */ -void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) +void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscreen) { // Get the widget control from the task bar window. The physical window geometry // should be the same for all windows. @@ -609,31 +650,44 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window) struct nxgl_point_s pos; struct nxgl_size_s size; + // In fullscreen mode, the application window gets everything + + if (fullscreen) + { + pos.x = 0; + pos.y = 0; + + size.w = rect.getWidth(); + size.h = rect.getHeight(); + } + else + { #if defined(CONFIG_NXWM_TASKBAR_TOP) - pos.x = 0; - pos.y = CONFIG_NXWM_TASKBAR_WIDTH; + pos.x = 0; + pos.y = CONFIG_NXWM_TASKBAR_WIDTH; - size.w = rect.getWidth(); - size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.w = rect.getWidth(); + size.h = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) - pos.x = 0; - pos.y = 0; + pos.x = 0; + pos.y = 0; - size.w = rect.getWidth(); - size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.w = rect.getWidth(); + size.h = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_LEFT) - pos.x = CONFIG_NXWM_TASKBAR_WIDTH; - pos.y = 0; + pos.x = CONFIG_NXWM_TASKBAR_WIDTH; + pos.y = 0; - size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); #else - pos.x = 0; - pos.y = 0; + pos.x = 0; + pos.y = 0; - size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = rect.getHeight(); #endif + } /* Set the size and position the window. * @@ -730,7 +784,7 @@ bool CTaskbar::createBackgroundWindow(void) // Set the geometry to fit in the application window space - setApplicationGeometry(static_cast(m_background)); + setApplicationGeometry(static_cast(m_background), false); return true; } @@ -1034,11 +1088,11 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) // Every application provides a method to obtain its application window - CApplicationWindow *appWindow = app->getWindow(); + IApplicationWindow *appWindow = app->getWindow(); // Each application window provides a method to get the underlying NX window - NXWidgets::CNxTkWindow *window = appWindow->getWindow(); + NXWidgets::INxWindow *window = appWindow->getWindow(); // Raise the application window to the top of the hierarchy @@ -1085,7 +1139,7 @@ void CTaskbar::hideApplicationWindow(IApplication *app) // Every application provides a method to obtain its application window - CApplicationWindow *appWindow = app->getWindow(); + IApplicationWindow *appWindow = app->getWindow(); // Hide the application window toolbar diff --git a/nxwm/src/glyph_play.cxx b/nxwm/src/glyph_play.cxx index a6970b2e0..1c6ce8cd9 100644 --- a/nxwm/src/glyph_play.cxx +++ b/nxwm/src/glyph_play.cxx @@ -60,6 +60,8 @@ #define BITMAP_NCOLUMNS 25 #define BITMAP_NLUTCODES 6 +#define DARK_PLAY_ICON 1 + /******************************************************************************************** * Private Bitmap Data ********************************************************************************************/ @@ -69,6 +71,21 @@ using namespace NxWM; /* RGB24 (8-8-8) Colors */ #if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_PLAY_ICON + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00a200, 0x006300, 0x004e00, 0x008100, 0x003600 /* Codes 1-5 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00d800, 0x008400, 0x006800, 0x00ac00, 0x004800, /* Codes 1-5 */ +}; + +# else /* DARK_PLAY_ICON */ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = { @@ -81,9 +98,26 @@ static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x3fe13f, 0x3fa23f, 0x3f8d3f, 0x3fc03f, 0x3f753f /* Codes 1-5 */ }; +# endif /* DARK_PLAY_ICON */ + /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ #elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_PLAY_ICON + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0500, 0x0300, 0x0260, 0x0400, 0x01a0 /* Codes 1-5 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x06c0, 0x0420, 0x0340, 0x0560, 0x0240, /* Codes 1-5 */ +}; + +# else /* DARK_PLAY_ICON */ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = { @@ -97,6 +131,8 @@ static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = 0x3f07, 0x3d07, 0x3c67, 0x3e07, 0x3ba7, /* Codes 0-5 */ }; +# endif /* DARK_PLAY_ICON */ + /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used * to lookup an 8-bit value. There is no savings in that! It would be better to just put * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these @@ -109,6 +145,22 @@ static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = /* 8-bit Greyscale */ +# ifdef DARK_PLAY_ICON + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x5f, 0x3a, 0x2d, 0x4b, 0x1f /* Codes 1-5 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x7e, 0x4d, 0x3d, 0x64, 0x2a /* Codes 1-5 */ +}; + +# else /* DARK_PLAY_ICON */ + static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ @@ -121,10 +173,26 @@ static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = 0x9e, 0x79, 0x6c, 0x8a, 0x5e /* Codes 1-5 */ }; +# endif /* DARK_PLAY_ICON */ # else /* CONFIG_NXWIDGETS_GREYSCALE */ /* RGB8 (332) Colors */ +# ifdef DARK_PLAY_ICON +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x14, 0x0c, 0x08, 0x10, 0x04 /* Codes 1-5 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x18, 0x10, 0x0c, 0x14, 0x08 /* Codes 1-5 */ +}; + +# else /* DARK_PLAY_ICON */ + static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ @@ -137,7 +205,8 @@ static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = 0x3c, 0x34, 0x30, 0x38, 0x2c /* Codes 0-5 */ }; -# endif +# endif /* DARK_PLAY_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ #else # error "Unsupport pixel format" #endif From a4fecca40b819d5e96a6fe47463835dde0dbb304 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 9 May 2012 19:32:56 +0000 Subject: [PATCH 040/390] Missed a file in the last checkin git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4717 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/src/cwindoweventhandlerlist.cxx | 161 +++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 libnxwidgets/src/cwindoweventhandlerlist.cxx diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx new file mode 100644 index 000000000..68f5e9d47 --- /dev/null +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -0,0 +1,161 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cwindoweventhandlerlist.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "nxconfig.hxx" + +#include "cwindoweventhandler.hxx" +#include "cwindoweventhandlerlist.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Adds a window event handler. The event handler will receive + * all events raised by this object. + * @param eventHandler A pointer to the event handler. + */ + +void CWindowEventHandlerList::addWindowEventHandler(CWindowEventHandler *eventHandler) +{ + // Make sure that the event handler does not already exist + + int index; + if (!findWindowEventHandler(eventHandler, index)) + { + // Add the new handler + + m_eventHandlers.push_back(eventHandler); + } +} + +/** + * Remove a window event handler. + * + * @param eventHandler A pointer to the event handler to remove. + */ + +void CWindowEventHandlerList::removeWindowEventHandler(CWindowEventHandler *eventHandler) +{ + // Find the event handler to be removed + + int index; + if (findWindowEventHandler(eventHandler, index)) + { + // and remove it + + m_eventHandlers.erase(index); + } +} + +/** + * Return the index to the window event handler. + */ + +bool CWindowEventHandlerList::findWindowEventHandler(CWindowEventHandler *eventHandler, int &index) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + if (m_eventHandlers.at(i) == eventHandler) + { + index = i; + return true; + } + } + + return false; +} + +/** + * Raise the NX window redraw event. + */ + +void CWindowEventHandlerList::raiseRedrawEvent(void) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + m_eventHandlers.at(i)->handleRedrawEvent(); + } +} + +/** + * Raise an NX window position/size change event. + */ + +void CWindowEventHandlerList::raiseGeometryEvent(void) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + m_eventHandlers.at(i)->handleGeometryEvent(); + } +} + +/** + * Raise an NX mouse window input event. + */ + +#ifdef CONFIG_NX_MOUSE +void CWindowEventHandlerList::raiseMouseEvent(void) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + m_eventHandlers.at(i)->handleMouseEvent(); + } +} +#endif + +/** + * Raise an NX keybord input event + */ + +#ifdef CONFIG_NX_KBD +void CWindowEventHandlerList::raiseKeyboardEvent(void) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + m_eventHandlers.at(i)->handleKeyboardEvent(); + } +#endif +} From c5e96122d193b4a7af3cace94e0782a2bc317929 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 9 May 2012 22:30:19 +0000 Subject: [PATCH 041/390] Adding beginning of NxWM touchscreen support git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4718 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 + UnitTests/nxwm/main.cxx | 92 +++++- nxwm/Makefile | 6 +- nxwm/images/calibration.png | Bin 0 -> 494 bytes nxwm/images/cmd.png | Bin nxwm/images/minimize.png | Bin nxwm/images/nxlogo.png | Bin nxwm/images/play.png | Bin nxwm/images/start.png | Bin nxwm/images/stop.png | Bin nxwm/include/ccalibration.hxx | 244 +++++++++++++++ nxwm/include/cstartwindow.hxx | 2 +- nxwm/include/ctaskbar.hxx | 2 +- nxwm/include/ctouchscreen.hxx | 106 +++++++ nxwm/include/nxwmconfig.hxx | 23 ++ nxwm/include/nxwmglyphs.hxx | 1 + nxwm/src/ccalibration.cxx | 543 +++++++++++++++++++++++++++++++++ nxwm/src/cfullscreenwindow.cxx | 4 +- nxwm/src/ctouchscreen.cxx | 125 ++++++++ nxwm/src/glyph_calibration.cxx | 193 ++++++++++++ 20 files changed, 1337 insertions(+), 7 deletions(-) create mode 100644 nxwm/images/calibration.png mode change 100755 => 100644 nxwm/images/cmd.png mode change 100755 => 100644 nxwm/images/minimize.png mode change 100755 => 100644 nxwm/images/nxlogo.png mode change 100755 => 100644 nxwm/images/play.png mode change 100755 => 100644 nxwm/images/start.png mode change 100755 => 100644 nxwm/images/stop.png create mode 100644 nxwm/include/ccalibration.hxx create mode 100644 nxwm/include/ctouchscreen.hxx create mode 100644 nxwm/src/ccalibration.cxx create mode 100644 nxwm/src/ctouchscreen.cxx create mode 100644 nxwm/src/glyph_calibration.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index f7791e99d..1367c8f68 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -51,4 +51,7 @@ * All application windows now use CWindowEventHandler and CWindowEventHandlerList to get notifications about mouse and keyboard events. These class will then automatically handle polling (with no need for a modal loop). +* CTouchscreen and CCalibration: Add touchscreen support (still a long way + to go). + diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 8125cf9f0..09744c8a6 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -46,6 +46,7 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" +#include "ccalibration.hxx" #include "cnxconsole.hxx" ///////////////////////////////////////////////////////////////////////////// @@ -79,6 +80,9 @@ struct SNxWmTest { NxWM::CTaskbar *taskbar; // The task bar NxWM::CStartWindow *startwindow; // The start window +#ifdef CONFIG_NXWM_TOUCHSCREEN + NxWM::CTouchscreen *touchscreen; // The touchscreen +#endif unsigned int mmInitial; // Initial memory usage unsigned int mmStep; // Memory Usage at beginning of test step unsigned int mmSubStep; // Memory Usage at beginning of test sub-step @@ -326,6 +330,90 @@ int MAIN_NAME(int argc, char *argv[]) } showTestCaseMemory("After create the start window application"); + // Perform touchscreen calibration +#if 0 // defined(CONFIG_NXWM_TOUCHSCREEN) -- Not ready for prime time + + NxWM::CCalibration *calibration = (NxWM::CCalibration *)0; // Avoid compiler complaint + NxWM::CFullScreenWindow *fullscreen = (NxWM::CFullScreenWindow *)0; // Avoid compiler complaint + + // Create the touchscreen device + + printf(MAIN_STRING "Creating CTouchscreen\n"); + g_nxwmtest.touchscreen = new NxWM::CTouchscreen; + if (!touchscreen) + { + printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); + goto nocalibration; + } + + printf(MAIN_STRING "Initialize the CTouchscreen\n"); + if (!g_nxwmtest.touchscreen->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CTouchscreen \n"); + delete g_nxwmtest.touchscreen; + goto nocalibration; + } + showTestCaseMemory("After initializing CTouchscreen"); + + // 1. Call CTaskBar::FullScreenWindow to create a window for the application, + // 2. Instantiate the application, providing the window to the application's + // constructor, + // 3. Then call CStartWindow::addApplication to add the application to the + // start window. + // 4. Call CTaskBar::startApplication start the application and bring its window to + // the top. + + printf(MAIN_STRING "Opening the calibrationapplication window\n"); + fullscreen = g_nxwmtest.taskbar->openFullScreenWindow(); + if (!fullscreen) + { + printf(MAIN_STRING "ERROR: Failed to create CFullScreenWindow for the calibration window\n"); + goto nocalibration; + } + showTestCaseMemory("After creating calibration full screen window"); + + printf(MAIN_STRING "Initialize the CFullScreenWindow\n"); + if (!fullscreen->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CFullScreenWindow \n"); + delete fullscreen; + goto nocalibration; + } + showTestCaseMemory("After initializing the calibration full screen window"); + + printf(MAIN_STRING "Creating the CCalibration application\n"); + calibration = new NxWM::CCalibration(fullscreen, g_nxwmtest.touchscreen); + if (!calibration) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CCalibration\n"); + delete fullscreen; + goto nocalibration; + } + showTestCaseMemory("After creating the CCalibration application"); + + printf(MAIN_STRING "Adding the CCalibration application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calibration)) + { + printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); + delete fullscreen; + goto nocalibration; + } + showTestCaseMemory("After adding the CCalibration application"); + + // Call CTaskBar::startApplication to start the Calibration application + + printf(MAIN_STRING "Start the start window application\n"); + if (!g_nxwmtest.taskbar->startApplication(calibration, false)) + { + printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); + delete fullscreen; + goto nocalibration; + } + showTestCaseMemory("After starting the start window application"); + +nocalibration: +#endif + // Add the NxConsole application to the start window NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint @@ -454,6 +542,7 @@ nocalculator: // Wait a little bit for the display to stabilize. The simulation pressing of // the 'start window' icon in the task bar +#ifndef CONFIG_NXWM_TOUCHSCREEN sleep(2); g_nxwmtest.taskbar->clickIcon(0); showTestCaseMemory("After clicking the start window icon"); @@ -464,7 +553,8 @@ nocalculator: sleep(2); g_nxwmtest.startwindow->clickIcon(0); showTestCaseMemory("After clicking the NxConsole icon"); - +#endif + // Wait bit to see the result of the button press. sleep(2); diff --git a/nxwm/Makefile b/nxwm/Makefile index 35656408b..3059934c9 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -42,9 +42,11 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = # Window Manager -CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx +CXXSRCS = capplicationwindow.cxx ccalibration.cxx cfullscreenwindow.cxx +CXXSRCS += cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx ctouchscreen.cxx # Images -CXXSRCS += glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx glyph_stop.cxx +CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx +CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/images/calibration.png b/nxwm/images/calibration.png new file mode 100644 index 0000000000000000000000000000000000000000..6cdb95e3b1315883ebe52acb69937394b12d7a73 GIT binary patch literal 494 zcmVP000>X1^@s6#OZ}&00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iye- z76&Sjkv81`00C}EL_t(Y$K6)Zaf2`nedHLxBQOG;px&T#f|3bBH(&!U6F?`Roq%?N z(ha&n*g*YxZgs9rNK*1q-T8=Z`90}b5hNmlwQYkd*f}H_0J}Cx31B!9M9BdFNdG_$ zm)R|!8P`7nbeEE}9_R$%mA^*-_s%g{P+hS|9q1dMBLJhMyqP003bY7-y8R>&P({B? z%LNh9Ba_w0yqu6t$;dMj+!130ko&r}-X#wU@5K38 z?&*2E@k%#m$^)Ysovt%h@oeqn;n|wX6grxU71gU~EVG--B&To44kFToYFwM;x>-=d zhW>7R%kFwtq56(*d+v8fWSe3bsVZ9&XyJ{zukO;9);99LFn&ip$5Pe%x2wH>BmK$B k`BwXQSNV`g{>>-R7u;kwHH^~VqyPW_07*qoM6N<$f+*I~IsgCw literal 0 HcmV?d00001 diff --git a/nxwm/images/cmd.png b/nxwm/images/cmd.png old mode 100755 new mode 100644 diff --git a/nxwm/images/minimize.png b/nxwm/images/minimize.png old mode 100755 new mode 100644 diff --git a/nxwm/images/nxlogo.png b/nxwm/images/nxlogo.png old mode 100755 new mode 100644 diff --git a/nxwm/images/play.png b/nxwm/images/play.png old mode 100755 new mode 100644 diff --git a/nxwm/images/start.png b/nxwm/images/start.png old mode 100755 new mode 100644 diff --git a/nxwm/images/stop.png b/nxwm/images/stop.png old mode 100755 new mode 100644 diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx new file mode 100644 index 000000000..9ca5b7589 --- /dev/null +++ b/nxwm/include/ccalibration.hxx @@ -0,0 +1,244 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/ccalibration.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CCALIBRATION_HXX +#define __INCLUDE_CCALIBRATION_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include "cnxstring.hxx" +#include "cwidgeteventhandler.hxx" +#include "cwidgetcontrol.hxx" + +#include "iapplication.hxx" +#include "cfullscreenwindow.hxx" +#include "ctouchscreen.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/** + * Calibration indices + */ + +#define CALIB_UPPER_LEFT_INDEX 0 +#define CALIB_UPPER_RIGHT_INDEX 1 +#define CALIB_LOWER_RIGHT_INDEX 2 +#define CALIB_LOWER_LEFT_INDEX 3 + +#define CALIB_DATA_POINTS 4 + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +namespace NxWM +{ + /** + * Touchscreen calibration data + */ + + struct SCalibrationData + { + b16_t xSlope; // X conversion: xSlope*(x) + xOffset + b16_t xOffset; + b16_t ySlope; // Y conversion: ySlope*(y) + yOffset + b16_t yOffset; + }; + + /** + * The CCalibration class provides the the calibration window and obtains + * callibration data. + */ + + class CCalibration : public IApplication, private NXWidgets::CWidgetEventHandler + { + private: + /** + * Identifies the current display state + */ + + enum ECalibState + { + CALIB_NOT_STARTED = 0, /**< Constructed, but not yet started */ + CALIB_UPPER_LEFT, /**< Touch point is in the upper left corner */ + CALIB_UPPER_RIGHT, /**< Touch point is in the upper right corner */ + CALIB_LOWER_RIGHT, /**< Touch point is in the lower left corner */ + CALIB_LOWER_LEFT, /**< Touch point is in the lower right corner */ + CALIB_COMPLETE /**< Calibration is complete */ + }; + + /** + * Characterizes one calibration screen + */ + + struct SCalibScreenInfo + { + struct nxgl_point_s pos; /**< The position of the touch point */ + nxgl_mxpixel_t lineColor; /**< The color of the cross-hair lines */ + nxgl_mxpixel_t circleFillColor; /**< The color of the circle */ + }; + + /** + * CCalibration state data + */ + + CFullScreenWindow *m_window; /**< The window for the calibration display */ + CTouchscreen *m_touchscreen; /**< The touchscreen device */ + enum ECalibState m_state; /**< Current calibration display state */ + struct SCalibScreenInfo m_screenInfo; /**< Describes the current calibration display */ + struct nxgl_point_s m_touchPos; /**< This is the last touch position */ + bool m_stop; /**< True: We have been asked to stop the calibration */ + bool m_touched; /**< True: The screen is touched */ + sem_t m_waitSem; /**< Supports wait for calibration data */ + struct nxgl_point_s m_calibData[CALIB_DATA_POINTS]; + + /** + * Accept raw touchscreen input. + * + * @param sample Touchscreen input sample + */ + + void touchscreenInput(struct touch_sample_s &sample); + + /** + * This is the calibration state machine. It is called initially and then + * as new touchscreen data is received. + */ + + void stateMachine(void); + + /** + * Handle a mouse button click event. + * + * @param e The event data. + */ + + void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); + + /** + * Presents the next calibration screen + */ + + void showCalibration(void); + + public: + + /** + * CCalibration Constructor + * + * @param window. The window to use for the calibration display + * @param touchscreen. An instance of the class that wraps the touchscreen device. + */ + + CCalibration(CFullScreenWindow *window, CTouchscreen *touchscreen); + + /** + * CCalibration Destructor + */ + + ~CCalibration(void); + + /** + * Each implementation of IApplication must provide a method to recover + * the contained IApplicationWindow instance. + */ + + IApplicationWindow *getWindow(void) const; + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + NXWidgets::CNxString getName(void); + + /** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + + bool run(void); + + /** + * Stop the application. + */ + + void stop(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + void hide(void); + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is called from + * CTaskbar when the application window must be displayed + */ + + void redraw(void); + + /** + * Wait for calibration data to be received. + * + * @return True if the calibration data was successfully obtained. + */ + + bool waitCalibrationData(struct SCalibrationData &data); + }; +} + +#endif // __INCLUDE_CCALIBRATION_HXX diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 12f15566b..226fbdf03 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -209,7 +209,7 @@ namespace NxWM * used during automated testing of NxWM. */ -#ifdef CONFIG_NXWM_UNITTEST +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) inline void clickIcon(int index) { if (index < m_slots.size()) diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 7043ef3a1..69595163c 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -390,7 +390,7 @@ namespace NxWM * used during automated testing of NxWM. */ -#ifdef CONFIG_NXWM_UNITTEST +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) inline void clickIcon(int index) { if (index < m_slots.size()) diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx new file mode 100644 index 000000000..31c61623b --- /dev/null +++ b/nxwm/include/ctouchscreen.hxx @@ -0,0 +1,106 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/ctouchscreen.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CTOUCHSCREEN_HXX +#define __INCLUDE_CTOUCHSCREEN_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgeteventhandler.hxx" +#include "iapplication.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +namespace NxWM +{ + /** + * The CTouchscreen class provides the the calibration window and obtains + * callibration data. + */ + + class CTouchscreen : public IApplication, private NXWidgets::CWidgetEventHandler + { + private: + int m_touchFd; /**< File descriptor of the opened touchscreen device */ + sem_t m_waitSem; /**< Semaphore the supports waits for touchscreen data */ + + public: + + /** + * CTouchscreen Constructor + */ + + CTouchscreen(void); + + /** + * CTouchscreen Destructor + */ + + ~CTouchscreen(void); + + /** + * Initialize the touchscreen device. Initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the touchscreen device was correctly initialized + */ + + bool open(void); + + /** + * Capture raw driver data. + * + * + * @return True if the raw touchscreen data was sucessfully obtained + */ + + bool waitRawTouchData(struct touch_sample_s &touch); + }; +} + +#endif // __INCLUDE_CTOUCHSCREEN_HXX diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 15d0cdad7..4e08b0481 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -321,6 +321,29 @@ # define CONFIG_NXWM_NXCONSOLE_ICON NxWM::g_cmdBitmap #endif +/* Touchscreen device *******************************************************/ + +#ifndef CONFIG_NXWM_TOUCHSCREEN_DEVPATH +# define CONFIG_NXWM_TOUCHSCREEN_DEVPATH "/dev/input0" +#endif + +/* Calibration display ******************************************************/ + +#ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR +# define CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +#endif + +#ifndef CONFIG_NXWM_CALIBRATION_LINECOLOR +# define CONFIG_NXWM_CALIBRATION_LINECOLOR MKRGB(0, 0, 128) +#endif + +#ifndef CONFIG_NXWM_CALIBRATION_CIRCLECOLOR +# define CONFIG_NXWM_CALIBRATION_CIRCLECOLOR MKRGB(255, 255, 255) +#endif + +#ifndef CONFIG_NXWM_CALIBRATION_ICON +# define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap +#endif /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 6a850179c..64f9a5262 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -57,6 +57,7 @@ namespace NxWM { + extern const struct NXWidgets::SRlePaletteBitmap g_calibrationBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx new file mode 100644 index 000000000..2ca132dac --- /dev/null +++ b/nxwm/src/ccalibration.cxx @@ -0,0 +1,543 @@ +/**************************************************************************** + * NxWidgets/nxwm/src/capplicationwindow.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "ccalibration.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/**************************************************************************** + * Configuration + */ + +#ifndef CONFIG_NX +# error "NX is not enabled (CONFIG_NX)" +#endif + +/** + * Positional/size data for the calibration lines and circles + */ + +#define CALIBRATION_LEFTX 40 +#define CALIBRATION_RIGHTX (windowSize.w - 41) +#define CALIBRATION_TOPY 40 +#define CALIBRATION_BOTTOMY (windowSize.h - 41) + +#define CALIBRATION_CIRCLE_RADIUS 16 +#define CALIBRATION_LINE_THICKNESS 2 + +/**************************************************************************** + * CCalibration Implementation Classes + ****************************************************************************/ + +using namespace NxWM; + +/** + * CCalibration Constructor + * + * @param window. The window to use for the calibration display + * @param touchscreen. An instance of the class that wraps the touchscreen device. + */ + +CCalibration::CCalibration(CFullScreenWindow *window, CTouchscreen *touchscreen) +{ + // Initialize state data + + m_window = window; + m_touchscreen = touchscreen; + m_state = CALIB_NOT_STARTED; + m_stop = false; + m_touched = false; +} + +/** + * CCalibration Destructor + */ + +CCalibration::~CCalibration(void) +{ + // Although we did not create the window, the rule is that I have to dispose + // of it + + delete m_window; +} + +/** + * Each implementation of IApplication must provide a method to recover + * the contained IApplicationWindow instance. + */ + +IApplicationWindow *CCalibration::getWindow(void) const +{ + return static_cast(m_window); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CCalibration::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_CALIBRATION_ICON); + + return bitmap; +} + +/** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + +NXWidgets::CNxString CCalibration::getName(void) +{ + return NXWidgets::CNxString("Touchscreen Calibration"); +} + +/** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + +bool CCalibration::run(void) +{ + // Provide the initial display + + m_state = CALIB_NOT_STARTED; + stateMachine(); + + // Loop until calibration completes + + while (!m_stop) + { + // Wait for the next raw touchscreen input + + struct touch_sample_s sample; + while (!m_touchscreen->waitRawTouchData(sample)); + + // Then process the raw touchscreen input + + touchscreenInput(sample); + } + + return !m_stop; +} + +/** + * Stop the application. + */ + +void CCalibration::stop(void) +{ + m_stop = true; +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but it is not at the top of the hierarchy) + */ + +void CCalibration::hide(void) +{ +#warning "Revisit" +} + +/** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is called from + * CTaskbar when the application window must be displayed + */ + +void CCalibration::redraw(void) +{ + // Reset the state machine and start over + + if (m_state != CALIB_COMPLETE) + { + m_state = CALIB_NOT_STARTED; + stateMachine(); + } +} + +/** + * Wait for calibration data to be received. + * + * @return True if the calibration data was successfully obtained. + */ + +bool CCalibration::waitCalibrationData(struct SCalibrationData &data) +{ + // Wait until calibration is finished + + while (m_state != CALIB_COMPLETE) + { + int ret = sem_wait(&m_waitSem); + DEBUGASSERT(ret == 0 || errno == EINTR); + } + + // Recover the window instance contained in the full screen window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the fullscreen window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + return false; + } + + // Calculate the calibration parameters + // + // (scaledX - LEFTX) / (rawX - leftX) = (RIGHTX - LEFTX) / (rightX - leftX) + // scaledX = (rawX - leftX) * (RIGHTX - LEFTX) / (rightX - leftX) + LEFTX + // = rawX * xSlope + (LEFTX - leftX * xSlope) + // = rawX * xSlope + xOffset + // + // where: + // xSlope = (RIGHTX - LEFTX) / (rightX - leftX) + // xOffset = (LEFTX - leftX * xSlope) + + b16_t leftX = (m_calibData[CALIB_UPPER_LEFT_INDEX].x + + m_calibData[CALIB_LOWER_LEFT_INDEX].x) << 15; + b16_t rightX = (m_calibData[CALIB_UPPER_RIGHT_INDEX].x + + m_calibData[CALIB_LOWER_RIGHT_INDEX].x) << 15; + + data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); + data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); + + gdbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + + // Similarly for Y + // + // (scaledY - TOPY) / (rawY - topY) = (BOTTOMY - TOPY) / (bottomY - topY) + // scaledY = (rawY - topY) * (BOTTOMY - TOPY) / (bottomY - topY) + TOPY + // = rawY * ySlope + (TOPY - topY * ySlope) + // = rawY * ySlope + yOffset + // + // where: + // ySlope = (BOTTOMY - TOPY) / (bottomY - topY) + // yOffset = (TOPY - topY * ySlope) + + b16_t topY = (m_calibData[CALIB_UPPER_LEFT_INDEX].y + + m_calibData[CALIB_UPPER_RIGHT_INDEX].y) << 15; + b16_t bottomY = (m_calibData[CALIB_LOWER_LEFT_INDEX].y + + m_calibData[CALIB_LOWER_RIGHT_INDEX].y) << 15; + + data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); + data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); + + gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + return true; +} + +/** + * Accept raw touchscreen input. + * + * @param sample Touchscreen input sample + */ + +void CCalibration::touchscreenInput(struct touch_sample_s &sample) +{ + // Is this a new touch event? Or is it a drag event? + + if ((sample.point[0].flags & (TOUCH_DOWN|TOUCH_MOVE)) != 0) + { + // Yes.. but ignore drag events if we did not see the matching + // touch down event + + if ((sample.point[0].flags & TOUCH_DOWN) != 0 || m_touched) + { + // Yes.. save the touch position and wait for the TOUCH_UP report + + m_touchPos.x = sample.point[0].x; + m_touchPos.y = sample.point[0].y; + + gvdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + sample.point[0].id, sample.point[0].flags, sample.point[0].x, + sample.point[0].y, sample.point[0].h, sample.point[0].w, + sample.point[0].pressure); + + // Remember that we saw the touch down event + + m_touched = true; + } + } + + // Was the touch released? + + else if ((sample.point[0].flags & TOUCH_UP) != 0) + { + // Yes.. did we see the matching pen down event? + + if (m_touched) + { + // Yes.. invoke the state machine. + + gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", + m_state, m_screenInfo.pos.x, m_screenInfo.pos.y, + m_touchPos.x, m_touchPos.y); + + stateMachine(); + } + + // In any event, the touch is not down + + m_touched = false; + } +} + +/** + * This is the calibration state machine. It is called initially and then + * as new touchscreen data is received. + */ + +void CCalibration::stateMachine(void) +{ + // Recover the window instance contained in the full screen window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the fullscreen window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + return; + } + + switch (m_state) + { + default: + case CALIB_NOT_STARTED: + { + // Clear the entire screen + // Get the widget control associated with the full screen window + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Then draw the first calibration screen + + m_screenInfo.pos.x = CALIBRATION_LEFTX; + m_screenInfo.pos.y = CALIBRATION_TOPY; + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + showCalibration(); + + // Then set up the current state + + m_state = CALIB_UPPER_LEFT; + } + break; + + case CALIB_UPPER_LEFT: + { + // A touch has been received while in the CALIB_UPPER_LEFT state. + // Save the touch data and set up the next calibration display + + m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x; + m_calibData[CALIB_UPPER_LEFT_INDEX].y = m_touchPos.y; + + // Clear the previous screen by re-drawing it using the backgro9und + // color. That is much faster than clearing the whole display + + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + showCalibration(); + + // Then draw the next calibration screen + + m_screenInfo.pos.x = CALIBRATION_RIGHTX; + m_screenInfo.pos.y = CALIBRATION_TOPY; + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + showCalibration(); + + // Then set up the current state + + m_state = CALIB_UPPER_RIGHT; + } + break; + + case CALIB_UPPER_RIGHT: + { + // A touch has been received while in the CALIB_UPPER_RIGHT state. + // Save the touch data and set up the next calibration display + + m_calibData[CALIB_UPPER_RIGHT_INDEX].x = m_touchPos.x; + m_calibData[CALIB_UPPER_RIGHT_INDEX].y = m_touchPos.y; + + // Clear the previous screen by re-drawing it using the backgro9und + // color. That is much faster than clearing the whole display + + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + showCalibration(); + + // Then draw the next calibration screen + + m_screenInfo.pos.x = CALIBRATION_RIGHTX; + m_screenInfo.pos.y = CALIBRATION_BOTTOMY; + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + showCalibration(); + + // Then set up the current state + + m_state = CALIB_LOWER_RIGHT; + } + break; + + case CALIB_LOWER_RIGHT: + { + // A touch has been received while in the CALIB_LOWER_RIGHT state. + // Save the touch data and set up the next calibration display + + m_calibData[CALIB_LOWER_RIGHT_INDEX].x = m_touchPos.x; + m_calibData[CALIB_LOWER_RIGHT_INDEX].y = m_touchPos.y; + + // Clear the previous screen by re-drawing it using the backgro9und + // color. That is much faster than clearing the whole display + + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + showCalibration(); + + // Then draw the next calibration screen + + m_screenInfo.pos.x = CALIBRATION_LEFTX; + m_screenInfo.pos.y = CALIBRATION_BOTTOMY; + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + showCalibration(); + + // Then set up the current state + + m_state = CALIB_LOWER_LEFT; + } + break; + + case CALIB_LOWER_LEFT: + { + // A touch has been received while in the CALIB_LOWER_LEFT state. + // Save the touch data and set up the next calibration display + + m_calibData[CALIB_LOWER_LEFT_INDEX].x = m_touchPos.x; + m_calibData[CALIB_LOWER_LEFT_INDEX].y = m_touchPos.y; + + // Inform any waiter that calibration is complete + + m_state = CALIB_COMPLETE; + sem_post(&m_waitSem); + } + break; + + case CALIB_COMPLETE: + // Might happen... do nothing if it does + break; + } + + gvdbg("State: %d Screen x: %d y: %d\n", + m_state, m_screenInfo.pos.x, m_screenInfo.pos.y); +} + +/** + * Presents the next calibration screen + * + * @param screenInfo Describes the next calibration screen + */ + +void CCalibration::showCalibration(void) +{ + // Recover the window instance contained in the full screen window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the widget control associated with the full screen window + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the fullscreen window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + return; + } + + // Draw the circle at the center of the touch position + + port->drawFilledCircle(&m_screenInfo.pos, CALIBRATION_CIRCLE_RADIUS, + m_screenInfo.circleFillColor); + + /* Draw horizontal line */ + + port->drawFilledRect(0, m_screenInfo.pos.y, windowSize.w, CALIBRATION_LINE_THICKNESS, + m_screenInfo.lineColor); + + /* Draw vertical line */ + + port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h, + m_screenInfo.lineColor); +} diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index d4fcf23b2..6b0d13fa0 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cfullscreen.cxx + * NxWidgets/nxwm/src/cfullscreenwindow.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,7 +57,7 @@ * CFullScreenWindow Method Implementations ********************************************************************************************/ - using namespace NxWM; +using namespace NxWM; /** * CFullScreenWindow Constructor diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx new file mode 100644 index 000000000..215e50064 --- /dev/null +++ b/nxwm/src/ctouchscreen.cxx @@ -0,0 +1,125 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/ctouchscreen.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "cgraphicsport.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "ctouchscreen.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CTouchscreen Method Implementations + ********************************************************************************************/ + +using namespace NxWM; + +/** + * CTouchscreen Constructor + */ + +CTouchscreen::CTouchscreen(void) +{ + m_touchFd = -1; + sem_init(&m_waitSem, 0, 0); +} + +/** + * CTouchscreen Destructor + */ + +CTouchscreen::~CTouchscreen(void) +{ + if (m_touchFd >= 0) + { + std::close(m_touchFd); + } + + sem_destroy(&m_waitSem); +} + +/** + * Initialize the touchscreen device. Initialization is separate from + * object instantiation so that failures can be reported. + * + * @return True if the touchscreen device was correctly initialized + */ + +bool CTouchscreen::open(void) +{ + // Open the touchscreen device + + m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); + if (m_touchFd < 0) + { + gdbg("ERROR Failed to open %s for reading: %d\n", + CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errno); + return false; + } + + return true; +} + +/** + * Capture raw driver data. + * + * + * @return True if the raw touchscreen data was sucessfully obtained + */ + +bool CTouchscreen::waitRawTouchData(struct touch_sample_s &touch) +{ +#warning "Missing logic" + return true; +} diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration.cxx new file mode 100644 index 000000000..95df5a7dd --- /dev/null +++ b/nxwm/src/glyph_calibration.cxx @@ -0,0 +1,193 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_calibration.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 21 +#define BITMAP_NCOLUMNS 21 +#define BITMAP_NLUTCODES 17 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_calibrationLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x202020, 0x404040, 0x808080, 0xfcfcfc, 0x606060, 0x9c9c9c, 0xdcdcdc, /* Codes 1-7 */ + 0xececec, 0xacacac, 0x707070, 0x303030, 0x101010, 0xcccccc, 0x505050, /* Codes 8-15 */ + 0x8c8c8c, 0xbcbcbc, /* Codes 15-16 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_calibrationLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x2104, 0x4208, 0x8410, 0xffff, 0x630c, 0x9cf3, 0xdefb, 0xef7d, 0xad75, /* Codes 1-9 */ + 0x738e, 0x3186, 0x1082, 0xce79, 0x528a, 0x8c71, 0xbdf7 /* Codes 10-16 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_calibrationLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x20, 0x40, 0x80, 0xfc, 0x60, 0x9c, 0xdc, 0xec, 0xac, 0x70, 0x30, 0x10, /* Codes 1-12 */ + 0xcc, 0x50, 0x8c, 0xbc, /* Codes 13-16 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_calibrationLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x24, 0x49, 0x92, 0xff, 0x6d, 0x92, 0xdb, 0xff, 0xb6, 0x6d, 0x24, 0x00, /* Codes 1-12 */ + 0xdb, 0x49, 0x92, 0xb7 /* Codes 13-16 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] = +{ + { 25, 0}, /* Row 0 */ + { 25, 0}, /* Row 1 */ + { 12, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 2 */ + { 12, 0}, { 1, 3}, { 1, 4}, { 6, 0}, { 1, 1}, { 2, 5}, { 2, 0}, /* Row 3 */ + { 12, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 1}, { 1, 5}, { 1, 6}, { 1, 7}, /* Row 4 */ + { 2, 4}, { 1, 7}, { 2, 0}, + { 12, 0}, { 1, 3}, { 1, 4}, { 1, 6}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 5 */ + { 1, 7}, { 1, 9}, { 3, 0}, + { 8, 0}, { 1, 1}, { 1, 5}, { 1, 6}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 6 */ + { 1, 10}, { 1, 11}, { 1, 0}, { 1, 12}, { 2, 13}, { 3, 0}, + { 4, 0}, { 1, 12}, { 1, 14}, { 1, 15}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 7 */ + { 1, 16}, { 1, 4}, { 5, 0}, { 1, 10}, { 1, 5}, { 1, 3}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 1}, { 2, 4}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 2, 0}, /* Row 8 */ + { 1, 3}, { 1, 4}, { 5, 0}, { 1, 13}, { 1, 0}, { 1, 1}, { 1, 9}, { 2, 0}, + { 4, 0}, { 1, 15}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 3}, { 1, 4}, { 4, 0}, /* Row 9 */ + { 1, 14}, { 1, 15}, { 2, 0}, { 1, 16}, { 1, 1}, { 1, 0}, + { 4, 0}, { 1, 5}, { 1, 10}, { 1, 13}, { 5, 0}, { 1, 3}, { 1, 4}, { 4, 0}, /* Row 10 */ + { 1, 9}, { 1, 1}, { 2, 0}, { 1, 5}, { 1, 10}, { 1, 0}, + { 4, 0}, { 1, 13}, { 1, 12}, { 1, 6}, { 1, 1}, { 4, 0}, { 1, 3}, { 1, 4}, /* Row 11 */ + { 3, 0}, { 1, 1}, { 1, 16}, { 1, 0}, { 1, 6}, { 1, 14}, { 1, 12}, { 1, 13}, + { 1, 0}, + { 3, 0}, { 1, 2}, { 1, 6}, { 1, 0}, { 1, 14}, { 1, 15}, { 4, 0}, { 1, 3}, /* Row 12 */ + { 1, 4}, { 3, 0}, { 1, 3}, { 1, 5}, { 1, 1}, { 1, 8}, { 1, 6}, { 1, 0}, + { 1, 6}, { 1, 11}, + { 3, 0}, { 1, 6}, { 1, 11}, { 2, 0}, { 1, 16}, { 4, 0}, { 1, 3}, { 1, 4}, /* Row 13 */ + { 3, 0}, { 1, 16}, { 1, 0}, { 1, 2}, { 1, 4}, { 1, 16}, { 1, 0}, { 1, 2}, + { 1, 6}, + { 2, 0}, { 1, 12}, { 1, 13}, { 1, 12}, { 1, 16}, { 1, 1}, { 1, 15}, { 1, 14}, /* Row 14 */ + { 3, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 10}, { 1, 13}, { 1, 3}, { 1, 6}, + { 1, 4}, { 1, 7}, { 2, 3}, { 1, 8}, + { 2, 0}, { 1, 10}, { 1, 5}, { 1, 9}, { 1, 4}, { 1, 16}, { 1, 2}, { 1, 6}, /* Row 15 */ + { 3, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 11}, { 1, 16}, { 5, 4}, { 1, 8}, + { 1, 15}, + { 2, 0}, { 1, 13}, { 1, 0}, { 3, 4}, { 1, 2}, { 1, 13}, { 1, 12}, { 2, 0}, /* Row 16 */ + { 1, 3}, { 1, 4}, { 4, 0}, { 1, 12}, { 3, 2}, { 1, 11}, { 2, 0}, + { 1, 0}, { 1, 14}, { 1, 15}, { 1, 0}, { 3, 4}, { 1, 2}, { 2, 5}, { 2, 0}, /* Row 17 */ + { 1, 3}, { 1, 4}, { 11, 0}, + { 1, 0}, { 1, 16}, { 1, 13}, { 1, 16}, { 3, 4}, { 2, 13}, { 1, 7}, { 2, 0}, /* Row 18 */ + { 1, 3}, { 1, 4}, { 11, 0}, + { 1, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 6}, { 1, 11}, /* Row 19 */ + { 2, 0}, { 1, 3}, { 1, 4}, { 11, 0}, + { 12, 0}, { 1, 3}, { 1, 4}, { 11, 0}, /* Row 20 */ + { 5, 0}, { 1, 2}, { 14, 4}, { 1, 3}, { 4, 0}, /* Row 21 */ + { 5, 0}, { 1, 2}, { 14, 4}, { 1, 3}, { 4, 0}, /* Row 22 */ + { 25, 0}, /* Row 23 */ + { 25, 0}, /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationLut, // Index 0: Unselected LUT + g_calibrationLut, // Index 1: Selected LUT + }, + g_calibrationRleEntries // data - Pointer to the beginning of the RLE data +}; From b52606e5691b139440039115724e58e097e793aa Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 10 May 2012 01:35:23 +0000 Subject: [PATCH 042/390] More NxWM touchscreen fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4719 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 95 ++++++++++++++++++++++++----------- nxwm/include/ccalibration.hxx | 10 +--- nxwm/include/ctouchscreen.hxx | 5 +- nxwm/src/ccalibration.cxx | 2 +- 4 files changed, 69 insertions(+), 43 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 09744c8a6..e7a16727d 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -197,6 +197,35 @@ static void initMemoryUsage(void) g_nxwmtest.mmSubStep = mmcurrent.uordblks; } +///////////////////////////////////////////////////////////////////////////// +// Name: cleanup +///////////////////////////////////////////////////////////////////////////// + +static void test_cleanup(void) +{ +#ifdef CONFIG_NXWM_TOUCHSCREEN + if (g_nxwmtest.touchscreen) + { + delete g_nxwmtest.touchscreen; + } +#endif + + // Delete the task bar then the start window. the order is important because + // we must bet all of the application references out of the task bar before + // deleting the start window. When the start window is deleted, it will + // also delete of of the resouces contained within the start window. + + if (g_nxwmtest.taskbar) + { + delete g_nxwmtest.taskbar; + } + + if (g_nxwmtest.startwindow) + { + delete g_nxwmtest.startwindow; + } +} + ///////////////////////////////////////////////////////////////////////////// // Public Functions ///////////////////////////////////////////////////////////////////////////// @@ -270,7 +299,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!g_nxwmtest.taskbar->connect()) { printf(MAIN_STRING "ERROR: Failed to connect the CTaskbar instance to the NX server\n"); - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After connecting to the server"); @@ -285,7 +314,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!g_nxwmtest.taskbar->initWindowManager()) { printf(MAIN_STRING "ERROR: Failed to intialize the CTaskbar instance\n"); - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After initializing window manager"); @@ -304,7 +333,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!window) { printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After creating start window application window"); @@ -314,7 +343,7 @@ int MAIN_NAME(int argc, char *argv[]) { printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); delete window; - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After initializing the start window application window"); @@ -325,13 +354,26 @@ int MAIN_NAME(int argc, char *argv[]) { printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); delete window; - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After create the start window application"); // Perform touchscreen calibration -#if 0 // defined(CONFIG_NXWM_TOUCHSCREEN) -- Not ready for prime time + +#ifdef CONFIG_NXWM_TOUCHSCREEN + // Start the window manager before adding applications + + printf(MAIN_STRING "Start the window manager\n"); + if (!g_nxwmtest.taskbar->startWindowManager()) + { + printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + test_cleanup(); + return EXIT_FAILURE; + } + showTestCaseMemory("After starting the window manager"); + + // Perform touchscreen calibration NxWM::CCalibration *calibration = (NxWM::CCalibration *)0; // Avoid compiler complaint NxWM::CFullScreenWindow *fullscreen = (NxWM::CFullScreenWindow *)0; // Avoid compiler complaint @@ -340,7 +382,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "Creating CTouchscreen\n"); g_nxwmtest.touchscreen = new NxWM::CTouchscreen; - if (!touchscreen) + if (!g_nxwmtest.touchscreen) { printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); goto nocalibration; @@ -395,7 +437,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!g_nxwmtest.startwindow->addApplication(calibration)) { printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete fullscreen; + delete calibration; goto nocalibration; } showTestCaseMemory("After adding the CCalibration application"); @@ -406,11 +448,19 @@ int MAIN_NAME(int argc, char *argv[]) if (!g_nxwmtest.taskbar->startApplication(calibration, false)) { printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); - delete fullscreen; goto nocalibration; } showTestCaseMemory("After starting the start window application"); + // Wait for calibration data + + printf(MAIN_STRING "Get calibration data\n"); + struct NxWM::SCalibrationData data; + if (!calibration->waitCalibrationData(data)) + { + printf(MAIN_STRING "ERROR: Failed to get calibration data\n"); + } + nocalibration: #endif @@ -432,8 +482,7 @@ nocalibration: { printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); delete window; - delete g_nxwmtest.taskbar; - return EXIT_FAILURE; + goto noconsole; } showTestCaseMemory("After initializing the NxConsole application window"); @@ -476,7 +525,7 @@ noconsole: { printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); delete window; - delete g_nxwmtest.taskbar; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After creating the initializing application window"); @@ -509,35 +558,23 @@ nocalculator: if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.startwindow, true)) { printf(MAIN_STRING "ERROR: Failed to start the start window application\n"); - - // Delete the task bar then the start window. the order is important because - // we must bet all of the application references out of the task bar before - // deleting the start window. When the start window is deleted, it will - // also delete of of the resouces contained within the start window. - - delete g_nxwmtest.taskbar; - delete g_nxwmtest.startwindow; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After starting the start window application"); // Call CTaskBar::startWindowManager to start the display with applications in place. +#ifndef CONFIG_NXWM_TOUCHSCREEN printf(MAIN_STRING "Start the window manager\n"); if (!g_nxwmtest.taskbar->startWindowManager()) { printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); - - // Delete the task bar then the start window. the order is important because - // we must bet all of the application references out of the task bar before - // deleting the start window. When the start window is deleted, it will - // also delete of of the resouces contained within the start window. - - delete g_nxwmtest.taskbar; - delete g_nxwmtest.startwindow; + test_cleanup(); return EXIT_FAILURE; } showTestCaseMemory("After starting the window manager"); +#endif // Wait a little bit for the display to stabilize. The simulation pressing of // the 'start window' icon in the task bar @@ -559,6 +596,6 @@ nocalculator: sleep(2); showTestMemory("Final memory usage"); - return EXIT_SUCCESS; + return EXIT_SUCCESS; } diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 9ca5b7589..0adcd894f 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -89,7 +89,7 @@ namespace NxWM * callibration data. */ - class CCalibration : public IApplication, private NXWidgets::CWidgetEventHandler + class CCalibration : public IApplication { private: /** @@ -146,14 +146,6 @@ namespace NxWM void stateMachine(void); - /** - * Handle a mouse button click event. - * - * @param e The event data. - */ - - void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); - /** * Presents the next calibration screen */ diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx index 31c61623b..f8eaeaee8 100644 --- a/nxwm/include/ctouchscreen.hxx +++ b/nxwm/include/ctouchscreen.hxx @@ -45,9 +45,6 @@ #include #include -#include "cwidgeteventhandler.hxx" -#include "iapplication.hxx" - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -63,7 +60,7 @@ namespace NxWM * callibration data. */ - class CTouchscreen : public IApplication, private NXWidgets::CWidgetEventHandler + class CTouchscreen { private: int m_touchFd; /**< File descriptor of the opened touchscreen device */ diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 2ca132dac..e218b5f1e 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -156,7 +156,7 @@ bool CCalibration::run(void) // Loop until calibration completes - while (!m_stop) + while (!m_stop && m_state != CALIB_COMPLETE) { // Wait for the next raw touchscreen input From 7b7620dfd16dae35a38f4ac88ce08f289e05c8c7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 10 May 2012 16:25:56 +0000 Subject: [PATCH 043/390] NX trapezoid fixes; Various NxWM fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4720 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 623 ++++++++++++++++++++---------------- nxwm/include/cnxconsole.hxx | 12 +- nxwm/src/ccalibration.cxx | 3 + nxwm/src/ctaskbar.cxx | 6 + 4 files changed, 363 insertions(+), 281 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index e7a16727d..7cdc778e0 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -78,14 +78,16 @@ struct SNxWmTest { - NxWM::CTaskbar *taskbar; // The task bar - NxWM::CStartWindow *startwindow; // The start window + NxWM::CTaskbar *taskbar; // The task bar + NxWM::CStartWindow *startwindow; // The start window #ifdef CONFIG_NXWM_TOUCHSCREEN - NxWM::CTouchscreen *touchscreen; // The touchscreen + NxWM::CTouchscreen *touchscreen; // The touchscreen + NxWM::CCalibration *calibration; // The touchscreen calibration application + struct NxWM::SCalibrationData data; // Calibration data #endif - unsigned int mmInitial; // Initial memory usage - unsigned int mmStep; // Memory Usage at beginning of test step - unsigned int mmSubStep; // Memory Usage at beginning of test sub-step + unsigned int mmInitial; // Initial memory usage + unsigned int mmStep; // Memory Usage at beginning of test step + unsigned int mmSubStep; // Memory Usage at beginning of test sub-step }; ///////////////////////////////////////////////////////////////////////////// @@ -201,7 +203,7 @@ static void initMemoryUsage(void) // Name: cleanup ///////////////////////////////////////////////////////////////////////////// -static void test_cleanup(void) +static void testCleanUpAndExit(int exitCode) { #ifdef CONFIG_NXWM_TOUCHSCREEN if (g_nxwmtest.touchscreen) @@ -224,6 +226,310 @@ static void test_cleanup(void) { delete g_nxwmtest.startwindow; } + + // And exit + + exit(exitCode); +} + +///////////////////////////////////////////////////////////////////////////// +// Name: createTaskbar +///////////////////////////////////////////////////////////////////////////// + +static bool createTaskbar(void) +{ + // Create an instance of the Task Bar. + // + // The general sequence for initializing the task bar is: + // + // 1. Create the CTaskbar instance, + // 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar + // inherits the connect method from CNxServer), + // 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. + // 3. Call CTaskBar::startApplication repeatedly to add applications to the task bar + // 4. Call CTaskBar::startWindowManager to start the display with applications in place + + printf(MAIN_STRING "Create CTaskbar instance\n"); + g_nxwmtest.taskbar = new NxWM::CTaskbar(); + if (!g_nxwmtest.taskbar) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); + return false; + } + showTestCaseMemory("After create taskbar"); + + // Connect to the NX server + + printf(MAIN_STRING "Connect the CTaskbar instance to the NX server\n"); + if (!g_nxwmtest.taskbar->connect()) + { + printf(MAIN_STRING "ERROR: Failed to connect the CTaskbar instance to the NX server\n"); + return false; + } + showTestCaseMemory("After connecting to the server"); + + // Initialize the task bar + // + // Taskbar::initWindowManager() prepares the task bar to receive applications. + // CTaskBar::startWindowManager() brings the window manager up with those applications + // in place. + + printf(MAIN_STRING "Initialize the CTaskbar instance\n"); + if (!g_nxwmtest.taskbar->initWindowManager()) + { + printf(MAIN_STRING "ERROR: Failed to intialize the CTaskbar instance\n"); + return false; + } + + showTestCaseMemory("After initializing window manager"); + return true; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: createStartWindow +///////////////////////////////////////////////////////////////////////////// + +static bool createStartWindow(void) +{ + // Create the start window. The general sequence for setting up the start window is: + // + // 1. Call CTaskBar::openApplicationWindow to create a window for the start window, + // 2. Use the window to instantiate Cstartwindow + // 3. Call Cstartwindow::addApplication numerous times to install applications + // in the start window. + // 4. Call CTaskBar::startApplication (initially minimized) to start the start + // window application. + + printf(MAIN_STRING "Opening the start window application window\n"); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); + return false; + } + showTestCaseMemory("After creating start window application window"); + + printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + delete window; + return false; + } + showTestCaseMemory("After initializing the start window application window"); + + printf(MAIN_STRING "Creating the start window application\n"); + g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); + if (!g_nxwmtest.startwindow) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); + delete window; + return false; + } + + // Call CTaskBar::startApplication to start the Calibration application (minimized) + + printf(MAIN_STRING "Start the start window application\n"); + if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.startwindow, true)) + { + printf(MAIN_STRING "ERROR: Failed to start the start window application\n"); + return false; + } + showTestCaseMemory("After starting the start window application"); + + showTestCaseMemory("After create the start window application"); + return true; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: startWindowManager +///////////////////////////////////////////////////////////////////////////// + +static bool startWindowManager(void) +{ + // Start the window manager + + printf(MAIN_STRING "Start the window manager\n"); + if (!g_nxwmtest.taskbar->startWindowManager()) + { + printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + return false; + } + + showTestCaseMemory("After starting the window manager"); + return true; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: createTouchScreen +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_TOUCHSCREEN +static bool createTouchScreen(void) +{ + // Create the touchscreen device + + printf(MAIN_STRING "Creating CTouchscreen\n"); + g_nxwmtest.touchscreen = new NxWM::CTouchscreen; + if (!g_nxwmtest.touchscreen) + { + printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); + return false; + } + + printf(MAIN_STRING "Initialize the CTouchscreen\n"); + if (!g_nxwmtest.touchscreen->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CTouchscreen \n"); + delete g_nxwmtest.touchscreen; + return false; + } + + showTestCaseMemory("After initializing CTouchscreen"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// +// Name: createCalibration +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_TOUCHSCREEN +static bool createCalibration(void) +{ + // 1. Call CTaskBar::FullScreenWindow to create a window for the application, + // 2. Instantiate the application, providing the window to the application's + // constructor, + // 3. Then call CStartWindow::addApplication to add the application to the + // start window. + // 4. Call CTaskBar::startApplication start the application and bring its window to + // the top. + + printf(MAIN_STRING "Opening the calibration application window\n"); + NxWM::CFullScreenWindow *window = g_nxwmtest.taskbar->openFullScreenWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CFullScreenWindow for the calibration window\n"); + return false; + } + showTestCaseMemory("After creating calibration full screen window"); + + printf(MAIN_STRING "Initialize the CFullScreenWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CFullScreenWindow \n"); + delete window; + return false; + } + showTestCaseMemory("After initializing the calibration full screen window"); + + printf(MAIN_STRING "Creating the CCalibration application\n"); + g_nxwmtest.calibration = new NxWM::CCalibration(window, g_nxwmtest.touchscreen); + if (!g_nxwmtest.calibration) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CCalibration\n"); + delete window; + return false; + } + showTestCaseMemory("After creating the CCalibration application"); + + printf(MAIN_STRING "Adding the CCalibration application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) + { + printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); + delete g_nxwmtest.calibration; + return false; + } + + showTestCaseMemory("After adding the CCalibration application"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// +// Name: runCalibration +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_TOUCHSCREEN +static bool runCalibration(void) +{ + // Call CTaskBar::startApplication to start the Calibration application + + printf(MAIN_STRING "Start the calibration application\n"); + if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.calibration, false)) + { + printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); + return false; + } + showTestCaseMemory("After starting the start window application"); + + // Wait for calibration data + + printf(MAIN_STRING "Get calibration data\n"); + if (!g_nxwmtest.calibration->waitCalibrationData(g_nxwmtest.data)) + { + printf(MAIN_STRING "ERROR: Failed to get calibration data\n"); + return false; + } + + printf(MAIN_STRING "Stop the calibration application\n"); + if (!g_nxwmtest.taskbar->stopApplication(g_nxwmtest.calibration)) + { + printf(MAIN_STRING "ERROR: Failed to stop the calibration application\n"); + return false; + } + + showTestCaseMemory("After stopping the calibration application"); + return true; +} +#endif + +///////////////////////////////////////////////////////////////////////////// +// Name: createNxConsole +///////////////////////////////////////////////////////////////////////////// + +static bool createNxConsole(void) +{ + // Add the NxConsole application to the start window + + printf(MAIN_STRING "Opening the NxConsole application window\n"); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + if (!window) + { + printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the NxConsole\n"); + return false; + } + showTestCaseMemory("After creating the NxConsole application window"); + + printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + if (!window->open()) + { + printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + delete window; + return false; + } + showTestCaseMemory("After initializing the NxConsole application window"); + + printf(MAIN_STRING "Creating the NxConsole application\n"); + NxWM::CNxConsole *console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); + if (!console) + { + printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); + delete window; + return false; + } + showTestCaseMemory("After creating the NxConsole application"); + + printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(console)) + { + printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start window\n"); + delete console; + return false; + } + + showTestCaseMemory("After adding the NxConsole application"); + return true; } ///////////////////////////////////////////////////////////////////////////// @@ -273,308 +579,75 @@ int MAIN_NAME(int argc, char *argv[]) } showTestCaseMemory("After initializing the NSH library"); - // Create an instance of the Task Bar. - // - // The general sequence for initializing the task bar is: - // - // 1. Create the CTaskbar instance, - // 2. Call the CTaskbar::connect() method to connect to the NX server (CTaskbar - // inherits the connect method from CNxServer), - // 3. Call the CTaskbar::initWindowManager() method to initialize the task bar. - // 3. Call CTaskBar::startApplication repeatedly to add applications to the task bar - // 4. Call CTaskBar::startWindowManager to start the display with applications in place + // Create the task bar. - printf(MAIN_STRING "Create CTaskbar instance\n"); - g_nxwmtest.taskbar = new NxWM::CTaskbar(); - if (!g_nxwmtest.taskbar) + if (!createTaskbar()) { - printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); - return EXIT_FAILURE; + printf(MAIN_STRING "Failed to create the task bar\n"); + testCleanUpAndExit(EXIT_FAILURE); } - showTestCaseMemory("After create taskbar"); - // Connect to the NX server + // Create the start window. - printf(MAIN_STRING "Connect the CTaskbar instance to the NX server\n"); - if (!g_nxwmtest.taskbar->connect()) + if (!createStartWindow()) { - printf(MAIN_STRING "ERROR: Failed to connect the CTaskbar instance to the NX server\n"); - test_cleanup(); - return EXIT_FAILURE; + printf(MAIN_STRING "Failed to create the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); } - showTestCaseMemory("After connecting to the server"); - // Initialize the task bar - // - // Taskbar::initWindowManager() prepares the task bar to receive applications. - // CTaskBar::startWindowManager() brings the window manager up with those applications - // in place. + // Create the touchscreen device - printf(MAIN_STRING "Initialize the CTaskbar instance\n"); - if (!g_nxwmtest.taskbar->initWindowManager()) +#ifdef CONFIG_NXWM_TOUCHSCREEN + if (!createTouchScreen()) { - printf(MAIN_STRING "ERROR: Failed to intialize the CTaskbar instance\n"); - test_cleanup(); - return EXIT_FAILURE; + printf(MAIN_STRING "Failed to create the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); } - showTestCaseMemory("After initializing window manager"); - - // Create the start window. The general sequence for setting up the start window is: - // - // 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - // 2. Use the window to instantiate Cstartwindow - // 3. Call Cstartwindow::addApplication numerous times to install applications - // in the start window. - // 4. Call CTaskBar::startApplication (initially minimized) to start the start - // window application. - - printf(MAIN_STRING "Opening the start window application window\n"); - NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); - if (!window) - { - printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After creating start window application window"); - - printf(MAIN_STRING "Initialize the CApplicationWindow\n"); - if (!window->open()) - { - printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); - delete window; - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After initializing the start window application window"); - - printf(MAIN_STRING "Creating the start window application\n"); - g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); - if (!g_nxwmtest.startwindow) - { - printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); - delete window; - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After create the start window application"); +#endif // Perform touchscreen calibration #ifdef CONFIG_NXWM_TOUCHSCREEN - // Start the window manager before adding applications - - printf(MAIN_STRING "Start the window manager\n"); - if (!g_nxwmtest.taskbar->startWindowManager()) - { - printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After starting the window manager"); - - // Perform touchscreen calibration - - NxWM::CCalibration *calibration = (NxWM::CCalibration *)0; // Avoid compiler complaint - NxWM::CFullScreenWindow *fullscreen = (NxWM::CFullScreenWindow *)0; // Avoid compiler complaint - // Create the touchscreen device - printf(MAIN_STRING "Creating CTouchscreen\n"); - g_nxwmtest.touchscreen = new NxWM::CTouchscreen; - if (!g_nxwmtest.touchscreen) + if (!createTouchScreen()) { - printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); - goto nocalibration; + printf(MAIN_STRING "Failed to create the touchscreen\n"); + testCleanUpAndExit(EXIT_FAILURE); } - printf(MAIN_STRING "Initialize the CTouchscreen\n"); - if (!g_nxwmtest.touchscreen->open()) + // Create the calibration application + + if (!createCalibration()) { - printf(MAIN_STRING "ERROR: Failed to open the CTouchscreen \n"); - delete g_nxwmtest.touchscreen; - goto nocalibration; - } - showTestCaseMemory("After initializing CTouchscreen"); - - // 1. Call CTaskBar::FullScreenWindow to create a window for the application, - // 2. Instantiate the application, providing the window to the application's - // constructor, - // 3. Then call CStartWindow::addApplication to add the application to the - // start window. - // 4. Call CTaskBar::startApplication start the application and bring its window to - // the top. - - printf(MAIN_STRING "Opening the calibrationapplication window\n"); - fullscreen = g_nxwmtest.taskbar->openFullScreenWindow(); - if (!fullscreen) - { - printf(MAIN_STRING "ERROR: Failed to create CFullScreenWindow for the calibration window\n"); - goto nocalibration; - } - showTestCaseMemory("After creating calibration full screen window"); - - printf(MAIN_STRING "Initialize the CFullScreenWindow\n"); - if (!fullscreen->open()) - { - printf(MAIN_STRING "ERROR: Failed to open the CFullScreenWindow \n"); - delete fullscreen; - goto nocalibration; - } - showTestCaseMemory("After initializing the calibration full screen window"); - - printf(MAIN_STRING "Creating the CCalibration application\n"); - calibration = new NxWM::CCalibration(fullscreen, g_nxwmtest.touchscreen); - if (!calibration) - { - printf(MAIN_STRING "ERROR: Failed to instantiate CCalibration\n"); - delete fullscreen; - goto nocalibration; - } - showTestCaseMemory("After creating the CCalibration application"); - - printf(MAIN_STRING "Adding the CCalibration application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(calibration)) - { - printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete calibration; - goto nocalibration; - } - showTestCaseMemory("After adding the CCalibration application"); - - // Call CTaskBar::startApplication to start the Calibration application - - printf(MAIN_STRING "Start the start window application\n"); - if (!g_nxwmtest.taskbar->startApplication(calibration, false)) - { - printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); - goto nocalibration; - } - showTestCaseMemory("After starting the start window application"); - - // Wait for calibration data - - printf(MAIN_STRING "Get calibration data\n"); - struct NxWM::SCalibrationData data; - if (!calibration->waitCalibrationData(data)) - { - printf(MAIN_STRING "ERROR: Failed to get calibration data\n"); + printf(MAIN_STRING "Failed to create the calibration application\n"); + testCleanUpAndExit(EXIT_FAILURE); } -nocalibration: + // Run the touchscreen calibration application + + if (!runCalibration()) + { + printf(MAIN_STRING "Touchscreen Calibration failed\n"); + testCleanUpAndExit(EXIT_FAILURE); + } #endif // Add the NxConsole application to the start window - NxWM::CNxConsole *console = (NxWM::CNxConsole *)0; // Avoid compiler complaint - - printf(MAIN_STRING "Opening the NxConsole application window\n"); - window = g_nxwmtest.taskbar->openApplicationWindow(); - if (!window) + if (!createNxConsole()) { - printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the NxConsole\n"); - goto noconsole; + printf(MAIN_STRING "Failed to create the NxConsole application\n"); + testCleanUpAndExit(EXIT_FAILURE); } - showTestCaseMemory("After creating the NxConsole application window"); - - printf(MAIN_STRING "Initialize the CApplicationWindow\n"); - if (!window->open()) - { - printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); - delete window; - goto noconsole; - } - showTestCaseMemory("After initializing the NxConsole application window"); - - printf(MAIN_STRING "Creating the NxConsole application\n"); - console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); - if (!console) - { - printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); - delete window; - goto noconsole; - } - showTestCaseMemory("After creating the NxConsole application"); - - printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(console)) - { - printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start window\n"); - delete window; - } - showTestCaseMemory("After adding the NxConsole application"); - -noconsole: - - // Add the calculator application to the start window - -#if 0 - NxWM::CCalculator *calculator = (NxWM::CCalculator *)0; // Avoid compiler complaint - - printf(MAIN_STRING "Opening the calculator application window\n"); - window = g_nxwmtest.taskbar->openApplicationWindow(); - if (!window) - { - printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the calculator\n"); - goto nocalculator; - } - showTestCaseMemory("After creating the calculator application window"); - - printf(MAIN_STRING "Initialize the CApplicationWindow\n"); - if (!window->open()) - { - printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); - delete window; - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After creating the initializing application window"); - - printf(MAIN_STRING "Creating the calculator application\n"); - calculator = new NxWM::CCalculator(g_nxwmtest.taskbar, window); - if (!calculator) - { - printf(MAIN_STRING "ERROR: Failed to instantiate calculator\n"); - delete window; - goto nocalculator; - } - showTestCaseMemory("After creating the calculator application"); - - printf(MAIN_STRING "Adding the calculator application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(calculator)) - { - printf(MAIN_STRING "ERROR: Failed to add calculator to the start window\n"); - delete window; - } - showTestCaseMemory("After adding the calculator application"); - -nocalculator: -#endif - - // Call CTaskBar::startApplication to start the start window application. The initial - // state of the start window is minimized. - - printf(MAIN_STRING "Start the start window application\n"); - if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.startwindow, true)) - { - printf(MAIN_STRING "ERROR: Failed to start the start window application\n"); - test_cleanup(); - return EXIT_FAILURE; - } - showTestCaseMemory("After starting the start window application"); // Call CTaskBar::startWindowManager to start the display with applications in place. -#ifndef CONFIG_NXWM_TOUCHSCREEN - printf(MAIN_STRING "Start the window manager\n"); - if (!g_nxwmtest.taskbar->startWindowManager()) + if (!startWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); - test_cleanup(); - return EXIT_FAILURE; + printf(MAIN_STRING "Failed to start the window manager\n"); + testCleanUpAndExit(EXIT_FAILURE); } - showTestCaseMemory("After starting the window manager"); -#endif // Wait a little bit for the display to stabilize. The simulation pressing of // the 'start window' icon in the task bar diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 7682e6620..1c7aab193 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -102,12 +102,6 @@ namespace NxWM void close(void); - /** - * CNxConsole destructor - */ - - ~CNxConsole(void); - public: /** * CNxConsole constructor @@ -120,6 +114,12 @@ namespace NxWM CNxConsole(CTaskbar *taskbar, CApplicationWindow *window); + /** + * CNxConsole destructor + */ + + ~CNxConsole(void); + /** * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index e218b5f1e..6e66f3028 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -177,6 +177,9 @@ bool CCalibration::run(void) void CCalibration::stop(void) { + // The main thread is stuck waiting for the next touchscreen input... + // So this is probably just a waste of good FLASH space. + m_stop = true; } diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 34bf53d1a..9edb3fff5 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -886,6 +886,12 @@ bool CTaskbar::redrawTaskbarWindow(void) return false; } + // Raise the task bar to the top of the display. This is only necessary + // after stopping a full screen application. Other applications do not + // overlap the task bar and, hence, do not interfere. + + m_taskbar->raise(); + // Fill the entire window with the background color port->drawFilledRect(0, 0, windowSize.w, windowSize.h, From c9896fa33d66f7e4c39c98c745c422363d6b90ce Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 11 May 2012 00:05:25 +0000 Subject: [PATCH 044/390] NxWM: Finishes touchscreen implementation; NuttX: Standardize touchscreen initialization interfaces for all boards git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4721 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 72 +++--- libnxwidgets/src/cnxserver.cxx | 68 +++--- nxwm/include/ccalibration.hxx | 7 +- nxwm/include/ctaskbar.hxx | 12 + nxwm/include/ctouchscreen.hxx | 119 +++++++++- nxwm/include/nxwmconfig.hxx | 34 +++ nxwm/src/ccalibration.cxx | 5 +- nxwm/src/ctouchscreen.cxx | 385 +++++++++++++++++++++++++++++++-- 8 files changed, 606 insertions(+), 96 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 7cdc778e0..291267eb8 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -46,6 +46,7 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" +#include "ctouchscreen.hxx" #include "ccalibration.hxx" #include "cnxconsole.hxx" @@ -260,10 +261,10 @@ static bool createTaskbar(void) // Connect to the NX server - printf(MAIN_STRING "Connect the CTaskbar instance to the NX server\n"); + printf(MAIN_STRING "Connect CTaskbar instance to the NX server\n"); if (!g_nxwmtest.taskbar->connect()) { - printf(MAIN_STRING "ERROR: Failed to connect the CTaskbar instance to the NX server\n"); + printf(MAIN_STRING "ERROR: Failed to connect CTaskbar instance to the NX server\n"); return false; } showTestCaseMemory("After connecting to the server"); @@ -274,10 +275,10 @@ static bool createTaskbar(void) // CTaskBar::startWindowManager() brings the window manager up with those applications // in place. - printf(MAIN_STRING "Initialize the CTaskbar instance\n"); + printf(MAIN_STRING "Initialize CTaskbar instance\n"); if (!g_nxwmtest.taskbar->initWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to intialize the CTaskbar instance\n"); + printf(MAIN_STRING "ERROR: Failed to intialize CTaskbar instance\n"); return false; } @@ -309,10 +310,10 @@ static bool createStartWindow(void) } showTestCaseMemory("After creating start window application window"); - printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + printf(MAIN_STRING "Initialize CApplicationWindow\n"); if (!window->open()) { - printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + printf(MAIN_STRING "ERROR: Failed to open CApplicationWindow \n"); delete window; return false; } @@ -367,25 +368,30 @@ static bool startWindowManager(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool createTouchScreen(void) { - // Create the touchscreen device + // Get the physical size of the device in pixels + + struct nxgl_size_s windowSize; + (void)g_nxwmtest.taskbar->getWindowSize(&windowSize); + + // Create the touchscreen device printf(MAIN_STRING "Creating CTouchscreen\n"); - g_nxwmtest.touchscreen = new NxWM::CTouchscreen; + g_nxwmtest.touchscreen = new NxWM::CTouchscreen(g_nxwmtest.taskbar, &windowSize); if (!g_nxwmtest.touchscreen) { printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); return false; } - printf(MAIN_STRING "Initialize the CTouchscreen\n"); - if (!g_nxwmtest.touchscreen->open()) + printf(MAIN_STRING "Start touchscreen listener\n"); + if (!g_nxwmtest.touchscreen->start()) { - printf(MAIN_STRING "ERROR: Failed to open the CTouchscreen \n"); + printf(MAIN_STRING "ERROR: Failed start the touchscreen listener\n"); delete g_nxwmtest.touchscreen; return false; } - showTestCaseMemory("After initializing CTouchscreen"); + showTestCaseMemory("After starting the touchscreen listener"); return true; } #endif @@ -414,16 +420,16 @@ static bool createCalibration(void) } showTestCaseMemory("After creating calibration full screen window"); - printf(MAIN_STRING "Initialize the CFullScreenWindow\n"); + printf(MAIN_STRING "Initialize CFullScreenWindow\n"); if (!window->open()) { - printf(MAIN_STRING "ERROR: Failed to open the CFullScreenWindow \n"); + printf(MAIN_STRING "ERROR: Failed to open CFullScreenWindow \n"); delete window; return false; } showTestCaseMemory("After initializing the calibration full screen window"); - printf(MAIN_STRING "Creating the CCalibration application\n"); + printf(MAIN_STRING "Creating CCalibration application\n"); g_nxwmtest.calibration = new NxWM::CCalibration(window, g_nxwmtest.touchscreen); if (!g_nxwmtest.calibration) { @@ -431,9 +437,9 @@ static bool createCalibration(void) delete window; return false; } - showTestCaseMemory("After creating the CCalibration application"); + showTestCaseMemory("After creating CCalibration application"); - printf(MAIN_STRING "Adding the CCalibration application to the start window\n"); + printf(MAIN_STRING "Adding CCalibration application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) { printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); @@ -441,7 +447,7 @@ static bool createCalibration(void) return false; } - showTestCaseMemory("After adding the CCalibration application"); + showTestCaseMemory("After adding CCalibration application"); return true; } #endif @@ -501,10 +507,10 @@ static bool createNxConsole(void) } showTestCaseMemory("After creating the NxConsole application window"); - printf(MAIN_STRING "Initialize the CApplicationWindow\n"); + printf(MAIN_STRING "Initialize CApplicationWindow\n"); if (!window->open()) { - printf(MAIN_STRING "ERROR: Failed to open the CApplicationWindow \n"); + printf(MAIN_STRING "ERROR: Failed to open CApplicationWindow \n"); delete window; return false; } @@ -583,7 +589,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createTaskbar()) { - printf(MAIN_STRING "Failed to create the task bar\n"); + printf(MAIN_STRING "ERROR: Failed to create the task bar\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -591,7 +597,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createStartWindow()) { - printf(MAIN_STRING "Failed to create the start window\n"); + printf(MAIN_STRING "ERROR: Failed to create the start window\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -600,27 +606,21 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN if (!createTouchScreen()) { - printf(MAIN_STRING "Failed to create the start window\n"); + printf(MAIN_STRING "ERROR: Failed to create the touchscreen\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif - // Perform touchscreen calibration + // Perform touchscreen calibration. In a real system, you would only do this + // if you have no saved touchscreen calibration. In this Unit Test, we run + // the calibration unconditionally. #ifdef CONFIG_NXWM_TOUCHSCREEN - // Create the touchscreen device - - if (!createTouchScreen()) - { - printf(MAIN_STRING "Failed to create the touchscreen\n"); - testCleanUpAndExit(EXIT_FAILURE); - } - // Create the calibration application if (!createCalibration()) { - printf(MAIN_STRING "Failed to create the calibration application\n"); + printf(MAIN_STRING "ERROR: Failed to create the calibration application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -628,7 +628,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!runCalibration()) { - printf(MAIN_STRING "Touchscreen Calibration failed\n"); + printf(MAIN_STRING "ERROR: Touchscreen Calibration failed\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -637,7 +637,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createNxConsole()) { - printf(MAIN_STRING "Failed to create the NxConsole application\n"); + printf(MAIN_STRING "ERROR: Failed to create the NxConsole application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -645,7 +645,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!startWindowManager()) { - printf(MAIN_STRING "Failed to start the window manager\n"); + printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); testCleanUpAndExit(EXIT_FAILURE); } diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index dc6316835..be67e5641 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -232,47 +232,51 @@ bool CNxServer::connect(void) m_hNxServer = nx_connect(); if (m_hNxServer) { - pthread_attr_t attr; + pthread_attr_t attr; - // Start a separate thread to listen for server events. This is probably - // the least efficient way to do this, but it makes this logic flow more - // smoothly. + // Start a separate thread to listen for server events. This is probably + // the least efficient way to do this, but it makes this logic flow more + // smoothly. - (void)pthread_attr_init(&attr); - param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; - (void)pthread_attr_setschedparam(&attr, ¶m); - (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK); + (void)pthread_attr_init(&attr); + param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; + (void)pthread_attr_setschedparam(&attr, ¶m); + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK); - m_stop = false; - m_running = true; + m_stop = false; + m_running = true; - ret = pthread_create(&thread, &attr, listener, (FAR void *)this); - if (ret != 0) - { - gdbg("NxServer::connect: pthread_create failed: %d\n", ret); - m_running = false; - disconnect(); - return false; - } + ret = pthread_create(&thread, &attr, listener, (FAR void *)this); + if (ret != 0) + { + gdbg("NxServer::connect: pthread_create failed: %d\n", ret); + m_running = false; + disconnect(); + return false; + } - // Don't return until we are connected to the server + // Detach from the thread - while (!m_connected && m_running) - { - // Wait for the listener thread to wake us up when we really - // are connected. + (void)pthread_detach(thread); - (void)sem_wait(&m_connsem); - } + // Don't return until we are connected to the server - // In the successful case, the listener is still running (m_running) - // and the server is connected (m_connected). Anything else is a failure. + while (!m_connected && m_running) + { + // Wait for the listener thread to wake us up when we really + // are connected. - if (!m_connected || !m_running) - { - disconnect(); - return false; - } + (void)sem_wait(&m_connsem); + } + + // In the successful case, the listener is still running (m_running) + // and the server is connected (m_connected). Anything else is a failure. + + if (!m_connected || !m_running) + { + disconnect(); + return false; + } } else { diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 0adcd894f..42eb56ad2 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -50,7 +50,6 @@ #include "iapplication.hxx" #include "cfullscreenwindow.hxx" -#include "ctouchscreen.hxx" /**************************************************************************** * Pre-processor Definitions @@ -72,6 +71,12 @@ namespace NxWM { + /** + * Forward references + */ + + struct CTouchscreen; + /** * Touchscreen calibration data */ diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 69595163c..398087f84 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -385,6 +385,18 @@ namespace NxWM bool stopApplication(IApplication *app); + /** + * Get the size of the physical display device as it is known to the task + * bar. + * + * @return The size of the display + */ + + inline bool getWindowSize(FAR struct nxgl_size_s *size) + { + return m_taskbar->getSize(size); + } + /** * Simulate a mouse click on the icon at index. This inline method is only * used during automated testing of NxWM. diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx index f8eaeaee8..c3aa198cb 100644 --- a/nxwm/include/ctouchscreen.hxx +++ b/nxwm/include/ctouchscreen.hxx @@ -43,8 +43,13 @@ #include #include +#include + #include +#include "cnxserver.hxx" +#include "ccalibration.hxx" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -63,16 +68,68 @@ namespace NxWM class CTouchscreen { private: - int m_touchFd; /**< File descriptor of the opened touchscreen device */ - sem_t m_waitSem; /**< Semaphore the supports waits for touchscreen data */ + /** + * The state of the listener thread. + */ + + enum EListenerState + { + LISTENER_NOTRUNNING = 0, /**< The listener thread has not yet been started */ + LISTENER_STARTED, /**< The listener thread has been started, but is not yet running */ + LISTENER_RUNNING, /**< The listener thread is running normally */ + LISTENER_STOPREQUESTED, /**< The listener thread has been requested to stop */ + LISTENER_TERMINATED, /**< The listener thread terminated normally */ + LISTENER_FAILED /**< The listener thread terminated abnormally */ + }; + + /** + * CTouchscreen state data + */ + + NXWidgets::CNxServer *m_server; /**< The current NX server */ + int m_touchFd; /**< File descriptor of the opened touchscreen device */ + sem_t m_waitSem; /**< Semaphore the supports waits for touchscreen data */ + pthread_t m_thread; /**< The listener thread ID */ + volatile enum EListenerState m_state; /**< The state of the listener thread */ + volatile bool m_enabled; /**< True: Normal touchscreen processing */ + volatile bool m_capture; /**< True: There is a thread waiting for raw touch data */ + volatile bool m_calibrated; /**< True: If have calibration data */ + struct nxgl_size_s m_windowSize; /**< The size of the physical display */ + struct SCalibrationData m_calibData; /**< Calibration data */ + struct touch_sample_s m_sample; /**< In normal mode, touch data is collected here */ + struct touch_sample_s *m_touch; /**< Points to the current touch data buffer */ + + /** + * The touchscreen listener thread. This is the entry point of a thread that + * listeners for and dispatches touchscreens events to the NX server. + * + * @param arg. The CTouchscreen 'this' pointer cast to a void*. + * @return This function normally does not return but may return NULL on + * error conditions. + */ + + static FAR void *listener(FAR void *arg); + + /** + * Inject touchscreen data into NX as mouse intput + * + * @param sample. The buffer where data was collected. + */ + + void handleMouseInput(struct touch_sample_s *sample); public: /** * CTouchscreen Constructor + * + * @param server. An instance of the NX server. This will be needed for + * injecting mouse data. + * @param windowSize. The size of the physical window in pixels. This + * is needed for touchscreen scaling. */ - CTouchscreen(void); + CTouchscreen(NXWidgets::CNxServer *server, struct nxgl_size_s *windowSize); /** * CTouchscreen Destructor @@ -81,22 +138,66 @@ namespace NxWM ~CTouchscreen(void); /** - * Initialize the touchscreen device. Initialization is separate from - * object instantiation so that failures can be reported. + * Start the touchscreen listener thread. * - * @return True if the touchscreen device was correctly initialized + * @return True if the touchscreen listener thread was correctly started. */ - bool open(void); + bool start(void); /** - * Capture raw driver data. + * Enable/disable touchscreen data processing. When enabled, touchscreen events + * are calibrated and forwarded to the NX layer which dispatches the touchscreen + * events in window-relative positions to the correct NX window. * + * When disabled, touchscreen data is not forwarded to NX, but is instead captured + * and made available for touchscreen calibration. The touchscreen driver is + * initially disabled and must be specifically enabled be begin normal processing. + * Normal processing also requires calibration data (see method setCalibrationData) + * + * @param capture. True enables capture mode; false disables. + */ + + inline void setEnabled(bool enable) + { + // Set the capture flag. m_calibrated must also be set to get to normal + // mode where touchscreen data is forwarded to NX. + + m_enabled = enable; + } + + /** + * Provide touchscreen calibration data. If calibration data is received (and + * the touchscreen is enabled), then received touchscreen data will be scaled + * using the calibration data and forward to the NX layer which dispatches the + * touchscreen events in window-relative positions to the correct NX window. + * + * @param data. A reference to the touchscreen data. + */ + + inline void setCalibrationData(struct SCalibrationData &caldata) + { + // Save a copy of the calibration data + + m_calibData = caldata; + + // Note that we have calibration data. Data will now be scaled and forwarded + // to NX (unless we are still in cpature mode) + + m_calibrated = true; + } + + /** + * Capture raw driver data. This method will capture mode one raw touchscreen + * input. The normal use of this method is for touchscreen calibration. + * + * This function is not re-entrant: There may be only one thread waiting for + * raw touchscreen data. * * @return True if the raw touchscreen data was sucessfully obtained */ - bool waitRawTouchData(struct touch_sample_s &touch); + bool waitRawTouchData(struct touch_sample_s *touch); }; } diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 4e08b0481..4e51cea1d 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -42,6 +42,8 @@ #include +#include + #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" @@ -322,12 +324,43 @@ #endif /* Touchscreen device *******************************************************/ +/** + * Touchscreen device settings + * + * CONFIG_NXWM_TOUCHSCREEN_DEVNO - Touchscreen device minor number, i.e., the + * N in /dev/inputN. Default: 0 + * CONFIG_NXWM_TOUCHSCREEN_DEVNO - The full path to the touchscreen device. + * Default: "/dev/input0" + * CONFIG_NXWM_TOUCHSCREEN_SIGNO - The realtime signal used to wake up the + * touchscreen listener thread. Default: 5 + */ + +#ifndef CONFIG_NXWM_TOUCHSCREEN_DEVNO +# define CONFIG_NXWM_TOUCHSCREEN_DEVNO 0 +#endif #ifndef CONFIG_NXWM_TOUCHSCREEN_DEVPATH # define CONFIG_NXWM_TOUCHSCREEN_DEVPATH "/dev/input0" #endif +#ifndef CONFIG_NXWM_TOUCHSCREEN_SIGNO +# define CONFIG_NXWM_TOUCHSCREEN_SIGNO 5 +#endif + /* Calibration display ******************************************************/ +/** + * Calibration display settings: + * + * CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR - The background color of the + * touchscreen calibration display. Default: Same as + * CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR + * CONFIG_NXWM_CALIBRATION_LINECOLOR - The color of the lines used in the + * touchscreen calibration display. Default: MKRGB(0, 0, 128) (dark blue) + * CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR - The background color of the + * touchscreen calibration display. Default: MKRGB(255, 255, 255) (white) + * CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen + * calibration application. Default: NxWM::g_calibrationBitmap + */ #ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR # define CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR @@ -344,6 +377,7 @@ #ifndef CONFIG_NXWM_CALIBRATION_ICON # define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap #endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 6e66f3028..82c12ebb3 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -43,6 +43,7 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" +#include "ctouchscreen.hxx" #include "ccalibration.hxx" /**************************************************************************** @@ -161,7 +162,7 @@ bool CCalibration::run(void) // Wait for the next raw touchscreen input struct touch_sample_s sample; - while (!m_touchscreen->waitRawTouchData(sample)); + while (!m_touchscreen->waitRawTouchData(&sample)); // Then process the raw touchscreen input @@ -190,7 +191,7 @@ void CCalibration::stop(void) void CCalibration::hide(void) { -#warning "Revisit" + // REVISIT } /** diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 215e50064..737c7d9e3 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -43,6 +43,9 @@ #include #include +#include +#include +#include #include #include @@ -58,6 +61,21 @@ /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ +/* We want debug output from this file if either input/touchscreen or graphics debug is + * enabled. + */ + +#if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS) +# undef dbg +# undef vdbg +# ifdef CONFIG_CPP_HAVE_VARARGS +# define dbg(x...) +# define vdbg(x...) +# else +# define dbg (void) +# define vdbg (void) +# endif +#endif /******************************************************************************************** * CTouchscreen Method Implementations @@ -67,11 +85,32 @@ using namespace NxWM; /** * CTouchscreen Constructor + * + * @param server. An instance of the NX server. This will be needed for + * injecting mouse data. + * @param windowSize. The size of the physical window in pixels. This + * is needed for touchscreen scaling. */ -CTouchscreen::CTouchscreen(void) +CTouchscreen::CTouchscreen(NXWidgets::CNxServer *server, struct nxgl_size_s *windowSize) { - m_touchFd = -1; + m_server = server; // Save the NX server + m_touchFd = -1; // Device driver is not opened + m_state = LISTENER_NOTRUNNING; // The listener thread is not running yet + m_enabled = false; // Normal forwarding is not enabled + m_capture = false; // There is no thread waiting for touchscreen data + m_calibrated = false; // We have no calibration data + + // Save the window size + + m_windowSize = *windowSize; + + // Use the default touch data buffer + + m_touch = &m_sample; + + // Initialize the m_waitSem semaphore so that any waits for data will block + sem_init(&m_waitSem, 0, 0); } @@ -81,45 +120,359 @@ CTouchscreen::CTouchscreen(void) CTouchscreen::~CTouchscreen(void) { + // Stop the listener thread + + m_state = LISTENER_STOPREQUESTED; + + // Wake up the listener thread so that it will use our buffer + // to receive data + // REVISIT: Need wait here for the listener thread to terminate + + (void)pthread_kill(m_thread, CONFIG_NXWM_TOUCHSCREEN_SIGNO); + + // Close the touchscreen device (or should these be done when the thread exits?) + if (m_touchFd >= 0) { std::close(m_touchFd); } + // Destroy the semaphores that we created. + sem_destroy(&m_waitSem); } /** - * Initialize the touchscreen device. Initialization is separate from - * object instantiation so that failures can be reported. + * Start the touchscreen listener thread. * - * @return True if the touchscreen device was correctly initialized + * @return True if the touchscreen listener thread was correctly started. */ -bool CTouchscreen::open(void) +bool CTouchscreen::start(void) { - // Open the touchscreen device + pthread_attr_t attr; - m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); - if (m_touchFd < 0) + vdbg("Starting listener\n"); + + // Start a separate thread to listen for touchscreen events + + (void)pthread_attr_init(&attr); + + struct sched_param param; + param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; + (void)pthread_attr_setschedparam(&attr, ¶m); + + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK); + + m_state = LISTENER_STARTED; // The listener thread has been started, but is not yet running + + int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); + if (ret != 0) { - gdbg("ERROR Failed to open %s for reading: %d\n", - CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errno); + dbg("NxServer::connect: pthread_create failed: %d\n", ret); return false; } - return true; + // Detach from the thread + + (void)pthread_detach(m_thread); + + // Don't return until we are sure that the listener thread is running + // (or until it reports an error). + + while (m_state == LISTENER_STARTED) + { + // Wait for the listener thread to wake us up when we really + // are connected. + + (void)sem_wait(&m_waitSem); + } + + // Then return true only if the listener thread reported successful + // initialization. + + vdbg("Listener m_state=%d\n", (int)m_state); + return m_state == LISTENER_RUNNING; } /** - * Capture raw driver data. + * Capture raw driver data. This method will capture mode one raw touchscreen + * input. The normal use of this method is for touchscreen calibration. * + * This function is not re-entrant: There may be only one thread waiting for + * raw touchscreen data. * * @return True if the raw touchscreen data was sucessfully obtained */ -bool CTouchscreen::waitRawTouchData(struct touch_sample_s &touch) +bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) { -#warning "Missing logic" - return true; + vdbg("Capturing touch input\n"); + + // Setup to cpature raw data into the user provided buffer + + sched_lock(); + m_touch = touch; + m_capture = true; + + // Wake up the listener thread so that it will use our buffer + // to receive data + + (void)pthread_kill(m_thread, CONFIG_NXWM_TOUCHSCREEN_SIGNO); + + // And wait for touch data + + int ret = OK; + while (m_capture) + { + ret = sem_wait(&m_waitSem); + DEBUGASSERT(ret == 0 || errno == EINTR); + } + sched_unlock(); + + // And return success. The listener thread will have (1) reset both + // m_touch and m_capture and (2) posted m_waitSem + + vdbg("Returning touch input: %d\n", ret); + return ret == OK; } + +/** + * The touchscreen listener thread. This is the entry point of a thread that + * listeners for and dispatches touchscreens events to the NX server. + * + * @param arg. The CTouchscreen 'this' pointer cast to a void*. + * @return This function normally does not return but may return NULL on + * error conditions. + */ + +FAR void *CTouchscreen::listener(FAR void *arg) +{ + CTouchscreen *This = (CTouchscreen *)arg; + + vdbg("Listener started\n"); + + // Initialize the touchscreen device + + int ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO); + if (ret < 0) + { + dbg("ERROR Failed initialize the touchscreen device: %d\n", ret); + This->m_state = LISTENER_FAILED; + sem_post(&This->m_waitSem); + return (FAR void *)0; + } + + // Open the touchscreen device that we just created. + + This->m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); + if (This->m_touchFd < 0) + { + dbg("ERROR Failed to open %s for reading: %d\n", + CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errno); + This->m_state = LISTENER_FAILED; + sem_post(&This->m_waitSem); + return (FAR void *)0; + } + + // Indicate that we have successfully initialized + + This->m_state = LISTENER_RUNNING; + sem_post(&This->m_waitSem); + + // Now loop, reading and dispatching touchscreen data + + while (This->m_state == LISTENER_RUNNING) + { + // The sample pointer can change dynamically let's sample it once + // and stick with that pointer. + + struct touch_sample_s *sample = This->m_touch; + + // Read one touchscreen sample + + vdbg("Listening for sample %p\n", sample); + DEBUGASSERT(sample); + ssize_t nbytes = read(This->m_touchFd, sample, + sizeof(struct touch_sample_s)); + vdbg("Received nbytes=%d\n", nbytes); + + // Check for errors + + if (nbytes < 0) + { + // The only expect error is to be interrupt by a signal + + int errval = errno; + + dbg("read %s failed: %d\n", + CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errval); + DEBUGASSERT(errval == EINTR); + } + + // On a truly success read, the size of the returned data will + // be exactly the size of one touchscreen sample + + else if (nbytes == sizeof(struct touch_sample_s)) + { + // Looks like good touchscreen input... process it + + This->handleMouseInput(sample); + } + else + { + dbg("ERROR Unexpected read size=%d, expected=%d\n", + nbytes, sizeof(struct touch_sample_s)); + } + } + + // We should get here only if we were asked to terminate via + // m_state = LISTENER_STOPREQUESTED + + vdbg("Listener exiting\n"); + This->m_state = LISTENER_TERMINATED; + return (FAR void *)0; +} + +/** + * Inject touchscreen data into NX as mouse intput + */ + +void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) +{ + vdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + sample->point[0].id, sample->point[0].flags, sample->point[0].x, + sample->point[0].y, sample->point[0].h, sample->point[0].w, + sample->point[0].pressure); + + // Verify the touchscreen data + + if (sample->npoints < 1 || + ((sample->point[0].flags & TOUCH_POS_VALID) == 0 && + (sample->point[0].flags & TOUCH_UP) == 0)) + { + // The pen is (probably) down, but we have do not have valid + // X/Y position data to report. This should not happen. + + return; + } + + // Was this data captured by some external logic? (probably the + // touchscreen calibration logic) + + if (m_capture && sample != &m_sample) + { + // Yes.. let waitRawTouchData know that the data is available + // and restore normal buffering + + m_touch = &m_sample; + m_capture = false; + sem_post(&m_waitSem); + return; + } + + // Sanity checks. Re-directed touch data should never reach this point. + // After posting m_waitSem, m_touch might change asynchronously. + + DEBUGASSERT(sample == &m_sample); + + // Check if normal processing of touchscreen data is enaable. Check if + // we have been given calibration data. + + if (!m_enabled || !m_calibrated) + { + // No.. we are not yet ready to process touchscreen data + + return; + } + + // Now we will inject the touchscreen into NX as mouse input. First + // massage the data a litle so that it behaves a little more like a + // mouse with only a left button + // + // Was the button up or down? + + uint8_t buttons; + if ((sample->point[0].flags & (TOUCH_DOWN|TOUCH_MOVE)) != 0) + { + buttons = NX_MOUSE_LEFTBUTTON; + } + else if ((sample->point[0].flags & TOUCH_UP) != 0) + { + buttons = NX_MOUSE_NOBUTTONS; + } + else + { + // The pen is neither up nor down. This should not happen + + return; + } + + // Get the "raw" touch coordinates (if they are valid) + + nxgl_coord_t x; + nxgl_coord_t y; + + if ((sample->point[0].flags & TOUCH_POS_VALID) == 0) + { + x = 0; + y = 0; + } + else + { + // We have valid coordinates. Get the raw touch + // position from the sample + + uint32_t rawX = (uint32_t)sample->point[0].x; + uint32_t rawY = (uint32_t)sample->point[0].y; + + // Get the fixed precision, scaled X and Y values + + b16_t scaledX = rawX * m_calibData.xSlope + m_calibData.xOffset; + b16_t scaledY = rawY * m_calibData.ySlope + m_calibData.yOffset; + + // Get integer scaled X and Y positions and clip + // to fix in the window + + int32_t bigX = b16toi(scaledX + b16HALF); + int32_t bigY = b16toi(scaledY + b16HALF); + + // Clip to the display + + if (bigX < 0) + { + x = 0; + } + else if (bigX >= m_windowSize.w) + { + x = m_windowSize.w - 1; + } + else + { + x = (nxgl_coord_t)bigX; + } + + if (bigY < 0) + { + y = 0; + } + else if (bigY >= m_windowSize.h) + { + y = m_windowSize.h - 1; + } + else + { + y = (nxgl_coord_t)bigY; + } + + vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); + } + + // Get the server handle and "inject the mouse data + + NXHANDLE handle = m_server->getServer(); + (void)nx_mousein(handle, x, y, buttons); +} + + + From 469ad81eccde86e0185fa5848e3690c56a77b9f0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 11 May 2012 18:27:46 +0000 Subject: [PATCH 045/390] SMTPE11 and NxWM touchscreen fixes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4722 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/images/play.png | Bin 550 -> 233 bytes nxwm/src/ccalibration.cxx | 4 ++ nxwm/src/ctouchscreen.cxx | 4 +- nxwm/src/glyph_play.cxx | 107 +++++++++++++++----------------------- 4 files changed, 49 insertions(+), 66 deletions(-) diff --git a/nxwm/images/play.png b/nxwm/images/play.png index ab7c29249b4c097bd420334358d6e44e4cccf3fa..02ff75414a32919654e57680db476d157d637f80 100644 GIT binary patch delta 211 zcmZ3+@{&=nGr-TCmrII^fq{Y7)59eQNK1e)2NRIY7hSa;NHG=%xjQkeJ16sUqJu&` zx1fcb+g`IMphUH&i(`nz>7{3O@*YqSV7=(L$SOVW%0lh}@pWwM9GoeAvHw&i?{#4E zsB~)NZU}zL)pBa9iFOFvh9CeM8v@%-qg<**` zXMpRIMSedPGCpiv*1~HfpnbxpM^XJ^^R^BdF`*8olP>R=WwSg3?l|;s2fBm7)78&q Iol`;+0PYV-EC2ui delta 530 zcmV+t0`2|j0j2~%iBL{Q4GJ0x0000DNk~Le0000P0000P2nGNE0L1BqV*mgE0drDE zLIAGL9O(c600v@9M??Vs0RI60puMM)kuD&A1Q8@U#Hycw0004|Nklb>! z3`HM}+{2@R9KvIPcFQ3OBwMrf2I<(XL++4l89L?=Ml|Xq>>$;OY)Mhkw44H)A^FMA zPm8K5e{72yCouv?z+OFUffZIOW<0C)&p zXrf@&wPdN;rjco< z(1*QRjJsg#n3PJEMAn7(<4lsX;6BKIoUB-2nfdn+4>4=LHL{n8ogqp43kWv;Jxve` z-wbZNPX`O_6lukY-ReG-ixDR=y(2^eem5-H!Oap_r%$N_fYUL;&V_dMz#e2N za|yBK%4aCN{HFzSHXu*iC_q=EFP_zBa}r+kU`v} zbVpALEy$A;$sk4?>a9Ok8N}rq@9#_W@h~MrOH#e7lSCqDu7bBg1gp;Te|&d+0nr@; UtzsH84*&oF07*qoM6N<$f~=qD@&Et; diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 82c12ebb3..9ba0c0917 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -223,8 +223,12 @@ bool CCalibration::waitCalibrationData(struct SCalibrationData &data) while (m_state != CALIB_COMPLETE) { +#ifdef CONFIG_DEBUG int ret = sem_wait(&m_waitSem); DEBUGASSERT(ret == 0 || errno == EINTR); +#else + (void)sem_wait(&m_waitSem); +#endif } // Recover the window instance contained in the full screen window diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 737c7d9e3..f5e476cce 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -295,19 +295,19 @@ FAR void *CTouchscreen::listener(FAR void *arg) DEBUGASSERT(sample); ssize_t nbytes = read(This->m_touchFd, sample, sizeof(struct touch_sample_s)); - vdbg("Received nbytes=%d\n", nbytes); // Check for errors if (nbytes < 0) { // The only expect error is to be interrupt by a signal - +#ifdef CONFIG_DEBUG int errval = errno; dbg("read %s failed: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errval); DEBUGASSERT(errval == EINTR); +#endif } // On a truly success read, the size of the returned data will diff --git a/nxwm/src/glyph_play.cxx b/nxwm/src/glyph_play.cxx index 1c6ce8cd9..8c16addae 100644 --- a/nxwm/src/glyph_play.cxx +++ b/nxwm/src/glyph_play.cxx @@ -56,9 +56,9 @@ * Pre-Processor Definitions ********************************************************************************************/ -#define BITMAP_NROWS 25 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 6 +#define BITMAP_NROWS 24 +#define BITMAP_NCOLUMNS 24 +#define BITMAP_NLUTCODES 5 #define DARK_PLAY_ICON 1 @@ -76,13 +76,13 @@ using namespace NxWM; static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00a200, 0x006300, 0x004e00, 0x008100, 0x003600 /* Codes 1-5 */ + 0x00bd00, 0x008100, 0x006300, 0x003600 /* Codes 1-4 */ }; static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00d800, 0x008400, 0x006800, 0x00ac00, 0x004800, /* Codes 1-5 */ + 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ }; # else /* DARK_PLAY_ICON */ @@ -90,13 +90,13 @@ static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00d800, 0x008400, 0x006800, 0x00ac00, 0x004800, /* Codes 1-5 */ + 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ }; static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x3fe13f, 0x3fa23f, 0x3f8d3f, 0x3fc03f, 0x3f753f /* Codes 1-5 */ + 0x00fc00, 0x00c000, 0x00a200, 0x007500 /* Codes 1-4 */ }; # endif /* DARK_PLAY_ICON */ @@ -108,13 +108,13 @@ static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x0500, 0x0300, 0x0260, 0x0400, 0x01a0 /* Codes 1-5 */ + 0x05e0, 0x0400, 0x0300, 0x01a0 /* Codes 1-4 */ }; static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x06c0, 0x0420, 0x0340, 0x0560, 0x0240, /* Codes 1-5 */ + 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ }; # else /* DARK_PLAY_ICON */ @@ -122,13 +122,13 @@ static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x06c0, 0x0420, 0x0340, 0x0560, 0x0240, /* Codes 0-5 */ + 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ }; static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x3f07, 0x3d07, 0x3c67, 0x3e07, 0x3ba7, /* Codes 0-5 */ + 0x07e0, 0x0600, 0x0500, 0x03a0 /* Codes 1-4 */ }; # endif /* DARK_PLAY_ICON */ @@ -150,13 +150,13 @@ static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x5f, 0x3a, 0x2d, 0x4b, 0x1f /* Codes 1-5 */ + 0x6e, 0x4b, 0x3a, 0x1f /* Codes 1-4 */ }; static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x7e, 0x4d, 0x3d, 0x64, 0x2a /* Codes 1-5 */ + 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ }; # else /* DARK_PLAY_ICON */ @@ -164,13 +164,13 @@ static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x7e, 0x4d, 0x3d, 0x64, 0x2a /* Codes 1-5 */ + 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ }; static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x9e, 0x79, 0x6c, 0x8a, 0x5e /* Codes 1-5 */ + 0x93, 0x70, 0x5f, 0x44 /* Codes 1-4 */ }; # endif /* DARK_PLAY_ICON */ @@ -182,13 +182,13 @@ static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x14, 0x0c, 0x08, 0x10, 0x04 /* Codes 1-5 */ + 0x14, 0x10, 0x0c, 0x04 /* Codes 1-4 */ }; static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x18, 0x10, 0x0c, 0x14, 0x08 /* Codes 1-5 */ + 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ }; # else /* DARK_PLAY_ICON */ @@ -196,13 +196,13 @@ static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x18, 0x10, 0x0c, 0x14, 0x08 /* Codes 0-5 */ + 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ }; static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x3c, 0x34, 0x30, 0x38, 0x2c /* Codes 0-5 */ + 0x1c, 0x18, 0x14, 0x0c /* Codes 1-4 */ }; # endif /* DARK_PLAY_ICON */ @@ -213,51 +213,30 @@ static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = { - { 25, 0}, /* Row 0 */ - { 9, 0}, { 1, 1}, { 1, 2}, { 3, 3}, { 1, 2}, { 1, 1}, { 9, 0}, /* Row 1 */ - { 7, 0}, { 1, 1}, { 1, 3}, { 2, 2}, { 3, 1}, { 1, 4}, { 1, 3}, { 1, 5}, /* Row 2 */ - { 1, 2}, { 7, 0}, - { 6, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 7, 0}, { 1, 1}, { 1, 5}, { 1, 3}, /* Row 3 */ - { 6, 0}, - { 4, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 4}, { 9, 0}, { 1, 1}, { 1, 2}, /* Row 4 */ - { 1, 5}, { 1, 3}, { 4, 0}, - { 3, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 1, 4}, { 1, 0}, { 1, 1}, { 10, 0}, /* Row 5 */ - { 1, 4}, { 1, 5}, { 1, 2}, { 3, 0}, - { 3, 0}, { 1, 3}, { 1, 5}, { 3, 0}, { 2, 1}, { 10, 0}, { 2, 3}, { 1, 4}, /* Row 6 */ - { 2, 0}, - { 2, 0}, { 1, 1}, { 1, 5}, { 1, 4}, { 3, 0}, { 1, 1}, { 1, 4}, { 2, 1}, /* Row 7 */ - { 8, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 2, 0}, - { 2, 0}, { 1, 3}, { 1, 2}, { 4, 0}, { 1, 1}, { 5, 4}, { 7, 0}, { 1, 1}, /* Row 8 */ - { 1, 5}, { 1, 2}, { 1, 0}, - { 1, 0}, { 1, 1}, { 1, 3}, { 1, 4}, { 4, 0}, { 1, 1}, { 7, 4}, { 6, 0}, /* Row 9 */ - { 1, 2}, { 1, 3}, { 1, 0}, - { 1, 1}, { 1, 3}, { 1, 5}, { 5, 0}, { 1, 1}, { 9, 4}, { 4, 0}, { 1, 4}, /* Row 10 */ - { 1, 2}, { 1, 4}, - { 1, 1}, { 1, 3}, { 1, 4}, { 5, 0}, { 1, 1}, { 11, 4}, { 2, 0}, { 1, 4}, /* Row 11 */ - { 1, 2}, { 1, 4}, - { 1, 1}, { 1, 5}, { 1, 1}, { 5, 0}, { 1, 4}, { 9, 2}, { 2, 3}, { 1, 5}, /* Row 12 */ - { 1, 0}, { 1, 4}, { 1, 2}, { 1, 4}, - { 1, 1}, { 1, 3}, { 1, 1}, { 5, 0}, { 1, 4}, { 7, 2}, { 3, 3}, { 1, 5}, /* Row 13 */ - { 2, 0}, { 1, 4}, { 1, 2}, { 1, 4}, - { 1, 1}, { 1, 3}, { 1, 4}, { 5, 0}, { 1, 4}, { 5, 2}, { 3, 3}, { 1, 5}, /* Row 14 */ - { 4, 0}, { 1, 2}, { 1, 3}, { 1, 4}, - { 1, 0}, { 1, 2}, { 1, 3}, { 5, 0}, { 1, 4}, { 3, 2}, { 3, 3}, { 1, 5}, /* Row 15 */ - { 5, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 1, 0}, - { 2, 0}, { 1, 5}, { 1, 4}, { 4, 0}, { 1, 4}, { 2, 2}, { 2, 3}, { 1, 5}, /* Row 16 */ - { 7, 0}, { 1, 2}, { 1, 5}, { 2, 0}, - { 2, 0}, { 1, 2}, { 1, 5}, { 1, 1}, { 3, 0}, { 1, 4}, { 2, 3}, { 1, 5}, /* Row 17 */ - { 8, 0}, { 1, 1}, { 1, 3}, { 1, 2}, { 2, 0}, - { 3, 0}, { 1, 2}, { 1, 3}, { 3, 0}, { 1, 3}, { 1, 5}, { 9, 0}, { 1, 1}, /* Row 18 */ - { 2, 3}, { 3, 0}, - { 3, 0}, { 1, 1}, { 1, 5}, { 1, 2}, { 2, 0}, { 1, 5}, { 9, 0}, { 1, 1}, /* Row 19 */ - { 1, 4}, { 1, 5}, { 4, 0}, - { 4, 0}, { 1, 1}, { 1, 5}, { 1, 3}, { 10, 0}, { 1, 1}, { 1, 3}, { 1, 5}, /* Row 20 */ - { 5, 0}, - { 6, 0}, { 1, 2}, { 1, 5}, { 1, 4}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 21 */ - { 1, 2}, { 6, 0}, - { 7, 0}, { 1, 3}, { 3, 5}, { 3, 3}, { 2, 5}, { 1, 3}, { 1, 2}, { 7, 0}, /* Row 22 */ - { 9, 0}, { 1, 4}, { 2, 2}, { 1, 3}, { 2, 2}, { 1, 4}, { 9, 0}, /* Row 23 */ - { 25, 0}, /* Row 24 */ + { 2, 1}, { 22, 0}, /* Row 0 */ + { 2, 2}, { 2, 1}, { 20, 0}, /* Row 1 */ + { 4, 2}, { 2, 1}, { 18, 0}, /* Row 2 */ + { 6, 2}, { 2, 1}, { 16, 0}, /* Row 3 */ + { 8, 2}, { 2, 1}, { 14, 0}, /* Row 4 */ + { 10, 2}, { 2, 1}, { 12, 0}, /* Row 5 */ + { 12, 2}, { 2, 1}, { 10, 0}, /* Row 6 */ + { 14, 2}, { 2, 1}, { 8, 0}, /* Row 7 */ + { 16, 2}, { 2, 1}, { 6, 0}, /* Row 8 */ + { 18, 2}, { 2, 1}, { 4, 0}, /* Row 9 */ + { 20, 2}, { 2, 1}, { 2, 0}, /* Row 10 */ + { 22, 2}, { 2, 1}, /* Row 11 */ + { 22, 3}, { 2, 4}, /* Row 12 */ + { 20, 3}, { 2, 4}, { 2, 0}, /* Row 13 */ + { 18, 3}, { 2, 4}, { 4, 0}, /* Row 14 */ + { 16, 3}, { 2, 4}, { 6, 0}, /* Row 15 */ + { 14, 3}, { 2, 4}, { 8, 0}, /* Row 16 */ + { 12, 3}, { 2, 4}, { 10, 0}, /* Row 17 */ + { 10, 3}, { 2, 4}, { 12, 0}, /* Row 18 */ + { 8, 3}, { 2, 4}, { 14, 0}, /* Row 19 */ + { 6, 3}, { 2, 4}, { 16, 0}, /* Row 20 */ + { 4, 3}, { 2, 4}, { 18, 0}, /* Row 21 */ + { 2, 3}, { 2, 4}, { 20, 0}, /* Row 22 */ + { 2, 4}, { 22, 0}, /* Row 23 */ }; /******************************************************************************************** From 5e475e79d5a0e39b58c69b5fa4784674b5ee156c Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 11 May 2012 22:07:06 +0000 Subject: [PATCH 046/390] Fix a few STMPE11 touchscreen and NxWM touchscreen calibration bugs git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4723 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 13 ++++++--- UnitTests/nxwm/main.cxx | 32 ++++++++++++++------- nxwm/include/ccalibration.hxx | 1 + nxwm/include/ctouchscreen.hxx | 12 +------- nxwm/include/nxwmconfig.hxx | 9 +++++- nxwm/src/ccalibration.cxx | 43 +++++++++++++++++++++------- nxwm/src/ctouchscreen.cxx | 54 ++++++++++++++++++++++++++++++++++- 7 files changed, 127 insertions(+), 37 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1367c8f68..38e902242 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -46,12 +46,17 @@ external logic. * CWindowEventHandler, CWindowEventHandlerList, CWidgetControl: New callback classes to receive notifications about window events. -* CFullScreenWindow and CTaskbar: Add support in NxWM for full screen - window applications. +* NxWM::CFullScreenWindow and NxWM::CTaskbar: Add support in NxWM for full + screen window applications. * All application windows now use CWindowEventHandler and CWindowEventHandlerList to get notifications about mouse and keyboard events. These class will then automatically handle polling (with no need for a modal loop). -* CTouchscreen and CCalibration: Add touchscreen support (still a long way - to go). +* NxWM::CTouchscreen and NxWM::CCalibration: Add touchscreen support (still a long + way to go). +* NxWM::g_playBitmp: Change the play icon again. These tiny touch icons + must be very simple. +* NxWM::CCalibration: Beef up touch input handling logic. Now changes the + color of the touch circle to yellow when it is touched. +* NxWM::CTouchscreen: Do not read touchscreen data when there is no consumer. diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 291267eb8..c7433f36e 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -79,16 +79,16 @@ struct SNxWmTest { - NxWM::CTaskbar *taskbar; // The task bar - NxWM::CStartWindow *startwindow; // The start window + NxWM::CTaskbar *taskbar; // The task bar + NxWM::CStartWindow *startwindow; // The start window #ifdef CONFIG_NXWM_TOUCHSCREEN - NxWM::CTouchscreen *touchscreen; // The touchscreen - NxWM::CCalibration *calibration; // The touchscreen calibration application - struct NxWM::SCalibrationData data; // Calibration data + NxWM::CTouchscreen *touchscreen; // The touchscreen + NxWM::CCalibration *calibration; // The touchscreen calibration application + struct NxWM::SCalibrationData calibData; // Calibration data #endif - unsigned int mmInitial; // Initial memory usage - unsigned int mmStep; // Memory Usage at beginning of test step - unsigned int mmSubStep; // Memory Usage at beginning of test sub-step + unsigned int mmInitial; // Initial memory usage + unsigned int mmStep; // Memory Usage at beginning of test step + unsigned int mmSubStep; // Memory Usage at beginning of test sub-step }; ///////////////////////////////////////////////////////////////////////////// @@ -459,6 +459,12 @@ static bool createCalibration(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool runCalibration(void) { + // 1. Start the calibration application + // 2. Wait until calibration data is available + // 3. Stop the calibration application + // 4. Provide the calibration data to the touchscreen device application + // 5. Enable forwarding of touchscreen input + // Call CTaskBar::startApplication to start the Calibration application printf(MAIN_STRING "Start the calibration application\n"); @@ -472,11 +478,12 @@ static bool runCalibration(void) // Wait for calibration data printf(MAIN_STRING "Get calibration data\n"); - if (!g_nxwmtest.calibration->waitCalibrationData(g_nxwmtest.data)) + if (!g_nxwmtest.calibration->waitCalibrationData(g_nxwmtest.calibData)) { printf(MAIN_STRING "ERROR: Failed to get calibration data\n"); return false; } + showTestCaseMemory("After getting calibration data"); printf(MAIN_STRING "Stop the calibration application\n"); if (!g_nxwmtest.taskbar->stopApplication(g_nxwmtest.calibration)) @@ -484,8 +491,13 @@ static bool runCalibration(void) printf(MAIN_STRING "ERROR: Failed to stop the calibration application\n"); return false; } - showTestCaseMemory("After stopping the calibration application"); + + // Configure the touchscreen device and enable touch forwarding + + g_nxwmtest.touchscreen->setCalibrationData(g_nxwmtest.calibData); + g_nxwmtest.touchscreen->setEnabled(true); + showTestCaseMemory("After givin calibration dato to the touchscreen device\n"); return true; } #endif diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 42eb56ad2..535a14804 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -133,6 +133,7 @@ namespace NxWM struct nxgl_point_s m_touchPos; /**< This is the last touch position */ bool m_stop; /**< True: We have been asked to stop the calibration */ bool m_touched; /**< True: The screen is touched */ + uint8_t m_touchId; /**< The ID of the touch */ sem_t m_waitSem; /**< Supports wait for calibration data */ struct nxgl_point_s m_calibData[CALIB_DATA_POINTS]; diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx index c3aa198cb..52433c1de 100644 --- a/nxwm/include/ctouchscreen.hxx +++ b/nxwm/include/ctouchscreen.hxx @@ -175,17 +175,7 @@ namespace NxWM * @param data. A reference to the touchscreen data. */ - inline void setCalibrationData(struct SCalibrationData &caldata) - { - // Save a copy of the calibration data - - m_calibData = caldata; - - // Note that we have calibration data. Data will now be scaled and forwarded - // to NX (unless we are still in cpature mode) - - m_calibrated = true; - } + void setCalibrationData(struct SCalibrationData &caldata); /** * Capture raw driver data. This method will capture mode one raw touchscreen diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 4e51cea1d..359f7d095 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -356,8 +356,11 @@ * CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR * CONFIG_NXWM_CALIBRATION_LINECOLOR - The color of the lines used in the * touchscreen calibration display. Default: MKRGB(0, 0, 128) (dark blue) - * CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR - The background color of the + * CONFIG_NXWM_CALIBRATION_CIRCLECOLOR - The color of the circle in the * touchscreen calibration display. Default: MKRGB(255, 255, 255) (white) + * CONFIG_NXWM_CALIBRATION_CIRCLECOLOR - The color of the circle in the + * touchscreen calibration display after the touch is recorder. Default: + * MKRGB(255, 255, 96) (very light yellow) * CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen * calibration application. Default: NxWM::g_calibrationBitmap */ @@ -374,6 +377,10 @@ # define CONFIG_NXWM_CALIBRATION_CIRCLECOLOR MKRGB(255, 255, 255) #endif +#ifndef CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR +# define CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR MKRGB(255, 255, 96) +#endif + #ifndef CONFIG_NXWM_CALIBRATION_ICON # define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap #endif diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 9ba0c0917..4c6a29ed9 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -302,7 +302,8 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) // Yes.. but ignore drag events if we did not see the matching // touch down event - if ((sample.point[0].flags & TOUCH_DOWN) != 0 || m_touched) + if ((sample.point[0].flags & TOUCH_DOWN) != 0 || + (m_touched && sample.point[0].id == m_touchId)) { // Yes.. save the touch position and wait for the TOUCH_UP report @@ -314,9 +315,19 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) sample.point[0].y, sample.point[0].h, sample.point[0].w, sample.point[0].pressure); - // Remember that we saw the touch down event + // Show calibration screen again, changing the color of the circle to + // make it clear that the touch has been noticed. - m_touched = true; + if (!m_touched) + { + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR; + showCalibration(); + m_touched = true; + } + + // Remember the ID of the touch down event + + m_touchId = sample.point[0].id; } } @@ -324,20 +335,32 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) else if ((sample.point[0].flags & TOUCH_UP) != 0) { - // Yes.. did we see the matching pen down event? + // Yes.. did we see the pen down event? if (m_touched) { - // Yes.. invoke the state machine. + // Yes.. For the matching touch ID? - gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", - m_state, m_screenInfo.pos.x, m_screenInfo.pos.y, - m_touchPos.x, m_touchPos.y); + if (sample.point[0].id == m_touchId) + { + // Yes.. invoke the state machine. - stateMachine(); + gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", + m_state, m_screenInfo.pos.x, m_screenInfo.pos.y, + m_touchPos.x, m_touchPos.y); + + stateMachine(); + } + else + { + // No... restore the un-highlighted circle + + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + showCalibration(); + } } - // In any event, the touch is not down + // In any event, the screen is not touched m_touched = false; } diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index f5e476cce..21ccc91e3 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -195,6 +195,32 @@ bool CTouchscreen::start(void) return m_state == LISTENER_RUNNING; } +/** + * Provide touchscreen calibration data. If calibration data is received (and + * the touchscreen is enabled), then received touchscreen data will be scaled + * using the calibration data and forward to the NX layer which dispatches the + * touchscreen events in window-relative positions to the correct NX window. + * + * @param data. A reference to the touchscreen data. + */ + +void CTouchscreen::setCalibrationData(struct SCalibrationData &caldata) +{ + // Save a copy of the calibration data + + m_calibData = caldata; + + // Note that we have calibration data. Data will now be scaled and forwarded + // to NX (unless we are still in cpature mode) + + m_calibrated = true; + + // Wake up the listener thread so that it will use our buffer + // to receive data + + (void)pthread_kill(m_thread, CONFIG_NXWM_TOUCHSCREEN_SIGNO); +} + /** * Capture raw driver data. This method will capture mode one raw touchscreen * input. The normal use of this method is for touchscreen calibration. @@ -284,6 +310,31 @@ FAR void *CTouchscreen::listener(FAR void *arg) while (This->m_state == LISTENER_RUNNING) { + // We may be running in one of three states + // + // 1. Disabled or no calibration data: In this case, just wait for a signal + // indicating that the state has changed. + // 2. Performing calibration and reporting raw touchscreen data + // 3. Normal operation, reading touchscreen data and forwarding it to NX + + // Check if we need to collect touchscreen data. That is, that we are enabled, + // AND have calibratation data OR if we need to collect data for the calbration + // process. + + while ((!This->m_enabled || !This->m_calibrated) && !This->m_capture) + { + // No.. just sleep. This sleep will be awakened by a signal if there + // is anything for this thread to do + + sleep(1); + + // We woke up here either because the one second elapsed or because we + // were signalled. In either case we need to check the conditions and + // determine what to do next. + } + + // We are going to collect a sample.. + // // The sample pointer can change dynamically let's sample it once // and stick with that pointer. @@ -381,7 +432,8 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) if (!m_enabled || !m_calibrated) { - // No.. we are not yet ready to process touchscreen data + // No.. we are not yet ready to process touchscreen data (We don't + // really every get to this condition. return; } From 6e07395780f9fd0c108a3da8a4085e93297967bf Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 12 May 2012 13:50:21 +0000 Subject: [PATCH 047/390] Add NxWM::CWindowControl; task bar and start window icons now functional git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4725 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 + UnitTests/nxwm/main.cxx | 65 +++++--- libnxwidgets/src/cwindoweventhandlerlist.cxx | 2 +- nxwm/Makefile | 1 + nxwm/images/calibration.png | Bin 494 -> 415 bytes nxwm/include/capplicationwindow.hxx | 22 +-- nxwm/include/cfullscreenwindow.hxx | 21 +-- nxwm/include/cstartwindow.hxx | 3 +- nxwm/include/ctaskbar.hxx | 11 +- nxwm/include/cwindowcontrol.hxx | 112 ++++++++++++++ nxwm/src/capplicationwindow.cxx | 78 ---------- nxwm/src/cfullscreenwindow.cxx | 77 ---------- nxwm/src/ctaskbar.cxx | 29 ++-- nxwm/src/cwindowcontrol.cxx | 143 ++++++++++++++++++ nxwm/src/glyph_calibration.cxx | 147 ++++++++++--------- 15 files changed, 403 insertions(+), 310 deletions(-) create mode 100644 nxwm/include/cwindowcontrol.hxx create mode 100644 nxwm/src/cwindowcontrol.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 38e902242..5d316d081 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -58,5 +58,7 @@ * NxWM::CCalibration: Beef up touch input handling logic. Now changes the color of the touch circle to yellow when it is touched. * NxWM::CTouchscreen: Do not read touchscreen data when there is no consumer. +* NxWM::CWindowControl: Add new class to wrap CWidgetControl and provide + some special mouse and keyboard input event handling. diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index c7433f36e..c230b9f87 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -403,13 +403,9 @@ static bool createTouchScreen(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool createCalibration(void) { - // 1. Call CTaskBar::FullScreenWindow to create a window for the application, + // 1. Call CTaskBar::openFullScreenWindow to create a window for the application, // 2. Instantiate the application, providing the window to the application's // constructor, - // 3. Then call CStartWindow::addApplication to add the application to the - // start window. - // 4. Call CTaskBar::startApplication start the application and bring its window to - // the top. printf(MAIN_STRING "Opening the calibration application window\n"); NxWM::CFullScreenWindow *window = g_nxwmtest.taskbar->openFullScreenWindow(); @@ -438,16 +434,6 @@ static bool createCalibration(void) return false; } showTestCaseMemory("After creating CCalibration application"); - - printf(MAIN_STRING "Adding CCalibration application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) - { - printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete g_nxwmtest.calibration; - return false; - } - - showTestCaseMemory("After adding CCalibration application"); return true; } #endif @@ -502,6 +488,26 @@ static bool runCalibration(void) } #endif +///////////////////////////////////////////////////////////////////////////// +// Name: addCalibrationToStartWindow +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_TOUCHSCREEN +static bool addCalibrationToStartWindow(void) +{ + printf(MAIN_STRING "Adding CCalibration application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) + { + printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); + delete g_nxwmtest.calibration; + return false; + } + + showTestCaseMemory("After adding CCalibration application"); + return true; +} +#endif + ///////////////////////////////////////////////////////////////////////////// // Name: createNxConsole ///////////////////////////////////////////////////////////////////////////// @@ -605,14 +611,6 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } - // Create the start window. - - if (!createStartWindow()) - { - printf(MAIN_STRING "ERROR: Failed to create the start window\n"); - testCleanUpAndExit(EXIT_FAILURE); - } - // Create the touchscreen device #ifdef CONFIG_NXWM_TOUCHSCREEN @@ -645,6 +643,27 @@ int MAIN_NAME(int argc, char *argv[]) } #endif + + // Create the start window. + + if (!createStartWindow()) + { + printf(MAIN_STRING "ERROR: Failed to create the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); + } + +#ifdef CONFIG_NXWM_TOUCHSCREEN + // Add the calibration application to the start window. It can't really + // be used to re-calibrate (because there is nothing to get the calibration + // data). But is a good case to test a full screen appliation + + if (!addCalibrationToStartWindow()) + { + printf(MAIN_STRING "ERROR: Failed to add calibration to the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Add the NxConsole application to the start window if (!createNxConsole()) diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index 68f5e9d47..1c95264d1 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include "nxconfig.hxx" #include "cwindoweventhandler.hxx" diff --git a/nxwm/Makefile b/nxwm/Makefile index 3059934c9..d951d11b2 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -44,6 +44,7 @@ CSRCS = # Window Manager CXXSRCS = capplicationwindow.cxx ccalibration.cxx cfullscreenwindow.cxx CXXSRCS += cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx ctouchscreen.cxx +CXXSRCS += cwindowcontrol.cxx # Images CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/images/calibration.png b/nxwm/images/calibration.png index 6cdb95e3b1315883ebe52acb69937394b12d7a73..76a84127f7a07d8fea134f3c53a72fdb161be6f1 100644 GIT binary patch delta 394 zcmV;50d@ZF1D^vfiBL{Q4GJ0x0000DNk~Le0000O0000L2m$~A0Mm=PaR2}S0drDE zLIAGL9O;ojAb$)44FH_>hA0340WnELK~y-)t&}lN#4r#=|3=%VNS!XF&k$>GkdBf_ zK0!{h7hvw-3&6@qZ~`|-?$Tz9ttdk=+94Rn5ZGUh9L>*v9^1S2;R#tebFkJP&t-mn zkL_~i03d|WbzKK&I&C&$3u`R^rPSs`N-5VgV!_RHEq{JC5`@SisbbkSR2QjvFRisr z(|GTX=W^-7{~%q*iTFbjp-UwVAs9E3u1VL%jh{xEPD6F!{mUb;xS73TG;WR%uo7pv z!d^uNJ0B;iiwOIdUNrSI_4hA#iKz)T{-nLcp{WP({Pqt0DziwQEYdab2%rU8ztrT!M-IL4^$~7_jwg9dTM#V otcX{TmscvCDDT40gVa&R4@?NSxjTK@o&W#<07*qoM6N<$f|wqt!2kdN delta 474 zcmV<00VV#Q1MUMriBL{Q4GJ0x0000DNk~Le0000P0000P2nGNE0L1BqV*mgE0drDE zLIAGL9O(c600v@9M??Vs0RI60puMM)kuD&A2^I$`kdZds0004QNklxaL;FZ5e0Qb&+ zFoF{s8a@V0U66JOJ3M`4i<1lI*DEsP1D)aTwl1OYmnB z|01yjp8&j^kWI3O^HN;hZ91EU(9t}|BgZ0+RX z*_z4}I+}_V)vIVMvzyB#r*Fs(BGQCvT$|;(Sx~};{%(BB?s`|D`i^gV?srFIn_?KL zDq9n1;f=bl?$VdmHuAqPen&mWQq}vntG$0C{mIJtR{MBY`H)Ed%_q?p++;TqHH^~V QqyPW_07*qoM6N<$f~}v?Bme*a diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index e8ce53740..7736a3081 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -49,7 +49,6 @@ #include "cimage.hxx" #include "clabel.hxx" #include "crlepalettebitmap.hxx" -#include "cwindoweventhandler.hxx" #include "iapplicationwindow.hxx" @@ -72,8 +71,7 @@ namespace NxWM */ class CApplicationWindow : public IApplicationWindow, - private NXWidgets::CWidgetEventHandler, - private NXWidgets::CWindowEventHandler + private NXWidgets::CWidgetEventHandler { protected: NXWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ @@ -86,24 +84,6 @@ namespace NxWM NXWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ IApplicationCallback *m_callback; /**< Toolbar action callbacks */ - /** - * Handle an NX window mouse input event. - * - * @param e The event data. - */ - -#ifdef CONFIG_NX_MOUSE - void handleMouseEvent(void); -#endif - - /** - * Handle a NX window keyboard input event. - */ - -#ifdef CONFIG_NX_KBD - void handleKeyboardEvent(void); -#endif - /** * Handle a mouse button click event. * diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index 41425bf4c..fb4788830 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -63,30 +63,11 @@ namespace NxWM * for example, to support full screen displays. */ - class CFullScreenWindow : public IApplicationWindow, - private NXWidgets::CWindowEventHandler + class CFullScreenWindow : public IApplicationWindow { protected: NXWidgets::CNxWindow *m_window; /**< The generic window used by the application */ - /** - * Handle an NX window mouse input event. - * - * @param e The event data. - */ - -#ifdef CONFIG_NX_MOUSE - void handleMouseEvent(void); -#endif - - /** - * Handle a NX window keyboard input event. - */ - -#ifdef CONFIG_NX_KBD - void handleKeyboardEvent(void); -#endif - public: /** diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 226fbdf03..5e4fa7564 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -61,7 +61,8 @@ namespace NxWM { class CTaskbar; - class CStartWindow : public IApplication, private IApplicationCallback, + class CStartWindow : public IApplication, + private IApplicationCallback, private NXWidgets::CWidgetEventHandler { protected: diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 398087f84..1f2f69580 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -82,7 +82,8 @@ namespace NxWM * (and I may still do that someday) */ - class CTaskbar : public NXWidgets::CNxServer, private NXWidgets::CWidgetEventHandler + class CTaskbar : public NXWidgets::CNxServer, + private NXWidgets::CWidgetEventHandler { private: /** @@ -109,12 +110,12 @@ namespace NxWM /** * Create a raw window. * - * 1) Create a dumb CWigetControl instance - * 2) Pass the dumb CWidgetControl instance to the window constructor - * that inherits from INxWindow. This will "smarten" the CWidgetControl + * 1) Create a dumb CWindowControl instance + * 2) Pass the dumb CWindowControl instance to the window constructor + * that inherits from INxWindow. This will "smarten" the CWindowControl * instance with some window knowlede * 3) Call the open() method on the window to display the window. - * 4) After that, the fully smartened CWidgetControl instance can + * 4) After that, the fully smartened CWindowControl instance can * be used to generate additional widgets by passing it to the * widget constructor */ diff --git a/nxwm/include/cwindowcontrol.hxx b/nxwm/include/cwindowcontrol.hxx new file mode 100644 index 000000000..acec12727 --- /dev/null +++ b/nxwm/include/cwindowcontrol.hxx @@ -0,0 +1,112 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cwindowcontrol.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CWINDOWCONTROL_HXX +#define __INCLUDE_CWINDOWCONTROL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "cwindoweventhandler.hxx" +#include "cwidgetcontrol.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * The class CWindowControl integrates the widget control with some special + * handling of mouse and keyboard inputs neesed by NxWM + */ + + class CWindowControl : public NXWidgets::CWidgetControl, + private NXWidgets::CWindowEventHandler + { + private: + /** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE + void handleMouseEvent(void); +#endif + + /** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD + void handleKeyboardEvent(void); +#endif + + public: + + /** + * Constructor + * + * @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. + */ + + CWindowControl(FAR const NXWidgets::CWidgetStyle *style = (const NXWidgets::CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + ~CWindowControl(void); + }; +} +#endif // __cplusplus + +#endif // __INCLUDE_CWINDOWCONTROL_HXX diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index ad57ba4b2..f57c04297 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -313,14 +313,6 @@ bool CApplicationWindow::open(void) m_windowLabel->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_LEFT); m_windowLabel->setTextAlignmentVert(NXWidgets::CLabel::TEXT_ALIGNMENT_VERT_CENTER); m_windowLabel->setRaisesEvents(false); - - // Get the window control - - NXWidgets::CWidgetControl *windowControl = m_window->getWidgetControl(); - - // Register to receive callbacks on a few select window events - - windowControl->addWindowEventHandler(this); return true; } @@ -462,76 +454,6 @@ void CApplicationWindow::clickStopIcon(int index) } #endif -/** - * Handle an NX window mouse input event. - * - * @param e The event data. - */ - -#ifdef CONFIG_NX_MOUSE -void CApplicationWindow::handleMouseEvent(void) -{ - // The logic path here is tortuous but flexible: - // - // 1. A listener thread receives mouse input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the mouse input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update mouse information then raise the - // mouse event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the wiget control to process - // the mouse input. - - // Get the CWidgetControl associated with the window - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // And perform a poll - - control->pollEvents(); -} -#endif - -/** - * Handle a NX window keyboard input event. - */ - -#ifdef CONFIG_NX_KBD -void CApplicationWindow::handleKeyboardEvent(void) -{ - // The logic path here is tortuous but flexible: - // - // 1. A listener thread receives keyboard input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the keyboard input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update keyboard information then raise the - // keyboard event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the wiget control to process - // the keyboard input. - - // Get the CWidgetControl associated with the window - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // And perform a poll - - control->pollEvents(); -} -#endif - /** * Handle a mouse button click event. * diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index 6b0d13fa0..2087543cd 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -96,13 +96,6 @@ CFullScreenWindow::~CFullScreenWindow(void) bool CFullScreenWindow::open(void) { - // Get the window control - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // Register to receive callbacks on a few select window events - - control->addWindowEventHandler(this); return true; } @@ -174,74 +167,4 @@ void CFullScreenWindow::clickStopIcon(int index) } #endif -/** - * Handle an NX window mouse input event. - * - * @param e The event data. - */ - -#ifdef CONFIG_NX_MOUSE -void CFullScreenWindow::handleMouseEvent(void) -{ - // The logic path here is tortuous but flexible: - // - // 1. A listener thread receives mouse input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the mouse input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update mouse information then raise the - // mouse event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the wiget control to process - // the mouse input. - - // Get the CWidgetControl associated with the window - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // And perform a poll - - control->pollEvents(); -} -#endif - -/** - * Handle a NX window keyboard input event. - */ - -#ifdef CONFIG_NX_KBD -void CFullScreenWindow::handleKeyboardEvent(void) -{ - // The logic path here is tortuous but flexible: - // - // 1. A listener thread receives keyboard input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the keyboard input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update keyboard information then raise the - // keyboard event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the wiget control to process - // the keyboard input. - - // Get the CWidgetControl associated with the window - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // And perform a poll - - control->pollEvents(); -} -#endif - diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 9edb3fff5..a840fdcb2 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -45,6 +45,7 @@ #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" +#include "cwindowcontrol.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -124,10 +125,12 @@ void CTaskbar::disconnect(void) NXWidgets::CWidgetControl *control; if (m_taskbar) { - // Delete the contained widget control. We are responsible for it - // because we created it + // Get the contained widget control control = m_taskbar->getWidgetControl(); + + // Delete the widget control. We are responsible for it because we created it + if (control) { delete control; @@ -226,7 +229,7 @@ bool CTaskbar::startWindowManager(void) { // Have we already been started - if (!m_started) + if (!m_started) { // We are now started @@ -234,10 +237,10 @@ bool CTaskbar::startWindowManager(void) // Draw the taskbar - if (!redrawTaskbarWindow()) - { - return false; - } + if (!redrawTaskbarWindow()) + { + return false; + } // Draw the top application window @@ -562,15 +565,15 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { // Initialize the widget control using the default style - NXWidgets::CWidgetControl *widgetControl = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); + CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. - NXWidgets::CNxWindow *window = createRawWindow(widgetControl); + NXWidgets::CNxWindow *window = createRawWindow(control); if (!window) { - delete widgetControl; + delete control; return false; } @@ -599,15 +602,15 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { // Initialize the widget control using the default style - NXWidgets::CWidgetControl *widgetControl = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); + CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the framed window as a class // that derives from INxWindow. - NXWidgets::CNxTkWindow *window = createFramedWindow(widgetControl); + NXWidgets::CNxTkWindow *window = createFramedWindow(control); if (!window) { - delete widgetControl; + delete control; return false; } diff --git a/nxwm/src/cwindowcontrol.cxx b/nxwm/src/cwindowcontrol.cxx new file mode 100644 index 000000000..841397a14 --- /dev/null +++ b/nxwm/src/cwindowcontrol.cxx @@ -0,0 +1,143 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cwindowcontrol.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include "cwindowcontrol.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CWindowControl Method Implementations + ********************************************************************************************/ + +using namespace NxWM; + +/** + * Constructor + * + * @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. + */ + +CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) +: NXWidgets::CWidgetControl(style) +{ + // Add ourself as the window callback + + addWindowEventHandler(this); +} + +/** + * Destructor. + */ + +CWindowControl::~CWindowControl(void) +{ + // Remove ourself from the window callback + + removeWindowEventHandler(this); +} + +/** + * Handle an NX window mouse input event. + * + * @param e The event data. + */ + +#ifdef CONFIG_NX_MOUSE +void CWindowControl::handleMouseEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives mouse input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the mouse input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update mouse information then raise the + // mouse event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the widget control to process + // the mouse input. + + // Perform the poll + + pollEvents(); +} +#endif + +/** + * Handle a NX window keyboard input event. + */ + +#ifdef CONFIG_NX_KBD +void CWindowControl::handleKeyboardEvent(void) +{ + // The logic path here is tortuous but flexible: + // + // 1. A listener thread receives keyboard input and injects that into NX + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the keyboard input + // and send a message to the listener. + // 4. The listener will call the NX message dispatcher will will do the + // message callback. + // 5. The callback goes into an instance of NXWidgets::CCallback that is + // part of the CWidget control. + // 6. That callback will update keyboard information then raise the + // keyboard event, + // 7. Which will finally call this function -- still running deep on the + // stack in the listener thread. + // 8. This function will then call back into the widget control to process + // the keyboard input. + + // Perform the poll + + pollEvents(); +} +#endif + + diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration.cxx index 95df5a7dd..fab2902fe 100644 --- a/nxwm/src/glyph_calibration.cxx +++ b/nxwm/src/glyph_calibration.cxx @@ -57,8 +57,8 @@ ********************************************************************************************/ #define BITMAP_NROWS 21 -#define BITMAP_NCOLUMNS 21 -#define BITMAP_NLUTCODES 17 +#define BITMAP_NCOLUMNS 24 +#define BITMAP_NLUTCODES 6 /******************************************************************************************** * Private Bitmap Data @@ -70,23 +70,31 @@ using namespace NxWM; #if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -static const uint32_t g_calibrationLut[BITMAP_NLUTCODES] = +static const uint32_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x202020, 0x404040, 0x808080, 0xfcfcfc, 0x606060, 0x9c9c9c, 0xdcdcdc, /* Codes 1-7 */ - 0xececec, 0xacacac, 0x707070, 0x303030, 0x101010, 0xcccccc, 0x505050, /* Codes 8-15 */ - 0x8c8c8c, 0xbcbcbc, /* Codes 15-16 */ + 0xfcfcfc, 0xacacac, 0xd8d8d8, 0xd8881c, 0x9c6014 /* Codes 1-5 */ }; +static const uint32_t g_calibrationSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffffff, 0xc0c0c0, 0xe1e1e1, 0xe1a554, 0xb4874e /* Codes 1-5 */ +}; /* RGB16 (565) Colors (four of the colors in this map are duplicates) */ #elif CONFIG_NXWIDGETS_BPP == 16 -static const uint16_t g_calibrationLut[BITMAP_NLUTCODES] = +static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x2104, 0x4208, 0x8410, 0xffff, 0x630c, 0x9cf3, 0xdefb, 0xef7d, 0xad75, /* Codes 1-9 */ - 0x738e, 0x3186, 0x1082, 0xce79, 0x528a, 0x8c71, 0xbdf7 /* Codes 10-16 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffff, 0xad75, 0xdedb, 0xdc43, 0x9b02 /* Codes 1-5 */ +}; + +static const uint16_t g_calibrationSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffff, 0xc618, 0xe71c, 0xe52a, 0xb429 /* Codes 1-5 */ }; /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used @@ -101,22 +109,32 @@ static const uint16_t g_calibrationLut[BITMAP_NLUTCODES] = /* 8-bit Greyscale */ -static const uint8_t g_calibrationLut[BITMAP_NLUTCODES] = +static const uint8_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x20, 0x40, 0x80, 0xfc, 0x60, 0x9c, 0xdc, 0xec, 0xac, 0x70, 0x30, 0x10, /* Codes 1-12 */ - 0xcc, 0x50, 0x8c, 0xbc, /* Codes 13-16 */ + 0xfc, 0xac, 0xd8, 0x93, 0x69 /* Codes 1-5 */ +}; + +static const uint8_t g_calibrationSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xc0, 0xe1, 0xad, 0x8d /* Codes 1-5 */ }; # else /* CONFIG_NXWIDGETS_GREYSCALE */ /* RGB8 (332) Colors */ -static const nxgl_mxpixel_t g_calibrationLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x24, 0x49, 0x92, 0xff, 0x6d, 0x92, 0xdb, 0xff, 0xb6, 0x6d, 0x24, 0x00, /* Codes 1-12 */ - 0xdb, 0x49, 0x92, 0xb7 /* Codes 13-16 */ + 0xff, 0xb6, 0xdb, 0xd0, 0x8c /* Codes 1-5 */ +}; + +static const nxgl_mxpixel_t g_calibrationSelectedLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xdb, 0xff, 0xf5, 0xb1 /* Codes 1-5 */ }; # endif @@ -126,52 +144,39 @@ static const nxgl_mxpixel_t g_calibrationLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] = { - { 25, 0}, /* Row 0 */ - { 25, 0}, /* Row 1 */ - { 12, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 2 */ - { 12, 0}, { 1, 3}, { 1, 4}, { 6, 0}, { 1, 1}, { 2, 5}, { 2, 0}, /* Row 3 */ - { 12, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 1}, { 1, 5}, { 1, 6}, { 1, 7}, /* Row 4 */ - { 2, 4}, { 1, 7}, { 2, 0}, - { 12, 0}, { 1, 3}, { 1, 4}, { 1, 6}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 5 */ - { 1, 7}, { 1, 9}, { 3, 0}, - { 8, 0}, { 1, 1}, { 1, 5}, { 1, 6}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 6 */ - { 1, 10}, { 1, 11}, { 1, 0}, { 1, 12}, { 2, 13}, { 3, 0}, - { 4, 0}, { 1, 12}, { 1, 14}, { 1, 15}, { 1, 7}, { 2, 4}, { 1, 8}, { 1, 9}, /* Row 7 */ - { 1, 16}, { 1, 4}, { 5, 0}, { 1, 10}, { 1, 5}, { 1, 3}, { 1, 5}, { 2, 0}, - { 3, 0}, { 1, 1}, { 2, 4}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 11}, { 2, 0}, /* Row 8 */ - { 1, 3}, { 1, 4}, { 5, 0}, { 1, 13}, { 1, 0}, { 1, 1}, { 1, 9}, { 2, 0}, - { 4, 0}, { 1, 15}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 3}, { 1, 4}, { 4, 0}, /* Row 9 */ - { 1, 14}, { 1, 15}, { 2, 0}, { 1, 16}, { 1, 1}, { 1, 0}, - { 4, 0}, { 1, 5}, { 1, 10}, { 1, 13}, { 5, 0}, { 1, 3}, { 1, 4}, { 4, 0}, /* Row 10 */ - { 1, 9}, { 1, 1}, { 2, 0}, { 1, 5}, { 1, 10}, { 1, 0}, - { 4, 0}, { 1, 13}, { 1, 12}, { 1, 6}, { 1, 1}, { 4, 0}, { 1, 3}, { 1, 4}, /* Row 11 */ - { 3, 0}, { 1, 1}, { 1, 16}, { 1, 0}, { 1, 6}, { 1, 14}, { 1, 12}, { 1, 13}, - { 1, 0}, - { 3, 0}, { 1, 2}, { 1, 6}, { 1, 0}, { 1, 14}, { 1, 15}, { 4, 0}, { 1, 3}, /* Row 12 */ - { 1, 4}, { 3, 0}, { 1, 3}, { 1, 5}, { 1, 1}, { 1, 8}, { 1, 6}, { 1, 0}, - { 1, 6}, { 1, 11}, - { 3, 0}, { 1, 6}, { 1, 11}, { 2, 0}, { 1, 16}, { 4, 0}, { 1, 3}, { 1, 4}, /* Row 13 */ - { 3, 0}, { 1, 16}, { 1, 0}, { 1, 2}, { 1, 4}, { 1, 16}, { 1, 0}, { 1, 2}, - { 1, 6}, - { 2, 0}, { 1, 12}, { 1, 13}, { 1, 12}, { 1, 16}, { 1, 1}, { 1, 15}, { 1, 14}, /* Row 14 */ - { 3, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 10}, { 1, 13}, { 1, 3}, { 1, 6}, - { 1, 4}, { 1, 7}, { 2, 3}, { 1, 8}, - { 2, 0}, { 1, 10}, { 1, 5}, { 1, 9}, { 1, 4}, { 1, 16}, { 1, 2}, { 1, 6}, /* Row 15 */ - { 3, 0}, { 1, 3}, { 1, 4}, { 2, 0}, { 1, 11}, { 1, 16}, { 5, 4}, { 1, 8}, - { 1, 15}, - { 2, 0}, { 1, 13}, { 1, 0}, { 3, 4}, { 1, 2}, { 1, 13}, { 1, 12}, { 2, 0}, /* Row 16 */ - { 1, 3}, { 1, 4}, { 4, 0}, { 1, 12}, { 3, 2}, { 1, 11}, { 2, 0}, - { 1, 0}, { 1, 14}, { 1, 15}, { 1, 0}, { 3, 4}, { 1, 2}, { 2, 5}, { 2, 0}, /* Row 17 */ - { 1, 3}, { 1, 4}, { 11, 0}, - { 1, 0}, { 1, 16}, { 1, 13}, { 1, 16}, { 3, 4}, { 2, 13}, { 1, 7}, { 2, 0}, /* Row 18 */ - { 1, 3}, { 1, 4}, { 11, 0}, - { 1, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 6}, { 1, 11}, /* Row 19 */ - { 2, 0}, { 1, 3}, { 1, 4}, { 11, 0}, - { 12, 0}, { 1, 3}, { 1, 4}, { 11, 0}, /* Row 20 */ - { 5, 0}, { 1, 2}, { 14, 4}, { 1, 3}, { 4, 0}, /* Row 21 */ - { 5, 0}, { 1, 2}, { 14, 4}, { 1, 3}, { 4, 0}, /* Row 22 */ - { 25, 0}, /* Row 23 */ - { 25, 0}, /* Row 24 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 3}, { 1, 2}, { 3, 0}, /* Row 0 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 0}, /* Row 1 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 3}, { 1, 2}, /* Row 2 */ + { 3, 0}, + { 11, 0}, { 1, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 3}, { 4, 0}, /* Row 3 */ + { 9, 0}, { 2, 1}, { 2, 3}, { 2, 2}, { 4, 0}, { 1, 3}, { 4, 0}, /* Row 4 */ + { 3, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 1}, { 1, 2}, /* Row 5 */ + { 5, 0}, { 1, 1}, { 2, 3}, { 3, 0}, + { 2, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 1}, { 1, 2}, /* Row 6 */ + { 4, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 2, 0}, + { 3, 0}, { 1, 2}, { 1, 3}, { 2, 2}, { 4, 0}, { 1, 1}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 1, 1}, { 3, 0}, { 1, 3}, { 2, 0}, + { 4, 0}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, { 1, 3}, /* Row 8 */ + { 3, 0}, { 2, 3}, { 1, 0}, + { 3, 0}, { 1, 1}, { 2, 3}, { 5, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, /* Row 9 */ + { 5, 0}, { 1, 3}, { 1, 0}, + { 2, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 4, 0}, { 1, 1}, { 1, 2}, /* Row 10 */ + { 3, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, + { 2, 0}, { 1, 1}, { 3, 0}, { 1, 3}, { 4, 0}, { 1, 1}, { 1, 2}, { 3, 0}, /* Row 11 */ + { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, + { 1, 0}, { 1, 1}, { 1, 3}, { 2, 4}, { 1, 5}, { 2, 3}, { 3, 0}, { 1, 1}, /* Row 12 */ + { 1, 2}, { 2, 0}, { 9, 3}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 13 */ + { 1, 1}, { 1, 2}, { 11, 0}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 14 */ + { 1, 1}, { 1, 2}, { 11, 0}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 15 */ + { 1, 1}, { 1, 2}, { 11, 0}, + { 9, 3}, { 2, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 16 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 17 */ + { 10, 0}, { 1, 1}, { 2, 3}, { 1, 2}, { 10, 0}, /* Row 18 */ + { 5, 0}, { 4, 1}, { 6, 3}, { 4, 2}, { 5, 0}, /* Row 19 */ + { 4, 0}, { 4, 1}, { 8, 3}, { 4, 2}, { 4, 0}, /* Row 20 */ }; /******************************************************************************************** @@ -180,14 +185,14 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_calibrationLut, // Index 0: Unselected LUT - g_calibrationLut, // Index 1: Selected LUT + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationNormalLut, // Index 0: Unselected LUT + g_calibrationSelectedLut, // Index 1: Selected LUT }, - g_calibrationRleEntries // data - Pointer to the beginning of the RLE data + g_calibrationRleEntries // data - Pointer to the beginning of the RLE data }; From eb31d305a1a591968d15e70f088316cbd419abde Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 12 May 2012 16:59:57 +0000 Subject: [PATCH 048/390] NxWM: Correct the calculation of the physical dispaly size git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4726 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 +- UnitTests/nxwm/main.cxx | 8 ++--- nxwm/include/ctaskbar.hxx | 5 +-- nxwm/src/ctaskbar.cxx | 74 ++++++++++++++++++++++++--------------- 4 files changed, 52 insertions(+), 38 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5d316d081..da14da62b 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -60,5 +60,6 @@ * NxWM::CTouchscreen: Do not read touchscreen data when there is no consumer. * NxWM::CWindowControl: Add new class to wrap CWidgetControl and provide some special mouse and keyboard input event handling. - +* NxWM::CTaskbar: Correct the calculation of the physical size of the + display. diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index c230b9f87..271fd22c2 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -368,15 +368,15 @@ static bool startWindowManager(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool createTouchScreen(void) { - // Get the physical size of the device in pixels + // Get the physical size of the display in pixels - struct nxgl_size_s windowSize; - (void)g_nxwmtest.taskbar->getWindowSize(&windowSize); + struct nxgl_size_s displaySize; + (void)g_nxwmtest.taskbar->getDisplaySize(displaySize); // Create the touchscreen device printf(MAIN_STRING "Creating CTouchscreen\n"); - g_nxwmtest.touchscreen = new NxWM::CTouchscreen(g_nxwmtest.taskbar, &windowSize); + g_nxwmtest.touchscreen = new NxWM::CTouchscreen(g_nxwmtest.taskbar, &displaySize); if (!g_nxwmtest.touchscreen) { printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 1f2f69580..431c2be48 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -393,10 +393,7 @@ namespace NxWM * @return The size of the display */ - inline bool getWindowSize(FAR struct nxgl_size_s *size) - { - return m_taskbar->getSize(size); - } + void getDisplaySize(FAR struct nxgl_size_s &size); /** * Simulate a mouse click on the icon at index. This inline method is only diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index a840fdcb2..87fa34c3d 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -548,6 +548,29 @@ bool CTaskbar::stopApplication(IApplication *app) return redrawTaskbarWindow(); } +/** + * Get the size of the physical display device as it is known to the task + * bar. + * + * @return The size of the display + */ + +void CTaskbar::getDisplaySize(FAR struct nxgl_size_s &size) +{ + // Get the widget control from the task bar window. The physical window geometry + // should be the same for all windows. + + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + + // Get the window bounding box from the widget control + + NXWidgets::CRect rect = control->getWindowBoundingBox(); + + // And return the size of the window + + rect.getSize(size); +} + /** * Create a raw window. * @@ -638,14 +661,10 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscreen) { - // Get the widget control from the task bar window. The physical window geometry - // should be the same for all windows. + // Get the physical size of the display - NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); - - // Get the size of the window from the widget control - - NXWidgets::CRect rect = control->getWindowBoundingBox(); + struct nxgl_size_s displaySize; + getDisplaySize(displaySize); // Now position and size the application. This will depend on the position and // orientation of the task bar. @@ -660,8 +679,8 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscr pos.x = 0; pos.y = 0; - size.w = rect.getWidth(); - size.h = rect.getHeight(); + size.w = displaySize.w; + size.h = displaySize.h; } else { @@ -669,26 +688,26 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscr pos.x = 0; pos.y = CONFIG_NXWM_TASKBAR_WIDTH; - size.w = rect.getWidth(); - size.h = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; + size.w = displaySize.w; + size.h = displaySize.h - CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) pos.x = 0; pos.y = 0; - size.w = rect.getWidth(); - size.h = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; + size.w = displaySize.w; + size.h = displaySize.h - CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_LEFT) pos.x = CONFIG_NXWM_TASKBAR_WIDTH; pos.y = 0; - size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.w = displaySize.w - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = displaySize.h; #else pos.x = 0; pos.y = 0; - size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.w = displaySize.w - CONFIG_NXWM_TASKBAR_WIDTH; + size.h = displaySize.h; #endif } @@ -718,13 +737,10 @@ bool CTaskbar::createTaskbarWindow(void) return false; } - // Get the contained widget control + // Get the size of the physical display - NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); - - // Get the size of the window from the widget control - - NXWidgets::CRect rect = control->getWindowBoundingBox(); + struct nxgl_size_s displaySize; + getDisplaySize(displaySize); // Now position and size the task bar. This will depend on the position and // orientation of the task bar. @@ -736,26 +752,26 @@ bool CTaskbar::createTaskbarWindow(void) pos.x = 0; pos.y = 0; - size.w = rect.getWidth(); + size.w = displaySize.w; size.h = CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_BOTTOM) pos.x = 0; - pos.y = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH; + pos.y = displaySize.h - CONFIG_NXWM_TASKBAR_WIDTH; - size.w = rect.getWidth(); + size.w = displaySize.w; size.h = CONFIG_NXWM_TASKBAR_WIDTH; #elif defined(CONFIG_NXWM_TASKBAR_LEFT) pos.x = 0; pos.y = 0; size.w = CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.h = displaySize.h; #else pos.x = rect.getWidgth() - CONFIG_NXWM_TASKBAR_WIDTH; pos.y = 0; size.w = CONFIG_NXWM_TASKBAR_WIDTH; - size.h = rect.getHeight(); + size.h = displaySize.h; #endif /* Set the size and position the window. @@ -940,7 +956,7 @@ bool CTaskbar::redrawTaskbarWindow(void) struct nxgl_point_s iconPos; #if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) - // For horizontal task bars, the icons will be aligned at the top of + // For horizontal task bars, the icons will be aligned along the top of // the task bar iconPos.x = taskbarPos.x; From 4b352d50527638c8e90985b70462f70532217fe4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 12 May 2012 21:12:56 +0000 Subject: [PATCH 049/390] NxWM: Fix double deletion of class git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4727 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 5 ++++- nxwm/src/ccalibration.cxx | 5 +++-- nxwm/src/ctaskbar.cxx | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index da14da62b..8dd65d78b 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -62,4 +62,7 @@ some special mouse and keyboard input event handling. * NxWM::CTaskbar: Correct the calculation of the physical size of the display. - +* NxWM::CCalibration: run method must clear m_stop when returning, or you can + never restart the Calibration window. +* NxWM::CTaskbar: On a failure to start an application, the application icon + CImage was being deleted twice. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 4c6a29ed9..1fc9f3466 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -168,8 +168,9 @@ bool CCalibration::run(void) touchscreenInput(sample); } - - return !m_stop; + + m_stop = false; + return true; } /** diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 87fa34c3d..9558e47a8 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -393,8 +393,12 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) if (!app->run()) { + // Call stopApplication on a failure to start. This will call + // app->stop() (which is probably not necesary for the application + // but it should be prepared/ to handle it). stopApplication() + // will also removed the icon image from the list and delete it. + stopApplication(app); - image->disable(); return false; } From ad3d507223957d312af23e7d11e3109f0466bc03 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 May 2012 14:36:59 +0000 Subject: [PATCH 050/390] NxWM: Fix detection of touch events in the tool bar; Start window should not have a stop icon git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4729 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 4 +- libnxwidgets/include/cnxtkwindow.hxx | 9 +- libnxwidgets/include/cwidgetcontrol.hxx | 13 +- libnxwidgets/src/cnxtkwindow.cxx | 48 +++++-- nxwm/include/capplicationwindow.hxx | 26 +++- nxwm/include/ctaskbar.hxx | 4 +- nxwm/src/capplicationwindow.cxx | 176 ++++++++++++++---------- nxwm/src/ctaskbar.cxx | 6 +- 8 files changed, 195 insertions(+), 91 deletions(-) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 271fd22c2..9026a670e 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -300,9 +300,11 @@ static bool createStartWindow(void) // in the start window. // 4. Call CTaskBar::startApplication (initially minimized) to start the start // window application. + // + // NOTE: that the start window should not have a stop button. printf(MAIN_STRING "Opening the start window application window\n"); - NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); + NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(NxWM::CApplicationWindow::WINDOW_PERSISTENT); if (!window) { printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 32d634182..4c379754a 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -112,7 +112,7 @@ namespace NXWidgets * @param widgetControl Controlling widget for this window. */ - CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl); + CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl); /** * Destructor. @@ -143,10 +143,15 @@ namespace NXWidgets * the toolbar object AND calls the INxWindow::open() method to * create the toolbar. The toolbar is ready for use upon return. * + * @param height. The height in rows of the tool bar + * @param widgetControl. The controlling widget for this window. If + * none is provided, then a new, vanilla CWidgetControl will be created + * for the tool bar. * @return True if the toolbar was successfully created. */ - CNxToolbar *openToolbar(nxgl_coord_t height); + CNxToolbar *openToolbar(nxgl_coord_t height, + CWidgetControl *widgetControl = (CWidgetControl *)0); /** * Detach the toolbar. This should *ONLY* be called by the toolbar diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 4a54469d8..565e9cc36 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -526,7 +526,7 @@ namespace NXWidgets /** * Get the default widget style for this window. * - * @return Pointer to the clicked widget. + * @param style. The location to return the widget's style */ inline void getWidgetStyle(CWidgetStyle *style) @@ -534,6 +534,17 @@ namespace NXWidgets copyWidgetStyle(style, &m_style); } + /** + * Set the default widget style for this window. + * + * @param style. The new widget style to copy. + */ + + inline void setWidgetStyle(const CWidgetStyle *style) + { + copyWidgetStyle(&m_style, style); + } + /** * These remaining methods are used by the CCallback instance to * provide notifications of certain events. diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 648cc368f..16eaad2c7 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -66,13 +66,13 @@ using namespace NXWidgets; * @param widgetControl Controlling widget for this window. */ -CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) - : CCallback(pWidgetControl) +CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl) + : CCallback(widgetControl) { // Save construction values m_hNxServer = hNxServer; - m_widgetControl = pWidgetControl; + m_widgetControl = widgetControl; // Nullify uninitilized pointers @@ -138,14 +138,38 @@ CWidgetControl *CNxTkWindow::getWidgetControl(void) const * the toolbar object AND calls the INxWindow::open() method to * create the toolbar. The toolbar is ready for use upon return. * + * @param height. The height in rows of the tool bar + * @param widgetControl. The controlling widget for this window. If + * none is provided, then a new, vanilla CWidgetControl will be created + * for the tool bar. * @param height Height of the toolbar */ -CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) +CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widgetControl) { if (m_hNxTkWindow && !m_toolbar) { - // Get current window style from the widget control + // Create a new widget control if none was provided + + CWidgetControl *allocControl = (CWidgetControl *)0; + if (!widgetControl) + { + // NOTE: This constructor would accept the toolbar "style" as a argument. + // However, we will explicitly set the style below to handle the case + // where the user has provided a custom widget control + + allocControl = new CWidgetControl(); + if (!allocControl) + { + return (CNxToolbar *)0; + } + + // Use the allocated widget control + + widgetControl = allocControl; + } + + // Get current window style from the NXTK window's widget control CWidgetStyle style; m_widgetControl->getWidgetStyle(&style); @@ -155,9 +179,7 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) style.colors.background = CONFIG_NXTK_BORDERCOLOR1; style.colors.selectedBackground = CONFIG_NXTK_BORDERCOLOR1; - // Create a new controlling widget for the window using these colors - - CWidgetControl *widgetControl = new CWidgetControl(&style); + widgetControl->setWidgetStyle(&style); // And create the toolbar @@ -165,7 +187,10 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) widgetControl, height); if (!m_toolbar) { - delete widgetControl; + if (allocControl) + { + delete allocControl; + } return (CNxToolbar *)0; } @@ -177,7 +202,10 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height) // Failed to create the toolbar. Clean-up and return NULL delete m_toolbar; - delete widgetControl; + if (allocControl) + { + delete allocControl; + } return (CNxToolbar *)0; } diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 7736a3081..807f268a6 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -73,6 +73,16 @@ namespace NxWM class CApplicationWindow : public IApplicationWindow, private NXWidgets::CWidgetEventHandler { + public: + /** + * Enumeration describing the bit settings for each window flag + */ + + enum EWindowFlags + { + WINDOW_PERSISTENT = 0x01 /**< Persistent windows have no stop button */ + }; + protected: NXWidgets::CNxTkWindow *m_window; /**< The framed window used by the application */ NXWidgets::CNxToolbar *m_toolbar; /**< The toolbar */ @@ -83,6 +93,7 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_stopBitmap; /**< The stop icon bitmap */ NXWidgets::CNxFont *m_windowFont; /**< The font used to rend the window label */ IApplicationCallback *m_callback; /**< Toolbar action callbacks */ + uint8_t m_flags; /**< Window flags */ /** * Handle a mouse button click event. @@ -98,9 +109,10 @@ namespace NxWM * CApplicationWindow Constructor * * @param window. The window to be used by this application. + * @param flags. Optional flags to control the window configuration (See EWindowFlags). */ - CApplicationWindow(NXWidgets::CNxTkWindow *window); + CApplicationWindow(NXWidgets::CNxTkWindow *window, uint8_t flags = 0); /** * CApplicationWindow Destructor @@ -152,6 +164,18 @@ namespace NxWM void registerCallbacks(IApplicationCallback *callback); + /** + * Check if this window is configured for a persistent application (i.e., + * an application that has no STOP icon + * + * @return True if the window is configured for a persistent application. + */ + + inline bool isPersistent(void) const + { + return (m_flags & WINDOW_PERSISTENT) != 0; + } + /** * Simulate a mouse click on the minimize icon. This inline method is only * used during automated testing of NxWM. diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 431c2be48..35a291aef 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -301,9 +301,11 @@ namespace NxWM * * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. + * + * @param flags. CApplicationWindow flugs for window customization. */ - CApplicationWindow *openApplicationWindow(void); + CApplicationWindow *openApplicationWindow(uint8_t flags = 0); /** * Create a full screen application window. Creating a new full screen application diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index f57c04297..d2190cd24 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -47,6 +47,7 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" +#include "cwindowcontrol.hxx" #include "capplicationwindow.hxx" /******************************************************************************************** @@ -63,13 +64,15 @@ * CApplicationWindow Constructor * * @param taskbar. A pointer to the parent task bar instance. + * @param flags. Optional flags to control the window configuration (See EWindowFlags). */ -CApplicationWindow::CApplicationWindow(NXWidgets::CNxTkWindow *window) +CApplicationWindow::CApplicationWindow(NXWidgets::CNxTkWindow *window, uint8_t flags) { - // Save the window for later use + // Save the window and window flags for later use m_window = window; + m_flags = flags; // These will be created with the open method is called @@ -150,9 +153,17 @@ CApplicationWindow::~CApplicationWindow(void) bool CApplicationWindow::open(void) { + // Create one of our special window controls for the tool bar + + CWindowControl *control = new CWindowControl(); + if (!control) + { + return false; + } + // Open the toolbar - m_toolbar = m_window->openToolbar(CONFIG_NXWM_TOOLBAR_HEIGHT); + m_toolbar = m_window->openToolbar(CONFIG_NXWM_TOOLBAR_HEIGHT, control); if (!m_toolbar) { // We failed to open the toolbar @@ -168,67 +179,67 @@ bool CApplicationWindow::open(void) return false; } - // Get the CWidgetControl associated with the toolbar - - NXWidgets::CWidgetControl *control = m_toolbar->getWidgetControl(); - if (!control) - { - return false; - } - - // Create STOP bitmap container - - m_stopBitmap = new NXWidgets::CRlePaletteBitmap(&g_stopBitmap); - if (!m_stopBitmap) - { - return false; - } - - // Create the STOP application icon at the right of the toolbar + // Start positioning icons from the right side of the tool bar struct nxgl_point_s iconPos; struct nxgl_size_s iconSize; - // Get the height and width of the stop bitmap + iconPos.x = windowSize.w; - iconSize.w = m_stopBitmap->getWidth(); - iconSize.h = m_stopBitmap->getHeight(); + // Create the STOP icon only if this is a non-persistent application - // The default CImage has borders enabled with thickness of the border - // width. Add twice the thickness of the border to the width and height. - // (We could let CImage do this for us by calling - // CImage::getPreferredDimensions()) - - iconSize.w += 2 * 1; - iconSize.h += 2 * 1; - - // Pick an X/Y position such that the image will position at the right of - // the toolbar and centered vertically. - - iconPos.x = windowSize.w - iconSize.w; - - if (iconSize.h >= windowSize.h) + if (!isPersistent()) { - iconPos.y = 0; + // Create STOP bitmap container + + m_stopBitmap = new NXWidgets::CRlePaletteBitmap(&g_stopBitmap); + if (!m_stopBitmap) + { + return false; + } + + // Create the STOP application icon at the right of the toolbar + // Get the height and width of the stop bitmap + + iconSize.w = m_stopBitmap->getWidth(); + iconSize.h = m_stopBitmap->getHeight(); + + // The default CImage has borders enabled with thickness of the border + // width. Add twice the thickness of the border to the width and height. + // (We could let CImage do this for us by calling + // CImage::getPreferredDimensions()) + + iconSize.w += 2 * 1; + iconSize.h += 2 * 1; + + // Pick an X/Y position such that the image will position at the right of + // the toolbar and centered vertically. + + iconPos.x -= iconSize.w; + + if (iconSize.h >= windowSize.h) + { + iconPos.y = 0; + } + else + { + iconPos.y = (windowSize.h - iconSize.h) >> 1; + } + + // Now we have enough information to create the image + + m_stopImage = new NXWidgets::CImage(control, iconPos.x, iconPos.y, iconSize.w, + iconSize.h, m_stopBitmap); + if (!m_stopImage) + { + return false; + } + + // Configure 'this' to receive mouse click inputs from the image + + m_stopImage->setBorderless(true); + m_stopImage->addWidgetEventHandler(this); } - else - { - iconPos.y = (windowSize.h - iconSize.h) >> 1; - } - - // Now we have enough information to create the image - - m_stopImage = new NXWidgets::CImage(control, iconPos.x, iconPos.y, iconSize.w, - iconSize.h, m_stopBitmap); - if (!m_stopImage) - { - return false; - } - - // Configure 'this' to receive mouse click inputs from the image - - m_stopImage->setBorderless(true); - m_stopImage->addWidgetEventHandler(this); // Create MINIMIZE application bitmap container @@ -343,17 +354,23 @@ void CApplicationWindow::redraw(void) port->drawFilledRect(0, 0, windowSize.w, windowSize.h, CONFIG_NXTK_BORDERCOLOR1); - // Then draw the images + // Then draw the stop image (which may not be present if this is a + // "persistent" application) - m_stopImage->enableDrawing(); - m_stopImage->redraw(); - m_stopImage->setRaisesEvents(true); + if (m_stopImage) + { + m_stopImage->enableDrawing(); + m_stopImage->redraw(); + m_stopImage->setRaisesEvents(true); + } + + // Draw the minimize image m_minimizeImage->enableDrawing(); m_minimizeImage->redraw(); m_minimizeImage->setRaisesEvents(true); - // And draw the window label + // And finally draw the window label m_windowLabel->enableDrawing(); m_windowLabel->redraw(); @@ -366,10 +383,16 @@ void CApplicationWindow::redraw(void) void CApplicationWindow::hide(void) { - // Disable the images + // Disable the stop image (which may not be present if this is a + // "persistent" application) - m_stopImage->disableDrawing(); - m_stopImage->setRaisesEvents(false); + if (m_stopImage) + { + m_stopImage->disableDrawing(); + m_stopImage->setRaisesEvents(false); + } + + // Disable the minimize image m_minimizeImage->disableDrawing(); m_minimizeImage->setRaisesEvents(false); @@ -428,7 +451,8 @@ void CApplicationWindow::clickMinimizeIcon(int index) // And click the image at its center - m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); } #endif @@ -440,17 +464,23 @@ void CApplicationWindow::clickMinimizeIcon(int index) #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) void CApplicationWindow::clickStopIcon(int index) { - // Get the size and position of the widget + // The stop icon will not be available for "persistent" applications - struct nxgl_size_s imageSize; - m_stopImage->getSize(imageSize); + if (m_stopImage) + { + // Get the size and position of the widget - struct nxgl_point_s imagePos; - m_stopImage->getPos(imagePos); + struct nxgl_size_s imageSize; + m_stopImage->getSize(imageSize); - // And click the image at its center + struct nxgl_point_s imagePos; + m_stopImage->getPos(imagePos); - m_stopImage->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); + // And click the image at its center + + m_stopImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } } #endif @@ -468,7 +498,7 @@ void CApplicationWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) { // Check the stop application image - if (m_stopImage->isClicked()) + if (m_stopImage && m_stopImage->isClicked()) { // Notify the controlling logic that the application should be stopped diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 9558e47a8..c6e1b574b 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -264,9 +264,11 @@ bool CTaskbar::startWindowManager(void) * * 4. Call CTaskBar::startApplication start the application and bring its window to * the top. + * + * @param flags. CApplicationWindow flugs for window customization. */ -CApplicationWindow *CTaskbar::openApplicationWindow(void) +CApplicationWindow *CTaskbar::openApplicationWindow(uint8_t flags) { // Get a framed window for the application @@ -282,7 +284,7 @@ CApplicationWindow *CTaskbar::openApplicationWindow(void) // Use this window to instantiate the application window - CApplicationWindow *appWindow = new CApplicationWindow(window); + CApplicationWindow *appWindow = new CApplicationWindow(window, flags); if (!appWindow) { delete window; From 6a983e670dde0485489c6758a21893b967cfa352 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 May 2012 18:28:43 +0000 Subject: [PATCH 051/390] NXWidgets::CImage needs to catch mouse/touchscreen events; All touchscreen drivers need to report the last valid X/Y data when the screen is untouched. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4731 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 5 ++++ libnxwidgets/include/cimage.hxx | 32 +++++++++++++++++--- libnxwidgets/src/cimage.cxx | 52 +++++++++++++++++++++++++++++++++ nxwm/include/cstartwindow.hxx | 2 +- nxwm/src/cstartwindow.cxx | 2 +- 5 files changed, 87 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8dd65d78b..0cb95cc13 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -66,3 +66,8 @@ never restart the Calibration window. * NxWM::CTaskbar: On a failure to start an application, the application icon CImage was being deleted twice. +* NXWidgets::CImage: Now handles mouse click callbacks. CImage is now really + a button. Probably should separate basic imaging functionality as CImage + and create a new CImageButton. +* NxWM::CStartWindow: Now ignores any close application button presses + (You can't close the start window). \ No newline at end of file diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index a1c282393..0b7be14f2 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -133,6 +133,33 @@ namespace NXWidgets virtual void drawBorder(CGraphicsPort *port); + /** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + /** * Copy constructor is protected to prevent usage. */ @@ -199,10 +226,7 @@ namespace NXWidgets * @param highlightOn True(1), the image will be highlighted */ - inline void highlight(bool highlightOn) - { - m_highlighted = highlightOn; - } + void highlight(bool highlightOn); }; } diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 0ca6f571e..7d9e0ee4e 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -357,6 +357,58 @@ void CImage::drawBorder(CGraphicsPort *port) port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } +/** + * Control the highlight state. + * + * @param highlightOn True(1), the image will be highlighted + */ + +void CImage::highlight(bool highlightOn) +{ + if (m_highlighted != highlightOn) + { + m_highlighted = highlightOn; + redraw(); + } +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CImage::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Raises an action event and redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CImage::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); + redraw(); +} + +/** + * Redraws the button. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CImage::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + /** * Set the horizontal position of the bitmap. Zero is the left edge * of the bitmap and values >0 will move the bit map to the right. diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 5e4fa7564..a04a4f1a5 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -92,7 +92,7 @@ namespace NxWM void minimize(void); /** - * Called when the window minimize close is pressed. + * Called when the window close button is pressed. */ void close(void); diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 8da71b2b5..f907f6718 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -356,7 +356,7 @@ void CStartWindow::minimize(void) void CStartWindow::close(void) { - m_taskbar->stopApplication(static_cast(this)); + // Do nothing... you can't close the start window!!! } /** From 92d74816c0fa935110c92616eba86bf41d45921a Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 May 2012 23:40:23 +0000 Subject: [PATCH 052/390] Disabled NXTK autoraise; it does not work properly in multi-user mode due to queue mouse/touchscreen input git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4732 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/cnxwidget.hxx | 92 +++++++++---------- .../include/cwidgeteventhandlerlist.hxx | 6 +- libnxwidgets/src/cnxwidget.cxx | 18 ++-- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 2 +- nxwm/src/ctaskbar.cxx | 2 +- 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 4c470cfb2..38a66d155 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -425,7 +425,7 @@ namespace NXWidgets * @return Widget space x coordinate. */ - const nxgl_coord_t getX(void) const; + nxgl_coord_t getX(void) const; /** * Get the y coordinate of the widget in "Widget space". @@ -433,7 +433,7 @@ namespace NXWidgets * @return Widget space y coordinate. */ - const nxgl_coord_t getY(void) const; + nxgl_coord_t getY(void) const; /** * Get the x coordinate of the widget relative to its parent. @@ -441,7 +441,7 @@ namespace NXWidgets * @return Parent-space x coordinate. */ - const nxgl_coord_t getRelativeX(void) const; + nxgl_coord_t getRelativeX(void) const; /** * Get the y coordinate of the widget relative to its parent. @@ -449,7 +449,7 @@ namespace NXWidgets * @return Parent-space y coordinate. */ - const nxgl_coord_t getRelativeY(void) const; + nxgl_coord_t getRelativeY(void) const; /** * Is the widget active? @@ -459,7 +459,7 @@ namespace NXWidgets * @return True if active. */ - inline const bool hasFocus(void) const + inline bool hasFocus(void) const { return m_flags.hasFocus; } @@ -475,7 +475,7 @@ namespace NXWidgets * @return True if marked for deletion. */ - const bool isDeleted(void) const; + bool isDeleted(void) const; /** * Is the widget allowed to draw? This function recurses up the widget @@ -485,7 +485,7 @@ namespace NXWidgets * @return True if drawing is enabled. */ - const bool isDrawingEnabled(void) const; + bool isDrawingEnabled(void) const; /** * Is the widget hidden? This function recurses up the widget @@ -495,7 +495,7 @@ namespace NXWidgets * @return True if hidden. */ - const bool isHidden(void) const; + bool isHidden(void) const; /** * Is the widget enabled? This function recurses up the widget @@ -505,7 +505,7 @@ namespace NXWidgets * @return True if enabled. */ - const bool isEnabled(void) const; + bool isEnabled(void) const; /** * Are the widget's edges permeable or solid? @@ -515,7 +515,7 @@ namespace NXWidgets * @return True if permeable. */ - inline const bool isPermeable(void) const + inline bool isPermeable(void) const { return m_flags.permeable; } @@ -525,7 +525,7 @@ namespace NXWidgets * @return True if the widget watches for double-clicks. */ - inline const bool isDoubleClickable(void) const + inline bool isDoubleClickable(void) const { return m_flags.doubleClickable; } @@ -536,7 +536,7 @@ namespace NXWidgets * @return True if the widget does not have a border. */ - inline const bool isBorderless(void) const + inline bool isBorderless(void) const { return m_flags.borderless; } @@ -547,7 +547,7 @@ namespace NXWidgets * @return True if the widget is currently clicked. */ - inline const bool isClicked(void) const + inline bool isClicked(void) const { return m_flags.clicked; } @@ -558,7 +558,7 @@ namespace NXWidgets * @return True if the widget is currently being dragged. */ - inline const bool isBeingDragged(void) const + inline bool isBeingDragged(void) const { return m_flags.dragging; } @@ -655,17 +655,6 @@ namespace NXWidgets return m_focusedChild; } - /** - * Check if this widget raises events or not. - * - * @return True if events are enabled. - */ - - inline const bool raisesEvents(void) const - { - return m_widgetEventHandlers->isEnabled(); - } - /** * Insert the dimensions that this widget wants to have into the rect * passed in as a parameter. All coordinates are relative to the widget's @@ -714,7 +703,7 @@ namespace NXWidgets * @return Background fill color. */ - inline const nxgl_mxpixel_t getBackgroundColor(void) const + inline nxgl_mxpixel_t getBackgroundColor(void) const { return m_style.colors.background; } @@ -725,7 +714,7 @@ namespace NXWidgets * @return Dark color. */ - inline const nxgl_mxpixel_t getSelectedBackgroundColor(void) const + inline nxgl_mxpixel_t getSelectedBackgroundColor(void) const { return m_style.colors.selectedBackground; } @@ -736,7 +725,7 @@ namespace NXWidgets * @return Shine color. */ - inline const nxgl_mxpixel_t getShineEdgeColor(void) const + inline nxgl_mxpixel_t getShineEdgeColor(void) const { return m_style.colors.shineEdge; } @@ -747,7 +736,7 @@ namespace NXWidgets * @return Shadow color. */ - inline const nxgl_mxpixel_t getShadowEdgeColor(void) const + inline nxgl_mxpixel_t getShadowEdgeColor(void) const { return m_style.colors.shadowEdge; } @@ -758,7 +747,7 @@ namespace NXWidgets * @return Highlight color. */ - inline const nxgl_mxpixel_t getHighlightColor(void) const + inline nxgl_mxpixel_t getHighlightColor(void) const { return m_style.colors.highlight; } @@ -769,7 +758,7 @@ namespace NXWidgets * @return Disabled text color. */ - inline const nxgl_mxpixel_t getDisabledTextColor(void) const + inline nxgl_mxpixel_t getDisabledTextColor(void) const { return m_style.colors.disabledText; } @@ -780,7 +769,7 @@ namespace NXWidgets * @return Enabled text color. */ - inline const nxgl_mxpixel_t getEnabledTextColor(void) const + inline nxgl_mxpixel_t getEnabledTextColor(void) const { return m_style.colors.enabledText; } @@ -791,7 +780,7 @@ namespace NXWidgets * @return Selected text color. */ - inline const nxgl_mxpixel_t getSelectedTextColor(void) const + inline nxgl_mxpixel_t getSelectedTextColor(void) const { return m_style.colors.selectedText; } @@ -810,7 +799,7 @@ namespace NXWidgets * @param isDraggable The draggable state. */ - inline void setDraggable(const bool isDraggable) + inline void setDraggable(bool isDraggable) { m_flags.draggable = isDraggable; } @@ -821,7 +810,7 @@ namespace NXWidgets * @param permeable The permeable state. */ - inline void setPermeable(const bool permeable) + inline void setPermeable(bool permeable) { m_flags.permeable = permeable; } @@ -832,7 +821,7 @@ namespace NXWidgets * @param doubleClickable The double-clickable state. */ - inline void setDoubleClickable(const bool doubleClickable) + inline void setDoubleClickable(bool doubleClickable) { m_flags.doubleClickable = doubleClickable; } @@ -866,11 +855,22 @@ namespace NXWidgets * @param raises True to enable events, false to disable. */ - inline void setRaisesEvents(const bool raises) + inline void setRaisesEvents(bool raises) { raises ? m_widgetEventHandlers->enable() : m_widgetEventHandlers->disable(); } + /** + * Check if event handling is enabled for this widget. + * + * @return True is event handling is enabled. + */ + + inline bool raisesEvents(void) const + { + return m_widgetEventHandlers->isEnabled(); + } + /** * Disabled drawing of this widget. Widgets hidden using this method will still * be processed. @@ -896,7 +896,7 @@ namespace NXWidgets * @param color The new background color. */ - inline void setBackgroundColor(const nxgl_mxpixel_t color) + inline void setBackgroundColor(nxgl_mxpixel_t color) { m_style.colors.background = color; } @@ -907,7 +907,7 @@ namespace NXWidgets * @param color The new selected background color. */ - inline void setSelectedBackgroundColor(const nxgl_mxpixel_t color) + inline void setSelectedBackgroundColor(nxgl_mxpixel_t color) { m_style.colors.selectedBackground = color; } @@ -918,7 +918,7 @@ namespace NXWidgets * @param color The new shine edge color. */ - inline void setShineEdgeColor(const nxgl_mxpixel_t color) + inline void setShineEdgeColor(nxgl_mxpixel_t color) { m_style.colors.shineEdge = color; } @@ -929,7 +929,7 @@ namespace NXWidgets * @param color The new shadow edge color. */ - inline void setShadowEdgeColor(const nxgl_mxpixel_t color) + inline void setShadowEdgeColor(nxgl_mxpixel_t color) { m_style.colors.shadowEdge = color; } @@ -940,7 +940,7 @@ namespace NXWidgets * @param color The new highlight color. */ - inline void setHighlightColor(const nxgl_mxpixel_t color) + inline void setHighlightColor(nxgl_mxpixel_t color) { m_style.colors.highlight = color; } @@ -951,7 +951,7 @@ namespace NXWidgets * @param color The new text color. */ - inline void setDisabledTextColor(const nxgl_mxpixel_t color) + inline void setDisabledTextColor(nxgl_mxpixel_t color) { m_style.colors.disabledText = color; } @@ -962,7 +962,7 @@ namespace NXWidgets * @param color The new text color. */ - inline void setEnabledTextColor(const nxgl_mxpixel_t color) + inline void setEnabledTextColor(nxgl_mxpixel_t color) { m_style.colors.enabledText = color; } @@ -973,7 +973,7 @@ namespace NXWidgets * @param color The new selected text color. */ - inline void setSelectedTextColor(const nxgl_mxpixel_t color) + inline void setSelectedTextColor(nxgl_mxpixel_t color) { m_style.colors.selectedText = color; } @@ -1303,7 +1303,7 @@ namespace NXWidgets * @return The number of child widgets belonging to this widget. */ - const int getChildCount(void) const + int getChildCount(void) const { return m_children.size(); } diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx index 8c9ef6738..f0a2f1d72 100644 --- a/libnxwidgets/include/cwidgeteventhandlerlist.hxx +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -131,7 +131,7 @@ namespace NXWidgets * @return True if events are enabled. */ - const bool isEnabled(void) const; + bool isEnabled(void) const; /** * Get the event handler at the specified index. @@ -140,7 +140,7 @@ namespace NXWidgets * @return The event handler at the specified index. */ - inline CWidgetEventHandler *at(const int index) const + inline CWidgetEventHandler *at(int index) const { return m_widgetEventHandlers.at(index); } @@ -151,7 +151,7 @@ namespace NXWidgets * @return The size of the array. */ - inline const nxgl_coord_t size(void) const + inline nxgl_coord_t size(void) const { return m_widgetEventHandlers.size(); } diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 97d24b73c..66766dca6 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -243,7 +243,7 @@ CNxWidget::~CNxWidget(void) * @return Widget space x coordinate. */ -const nxgl_coord_t CNxWidget::getX(void) const +nxgl_coord_t CNxWidget::getX(void) const { if (m_parent != (CNxWidget *)NULL) { @@ -259,7 +259,7 @@ const nxgl_coord_t CNxWidget::getX(void) const * @return Widget space y coordinate. */ -const nxgl_coord_t CNxWidget::getY(void) const +nxgl_coord_t CNxWidget::getY(void) const { if (m_parent != (CNxWidget *)NULL) { @@ -275,7 +275,7 @@ const nxgl_coord_t CNxWidget::getY(void) const * @return Parent-space x coordinate. */ -const nxgl_coord_t CNxWidget::getRelativeX(void) const +nxgl_coord_t CNxWidget::getRelativeX(void) const { return m_rect.getX(); } @@ -286,7 +286,7 @@ const nxgl_coord_t CNxWidget::getRelativeX(void) const * @return Parent-space y coordinate. */ -const nxgl_coord_t CNxWidget::getRelativeY(void) const +nxgl_coord_t CNxWidget::getRelativeY(void) const { return m_rect.getY(); } @@ -302,7 +302,7 @@ const nxgl_coord_t CNxWidget::getRelativeY(void) const * @return True if marked for deletion. */ -const bool CNxWidget::isDeleted(void) const +bool CNxWidget::isDeleted(void) const { if (m_parent != (CNxWidget *)NULL) { @@ -323,7 +323,7 @@ const bool CNxWidget::isDeleted(void) const * @return True if drawing is enabled. */ -const bool CNxWidget::isDrawingEnabled(void) const +bool CNxWidget::isDrawingEnabled(void) const { if (m_parent != (CNxWidget *)NULL) { @@ -350,7 +350,7 @@ const bool CNxWidget::isDrawingEnabled(void) const * @return True if hidden. */ -const bool CNxWidget::isHidden(void) const +bool CNxWidget::isHidden(void) const { if (m_parent != (CNxWidget *)NULL) { @@ -377,7 +377,7 @@ const bool CNxWidget::isHidden(void) const * @return True if enabled. */ -const bool CNxWidget::isEnabled() const +bool CNxWidget::isEnabled() const { if (m_parent != (CNxWidget *)NULL) { @@ -1385,7 +1385,7 @@ bool CNxWidget::removeChild(CNxWidget *widget) * @return Pointer to the child at the specified index. */ -const CNxWidget *CNxWidget::getChild(const int index) const +const CNxWidget *CNxWidget::getChild(int index) const { if (index < (int)m_children.size()) { diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index 21d21add9..68230e17a 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -110,7 +110,7 @@ CWidgetEventHandlerList::CWidgetEventHandlerList(CNxWidget *widget) * @return True if events are enabled. */ -const bool CWidgetEventHandlerList::isEnabled(void) const +bool CWidgetEventHandlerList::isEnabled(void) const { return m_isEnabled && !m_widget->isDeleted(); } diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index c6e1b574b..f5a5c08f5 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -499,7 +499,7 @@ bool CTaskbar::minimizeApplication(IApplication *app) if (!app->isMinimized()) { // No, then we are going to minimize it but disabling its components, - // marking it as minized, then raising a new window to the top window. + // marking it as minimized, then raising a new window to the top window. hideApplicationWindow(app); From fc935338e8835194a729a92b751bed47a082810c Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 14 May 2012 20:46:47 +0000 Subject: [PATCH 053/390] NxWM: Calibration is now done on a separate thread; Change mechanism for reporting calibration data; add method to determine if the application is full-screen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4736 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 14 +- UnitTests/nxwm/main.cxx | 143 +++------ nxwm/include/capplicationwindow.hxx | 10 + nxwm/include/ccalibration.hxx | 105 ++++++- nxwm/include/cfullscreenwindow.hxx | 10 + nxwm/include/cnxconsole.hxx | 10 + nxwm/include/cstartwindow.hxx | 10 + nxwm/include/ctouchscreen.hxx | 29 +- nxwm/include/iapplication.hxx | 10 + nxwm/include/iapplicationwindow.hxx | 10 + nxwm/include/nxwmconfig.hxx | 30 ++ nxwm/src/capplicationwindow.cxx | 13 + nxwm/src/ccalibration.cxx | 460 ++++++++++++++++++++-------- nxwm/src/cfullscreenwindow.cxx | 13 + nxwm/src/cnxconsole.cxx | 13 + nxwm/src/cstartwindow.cxx | 13 + nxwm/src/ctaskbar.cxx | 401 +++++++++++++++--------- nxwm/src/ctouchscreen.cxx | 8 +- 18 files changed, 912 insertions(+), 390 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0cb95cc13..5b14799bd 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -70,4 +70,16 @@ a button. Probably should separate basic imaging functionality as CImage and create a new CImageButton. * NxWM::CStartWindow: Now ignores any close application button presses - (You can't close the start window). \ No newline at end of file + (You can't close the start window). +* NxWM::CCalibration: The calibration application now has its own thread. + This was necessary for a proper integration with the taskbar. +* NxWM::CCalibration and NxWM:CTouchscreen: Changed the mechanism use + to report calbration data. It is now reported directly from CCalibration + to CTouchscreen. If external logic needs calibration, it can now get it + from CTouchscreen instead of CCalibration. This change was necessary + to make the termination conditions of CCalibration clean (it used to + have to persist until some external logic got the Calibration data). +* IApplication, IApplicationWindow, and all classes that inherit from + these: Now support method to report if the application is a full-screen + or a normal application. This is necessary to prevent CTaskbar from + displaying a task bar on top of a full-screen window. diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 9026a670e..d4b7caa6b 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -428,7 +428,7 @@ static bool createCalibration(void) showTestCaseMemory("After initializing the calibration full screen window"); printf(MAIN_STRING "Creating CCalibration application\n"); - g_nxwmtest.calibration = new NxWM::CCalibration(window, g_nxwmtest.touchscreen); + g_nxwmtest.calibration = new NxWM::CCalibration(g_nxwmtest.taskbar, window, g_nxwmtest.touchscreen); if (!g_nxwmtest.calibration) { printf(MAIN_STRING "ERROR: Failed to instantiate CCalibration\n"); @@ -436,24 +436,22 @@ static bool createCalibration(void) return false; } showTestCaseMemory("After creating CCalibration application"); - return true; -} -#endif -///////////////////////////////////////////////////////////////////////////// -// Name: runCalibration -///////////////////////////////////////////////////////////////////////////// + // Add the calibration application to the start window. It can't really + // be used to re-calibrate (because there is nothing to get the calibration + // data). But is a good case to test a full screen appliation -#ifdef CONFIG_NXWM_TOUCHSCREEN -static bool runCalibration(void) -{ - // 1. Start the calibration application - // 2. Wait until calibration data is available - // 3. Stop the calibration application - // 4. Provide the calibration data to the touchscreen device application - // 5. Enable forwarding of touchscreen input + printf(MAIN_STRING "Adding CCalibration application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) + { + printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); + delete g_nxwmtest.calibration; + return false; + } + showTestCaseMemory("After adding CCalibration application"); - // Call CTaskBar::startApplication to start the Calibration application + // Call CTaskBar::startApplication to start the Calibration application. Nothing + // will be displayed because the window manager has not yet been started. printf(MAIN_STRING "Start the calibration application\n"); if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.calibration, false)) @@ -462,50 +460,6 @@ static bool runCalibration(void) return false; } showTestCaseMemory("After starting the start window application"); - - // Wait for calibration data - - printf(MAIN_STRING "Get calibration data\n"); - if (!g_nxwmtest.calibration->waitCalibrationData(g_nxwmtest.calibData)) - { - printf(MAIN_STRING "ERROR: Failed to get calibration data\n"); - return false; - } - showTestCaseMemory("After getting calibration data"); - - printf(MAIN_STRING "Stop the calibration application\n"); - if (!g_nxwmtest.taskbar->stopApplication(g_nxwmtest.calibration)) - { - printf(MAIN_STRING "ERROR: Failed to stop the calibration application\n"); - return false; - } - showTestCaseMemory("After stopping the calibration application"); - - // Configure the touchscreen device and enable touch forwarding - - g_nxwmtest.touchscreen->setCalibrationData(g_nxwmtest.calibData); - g_nxwmtest.touchscreen->setEnabled(true); - showTestCaseMemory("After givin calibration dato to the touchscreen device\n"); - return true; -} -#endif - -///////////////////////////////////////////////////////////////////////////// -// Name: addCalibrationToStartWindow -///////////////////////////////////////////////////////////////////////////// - -#ifdef CONFIG_NXWM_TOUCHSCREEN -static bool addCalibrationToStartWindow(void) -{ - printf(MAIN_STRING "Adding CCalibration application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) - { - printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete g_nxwmtest.calibration; - return false; - } - - showTestCaseMemory("After adding CCalibration application"); return true; } #endif @@ -613,6 +567,14 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the start window. + + if (!createStartWindow()) + { + printf(MAIN_STRING "ERROR: Failed to create the start window\n"); + testCleanUpAndExit(EXIT_FAILURE); + } + // Create the touchscreen device #ifdef CONFIG_NXWM_TOUCHSCREEN @@ -623,50 +585,17 @@ int MAIN_NAME(int argc, char *argv[]) } #endif - // Perform touchscreen calibration. In a real system, you would only do this - // if you have no saved touchscreen calibration. In this Unit Test, we run - // the calibration unconditionally. + // Create the calibration application and add it to the start window #ifdef CONFIG_NXWM_TOUCHSCREEN - // Create the calibration application - if (!createCalibration()) { printf(MAIN_STRING "ERROR: Failed to create the calibration application\n"); testCleanUpAndExit(EXIT_FAILURE); } - - // Run the touchscreen calibration application - - if (!runCalibration()) - { - printf(MAIN_STRING "ERROR: Touchscreen Calibration failed\n"); - testCleanUpAndExit(EXIT_FAILURE); - } #endif - - // Create the start window. - - if (!createStartWindow()) - { - printf(MAIN_STRING "ERROR: Failed to create the start window\n"); - testCleanUpAndExit(EXIT_FAILURE); - } - -#ifdef CONFIG_NXWM_TOUCHSCREEN - // Add the calibration application to the start window. It can't really - // be used to re-calibrate (because there is nothing to get the calibration - // data). But is a good case to test a full screen appliation - - if (!addCalibrationToStartWindow()) - { - printf(MAIN_STRING "ERROR: Failed to add calibration to the start window\n"); - testCleanUpAndExit(EXIT_FAILURE); - } -#endif - - // Add the NxConsole application to the start window + // Create the NxConsole application and add it to the start window if (!createNxConsole()) { @@ -682,6 +611,30 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } +#ifdef CONFIG_NXWM_TOUCHSCREEN + // Since we started the touchscreen calibration program maximized, it will run + // immediately when we start the window manager. There is no positive handshake + // to know whenthe touchscreen has been calibrated. If we really want to know, + // we have to poll + + printf(MAIN_STRING "Waiting for touchscreen calibration\n"); + while (!g_nxwmtest.touchscreen->isCalibrated()) + { + std::sleep(2); + } + + // This is how we would then recover the calibration data. After the calibration + // application creates the calibration data, it hands it to the touchscreen driver + // After the touchscreen driver gets it, it will report isCalibrated() == true + // and then we can read the calibration data from the touchscreen driver. + + printf(MAIN_STRING "Getting calibration data from the touchscreen\n"); + if (!g_nxwmtest.touchscreen->getCalibrationData(g_nxwmtest.calibData)) + { + printf(MAIN_STRING "ERROR: Failed to get calibration data from the touchscreen\n"); + } +#endif + // Wait a little bit for the display to stabilize. The simulation pressing of // the 'start window' icon in the task bar diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 807f268a6..1a3d7eb48 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -158,6 +158,16 @@ namespace NxWM void setWindowLabel(NXWidgets::CNxString &appname); + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 535a14804..3d90d59a8 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -42,12 +42,14 @@ #include +#include #include #include "cnxstring.hxx" #include "cwidgeteventhandler.hxx" #include "cwidgetcontrol.hxx" +#include "ctaskbar.hxx" #include "iapplication.hxx" #include "cfullscreenwindow.hxx" @@ -97,18 +99,33 @@ namespace NxWM class CCalibration : public IApplication { private: + /** + * The state of the calibration thread. + */ + + enum ECalThreadState + { + CALTHREAD_NOTRUNNING = 0, /**< The calibration thread has not yet been started */ + CALTHREAD_STARTED, /**< The calibration thread has been started, but is not yet running */ + CALTHREAD_RUNNING, /**< The calibration thread is running normally */ + CALTHREAD_STOPREQUESTED, /**< The calibration thread has been requested to stop */ + CALTHREAD_HIDE, /**< The hide() called by calibration thread running */ + CALTHREAD_SHOW, /**< The redraw() called by calibration thread running */ + CALTHREAD_TERMINATED /**< The calibration thread terminated normally */ + }; + /** * Identifies the current display state */ - enum ECalibState + enum ECalibrationPhase { - CALIB_NOT_STARTED = 0, /**< Constructed, but not yet started */ - CALIB_UPPER_LEFT, /**< Touch point is in the upper left corner */ - CALIB_UPPER_RIGHT, /**< Touch point is in the upper right corner */ - CALIB_LOWER_RIGHT, /**< Touch point is in the lower left corner */ - CALIB_LOWER_LEFT, /**< Touch point is in the lower right corner */ - CALIB_COMPLETE /**< Calibration is complete */ + CALPHASE_NOT_STARTED = 0, /**< Constructed, but not yet started */ + CALPHASE_UPPER_LEFT, /**< Touch point is in the upper left corner */ + CALPHASE_UPPER_RIGHT, /**< Touch point is in the upper right corner */ + CALPHASE_LOWER_RIGHT, /**< Touch point is in the lower left corner */ + CALPHASE_LOWER_LEFT, /**< Touch point is in the lower right corner */ + CALPHASE_COMPLETE /**< Calibration is complete */ }; /** @@ -126,15 +143,17 @@ namespace NxWM * CCalibration state data */ + CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */ CFullScreenWindow *m_window; /**< The window for the calibration display */ CTouchscreen *m_touchscreen; /**< The touchscreen device */ - enum ECalibState m_state; /**< Current calibration display state */ + pthread_t m_thread; /**< The calibration thread ID */ struct SCalibScreenInfo m_screenInfo; /**< Describes the current calibration display */ struct nxgl_point_s m_touchPos; /**< This is the last touch position */ + volatile uint8_t m_calthread; /**< Current calibration display state (See ECalibThreadState)*/ + uint8_t m_calphase; /**< Current calibration display state (See ECalibrationPhase)*/ bool m_stop; /**< True: We have been asked to stop the calibration */ bool m_touched; /**< True: The screen is touched */ uint8_t m_touchId; /**< The ID of the touch */ - sem_t m_waitSem; /**< Supports wait for calibration data */ struct nxgl_point_s m_calibData[CALIB_DATA_POINTS]; /** @@ -145,6 +164,42 @@ namespace NxWM void touchscreenInput(struct touch_sample_s &sample); + /** + * Start the calibration thread. + * + * @param initialState. The initial state of the calibration thread + * @return True if the thread was successfully started. + */ + + bool startCalibration(enum ECalThreadState initialState); + + /** + * Return true if the calibration thread is running normally. There are + * lots of potential race conditions. Let's hope that things are running + * orderly and we that we do not have to concern ourself with them + * + * @return True if the calibration thread is runnning normally. + */ + + inline bool isRunning(void) const + { + // What if the boundary states CALTHREAD_STARTED and CALTHREAD_STOPREQUESTED? + + return (m_calthread == CALTHREAD_RUNNING || + m_calthread == CALTHREAD_HIDE || + m_calthread == CALTHREAD_SHOW); + } + + /** + * The calibration thread. This is the entry point of a thread that provides the + * calibration displays, waits for input, and collects calibration data. + * + * @param arg. The CCalibration 'this' pointer cast to a void*. + * @return This function always returns NULL when the thread exits + */ + + static FAR void *calibration(FAR void *arg); + /** * This is the calibration state machine. It is called initially and then * as new touchscreen data is received. @@ -158,16 +213,36 @@ namespace NxWM void showCalibration(void); + /** + * Finish calibration steps and provide the calibration data to the + * touchscreen driver. + */ + + void finishCalibration(void); + + /** + * Given the raw touch data collected by the calibration thread, create the + * massaged calibration data needed by CTouchscreen. + * + * @param data. A reference to the location to save the calibration data + * @return True if the calibration data was successfully created. + */ + + bool createCalibrationData(struct SCalibrationData &data); + public: /** * CCalibration Constructor * + * @param taskbar. The taskbar instance used to terminate calibration * @param window. The window to use for the calibration display - * @param touchscreen. An instance of the class that wraps the touchscreen device. + * @param touchscreen. An instance of the class that wraps the + * touchscreen device. */ - CCalibration(CFullScreenWindow *window, CTouchscreen *touchscreen); + CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, + CTouchscreen *touchscreen); /** * CCalibration Destructor @@ -230,12 +305,14 @@ namespace NxWM void redraw(void); /** - * Wait for calibration data to be received. + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. * - * @return True if the calibration data was successfully obtained. + * @return True if this is a full screen window. */ - bool waitCalibrationData(struct SCalibrationData &data); + bool isFullScreen(void) const; }; } diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index fb4788830..3c4117689 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -122,6 +122,16 @@ namespace NxWM void setWindowLabel(NXWidgets::CNxString &appname); + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 1c7aab193..426cf165f 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -173,6 +173,16 @@ namespace NxWM */ void redraw(void); + + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; }; } #endif // __cplusplus diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index a04a4f1a5..5a5ea12f4 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -188,6 +188,16 @@ namespace NxWM void redraw(void); + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; + /** * Add the application to the start window. The general sequence for * setting up the start window is: diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx index 52433c1de..396400204 100644 --- a/nxwm/include/ctouchscreen.hxx +++ b/nxwm/include/ctouchscreen.hxx @@ -166,6 +166,17 @@ namespace NxWM m_enabled = enable; } + /** + * Is the touchscreen calibrated? + * + * @return True if the touchscreen has been calibrated. + */ + + inline bool isCalibrated(void) const + { + return m_calibrated; + } + /** * Provide touchscreen calibration data. If calibration data is received (and * the touchscreen is enabled), then received touchscreen data will be scaled @@ -175,7 +186,23 @@ namespace NxWM * @param data. A reference to the touchscreen data. */ - void setCalibrationData(struct SCalibrationData &caldata); + void setCalibrationData(const struct SCalibrationData &caldata); + + /** + * Recover the calibration data so that it can be saved to non-volatile storage. + * + * @param data. A reference to the touchscreen data. + * @return True if calibration data was successfully returned. + */ + + inline bool getCalibrationData(struct SCalibrationData &caldata) const + { + if (m_calibrated) + { + caldata = m_calibData; + } + return m_calibrated; + } /** * Capture raw driver data. This method will capture mode one raw touchscreen diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index e92e1908e..0d33db7bc 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -170,6 +170,16 @@ namespace NxWM { return m_topapp; } + + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + virtual bool isFullScreen(void) const = 0; }; } diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx index 115998775..b00a03fa2 100644 --- a/nxwm/include/iapplicationwindow.hxx +++ b/nxwm/include/iapplicationwindow.hxx @@ -129,6 +129,16 @@ namespace NxWM virtual void setWindowLabel(NXWidgets::CNxString &appname) = 0; + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + virtual bool isFullScreen(void) const = 0; + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 359f7d095..88c2ea8db 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -333,6 +333,10 @@ * Default: "/dev/input0" * CONFIG_NXWM_TOUCHSCREEN_SIGNO - The realtime signal used to wake up the * touchscreen listener thread. Default: 5 + * CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO - Priority of the touchscreen listener + * thread. Default: SCHED_PRIORITY_DEFAULT + * CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK - Touchscreen listener thread stack + * size. Default 2048 */ #ifndef CONFIG_NXWM_TOUCHSCREEN_DEVNO @@ -347,6 +351,14 @@ # define CONFIG_NXWM_TOUCHSCREEN_SIGNO 5 #endif +#ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO +# define CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO SCHED_PRIORITY_DEFAULT +#endif + +#ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK +# define CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK 2048 +#endif + /* Calibration display ******************************************************/ /** * Calibration display settings: @@ -363,6 +375,12 @@ * MKRGB(255, 255, 96) (very light yellow) * CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen * calibration application. Default: NxWM::g_calibrationBitmap + * CONFIG_NXWM_CALIBRATION_SIGNO - The realtime signal used to wake up the + * touchscreen calibration thread. Default: 5 + * CONFIG_NXWM_CALIBRATION_LISTENERPRIO - Priority of the touchscreen listener + * thread. Default: SCHED_PRIORITY_DEFAULT + * CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Touchscreen listener thread stack + * size. Default 2048 */ #ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR @@ -385,6 +403,18 @@ # define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap #endif +#ifndef CONFIG_NXWM_CALIBRATION_SIGNO +# define CONFIG_NXWM_CALIBRATION_SIGNO 5 +#endif + +#ifndef CONFIG_NXWM_CALIBRATION_LISTENERPRIO +# define CONFIG_NXWM_CALIBRATION_LISTENERPRIO SCHED_PRIORITY_DEFAULT +#endif + +#ifndef CONFIG_NXWM_CALIBRATION_LISTENERSTACK +# define CONFIG_NXWM_CALIBRATION_LISTENERSTACK 2048 +#endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index d2190cd24..60ab5a3d3 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -424,6 +424,19 @@ void CApplicationWindow::setWindowLabel(NXWidgets::CNxString &appname) m_windowLabel->setText(appname); } +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CApplicationWindow::isFullScreen(void) const +{ + return false; +} + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 1fc9f3466..2f9adb2e0 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -37,8 +37,11 @@ * Included Files ****************************************************************************/ +#include +#include + +#include #include -#include #include #include "nxwmconfig.hxx" @@ -78,18 +81,23 @@ using namespace NxWM; /** * CCalibration Constructor * + * @param taskbar. The taskbar instance used to terminate calibration * @param window. The window to use for the calibration display - * @param touchscreen. An instance of the class that wraps the touchscreen device. + * @param touchscreen. An instance of the class that wraps the touchscreen + * device. */ -CCalibration::CCalibration(CFullScreenWindow *window, CTouchscreen *touchscreen) +CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, + CTouchscreen *touchscreen) { // Initialize state data + m_taskbar = taskbar; m_window = window; m_touchscreen = touchscreen; - m_state = CALIB_NOT_STARTED; - m_stop = false; + m_thread = 0; + m_calthread = CALTHREAD_NOTRUNNING; + m_calphase = CALPHASE_NOT_STARTED; m_touched = false; } @@ -150,27 +158,9 @@ NXWidgets::CNxString CCalibration::getName(void) bool CCalibration::run(void) { - // Provide the initial display + gvdbg("Starting calibration: m_calthread=%d\n", (int)m_calthread); - m_state = CALIB_NOT_STARTED; - stateMachine(); - - // Loop until calibration completes - - while (!m_stop && m_state != CALIB_COMPLETE) - { - // Wait for the next raw touchscreen input - - struct touch_sample_s sample; - while (!m_touchscreen->waitRawTouchData(&sample)); - - // Then process the raw touchscreen input - - touchscreenInput(sample); - } - - m_stop = false; - return true; + return startCalibration(CALTHREAD_STARTED); } /** @@ -179,10 +169,29 @@ bool CCalibration::run(void) void CCalibration::stop(void) { - // The main thread is stuck waiting for the next touchscreen input... - // So this is probably just a waste of good FLASH space. + gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); - m_stop = true; + // Was the calibration thread created? + + if (m_thread != 0) + { + // Is the calibration thread running? + + if (isRunning()) + { + // The main thread is stuck waiting for the next touchscreen input... + // We can signal that we would like the thread to stop, but we will be + // stuck here until the next touch + + m_calthread = CALTHREAD_STOPREQUESTED; + + // Try to wake up the calibration thread so that it will see our + // terminatin request + + gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); + (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); + } + } } /** @@ -192,7 +201,17 @@ void CCalibration::stop(void) void CCalibration::hide(void) { - // REVISIT + gvdbg("Entry\n"); + + // Is the calibration thread running? + + if (m_calthread == CALTHREAD_RUNNING || m_calthread == CALTHREAD_SHOW) + { + // Ask the calibration thread to hide the display + + m_calthread = CALTHREAD_HIDE; + (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); + } } /** @@ -203,89 +222,43 @@ void CCalibration::hide(void) void CCalibration::redraw(void) { - // Reset the state machine and start over + gvdbg("Entry\n"); - if (m_state != CALIB_COMPLETE) + // Is the calibration thread running? We might have to restart it if + // we have completed the calibration early but are being brought to + // top of the display again + + // Is the calibration thread running? + + if (!isRunning()) { - m_state = CALIB_NOT_STARTED; - stateMachine(); + gvdbg("Starting calibration: m_calthread=%d\n", (int)m_calthread); + (void)startCalibration(CALTHREAD_SHOW); + } + + // The calibration thread is running. Make sure that is is not + // already processing a redraw + + else if (m_calthread != CALTHREAD_SHOW) + { + // Ask the calibration thread to restart the calibration and redraw the display + + m_calthread = CALTHREAD_SHOW; + (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); } } /** - * Wait for calibration data to be received. + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. * - * @return True if the calibration data was successfully obtained. + * @return True if this is a full screen window. */ -bool CCalibration::waitCalibrationData(struct SCalibrationData &data) +bool CCalibration::isFullScreen(void) const { - // Wait until calibration is finished - - while (m_state != CALIB_COMPLETE) - { -#ifdef CONFIG_DEBUG - int ret = sem_wait(&m_waitSem); - DEBUGASSERT(ret == 0 || errno == EINTR); -#else - (void)sem_wait(&m_waitSem); -#endif - } - - // Recover the window instance contained in the full screen window - - NXWidgets::INxWindow *window = m_window->getWindow(); - - // Get the size of the fullscreen window - - struct nxgl_size_s windowSize; - if (!window->getSize(&windowSize)) - { - return false; - } - - // Calculate the calibration parameters - // - // (scaledX - LEFTX) / (rawX - leftX) = (RIGHTX - LEFTX) / (rightX - leftX) - // scaledX = (rawX - leftX) * (RIGHTX - LEFTX) / (rightX - leftX) + LEFTX - // = rawX * xSlope + (LEFTX - leftX * xSlope) - // = rawX * xSlope + xOffset - // - // where: - // xSlope = (RIGHTX - LEFTX) / (rightX - leftX) - // xOffset = (LEFTX - leftX * xSlope) - - b16_t leftX = (m_calibData[CALIB_UPPER_LEFT_INDEX].x + - m_calibData[CALIB_LOWER_LEFT_INDEX].x) << 15; - b16_t rightX = (m_calibData[CALIB_UPPER_RIGHT_INDEX].x + - m_calibData[CALIB_LOWER_RIGHT_INDEX].x) << 15; - - data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); - data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - - gdbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); - - // Similarly for Y - // - // (scaledY - TOPY) / (rawY - topY) = (BOTTOMY - TOPY) / (bottomY - topY) - // scaledY = (rawY - topY) * (BOTTOMY - TOPY) / (bottomY - topY) + TOPY - // = rawY * ySlope + (TOPY - topY * ySlope) - // = rawY * ySlope + yOffset - // - // where: - // ySlope = (BOTTOMY - TOPY) / (bottomY - topY) - // yOffset = (TOPY - topY * ySlope) - - b16_t topY = (m_calibData[CALIB_UPPER_LEFT_INDEX].y + - m_calibData[CALIB_UPPER_RIGHT_INDEX].y) << 15; - b16_t bottomY = (m_calibData[CALIB_LOWER_LEFT_INDEX].y + - m_calibData[CALIB_LOWER_RIGHT_INDEX].y) << 15; - - data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); - data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - - gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); - return true; + return m_window->isFullScreen(); } /** @@ -347,7 +320,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) // Yes.. invoke the state machine. gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", - m_state, m_screenInfo.pos.x, m_screenInfo.pos.y, + m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y, m_touchPos.x, m_touchPos.y); stateMachine(); @@ -367,6 +340,139 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) } } +/** + * Start the calibration thread. + * + * @param initialState. The initial state of the calibration thread + * @return True if the thread was successfully started. + */ + +bool CCalibration::startCalibration(enum ECalThreadState initialState) +{ + + // Verify that the thread is not already running + + if (isRunning()) + { + gdbg("The calibration thread is already running\n"); + return false; + } + + // Configure the calibration thread + + pthread_attr_t attr; + (void)pthread_attr_init(&attr); + + struct sched_param param; + param.sched_priority = CONFIG_NXWM_CALIBRATION_LISTENERPRIO; + (void)pthread_attr_setschedparam(&attr, ¶m); + + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWM_CALIBRATION_LISTENERSTACK); + + // Set the initial state of the thread + + m_calthread = initialState; + + // Start the thread that will perform the calibration process + + int ret = pthread_create(&m_thread, &attr, calibration, (FAR void *)this); + if (ret != 0) + { + gdbg("pthread_create failed: %d\n", ret); + return false; + } + + // Detach from the pthread so that we do not have any memory leaks + + (void)pthread_detach(m_thread); + + gvdbg("Calibration thread m_calthread=%d\n", (int)m_calthread); + return true; +} + +/** + * The calibration thread. This is the entry point of a thread that provides the + * calibration displays, waits for input, and collects calibration data. + * + * @param arg. The CCalibration 'this' pointer cast to a void*. + * @return This function always returns NULL when the thread exits + */ + +FAR void *CCalibration::calibration(FAR void *arg) +{ + CCalibration *This = (CCalibration *)arg; + bool stalled = true; + + // The calibration thread is now running + + This->m_calthread = CALTHREAD_RUNNING; + This->m_calphase = CALPHASE_NOT_STARTED; + gvdbg("Started: m_calthread=%d\n", (int)This->m_calthread); + + // Loop until calibration completes or we have been requested to terminate + + while (This->m_calthread != CALTHREAD_STOPREQUESTED && + This->m_calphase != CALPHASE_COMPLETE) + { + // Check for state changes due to display order changes + + if (This->m_calthread == CALTHREAD_HIDE) + { + // This state is set by hide() when our display is no longer visible + + This->m_calthread = CALTHREAD_RUNNING; + This->m_calphase = CALPHASE_NOT_STARTED; + stalled = true; + } + else if (This->m_calthread == CALTHREAD_SHOW) + { + // This state is set by redraw() when our display has become visible + + This->m_calthread = CALTHREAD_RUNNING; + This->m_calphase = CALPHASE_NOT_STARTED; + stalled = false; + This->stateMachine(); + } + + // The calibration thread will stall if has been asked to hide the + // display. While stalled, we will just sleep for a bit abd test + // the state again. If we are re-awakened by a redraw(), then we + // will be given a signal which will wake us up immediately. + // + // Note that stalled is also initially true so we have to receive + // redraw() before we attempt to draw anything + + if (stalled) + { + // Sleep for a while (or until we receive a signal) + + std::usleep(500*1000); + } + else + { + // Wait for the next raw touchscreen input (or possibly a signal) + + struct touch_sample_s sample; + while (!This->m_touchscreen->waitRawTouchData(&sample) && + This->m_calthread == CALTHREAD_RUNNING); + + // Then process the raw touchscreen input + + if (This->m_calthread == CALTHREAD_RUNNING) + { + This->touchscreenInput(sample); + } + } + } + + // Perform the final steps of calibration + + This->finishCalibration(); + + gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread); + return (FAR void *)0; +} + /** * This is the calibration state machine. It is called initially and then * as new touchscreen data is received. @@ -374,6 +480,8 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) void CCalibration::stateMachine(void) { + gvdbg("Old m_calphase=%d\n", m_calphase); + // Recover the window instance contained in the full screen window NXWidgets::INxWindow *window = m_window->getWindow(); @@ -386,10 +494,10 @@ void CCalibration::stateMachine(void) return; } - switch (m_state) + switch (m_calphase) { default: - case CALIB_NOT_STARTED: + case CALPHASE_NOT_STARTED: { // Clear the entire screen // Get the widget control associated with the full screen window @@ -415,13 +523,13 @@ void CCalibration::stateMachine(void) // Then set up the current state - m_state = CALIB_UPPER_LEFT; + m_calphase = CALPHASE_UPPER_LEFT; } break; - case CALIB_UPPER_LEFT: + case CALPHASE_UPPER_LEFT: { - // A touch has been received while in the CALIB_UPPER_LEFT state. + // A touch has been received while in the CALPHASE_UPPER_LEFT state. // Save the touch data and set up the next calibration display m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x; @@ -444,13 +552,13 @@ void CCalibration::stateMachine(void) // Then set up the current state - m_state = CALIB_UPPER_RIGHT; + m_calphase = CALPHASE_UPPER_RIGHT; } break; - case CALIB_UPPER_RIGHT: + case CALPHASE_UPPER_RIGHT: { - // A touch has been received while in the CALIB_UPPER_RIGHT state. + // A touch has been received while in the CALPHASE_UPPER_RIGHT state. // Save the touch data and set up the next calibration display m_calibData[CALIB_UPPER_RIGHT_INDEX].x = m_touchPos.x; @@ -473,13 +581,13 @@ void CCalibration::stateMachine(void) // Then set up the current state - m_state = CALIB_LOWER_RIGHT; + m_calphase = CALPHASE_LOWER_RIGHT; } break; - case CALIB_LOWER_RIGHT: + case CALPHASE_LOWER_RIGHT: { - // A touch has been received while in the CALIB_LOWER_RIGHT state. + // A touch has been received while in the CALPHASE_LOWER_RIGHT state. // Save the touch data and set up the next calibration display m_calibData[CALIB_LOWER_RIGHT_INDEX].x = m_touchPos.x; @@ -502,32 +610,38 @@ void CCalibration::stateMachine(void) // Then set up the current state - m_state = CALIB_LOWER_LEFT; + m_calphase = CALPHASE_LOWER_LEFT; } break; - case CALIB_LOWER_LEFT: + case CALPHASE_LOWER_LEFT: { - // A touch has been received while in the CALIB_LOWER_LEFT state. + // A touch has been received while in the CALPHASE_LOWER_LEFT state. // Save the touch data and set up the next calibration display m_calibData[CALIB_LOWER_LEFT_INDEX].x = m_touchPos.x; m_calibData[CALIB_LOWER_LEFT_INDEX].y = m_touchPos.y; + // Clear the previous screen by re-drawing it using the backgro9und + // color. That is much faster than clearing the whole display + + m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; + showCalibration(); + // Inform any waiter that calibration is complete - m_state = CALIB_COMPLETE; - sem_post(&m_waitSem); + m_calphase = CALPHASE_COMPLETE; } break; - case CALIB_COMPLETE: + case CALPHASE_COMPLETE: // Might happen... do nothing if it does break; } - gvdbg("State: %d Screen x: %d y: %d\n", - m_state, m_screenInfo.pos.x, m_screenInfo.pos.y); + gvdbg("New m_calphase=%d Screen x: %d y: %d\n", + m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y); } /** @@ -573,3 +687,105 @@ void CCalibration::showCalibration(void) port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h, m_screenInfo.lineColor); } + +/** + * Finish calibration steps and provide the calibration data to the + * touchscreen driver. + */ + +void CCalibration::finishCalibration(void) +{ + // Did we finish calibration successfully? + + if (m_calphase == CALPHASE_COMPLETE) + { + // Yes... Get the final Calibration data + + struct SCalibrationData caldata; + if (createCalibrationData(caldata)) + { + // And provide this to the touchscreen, enabling touchscreen processing + + m_touchscreen->setEnabled(false); + m_touchscreen->setCalibrationData(caldata); + m_touchscreen->setEnabled(true); + } + } + + // Remove the touchscreen application from the taskbar + + m_taskbar->stopApplication(this); + + // And set the terminated stated + + m_calthread = CALTHREAD_TERMINATED; +} + +/** + * Given the raw touch data collected by the calibration thread, create the + * massaged calibration data needed by CTouchscreen. + * + * @param data. A reference to the location to save the calibration data + * @return True if the calibration data was successfully created. + */ + +bool CCalibration::createCalibrationData(struct SCalibrationData &data) +{ + // Recover the window instance contained in the full screen window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the fullscreen window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + gdbg("NXWidgets::INxWindow::getSize failed\n"); + return false; + } + + // Calculate the calibration parameters + // + // (scaledX - LEFTX) / (rawX - leftX) = (RIGHTX - LEFTX) / (rightX - leftX) + // scaledX = (rawX - leftX) * (RIGHTX - LEFTX) / (rightX - leftX) + LEFTX + // = rawX * xSlope + (LEFTX - leftX * xSlope) + // = rawX * xSlope + xOffset + // + // where: + // xSlope = (RIGHTX - LEFTX) / (rightX - leftX) + // xOffset = (LEFTX - leftX * xSlope) + + b16_t leftX = (m_calibData[CALIB_UPPER_LEFT_INDEX].x + + m_calibData[CALIB_LOWER_LEFT_INDEX].x) << 15; + b16_t rightX = (m_calibData[CALIB_UPPER_RIGHT_INDEX].x + + m_calibData[CALIB_LOWER_RIGHT_INDEX].x) << 15; + + data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); + data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); + + gdbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + + // Similarly for Y + // + // (scaledY - TOPY) / (rawY - topY) = (BOTTOMY - TOPY) / (bottomY - topY) + // scaledY = (rawY - topY) * (BOTTOMY - TOPY) / (bottomY - topY) + TOPY + // = rawY * ySlope + (TOPY - topY * ySlope) + // = rawY * ySlope + yOffset + // + // where: + // ySlope = (BOTTOMY - TOPY) / (bottomY - topY) + // yOffset = (TOPY - topY * ySlope) + + b16_t topY = (m_calibData[CALIB_UPPER_LEFT_INDEX].y + + m_calibData[CALIB_UPPER_RIGHT_INDEX].y) << 15; + b16_t bottomY = (m_calibData[CALIB_LOWER_LEFT_INDEX].y + + m_calibData[CALIB_LOWER_RIGHT_INDEX].y) << 15; + + data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); + data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); + + gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + return true; +} + + diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index 2087543cd..7d63b02d7 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -137,6 +137,19 @@ void CFullScreenWindow::setWindowLabel(NXWidgets::CNxString &appname) { } +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CFullScreenWindow::isFullScreen(void) const +{ + return true; +} + /** * Register to receive callbacks when toolbar icons are selected */ diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 5ee12d36f..264845a03 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -326,6 +326,19 @@ void CNxConsole::redraw(void) nxcon_redraw(m_nxcon, &rect, false); } +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CNxConsole::isFullScreen(void) const +{ + return m_window->isFullScreen(); +} + /** * This is the NxConsole task. This function first redirects output to the * console window. diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index f907f6718..ceeff0d7b 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -279,6 +279,19 @@ void CStartWindow::redraw(void) } } +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CStartWindow::isFullScreen(void) const +{ + return m_window->isFullScreen(); +} + /** * Add the application to the start window. The general sequence for * setting up the start window is: diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index f5a5c08f5..3305b945b 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -39,6 +39,8 @@ #include +#include + #include #include "crect.hxx" @@ -235,16 +237,75 @@ bool CTaskbar::startWindowManager(void) m_started = true; - // Draw the taskbar + // Decide which application will be the initial 'top' application - if (!redrawTaskbarWindow()) + m_topApp = (IApplication *)0; + int topIndex = -1; + + // No.. Search for that last, non-minimized application (there might not be one) + + for (int i = m_slots.size() - 1; i >= 0; i--) { - return false; + IApplication *candidate = m_slots.at(i).app; + if (!candidate->isMinimized()) + { + m_topApp = candidate; + topIndex = i; + break; + } + } + gvdbg("m_topApp=%p topIndex=%d\n", m_topApp, topIndex); + + // Now start each application (whatever that means to the application) + + for (int i = 0; i < m_slots.size(); ) + { + IApplication *app = m_slots.at(i).app; + + gvdbg("Starting app[%d]\n", i); + if (!app->run()) + { + // Call stopApplication on a failure to start. This will call + // app->stop() (which is probably not necesary for the application + // but it should be prepared/ to handle it). stopApplication() + // will also removed the icon image from the list and delete it. + + stopApplication(app); + + // Then continue with the next application. Notice that i is + // not incremented in this case and we will continue with the + // next application which will not be at this same index + + continue; + } + + // Hide all appliations except for the top application + + if (i != topIndex) + { + // Bring the application up in the non-visible state (the + // application may or may not be minimized, but it is not + // visible now). + + gvdbg("Hiding app[%d]\n", i); + hideApplicationWindow(app); + } + else + { + // Bring up the application as the new top application + + gvdbg("Showing app[%d]\n", i); + topApplication(app); + } + + // The application was successfully initialized.. index to the next application + + i++; } - // Draw the top application window + // Draw the taskbar. It will be draw at a higher level than the application. - return redrawTopWindow(); + return redrawTaskbarWindow(); } return false; @@ -391,41 +452,48 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) slot.image = image; m_slots.push_back(slot); - // Start the application (whatever that means). + // Initialize the application states - if (!app->run()) - { - // Call stopApplication on a failure to start. This will call - // app->stop() (which is probably not necesary for the application - // but it should be prepared/ to handle it). stopApplication() - // will also removed the icon image from the list and delete it. + app->setTopApplication(false); + app->setMinimized(minimized); - stopApplication(app); - return false; - } - - // Has the window manager been started? Or were we ask to start - // the application minimized? - - if (minimized || !m_started) - { - // Bring the application up in the minimized state - - hideApplicationWindow(app); - } - else - { - // Bring up the application as the new top application - - app->setTopApplication(false); - app->setMinimized(false); - topApplication(app); - } - - // Redraw the task bar with the new icon (if we have been started) + // Has the window manager been started? if (m_started) { + // Yes.. Start the application (whatever that means). + + if (!app->run()) + { + // Call stopApplication on a failure to start. This will call + // app->stop() (which is probably not necesary for the application + // but it should be prepared/ to handle it). stopApplication() + // will also removed the icon image from the list and delete it. + + stopApplication(app); + return false; + } + + // Has the window manager been started? Or were we ask to start + // the application minimized? + + if (minimized) + { + // Bring the minimized application up in non-visible state + + hideApplicationWindow(app); + } + else + { + // Bring up the application as the new top application if we are running + // If not, we will select and bring up the top application when the + // window manager is started + + topApplication(app); + } + + // Redraw the task bar with the new icon (if we have been started) + redrawTaskbarWindow(); } @@ -451,7 +519,11 @@ bool CTaskbar::topApplication(IApplication *app) if (m_topApp) { - // Yes.. then disable it + // Yes.. then minimize the application + + app->setMinimized(true); + + // And make the application non-visible hideApplicationWindow(m_topApp); } @@ -501,6 +573,7 @@ bool CTaskbar::minimizeApplication(IApplication *app) // No, then we are going to minimize it but disabling its components, // marking it as minimized, then raising a new window to the top window. + app->setMinimized(true); hideApplicationWindow(app); // Re-draw the new top, non-minimized application @@ -521,13 +594,22 @@ bool CTaskbar::minimizeApplication(IApplication *app) bool CTaskbar::stopApplication(IApplication *app) { - // First, minimize the application. That will move the application - // to the bottom of the hiearachy and redraw the next application - // (If the application is already minimized, it does nothing) + // Make the application minimized and make sure that it is not the top + // application. - minimizeApplication(app); + app->setMinimized(true); + if (app->isTopApplication()) + { + app->setTopApplication(false); + m_topApp = (IApplication *)0; + } + + // Hide the application window. That will move the application to the + // bottom of the hiearachy. - // Stop the application + hideApplicationWindow(app); + + // Stop the application (whatever this means to the application) app->stop(); @@ -540,7 +622,7 @@ bool CTaskbar::stopApplication(IApplication *app) IApplication *candidate = m_slots.at(i).app; if (candidate == app) { - // Yes.. found it. Delete the icon image and remove it + // Yes.. found it. Delete the icon image and remove the entry // from the list of applications delete m_slots.at(i).image; @@ -549,9 +631,16 @@ bool CTaskbar::stopApplication(IApplication *app) } } - // And redraw the task bar (without the icon for this task) + // Re-draw the new top, non-minimized application - return redrawTaskbarWindow(); + bool ret = redrawTopWindow(); + if (ret) + { + // And redraw the task bar (without the icon for this task) + + ret = redrawTaskbarWindow(); + } + return ret; } /** @@ -895,115 +984,125 @@ bool CTaskbar::createBackgroundImage(void) bool CTaskbar::redrawTaskbarWindow(void) { - // Get the widget control from the task bar + // Only redraw the task bar if (1) the window manager has been started, AND + // (2) there is no top window (i.e., we are showing the background image), OR + // (3) there is a top window, but it is not full screen - NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); - - // Get the graphics port for drawing on the background window - - NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); - - // Get the size of the window - - struct nxgl_size_s windowSize; - if (!m_taskbar->getSize(&windowSize)) + if (m_started && (!m_topApp || !m_topApp->isFullScreen())) { - return false; + // Get the widget control from the task bar + + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + + // Get the graphics port for drawing on the background window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!m_taskbar->getSize(&windowSize)) + { + return false; + } + + // Raise the task bar to the top of the display. This is only necessary + // after stopping a full screen application. Other applications do not + // overlap the task bar and, hence, do not interfere. + + m_taskbar->raise(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + + // Add a border to the task bar to delineate it from the background window + + port->drawBevelledRect(0, 0, windowSize.w, windowSize.h, + CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR, + CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR); + + // Begin adding icons in the upper left corner + + struct nxgl_point_s taskbarPos; +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + taskbarPos.x = CONFIG_NXWM_TASKBAR_HSPACING; + taskbarPos.y = 0; +#else + taskbarPos.x = 0; + taskbarPos.y = CONFIG_NXWM_TASKBAR_VSPACING; +#endif + + // Add each icon in the list of applications + + for (int i = 0; i < m_slots.size(); i++) + { + // Get the icon associated with this application + + NXWidgets::CImage *image = m_slots.at(i).image; + + // Disable drawing of the icon image; disable events from the icon + + image->disableDrawing(); + image->setRaisesEvents(false); + + // Get the size of the icon image + + NXWidgets::CRect rect; + image->getPreferredDimensions(rect); + + // Position the icon + + struct nxgl_point_s iconPos; + +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + // For horizontal task bars, the icons will be aligned along the top of + // the task bar + + iconPos.x = taskbarPos.x; + iconPos.y = taskbarPos.y + CONFIG_NXWM_TASKBAR_VSPACING; +#else + // For vertical task bars, the icons will be centered horizontally + + iconPos.x = (windowSize.w - rect.getWidth()) >> 1; + iconPos.y = taskbarPos.y; +#endif + + // Set the position of the icon bitmap + + (void)image->moveTo(iconPos.x, iconPos.y); + + // Then re-draw the icon at the new position + + image->enableDrawing(); + image->redraw(); + image->setRaisesEvents(true); + + // Do we add icons left-to-right? Or top-to-bottom? + +#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) + // left-to-right ... increment the X display position + + taskbarPos.x += rect.getWidth() + CONFIG_NXWM_TASKBAR_HSPACING; + if (taskbarPos.x > windowSize.w) + { + break; + } +#else + // top-to-bottom ... increment the Y display position + + taskbarPos.y += rect.getHeight() + CONFIG_NXWM_TASKBAR_VSPACING; + if (taskbarPos.y > windowSize.h) + { + break; + } +#endif + } } - // Raise the task bar to the top of the display. This is only necessary - // after stopping a full screen application. Other applications do not - // overlap the task bar and, hence, do not interfere. - - m_taskbar->raise(); - - // Fill the entire window with the background color - - port->drawFilledRect(0, 0, windowSize.w, windowSize.h, - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); - - // Add a border to the task bar to delineate it from the background window - - port->drawBevelledRect(0, 0, windowSize.w, windowSize.h, - CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR, - CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR); - - // Begin adding icons in the upper left corner - - struct nxgl_point_s taskbarPos; -#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) - taskbarPos.x = CONFIG_NXWM_TASKBAR_HSPACING; - taskbarPos.y = 0; -#else - taskbarPos.x = 0; - taskbarPos.y = CONFIG_NXWM_TASKBAR_VSPACING; -#endif - - // Add each icon in the list of applications - - for (int i = 0; i < m_slots.size(); i++) - { - // Get the icon associated with this application - - NXWidgets::CImage *image = m_slots.at(i).image; - - // Disable drawing of the icon image; disable events from the icon - - image->disableDrawing(); - image->setRaisesEvents(false); - - // Get the size of the icon image - - NXWidgets::CRect rect; - image->getPreferredDimensions(rect); - - // Position the icon - - struct nxgl_point_s iconPos; - -#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) - // For horizontal task bars, the icons will be aligned along the top of - // the task bar - - iconPos.x = taskbarPos.x; - iconPos.y = taskbarPos.y + CONFIG_NXWM_TASKBAR_VSPACING; -#else - // For vertical task bars, the icons will be centered horizontally - - iconPos.x = (windowSize.w - rect.getWidth()) >> 1; - iconPos.y = taskbarPos.y; -#endif - - // Set the position of the icon bitmap - - (void)image->moveTo(iconPos.x, iconPos.y); - - // Then re-draw the icon at the new position - - image->enableDrawing(); - image->redraw(); - image->setRaisesEvents(true); - - // Do we add icons left-to-right? Or top-to-bottom? - -#if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) - // left-to-right ... increment the X display position - - taskbarPos.x += rect.getWidth() + CONFIG_NXWM_TASKBAR_HSPACING; - if (taskbarPos.x > windowSize.w) - { - break; - } -#else - // top-to-bottom ... increment the Y display position - - taskbarPos.y += rect.getHeight() + CONFIG_NXWM_TASKBAR_VSPACING; - if (taskbarPos.y > windowSize.h) - { - break; - } -#endif - } + // Return success (it is not a failure if the window manager is not started + // or the task bar is occluded by a full screen window. return true; } @@ -1158,10 +1257,6 @@ void CTaskbar::hideApplicationWindow(IApplication *app) app->setTopApplication(false); } - // Make sure that the application is marked as minimized. - - app->setMinimized(true); - // We do not need to lower the application to the back.. the new top // window will be raised instead. // diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 21ccc91e3..1a8a5e967 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -159,17 +159,17 @@ bool CTouchscreen::start(void) (void)pthread_attr_init(&attr); struct sched_param param; - param.sched_priority = CONFIG_NXWIDGETS_LISTENERPRIO; + param.sched_priority = CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO; (void)pthread_attr_setschedparam(&attr, ¶m); - (void)pthread_attr_setstacksize(&attr, CONFIG_NXWIDGETS_LISTENERSTACK); + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK); m_state = LISTENER_STARTED; // The listener thread has been started, but is not yet running int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - dbg("NxServer::connect: pthread_create failed: %d\n", ret); + dbg("CTouchscreen::start: pthread_create failed: %d\n", ret); return false; } @@ -204,7 +204,7 @@ bool CTouchscreen::start(void) * @param data. A reference to the touchscreen data. */ -void CTouchscreen::setCalibrationData(struct SCalibrationData &caldata) +void CTouchscreen::setCalibrationData(const struct SCalibrationData &caldata) { // Save a copy of the calibration data From a23a99c97c9bd5d7662f91de8ce89ddf865f51f9 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 14 May 2012 21:57:38 +0000 Subject: [PATCH 054/390] Improved thresholding logic in the STMPE11 driver; NxWM: Oops minimizing wrong application git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4737 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 1 + nxwm/src/capplicationwindow.cxx | 2 +- nxwm/src/cnxconsole.cxx | 2 +- nxwm/src/ctaskbar.cxx | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5b14799bd..b6d2cf9f8 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -83,3 +83,4 @@ these: Now support method to report if the application is a full-screen or a normal application. This is necessary to prevent CTaskbar from displaying a task bar on top of a full-screen window. +* NxWM::CTaskbar: Ooops... minimizing the wrong application! diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 60ab5a3d3..320559ef7 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 264845a03..0d0f8e60e 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 3305b945b..b15916b0a 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -521,7 +521,7 @@ bool CTaskbar::topApplication(IApplication *app) { // Yes.. then minimize the application - app->setMinimized(true); + m_topApp->setMinimized(true); // And make the application non-visible From 3c23ea4f5ef13968f45ac87401b2214e5c12a8ad Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 May 2012 00:45:14 +0000 Subject: [PATCH 055/390] Fix several compiler errors that occur when CONFIG_SCHED_ONEXIT is enabled; on_exit is now used in NxWM::NxConsole to close the window with the NSH session exits git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4738 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 + nxwm/include/cnxconsole.hxx | 15 +++-- nxwm/include/nxwmconfig.hxx | 11 ++++ nxwm/src/cnxconsole.cxx | 119 +++++++++++++++++++++++++----------- 4 files changed, 108 insertions(+), 40 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b6d2cf9f8..733924248 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -84,3 +84,6 @@ or a normal application. This is necessary to prevent CTaskbar from displaying a task bar on top of a full-screen window. * NxWM::CTaskbar: Ooops... minimizing the wrong application! +* NxWM::CNxConsole: Add a on_exit() exit handler that will close the + NxConsole window when the NSH thread exits. A correct build now depends + on having CONFIG_SCHED_ONEXIT defined. diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 426cf165f..91fb941d8 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -83,13 +83,20 @@ namespace NxWM 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. - */ + /** + * This is the NxConsole task. This function first redirects output to the + * console window then calls to start the NSH logic. + */ static int nxconsole(int argc, char *argv[]); + /** + * This is the NxConsole task exit handler. It is registered with on_exit() + * and called automatically when the nxconsole task exits. + */ + + static void exitHandler(int code, FAR void *arg); + /** * Called when the window minimize button is pressed. */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 88c2ea8db..34721d777 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -58,6 +58,7 @@ * CONFIG_NX : NX must enabled * CONFIG_NX_MULTIUSER=y : NX must be configured in multiuse mode * CONFIG_NXCONSOLE=y : For NxConsole support + * CONFIG_SCHED_ONEXIT : Support for on_exit() * * General settings: * @@ -90,6 +91,16 @@ # warning "NxConsole support may be needed (CONFIG_NXCONSOLE)" #endif +/** + * on_exit() support is (probably) required. on_exit() is the normal + * mechanism used by NxWM applications to clean-up on a application task + * exit. + */ + +#ifndef CONFIG_SCHED_ONEXIT +# warning "on_exit() support may be needed (CONFIG_SCHED_ONEXIT)" +#endif + /** * Default font ID */ diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 0d0f8e60e..79baf67d9 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -73,12 +73,14 @@ namespace NxWM struct SNxConsole { - sem_t sem; /**< Sem that posted when the task is initialized */ - NXTKWINDOW hwnd; /**< Window handle */ - NXCONSOLE nxcon; /**< NxConsole handle */ - int minor; /**< Next device minor number */ - struct nxcon_window_s wndo; /**< Describes the NxConsole window */ - bool result; /**< True if successfully initialized */ + FAR void *console; /**< The console 'this' pointer use with on_exit() */ + sem_t exclSem; /**< Sem that gives exclusive access to this structure */ + sem_t waitSem; /**< Sem that posted when the task is initialized */ + NXTKWINDOW hwnd; /**< Window handle */ + NXCONSOLE nxcon; /**< NxConsole handle */ + int minor; /**< Next device minor number */ + struct nxcon_window_s wndo; /**< Describes the NxConsole window */ + bool result; /**< True if successfully initialized */ }; /******************************************************************************************** @@ -200,6 +202,15 @@ bool CNxConsole::run(void) return false; } + // Get exclusive access to the global data structure + + if (sem_wait(&g_nxconvars.exclSem) != 0) + { + // This might fail if a signal is received while we are waiting. + + return false; + } + // Recover the NXTK window instance contained in the application window NXWidgets::INxWindow *window = m_window->getWindow(); @@ -224,8 +235,9 @@ bool CNxConsole::run(void) // Start the NxConsole task - g_nxconvars.result = false; - g_nxconvars.nxcon = 0; + g_nxconvars.console = (FAR void *)this; + g_nxconvars.result = false; + g_nxconvars.nxcon = 0; sched_lock(); m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, @@ -234,34 +246,39 @@ bool CNxConsole::run(void) // Did we successfully start the NxConsole task? + bool result = true; if (m_pid < 0) { - return false; - } - - // Wait for up to two second for the task to initialize - - struct timespec abstime; - clock_gettime(CLOCK_REALTIME, &abstime); - abstime.tv_sec += 2; - - int ret = sem_timedwait(&g_nxconvars.sem, &abstime); - sched_unlock(); - - if (ret == OK && g_nxconvars.result) - { - // Save the handle to use in the stop method - - m_nxcon = g_nxconvars.nxcon; - return true; + result = false; } else { - // Stop the application + // Wait for up to two seconds for the task to initialize - stop(); - return false; + struct timespec abstime; + clock_gettime(CLOCK_REALTIME, &abstime); + abstime.tv_sec += 2; + + int ret = sem_timedwait(&g_nxconvars.waitSem, &abstime); + sched_unlock(); + + if (ret == OK && g_nxconvars.result) + { + // Save the handle to use in the stop method + + m_nxcon = g_nxconvars.nxcon; + } + else + { + // Stop the application + + stop(); + result = false; + } } + + sem_post(&g_nxconvars.exclSem); + return result; } /** @@ -270,7 +287,7 @@ bool CNxConsole::run(void) void CNxConsole::stop(void) { - // Delete the NxConsole task if it is still running (this could strand resources) + // Delete the NxConsole task if it is still running (this could strand resources). if (m_pid >= 0) { @@ -341,7 +358,7 @@ bool CNxConsole::isFullScreen(void) const /** * This is the NxConsole task. This function first redirects output to the - * console window. + * console window then calls to start the NSH logic. */ int CNxConsole::nxconsole(int argc, char *argv[]) @@ -351,6 +368,13 @@ int CNxConsole::nxconsole(int argc, char *argv[]) int fd = -1; + // Set up an on_exit() event that will be called when this task exits + + if (on_exit(exitHandler, g_nxconvars.console) != 0) + { + goto errout; + } + // Use the window handle to create the NX console g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &g_nxconvars.wndo, @@ -401,7 +425,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) // Inform the parent thread that we successfully initialized g_nxconvars.result = true; - sem_post(&g_nxconvars.sem); + sem_post(&g_nxconvars.waitSem); // Run the NSH console @@ -409,8 +433,10 @@ int CNxConsole::nxconsole(int argc, char *argv[]) (void)nsh_consolemain(argc, argv); #endif - // We get here if console exits -#warning "Missing logic" + // We get here if the NSH console should exits. nsh_consolemain() ALWAYS + // exits by calling nsh_exit() (which is a pointer to nsh_consoleexit()) + // which, in turn, calls exit() + return EXIT_SUCCESS; errout_with_nxcon: @@ -419,10 +445,30 @@ errout_with_nxcon: errout: g_nxconvars.nxcon = 0; g_nxconvars.result = false; - sem_post(&g_nxconvars.sem); + sem_post(&g_nxconvars.waitSem); return EXIT_FAILURE; } +/** + * This is the NxConsole task exit handler. It registered with on_exit() + * and called automatically when the nxconsole task exits. + */ + +void CNxConsole::exitHandler(int code, FAR void *arg) +{ + CNxConsole *This = (CNxConsole *)arg; + + // Set m_pid to -1 to prevent calling detlete_task() in CNxConsole::stop(). + // CNxConsole::stop() is called by the processing initiated by the following + // call to CTaskbar::stopApplication() + + This->m_pid = -1; + + // Remove the NxConsole application from the taskbar + + This->m_taskbar->stopApplication(This); +} + /** * Called when the window minimize button is pressed. */ @@ -452,7 +498,8 @@ bool NxWM::nshlibInitialize(void) { // Initialize the global data structure - sem_init(&g_nxconvars.sem, 0, 0); + sem_init(&g_nxconvars.exclSem, 0, 1); + sem_init(&g_nxconvars.waitSem, 0, 0); // Initialize the NSH library From 074a88c409c509e22ccc6c63a14f7e38734e67e0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 May 2012 01:20:34 +0000 Subject: [PATCH 056/390] NxWM::CNxConsole when NSH window is closed by touching toolbar icon, need to suppress certain activities performed by the on_exit() handler git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4739 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/src/cnxconsole.cxx | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 79baf67d9..855bd3d0b 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -287,12 +287,23 @@ bool CNxConsole::run(void) void CNxConsole::stop(void) { - // Delete the NxConsole task if it is still running (this could strand resources). + // Delete the NxConsole task if it is still running (this could strand + // resources). If we get here due to CTaskbar::stopApplication() processing + // initialed by CNxConsole::exitHandler, then do *not* delete the task (it + // is already being delete). if (m_pid >= 0) { - task_delete(m_pid); + // Calling task_delete() will also invoke the on_exit() handler. We se + // m_pid = -1 before calling task_delete() to let the on_exit() handler, + // CNxConsole::exitHandler(), know that it should not do anything + + pid_t pid = m_pid; m_pid = -1; + + // Then delete the NSH task, possibly stranding resources + + task_delete(pid); } // Destroy the NX console device @@ -458,15 +469,22 @@ void CNxConsole::exitHandler(int code, FAR void *arg) { CNxConsole *This = (CNxConsole *)arg; - // Set m_pid to -1 to prevent calling detlete_task() in CNxConsole::stop(). - // CNxConsole::stop() is called by the processing initiated by the following - // call to CTaskbar::stopApplication() + // If we got here because of the task_delete() call in CNxConsole::stop(), + // then m_pid will be set to -1 to let us know that we do not need to do + // anything - This->m_pid = -1; + if (This->m_pid >= 0) + { + // Set m_pid to -1 to prevent calling detlete_task() in CNxConsole::stop(). + // CNxConsole::stop() is called by the processing initiated by the following + // call to CTaskbar::stopApplication() - // Remove the NxConsole application from the taskbar + This->m_pid = -1; - This->m_taskbar->stopApplication(This); + // Remove the NxConsole application from the taskbar + + This->m_taskbar->stopApplication(This); + } } /** From 4c27a000d0c4b5b626db7ad7edb4e28fd0cfbff6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 May 2012 16:40:43 +0000 Subject: [PATCH 057/390] NxWidgets: New pre-release event. Action now raised on pre-release. NxWM: Use action event to process icon touches; Fix initialization of image highlighted state. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4740 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/cbutton.hxx | 11 +++++++- libnxwidgets/include/cbuttonarray.hxx | 11 +++++++- libnxwidgets/include/cimage.hxx | 15 ++++++++-- libnxwidgets/include/cnxwidget.hxx | 17 ++++++++++-- libnxwidgets/include/crlepalettebitmap.hxx | 2 +- libnxwidgets/include/cwidgeteventhandler.hxx | 2 +- libnxwidgets/src/cbitmap.cxx | 2 +- libnxwidgets/src/cbutton.cxx | 15 ++++++++-- libnxwidgets/src/cbuttonarray.cxx | 16 +++++++++-- libnxwidgets/src/cimage.cxx | 29 +++++++++++++++----- libnxwidgets/src/cnxwidget.cxx | 21 ++++++++++++-- libnxwidgets/src/crlepalettebitmap.cxx | 2 +- libnxwidgets/src/cwidgetcontrol.cxx | 2 +- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 2 +- nxwm/include/capplicationwindow.hxx | 4 +-- nxwm/include/cstartwindow.hxx | 4 +-- nxwm/include/ctaskbar.hxx | 4 +-- nxwm/src/capplicationwindow.cxx | 4 +-- nxwm/src/cstartwindow.cxx | 8 +++--- nxwm/src/ctaskbar.cxx | 6 ++-- 20 files changed, 134 insertions(+), 43 deletions(-) diff --git a/libnxwidgets/include/cbutton.hxx b/libnxwidgets/include/cbutton.hxx index 4af39f0ef..45481387f 100644 --- a/libnxwidgets/include/cbutton.hxx +++ b/libnxwidgets/include/cbutton.hxx @@ -179,7 +179,16 @@ namespace NXWidgets virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/include/cbuttonarray.hxx b/libnxwidgets/include/cbuttonarray.hxx index 487a6cb9f..435fa1080 100644 --- a/libnxwidgets/include/cbuttonarray.hxx +++ b/libnxwidgets/include/cbuttonarray.hxx @@ -133,7 +133,16 @@ namespace NXWidgets virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 0b7be14f2..0fe275624 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -143,16 +143,25 @@ namespace NXWidgets virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the image. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. */ virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** - * Redraws the button. + * Redraws the image. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 38a66d155..2ca055c1c 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -296,9 +296,20 @@ namespace NXWidgets virtual inline void onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) { } /** - * Called when the widget is released. Override this when - * creating new widgets if the widget should exhibit additional - * behaviour when it is released. + * Called just before the widget is released; the widget will be in the + * clicked stated. Override this when creating new widgets if the + * widget should exhibit additional behaviour when it is released. + * + * @param x The x coordinate of the mouse when released. + * @param y The y coordinate of the mouse when released. + */ + + virtual inline void onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Called just after the widget is released; the widget will be in the + * released stated. Override this when creating new widgets if the + * widget should exhibit additional behaviour when it is released. * * @param x The x coordinate of the mouse when released. * @param y The y coordinate of the mouse when released. diff --git a/libnxwidgets/include/crlepalettebitmap.hxx b/libnxwidgets/include/crlepalettebitmap.hxx index 451b472f4..dd869c476 100644 --- a/libnxwidgets/include/crlepalettebitmap.hxx +++ b/libnxwidgets/include/crlepalettebitmap.hxx @@ -40,7 +40,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/include/cwidgeteventhandler.hxx b/libnxwidgets/include/cwidgeteventhandler.hxx index d176d8822..8883fa12d 100644 --- a/libnxwidgets/include/cwidgeteventhandler.hxx +++ b/libnxwidgets/include/cwidgeteventhandler.hxx @@ -270,7 +270,7 @@ namespace NXWidgets virtual void handleDoubleClickEvent(const CWidgetEventArgs &e) { } /** - * Handle a widget action event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ diff --git a/libnxwidgets/src/cbitmap.cxx b/libnxwidgets/src/cbitmap.cxx index 875e6daaa..c9c974814 100644 --- a/libnxwidgets/src/cbitmap.cxx +++ b/libnxwidgets/src/cbitmap.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cbutton.cxx b/libnxwidgets/src/cbutton.cxx index 66ad3f2c7..429905759 100644 --- a/libnxwidgets/src/cbutton.cxx +++ b/libnxwidgets/src/cbutton.cxx @@ -275,7 +275,19 @@ void CButton::onClick(nxgl_coord_t x, nxgl_coord_t y) } /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); +} + +/** + * Redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. @@ -283,7 +295,6 @@ void CButton::onClick(nxgl_coord_t x, nxgl_coord_t y) void CButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) { - m_widgetEventHandlers->raiseActionEvent(); redraw(); } diff --git a/libnxwidgets/src/cbuttonarray.cxx b/libnxwidgets/src/cbuttonarray.cxx index 263a16ce4..642a0a562 100644 --- a/libnxwidgets/src/cbuttonarray.cxx +++ b/libnxwidgets/src/cbuttonarray.cxx @@ -546,7 +546,19 @@ void CButtonArray::onClick(nxgl_coord_t x, nxgl_coord_t y) } /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CButtonArray::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); +} + +/** + * Redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. @@ -554,8 +566,6 @@ void CButtonArray::onClick(nxgl_coord_t x, nxgl_coord_t y) void CButtonArray::onRelease(nxgl_coord_t x, nxgl_coord_t y) { - m_widgetEventHandlers->raiseActionEvent(); - // Redraw only the button that was released m_redrawButton = true; diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 7d9e0ee4e..30bf7e78b 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -116,12 +116,16 @@ CImage::CImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, { // Save the IBitmap instance - m_bitmap = bitmap; + m_bitmap = bitmap; + + // Not highlighted + + m_highlighted = false; // Position the top/lef corner of the bitmap in the top/left corner of the display - m_origin.x = 0; - m_origin.y = 0; + m_origin.x = 0; + m_origin.y = 0; } /** @@ -385,7 +389,19 @@ void CImage::onClick(nxgl_coord_t x, nxgl_coord_t y) } /** - * Raises an action event and redraws the button. + * Raises an action. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CImage::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); +} + +/** + * Redraws the image. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. @@ -393,12 +409,11 @@ void CImage::onClick(nxgl_coord_t x, nxgl_coord_t y) void CImage::onRelease(nxgl_coord_t x, nxgl_coord_t y) { - m_widgetEventHandlers->raiseActionEvent(); redraw(); } /** - * Redraws the button. + * Redraws the image. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 66766dca6..ab4a09b4e 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -772,6 +772,17 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) return false; } + // Notify of the pre-release event. In this event, the widget is still in the + // clicked state. This event is used, for example, by button handlers so + // that the click event is really processed when the button is released + // instead of pressed. The former behavior is needed because the result + // of processing the press may obscure the button and make it impossible + // to receive the release event. + + onPreRelease(x, y); + + // Now mark the widget as NOT clicked and stop draggin actions. + m_flags.clicked = false; stopDragging(x, y); @@ -784,6 +795,9 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) if (checkCollision(x, y)) { + // Notify of the release event... the widget was NOT dragged outside of + // its original bounding box + onRelease(x, y); // Release occurred within widget; raise release @@ -792,9 +806,12 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) } else { + // Notify of the release event... the widget WAS dragged outside of + // its original bounding box + onReleaseOutside(x, y); - // Release occurred outside widget; raise release + // Release occurred outside widget; raise release outside event m_widgetEventHandlers->raiseReleaseOutsideEvent(x, y); } diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 4c781e2c9..99f7fdbba 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 5ecd8ab22..286c9c46a 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index 68230e17a..91722725a 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 1a3d7eb48..8eda8d28a 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -96,12 +96,12 @@ namespace NxWM uint8_t m_flags; /**< Window flags */ /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ - void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); + void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); public: diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 5a5ea12f4..d0ae5ec84 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -110,12 +110,12 @@ namespace NxWM void stopAllApplications(void); /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ - void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); + void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); public: diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 35a291aef..cf98d10d9 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -209,12 +209,12 @@ namespace NxWM void hideApplicationWindow(IApplication *app); /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ - void handleClickEvent(const NXWidgets::CWidgetEventArgs &e); + void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); public: /** diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 320559ef7..df8c69f11 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -498,12 +498,12 @@ void CApplicationWindow::clickStopIcon(int index) #endif /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ -void CApplicationWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +void CApplicationWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { // Ignore the event if no callback is registered diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index ceeff0d7b..de35662d5 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include "cwidgetcontrol.hxx" @@ -443,14 +443,14 @@ void CStartWindow::stopAllApplications(void) } /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ -void CStartWindow::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - // icon was clicked? + // Was an ICON clicked? for (int i = 0; i < m_slots.size(); i++) { diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index b15916b0a..ec3d8460b 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -1277,14 +1277,14 @@ void CTaskbar::hideApplicationWindow(IApplication *app) } /** - * Handle a mouse button click event. + * Handle a widget action event. For CImage, this is a mouse button pre-release event. * * @param e The event data. */ -void CTaskbar::handleClickEvent(const NXWidgets::CWidgetEventArgs &e) +void CTaskbar::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - // icon was clicked? + // Was a n ICON clicked? for (int i = 0; i < m_slots.size(); i++) { From a8c4c5e628a3ceb25f46e85ac10e424937601de0 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 May 2012 20:10:32 +0000 Subject: [PATCH 058/390] NXWidgets::CNxTkWindow must subtract the height of the toolbar (if any) when reporting the size of the window git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4741 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 5 +++ TODO.txt | 38 ++++++++++++++++++++++ libnxwidgets/include/cnxtkwindow.hxx | 20 ++++++------ libnxwidgets/src/cnxtkwindow.cxx | 47 ++++++++++++++++++---------- nxwm/src/cnxconsole.cxx | 1 - 5 files changed, 85 insertions(+), 26 deletions(-) create mode 100755 TODO.txt diff --git a/ChangeLog.txt b/ChangeLog.txt index 733924248..0e93187c1 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -87,3 +87,8 @@ * NxWM::CNxConsole: Add a on_exit() exit handler that will close the NxConsole window when the NSH thread exits. A correct build now depends on having CONFIG_SCHED_ONEXIT defined. +* NXWidgets::CNxWidget: Add a new onPreRelease() method. +* NXWidgets::CButton, CButtonArry, CImage now post action event at pre-release time. +* NxWM: ICON touches are now drive by action events instead of click events. +* NXWidgets::CNxTkWindow: Reported size of a framed window must exlude the + height of the tool bar (if present) diff --git a/TODO.txt b/TODO.txt new file mode 100755 index 000000000..2a55c8197 --- /dev/null +++ b/TODO.txt @@ -0,0 +1,38 @@ +NxWidgets +--------- + +NxWM +---- + + Title: DRAGGING ACROSS WINDOWS + Description: Need some indication if the touch/mouse drags from one window to + another then is release. Release event is lost in this case. + Status: Open + Priority: Low. ICON just stays selected and must be touched again. + + Title: AUTO-RAISE DISABLED + Description: Auto-raise is currently disabled in nuttx for NX multi-server + mode. The + reason is complex: + - Most touchscreen controls send touch data a high rates + - In multi-server mode, touch events get queued in a message + queue. + - The logic that receives the messages performs the auto-raise. + But it can do stupid things after the first auto-raise as + it opperates on the stale data in the message queue. + I am thinking that auto-raise ought to be removed from NuttX + and moved out into a graphics layer (like NxWM) that knows + more about the appropriate context to do the autoraise. + Status: Open + Priority: Medium low + + Title: MULTIPLE COPIES OF AN APPLICATION + Description: There is a limitation now in that one instance of an application + an be started at a time. This limitation is because the + application container class is created at start-up time; in + order to have multiple instances of tasks, you would have to + be able to create multiple container classes from the start + window. + Status: Open + Priority: High + \ No newline at end of file diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 4c379754a..8fda121a9 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -88,6 +88,7 @@ namespace NXWidgets NXTKWINDOW m_hNxTkWindow; /**< Handle to the NX raw window */ CWidgetControl *m_widgetControl; /**< Controlling widget for the window */ CNxToolbar *m_toolbar; /**< Child toolbar */ + nxgl_coord_t m_toolbarHeight; /**< The height of the toolbar */ public: @@ -161,7 +162,8 @@ namespace NXWidgets inline void detachToolbar(void) { - m_toolbar = (CNxToolbar *)NULL; + m_toolbar = (CNxToolbar *)NULL; + m_toolbarHeight = 0; } /** @@ -181,7 +183,7 @@ namespace NXWidgets * @return True on success, false on any failure. */ - bool getPosition(FAR struct nxgl_point_s *pPos); + bool getPosition(FAR struct nxgl_point_s *pos); /** * Get the size of the window (as reported by the NX callback). @@ -189,25 +191,25 @@ namespace NXWidgets * @return The size. */ - bool getSize(FAR struct nxgl_size_s *pSize); + bool getSize(FAR struct nxgl_size_s *size); /** * Set the position and size of the window. * - * @param pPos The new position of the window. + * @param pos The new position of the window. * @return True on success, false on any failure. */ - bool setPosition(FAR const struct nxgl_point_s *pPos); + bool setPosition(FAR const struct nxgl_point_s *pos); /** * Set the size of the selected window. * - * @param pSize The new size of the window. + * @param size The new size of the window. * @return True on success, false on any failure. */ - bool setSize(FAR const struct nxgl_size_s *pSize); + bool setSize(FAR const struct nxgl_size_s *size); /** * Bring the window to the top of the display. @@ -228,13 +230,13 @@ namespace NXWidgets /** * Set an individual pixel in the window with the specified color. * - * @param pPos The location of the pixel to be filled. + * @param pos The location of the pixel to be filled. * @param color The color to use in the fill. * * @return True on success; false on failure. */ - bool setPixel(FAR const struct nxgl_point_s *pPos, + bool setPixel(FAR const struct nxgl_point_s *pos, nxgl_mxpixel_t color); /** diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 16eaad2c7..f1ea58692 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -74,10 +74,11 @@ CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl) m_hNxServer = hNxServer; m_widgetControl = widgetControl; - // Nullify uninitilized pointers + // Nullify uninitilized pointers and values m_hNxTkWindow = (NXTKWINDOW )0; m_toolbar = (CNxToolbar *)0; + m_toolbarHeight = 0; // Create the CGraphicsPort instance for this window @@ -209,6 +210,11 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widget return (CNxToolbar *)0; } + // Save the height of the toolbar. We will need this because it will change + // how we report the size of drawable part of the window. + + m_toolbarHeight = height; + // Provide parent widget control information to new widget control instance. // This information is reported by an NX callback for "normal" windows. But // the toolbar widget control does not get NX callbacks and has to get the @@ -277,48 +283,57 @@ bool CNxTkWindow::requestPosition(void) * @return The position. */ -bool CNxTkWindow::getPosition(FAR struct nxgl_point_s *pPos) +bool CNxTkWindow::getPosition(FAR struct nxgl_point_s *pos) { - return m_widgetControl->getWindowPosition(pPos); + return m_widgetControl->getWindowPosition(pos); } /** - * Get the size of the window (as reported by the NX callback). + * Get the size of the window drawable region. * * @return The size. */ -bool CNxTkWindow::getSize(FAR struct nxgl_size_s *pSize) +bool CNxTkWindow::getSize(FAR struct nxgl_size_s *size) { - return m_widgetControl->getWindowSize(pSize); + // Get the size of the NXTK window (this will exclude the thickness of + // the frame). + + bool ret = m_widgetControl->getWindowSize(size); + + // Subtract the height of the toolbar (if any) to get the size of the + // drawable region in the window. + + size->h -= m_toolbarHeight; + return ret; } /** * Set the position and size of the window. * - * @param pPos The new position of the window. + * @param pos The new position of the window. * @return True on success, false on any failure. */ -bool CNxTkWindow::setPosition(FAR const struct nxgl_point_s *pPos) +bool CNxTkWindow::setPosition(FAR const struct nxgl_point_s *pos) { // Set the window size and position - return nxtk_setposition(m_hNxTkWindow, pPos) == OK; + return nxtk_setposition(m_hNxTkWindow, pos) == OK; } /** * Set the size of the selected window. * - * @param pSize The new size of the window. + * @param size The new size of the window. * @return True on success, false on any failure. */ -bool CNxTkWindow::setSize(FAR const struct nxgl_size_s *pSize) +bool CNxTkWindow::setSize(FAR const struct nxgl_size_s *size) { // Set the window size - return nxtk_setsize(m_hNxTkWindow, pSize) == OK; + return nxtk_setsize(m_hNxTkWindow, size) == OK; } /** @@ -350,21 +365,21 @@ bool CNxTkWindow::lower(void) /** * Set an individual pixel in the window with the specified color. * - * @param pPos The location of the pixel to be filled. + * @param pos The location of the pixel to be filled. * @param color The color to use in the fill. * * @return True on success; false on failure. */ -bool CNxTkWindow::setPixel(FAR const struct nxgl_point_s *pPos, +bool CNxTkWindow::setPixel(FAR const struct nxgl_point_s *pos, nxgl_mxpixel_t color) { #if 0 // Set an individual pixel to the specified color - return nxtk_setpixel(m_hNxTkWindow, pPos, &color) == OK; + return nxtk_setpixel(m_hNxTkWindow, pos, &color) == OK; #else -# warning "Revisit" + // REVISIT return false; #endif } diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 855bd3d0b..ec43c5656 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -323,7 +323,6 @@ void CNxConsole::stop(void) void CNxConsole::hide(void) { // Disable drawing and events -#warning "Missing logic" } /** From 0efb245d6def577e7a457d17a41a0c170277062e Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 May 2012 22:43:40 +0000 Subject: [PATCH 059/390] NxWM: Add IApplicationFactory so that we can create multiple instances of applications; And, as a result of that, re-vamp entire threading model. this is now buggier than it was before git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4742 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 19 +- README.txt | 0 ReleaseNotes.txt | 0 TODO.txt | 23 +- UnitTests/CButton/cbutton-pushed.png | Bin UnitTests/CButton/cbutton-released.png | Bin UnitTests/CButtonArray/cbuttonarray.png | Bin UnitTests/CCheckBox/ccheckbox.png | Bin UnitTests/CLabel/clabel.png | Bin UnitTests/CProgressBar/cprogressbar.png | Bin UnitTests/CRadioButton/cradiobutton.png | Bin .../cscrollbarhorizontal.png | Bin .../CScrollbarVertical/cscrollbarvertical.png | Bin .../CSliderHorizonal/csliderhorizontal.png | Bin UnitTests/CSliderVertical/cslidervertical.png | Bin UnitTests/CTextBox/ctextbox.png | Bin UnitTests/README.txt | 10 +- UnitTests/TestStatus.txt | 0 UnitTests/nxwm/main.cxx | 177 +++++++--------- libnxwidgets/include/cwidgetcontrol.hxx | 2 +- libnxwidgets/src/cnxtkwindow.cxx | 6 +- libnxwidgets/src/cnxtoolbar.cxx | 2 +- libnxwidgets/src/cwidgetcontrol.cxx | 3 +- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 46 ++-- libnxwidgets/src/cwindoweventhandlerlist.cxx | 1 + nxwm/doc/NxWM-ThreadingModel.ppt | Bin 0 -> 92672 bytes nxwm/include/capplicationwindow.hxx | 8 + nxwm/include/ccalibration.hxx | 40 ++++ nxwm/include/cfullscreenwindow.hxx | 8 + nxwm/include/cnxconsole.hxx | 37 ++++ nxwm/include/cstartwindow.hxx | 71 ++++++- nxwm/include/cwindowcontrol.hxx | 21 ++ nxwm/include/iapplication.hxx | 56 ++++- nxwm/include/iapplicationwindow.hxx | 19 +- nxwm/include/nxwmconfig.hxx | 50 ++++- nxwm/src/capplicationwindow.cxx | 12 ++ nxwm/src/ccalibration.cxx | 74 ++++++- nxwm/src/cfullscreenwindow.cxx | 12 ++ nxwm/src/cnxconsole.cxx | 72 +++++++ nxwm/src/cstartwindow.cxx | 196 ++++++++++++++++-- nxwm/src/ctaskbar.cxx | 9 +- nxwm/src/cwindowcontrol.cxx | 151 ++++++++++---- 42 files changed, 902 insertions(+), 223 deletions(-) mode change 100755 => 100644 ChangeLog.txt mode change 100755 => 100644 README.txt mode change 100755 => 100644 ReleaseNotes.txt mode change 100755 => 100644 TODO.txt mode change 100755 => 100644 UnitTests/CButton/cbutton-pushed.png mode change 100755 => 100644 UnitTests/CButton/cbutton-released.png mode change 100755 => 100644 UnitTests/CButtonArray/cbuttonarray.png mode change 100755 => 100644 UnitTests/CCheckBox/ccheckbox.png mode change 100755 => 100644 UnitTests/CLabel/clabel.png mode change 100755 => 100644 UnitTests/CProgressBar/cprogressbar.png mode change 100755 => 100644 UnitTests/CRadioButton/cradiobutton.png mode change 100755 => 100644 UnitTests/CScrollbarHorizontal/cscrollbarhorizontal.png mode change 100755 => 100644 UnitTests/CScrollbarVertical/cscrollbarvertical.png mode change 100755 => 100644 UnitTests/CSliderHorizonal/csliderhorizontal.png mode change 100755 => 100644 UnitTests/CSliderVertical/cslidervertical.png mode change 100755 => 100644 UnitTests/CTextBox/ctextbox.png mode change 100755 => 100644 UnitTests/TestStatus.txt create mode 100644 nxwm/doc/NxWM-ThreadingModel.ppt diff --git a/ChangeLog.txt b/ChangeLog.txt old mode 100755 new mode 100644 index 0e93187c1..1a51aacda --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -90,5 +90,22 @@ * NXWidgets::CNxWidget: Add a new onPreRelease() method. * NXWidgets::CButton, CButtonArry, CImage now post action event at pre-release time. * NxWM: ICON touches are now drive by action events instead of click events. -* NXWidgets::CNxTkWindow: Reported size of a framed window must exlude the +* NXWidgets::CNxTkWindow: Reported size of a framed window must exclude the height of the tool bar (if present) +* TODO.txt: Add a file to keep track of issues. +* NXWidgets::CStartWindow and IApplicationFactory: This is a substantial + redesign. IApplication wraps an application. However, if we want to + be able to start multiple copies of an application, then we need to + be able to create multiple IApplication instances from the start window. + Enter IApplicationFactory. Icons in the start window now correspond + to application factories; icons in the task bar no correspond to + application instances. +* NXWidgetes::CStartWindow and CWindowControl: The above change necessitated + another architectural change: When create applications, it is sometimes + necessary to wait for windows events. The above change moved the + application creation to the window event thread, hence, causing deadlocks + wheneven the logic tried to wait for a window event. The solution was + to create a new thread, called the start window thread, that runs + asynchronously and can wait for windoew events. +* doc/NxWM-ThreadingModel.ppt: Documented the now rather complex NxWM + threading model. diff --git a/README.txt b/README.txt old mode 100755 new mode 100644 diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt old mode 100755 new mode 100644 diff --git a/TODO.txt b/TODO.txt old mode 100755 new mode 100644 index 2a55c8197..009ce9039 --- a/TODO.txt +++ b/TODO.txt @@ -26,13 +26,20 @@ NxWM Status: Open Priority: Medium low - Title: MULTIPLE COPIES OF AN APPLICATION - Description: There is a limitation now in that one instance of an application - an be started at a time. This limitation is because the - application container class is created at start-up time; in - order to have multiple instances of tasks, you would have to - be able to create multiple container classes from the start - window. + Title: MULTIPLE COPIES OF AN NxCONSOLE + Description: From the start window, you an create multiple copies of the + NxConsole. However, there is a problem in the current + implementation: Each NxConsole receives its input from the + serial console so, for example, it you enter text one character + will go to one NxConsole instance and the next character goes + to a different instance. That is correct behavior within the + current design, but not very usable. We need a mechanism to + assure that the top window is the one that receives all + eyboard input. NX already provides this capability with its + nx_kbdin interface(), but that is not currently used. At present, + NxConsoles get their input from /dev/console which is the serial + port. The necessary change is to create an NX input device for + /dev/console that will get its input from NX. Status: Open - Priority: High + Priority: Medium High \ No newline at end of file diff --git a/UnitTests/CButton/cbutton-pushed.png b/UnitTests/CButton/cbutton-pushed.png old mode 100755 new mode 100644 diff --git a/UnitTests/CButton/cbutton-released.png b/UnitTests/CButton/cbutton-released.png old mode 100755 new mode 100644 diff --git a/UnitTests/CButtonArray/cbuttonarray.png b/UnitTests/CButtonArray/cbuttonarray.png old mode 100755 new mode 100644 diff --git a/UnitTests/CCheckBox/ccheckbox.png b/UnitTests/CCheckBox/ccheckbox.png old mode 100755 new mode 100644 diff --git a/UnitTests/CLabel/clabel.png b/UnitTests/CLabel/clabel.png old mode 100755 new mode 100644 diff --git a/UnitTests/CProgressBar/cprogressbar.png b/UnitTests/CProgressBar/cprogressbar.png old mode 100755 new mode 100644 diff --git a/UnitTests/CRadioButton/cradiobutton.png b/UnitTests/CRadioButton/cradiobutton.png old mode 100755 new mode 100644 diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal.png b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal.png old mode 100755 new mode 100644 diff --git a/UnitTests/CScrollbarVertical/cscrollbarvertical.png b/UnitTests/CScrollbarVertical/cscrollbarvertical.png old mode 100755 new mode 100644 diff --git a/UnitTests/CSliderHorizonal/csliderhorizontal.png b/UnitTests/CSliderHorizonal/csliderhorizontal.png old mode 100755 new mode 100644 diff --git a/UnitTests/CSliderVertical/cslidervertical.png b/UnitTests/CSliderVertical/cslidervertical.png old mode 100755 new mode 100644 diff --git a/UnitTests/CTextBox/ctextbox.png b/UnitTests/CTextBox/ctextbox.png old mode 100755 new mode 100644 diff --git a/UnitTests/README.txt b/UnitTests/README.txt index f501f30f6..cc01c3855 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -35,8 +35,12 @@ Installing and Building the Unit Tests for the STM3210E-EVAL available. However, the unit test can be run on other configurations (see steps d and e below). - NOTE: Another special configuration, sim/nxwm, is recommended for unit-leveling - testing of NxWM because the configuration is more complex in that case. + NOTE: There are some other special configurationsrecommended for unit-leveling + testing of NxWM because the configuration is more complex in that case. These + are: + + 1) sim/nxwmm, or the simulated platform (no touchscreen), and + 2) stm3240g-evel, for the STM3240G-EVAL board (with the STMPE11 touchscreen) We will assume the sim/nsh2 configuration in this discussion. The sim/nsh2 configuration is installed as follows: @@ -286,7 +290,7 @@ CTextBox nxwm Exercises the NxWM window manager. - Use the special configuration nuttx/configs/sim/nxwm + Use the special configurations nuttx/configs/sim/nxwm or nuttx/configs/stm3240g-eval/nxwm. Example ======= diff --git a/UnitTests/TestStatus.txt b/UnitTests/TestStatus.txt old mode 100755 new mode 100644 diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index d4b7caa6b..6a2e952d8 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -83,7 +83,6 @@ struct SNxWmTest NxWM::CStartWindow *startwindow; // The start window #ifdef CONFIG_NXWM_TOUCHSCREEN NxWM::CTouchscreen *touchscreen; // The touchscreen - NxWM::CCalibration *calibration; // The touchscreen calibration application struct NxWM::SCalibrationData calibData; // Calibration data #endif unsigned int mmInitial; // Initial memory usage @@ -250,24 +249,24 @@ static bool createTaskbar(void) // 3. Call CTaskBar::startApplication repeatedly to add applications to the task bar // 4. Call CTaskBar::startWindowManager to start the display with applications in place - printf(MAIN_STRING "Create CTaskbar instance\n"); + printf("createTaskbar: Create CTaskbar instance\n"); g_nxwmtest.taskbar = new NxWM::CTaskbar(); if (!g_nxwmtest.taskbar) { - printf(MAIN_STRING "ERROR: Failed to instantiate CTaskbar\n"); + printf("createTaskbar: ERROR: Failed to instantiate CTaskbar\n"); return false; } - showTestCaseMemory("After create taskbar"); + showTestCaseMemory("createTaskbar: After create taskbar"); // Connect to the NX server - printf(MAIN_STRING "Connect CTaskbar instance to the NX server\n"); + printf("createTaskbar: Connect CTaskbar instance to the NX server\n"); if (!g_nxwmtest.taskbar->connect()) { - printf(MAIN_STRING "ERROR: Failed to connect CTaskbar instance to the NX server\n"); + printf("createTaskbar: ERROR: Failed to connect CTaskbar instance to the NX server\n"); return false; } - showTestCaseMemory("After connecting to the server"); + showTestCaseMemory("createTaskbar: After connecting to the server"); // Initialize the task bar // @@ -275,14 +274,14 @@ static bool createTaskbar(void) // CTaskBar::startWindowManager() brings the window manager up with those applications // in place. - printf(MAIN_STRING "Initialize CTaskbar instance\n"); + printf("createTaskbar: Initialize CTaskbar instance\n"); if (!g_nxwmtest.taskbar->initWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to intialize CTaskbar instance\n"); + printf("createTaskbar: ERROR: Failed to intialize CTaskbar instance\n"); return false; } - showTestCaseMemory("After initializing window manager"); + showTestCaseMemory("createTaskbar: After initializing window manager"); return true; } @@ -292,55 +291,58 @@ static bool createTaskbar(void) static bool createStartWindow(void) { - // Create the start window. The general sequence for setting up the start window is: + // Create the start window. The start window is unique among applications + // because it has no factory. The general sequence for setting up the + // start window is: // - // 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - // 2. Use the window to instantiate Cstartwindow - // 3. Call Cstartwindow::addApplication numerous times to install applications + // 1. Create and open a CApplicationWindow + // 2. Use the window to create the CStartWindow the start window application + // 2. Call Cstartwindow::addApplication numerous times to install applications // in the start window. - // 4. Call CTaskBar::startApplication (initially minimized) to start the start + // 3. Call CTaskBar::startApplication (initially minimized) to start the start // window application. // // NOTE: that the start window should not have a stop button. - printf(MAIN_STRING "Opening the start window application window\n"); NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(NxWM::CApplicationWindow::WINDOW_PERSISTENT); if (!window) { - printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the start window\n"); + printf("createStartWindow: ERROR: Failed to create CApplicationWindow\n"); return false; } - showTestCaseMemory("After creating start window application window"); + showTestCaseMemory("createStartWindow: After creating CApplicationWindow"); + + // Open the window (it is hot in here) - printf(MAIN_STRING "Initialize CApplicationWindow\n"); if (!window->open()) { - printf(MAIN_STRING "ERROR: Failed to open CApplicationWindow \n"); + printf("createStartWindow: ERROR: Failed to open CApplicationWindow \n"); delete window; return false; } - showTestCaseMemory("After initializing the start window application window"); + showTestCaseMemory("createStartWindow: After opening CApplicationWindow"); + + // Instantiate the application, providing the window to the application's + // constructor - printf(MAIN_STRING "Creating the start window application\n"); g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); if (!g_nxwmtest.startwindow) { - printf(MAIN_STRING "ERROR: Failed to instantiate CStartWindow\n"); + gdbg("ERROR: Failed to instantiate CStartWindow\n"); delete window; return false; } + showTestCaseMemory("createStartWindow: After creating CStartWindow"); - // Call CTaskBar::startApplication to start the Calibration application (minimized) + // Add the CStartWindow application to the task bar (minimized) - printf(MAIN_STRING "Start the start window application\n"); + printf("createStartWindow: Start the start window application\n"); if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.startwindow, true)) { - printf(MAIN_STRING "ERROR: Failed to start the start window application\n"); + printf("createStartWindow: ERROR: Failed to start the start window application\n"); return false; } - showTestCaseMemory("After starting the start window application"); - - showTestCaseMemory("After create the start window application"); + showTestCaseMemory("createStartWindow: After starting the start window application"); return true; } @@ -352,14 +354,14 @@ static bool startWindowManager(void) { // Start the window manager - printf(MAIN_STRING "Start the window manager\n"); + printf("startWindowManager: Start the window manager\n"); if (!g_nxwmtest.taskbar->startWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + printf("startWindowManager: ERROR: Failed to start the window manager\n"); return false; } - showTestCaseMemory("After starting the window manager"); + showTestCaseMemory("AstartWindowManager: fter starting the window manager"); return true; } @@ -377,23 +379,24 @@ static bool createTouchScreen(void) // Create the touchscreen device - printf(MAIN_STRING "Creating CTouchscreen\n"); + printf("createTouchScreen: Creating CTouchscreen\n"); g_nxwmtest.touchscreen = new NxWM::CTouchscreen(g_nxwmtest.taskbar, &displaySize); if (!g_nxwmtest.touchscreen) { - printf(MAIN_STRING "ERROR: Failed to create CTouchscreen\n"); + printf("createTouchScreen: ERROR: Failed to create CTouchscreen\n"); return false; } + showTestCaseMemory("createTouchScreen: createTouchScreen: After creating CTouchscreen"); - printf(MAIN_STRING "Start touchscreen listener\n"); + printf("createTouchScreen: Start touchscreen listener\n"); if (!g_nxwmtest.touchscreen->start()) { - printf(MAIN_STRING "ERROR: Failed start the touchscreen listener\n"); + printf("createTouchScreen: ERROR: Failed start the touchscreen listener\n"); delete g_nxwmtest.touchscreen; return false; } - showTestCaseMemory("After starting the touchscreen listener"); + showTestCaseMemory("createTouchScreen: After starting the touchscreen listener"); return true; } #endif @@ -405,61 +408,50 @@ static bool createTouchScreen(void) #ifdef CONFIG_NXWM_TOUCHSCREEN static bool createCalibration(void) { - // 1. Call CTaskBar::openFullScreenWindow to create a window for the application, - // 2. Instantiate the application, providing the window to the application's - // constructor, + // 1Create the CCalibrationFactory application factory - printf(MAIN_STRING "Opening the calibration application window\n"); - NxWM::CFullScreenWindow *window = g_nxwmtest.taskbar->openFullScreenWindow(); - if (!window) + printf("createCalibration: Creating CCalibrationFactory\n"); + NxWM::CCalibrationFactory *factory = new NxWM::CCalibrationFactory(g_nxwmtest.taskbar, g_nxwmtest.touchscreen); + if (!factory) { - printf(MAIN_STRING "ERROR: Failed to create CFullScreenWindow for the calibration window\n"); + printf("createCalibration: ERROR: Failed to create CCalibrationFactory\n"); return false; } - showTestCaseMemory("After creating calibration full screen window"); + showTestCaseMemory("createCalibration: After creating CCalibrationFactory"); - printf(MAIN_STRING "Initialize CFullScreenWindow\n"); - if (!window->open()) + // Add the calibration application to the start window. + + printf("createCalibration: Adding CCalibration to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(factory)) { - printf(MAIN_STRING "ERROR: Failed to open CFullScreenWindow \n"); - delete window; + printf("createCalibration: ERROR: Failed to add CCalibrationto the start window\n"); + delete factory; return false; } - showTestCaseMemory("After initializing the calibration full screen window"); + showTestCaseMemory("createCalibration: After adding CCalibration"); - printf(MAIN_STRING "Creating CCalibration application\n"); - g_nxwmtest.calibration = new NxWM::CCalibration(g_nxwmtest.taskbar, window, g_nxwmtest.touchscreen); - if (!g_nxwmtest.calibration) + // Call StartWindowFactory::create to to create the start window application + + printf("createCalibration: Creating CCalibration\n"); + NxWM::IApplication *calibration = factory->create(); + if (!calibration) { - printf(MAIN_STRING "ERROR: Failed to instantiate CCalibration\n"); - delete window; + printf("createCalibration: ERROR: Failed to create CCalibration\n"); return false; } - showTestCaseMemory("After creating CCalibration application"); - - // Add the calibration application to the start window. It can't really - // be used to re-calibrate (because there is nothing to get the calibration - // data). But is a good case to test a full screen appliation - - printf(MAIN_STRING "Adding CCalibration application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(g_nxwmtest.calibration)) - { - printf(MAIN_STRING "ERROR: Failed to add CCalibration to the start window\n"); - delete g_nxwmtest.calibration; - return false; - } - showTestCaseMemory("After adding CCalibration application"); + showTestCaseMemory("createCalibration: After creating CCalibration"); // Call CTaskBar::startApplication to start the Calibration application. Nothing // will be displayed because the window manager has not yet been started. - printf(MAIN_STRING "Start the calibration application\n"); - if (!g_nxwmtest.taskbar->startApplication(g_nxwmtest.calibration, false)) + printf("createCalibration: Start the calibration application\n"); + if (!g_nxwmtest.taskbar->startApplication(calibration, false)) { printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); + delete calibration; return false; } - showTestCaseMemory("After starting the start window application"); + showTestCaseMemory("createCalibration: After starting the start window application"); return true; } #endif @@ -472,43 +464,24 @@ static bool createNxConsole(void) { // Add the NxConsole application to the start window - printf(MAIN_STRING "Opening the NxConsole application window\n"); - NxWM::CApplicationWindow *window = g_nxwmtest.taskbar->openApplicationWindow(); - if (!window) - { - printf(MAIN_STRING "ERROR: Failed to create CApplicationWindow for the NxConsole\n"); - return false; - } - showTestCaseMemory("After creating the NxConsole application window"); - - printf(MAIN_STRING "Initialize CApplicationWindow\n"); - if (!window->open()) - { - printf(MAIN_STRING "ERROR: Failed to open CApplicationWindow \n"); - delete window; - return false; - } - showTestCaseMemory("After initializing the NxConsole application window"); - - printf(MAIN_STRING "Creating the NxConsole application\n"); - NxWM::CNxConsole *console = new NxWM::CNxConsole(g_nxwmtest.taskbar, window); + printf("createNxConsole: Creating the NxConsole application\n"); + NxWM::CNxConsoleFactory *console = new NxWM::CNxConsoleFactory(g_nxwmtest.taskbar); if (!console) { - printf(MAIN_STRING "ERROR: Failed to instantiate CNxConsole\n"); - delete window; + printf("createNxConsole: ERROR: Failed to instantiate CNxConsoleFactory\n"); return false; } - showTestCaseMemory("After creating the NxConsole application"); + showTestCaseMemory("createNxConsole: After creating the NxConsole application"); - printf(MAIN_STRING "Adding the NxConsole application to the start window\n"); + printf("createNxConsole: Adding the NxConsole application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(console)) { - printf(MAIN_STRING "ERROR: Failed to add CNxConsole to the start window\n"); + printf("createNxConsole: ERROR: Failed to add CNxConsoleFactory to the start window\n"); delete console; return false; } - showTestCaseMemory("After adding the NxConsole application"); + showTestCaseMemory("createNxConsole: After adding the NxConsole application"); return true; } @@ -557,7 +530,7 @@ int MAIN_NAME(int argc, char *argv[]) printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); return EXIT_FAILURE; } - showTestCaseMemory("After initializing the NSH library"); + showTestCaseMemory(MAIN_STRING "After initializing the NSH library"); // Create the task bar. @@ -641,20 +614,20 @@ int MAIN_NAME(int argc, char *argv[]) #ifndef CONFIG_NXWM_TOUCHSCREEN sleep(2); g_nxwmtest.taskbar->clickIcon(0); - showTestCaseMemory("After clicking the start window icon"); + showTestCaseMemory(MAIN_STRING "After clicking the start window icon"); // Wait bit to see the result of the button press. The press the first icon // in the start menu. That should be the NxConsole icon. sleep(2); g_nxwmtest.startwindow->clickIcon(0); - showTestCaseMemory("After clicking the NxConsole icon"); + showTestCaseMemory(MAIN_STRING "After clicking the NxConsole icon"); #endif // Wait bit to see the result of the button press. sleep(2); - showTestMemory("Final memory usage"); + showTestMemory(MAIN_STRING "Final memory usage"); return EXIT_SUCCESS; } diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 565e9cc36..757dc1c5b 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -346,7 +346,7 @@ namespace NXWidgets * Destructor. */ - ~CWidgetControl(void); + virtual ~CWidgetControl(void); /** * Wait for an interesting window event to occur (like a mouse or keyboard event) diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index f1ea58692..6a9c115e1 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -152,7 +152,7 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widget { // Create a new widget control if none was provided - CWidgetControl *allocControl = (CWidgetControl *)0; + CWidgetControl *allocControl = (CWidgetControl *)0; if (!widgetControl) { // NOTE: This constructor would accept the toolbar "style" as a argument. @@ -226,7 +226,7 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widget sched_lock(); // Get the physical bounding box of the window in display coordinates - + struct nxgl_rect_s windowBounds; m_widgetControl->getWindowBoundingBox(&windowBounds); diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index b14a0b611..12b6bea4c 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 286c9c46a..9d2c5c7e9 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -143,7 +143,7 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) CWidgetControl::~CWidgetControl(void) { - // Notify any external waiters... this should not happen becaue it + // Notify any external waiters... this should not happen because it // it is probably already too late #ifdef CONFIG_NXWIDGET_EVENTWAIT @@ -432,6 +432,7 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more) { + // REVISIT. This is not not yet used and not fully implemented. CRect rect; rect.setNxRect(nxRect); m_eventHandlers.raiseRedrawEvent(); diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index 91722725a..bebab89aa 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -100,7 +100,7 @@ using namespace NXWidgets; CWidgetEventHandlerList::CWidgetEventHandlerList(CNxWidget *widget) { - m_widget = widget; + m_widget = widget; m_isEnabled = true; } @@ -125,7 +125,7 @@ void CWidgetEventHandlerList::addWidgetEventHandler(CWidgetEventHandler *eventHa { // Prevent insertion if the handler already exists - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { if (m_widgetEventHandlers.at(i) == eventHandler) { @@ -146,7 +146,7 @@ void CWidgetEventHandlerList::addWidgetEventHandler(CWidgetEventHandler *eventHa void CWidgetEventHandlerList::removeWidgetEventHandler(CWidgetEventHandler *eventHandler) { - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { if (m_widgetEventHandlers.at(i) == eventHandler) { @@ -169,7 +169,7 @@ void CWidgetEventHandlerList::raiseClickEvent(nxgl_coord_t x, nxgl_coord_t y) { CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleClickEvent(e); } @@ -189,7 +189,7 @@ void CWidgetEventHandlerList::raiseDoubleClickEvent(nxgl_coord_t x, nxgl_coord_t { CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleDoubleClickEvent(e); } @@ -209,7 +209,7 @@ void CWidgetEventHandlerList::raiseReleaseEvent(nxgl_coord_t x, nxgl_coord_t y) { CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleReleaseEvent(e); } @@ -229,7 +229,7 @@ void CWidgetEventHandlerList::raiseReleaseOutsideEvent(nxgl_coord_t x, nxgl_coor { CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleReleaseOutsideEvent(e); } @@ -252,7 +252,7 @@ void CWidgetEventHandlerList::raiseDragEvent(nxgl_coord_t x, nxgl_coord_t y, { CWidgetEventArgs e(m_widget, x, y, vX, vY, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleDragEvent(e); } @@ -272,7 +272,7 @@ void CWidgetEventHandlerList::raiseDropEvent(nxgl_coord_t x, nxgl_coord_t y) { CWidgetEventArgs e(m_widget, x, y, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleDropEvent(e); } @@ -291,7 +291,7 @@ void CWidgetEventHandlerList::raiseKeyPressEvent(nxwidget_char_t key) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, key); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleKeyPressEvent(e); } @@ -310,7 +310,7 @@ void CWidgetEventHandlerList::raiseCursorControlEvent(ECursorControl cursorContr { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, (nxwidget_char_t)cursorControl); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleCursorControlEvent(e); } @@ -327,7 +327,7 @@ void CWidgetEventHandlerList::raiseFocusEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleFocusEvent(e); } @@ -344,7 +344,7 @@ void CWidgetEventHandlerList::raiseBlurEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleBlurEvent(e); } @@ -361,7 +361,7 @@ void CWidgetEventHandlerList::raiseCloseEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleCloseEvent(e); } @@ -378,7 +378,7 @@ void CWidgetEventHandlerList::raiseHideEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleHideEvent(e); } @@ -395,7 +395,7 @@ void CWidgetEventHandlerList::raiseShowEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleShowEvent(e); } @@ -412,7 +412,7 @@ void CWidgetEventHandlerList::raiseEnableEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleEnableEvent(e); } @@ -429,7 +429,7 @@ void CWidgetEventHandlerList::raiseDisableEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleDisableEvent(e); } @@ -446,7 +446,7 @@ void CWidgetEventHandlerList::raiseValueChangeEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleValueChangeEvent(e); } @@ -466,7 +466,7 @@ void CWidgetEventHandlerList::raiseResizeEvent(nxgl_coord_t width, nxgl_coord_t { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleResizeEvent(e); } @@ -489,7 +489,7 @@ void CWidgetEventHandlerList::raiseMoveEvent(nxgl_coord_t x, nxgl_coord_t y, { CWidgetEventArgs e(m_widget, x, y, vX, vY, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleMoveEvent(e); } @@ -510,7 +510,7 @@ void CWidgetEventHandlerList::raiseActionEvent(void) { CWidgetEventArgs e(m_widget, 0, 0, 0, 0, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleActionEvent(e); } @@ -530,7 +530,7 @@ void CWidgetEventHandlerList::raiseScrollEvent(nxgl_coord_t vX, nxgl_coord_t vY) { CWidgetEventArgs e(m_widget, 0, 0, vX, vY, KEY_CODE_NONE); - for (int i = 0; i < m_widgetEventHandlers.size(); ++i) + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleScrollEvent(e); } diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index 1c95264d1..5f3048b63 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -159,3 +159,4 @@ void CWindowEventHandlerList::raiseKeyboardEvent(void) } #endif } + diff --git a/nxwm/doc/NxWM-ThreadingModel.ppt b/nxwm/doc/NxWM-ThreadingModel.ppt new file mode 100644 index 0000000000000000000000000000000000000000..382f69dd84bc787bb639cc4ffe0563e0affb942c GIT binary patch literal 92672 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 literal 0 HcmV?d00001 diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 8eda8d28a..f923f28b4 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -150,6 +150,14 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; + /** + * Recover the contained window control + * + * @return. The window control used by this application + */ + + CWindowControl *getWindowControl(void) const ; + /** * Set the window label * diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 3d90d59a8..55cef6d84 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -314,6 +314,46 @@ namespace NxWM bool isFullScreen(void) const; }; + + class CCalibrationFactory : public IApplicationFactory + { + private: + CTaskbar *m_taskbar; /**< The taskbar */ + CTouchscreen *m_touchscreen; /**< The touchscreen device */ + + public: + /** + * CCalibrationFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate calibration + * @param touchscreen. An instance of the class that wraps the + * touchscreen device. + */ + + CCalibrationFactory(CTaskbar *taskbar, CTouchscreen *touchscreen); + + /** + * CCalibrationFactory Destructor + */ + + inline ~CCalibrationFactory(void) { } + + /** + * Create a new instance of an CCalibration (as IApplication). + */ + + IApplication *create(void); + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + }; } #endif // __INCLUDE_CCALIBRATION_HXX diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index 3c4117689..2e3fbd45d 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -114,6 +114,14 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; + /** + * Recover the contained window control + * + * @return. The window control used by this application + */ + + CWindowControl *getWindowControl(void) const; + /** * Set the window label * diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index 91fb941d8..b95c86406 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -191,6 +191,43 @@ namespace NxWM bool isFullScreen(void) const; }; + + class CNxConsoleFactory : public IApplicationFactory + { + private: + CTaskbar *m_taskbar; /**< The taskbar */ + + public: + /** + * CNxConsoleFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate calibration + */ + + CNxConsoleFactory(CTaskbar *taskbar); + + /** + * CNxConsoleFactory Destructor + */ + + inline ~CNxConsoleFactory(void) { } + + /** + * Create a new instance of an CNxConsole (as IApplication). + */ + + IApplication *create(void); + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + }; } #endif // __cplusplus diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index d0ae5ec84..b0cad6127 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -42,6 +42,8 @@ #include +#include + #include "tnxarray.hxx" #include "iapplication.hxx" @@ -59,8 +61,35 @@ namespace NxWM { + /** + * Forward references + */ + class CTaskbar; + /** + * Start window message opcodes and format + */ + + enum EStartWindowMessageOpcodes + { + MSGID_POSITIONAL_CHANGE = 1, /**< Change in window positional data (not used) */ + MSGID_REDRAW_REQUEST, /**< Request to redraw a portion of the window (not used) */ + MSGID_MOUSE_INPUT, /**< New mouse input is available */ + MSGID_KEYBOARD_INPUT, /**< New keyboard input is available */ + MSGID_DESTROY_APP /**< Destroy the application */ + }; + + struct SStartWindowMessage + { + enum EStartWindowMessageOpcodes msgId; /**< The message opcode */ + FAR void *instance; /**< Object instance. */ + }; + + /** + * This class is the the start window application. + */ + class CStartWindow : public IApplication, private IApplicationCallback, private NXWidgets::CWidgetEventHandler @@ -72,7 +101,7 @@ namespace NxWM struct SStartWindowSlot { - IApplication *app; /**< A reference to the icon */ + IApplicationFactory *app; /**< A reference to the icon */ NXWidgets::CImage *image; /**< The icon image that goes with the application */ }; @@ -84,6 +113,33 @@ namespace NxWM CApplicationWindow *m_window; /**< Reference to the application window */ TNxArray m_slots; /**< List of apps in the start window */ struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ + pid_t m_taskId; /**< ID of the start window task */ + + /** + * This is the start window task. This function receives window events from + * the NX listener threads indirectly through this sequence: + * + * 1. The NX listener thread receives a windows event. The NX listener thread + * which is part of CTaskBar and was created when NX server connection was + * established). This event may be a positional change notification, a + * redraw request, or mouse or keyboard input. + * 2. The NX listener thread handles the message by calling nx_eventhandler(). + * nx_eventhandler() dispatches the message by calling a method in the + * NXWidgets::CCallback instance associated with the window. + * NXWidgets::CCallback is a part of the CWidgetControl. + * 3. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process + * the event. + * 4. NXWidgets::CWidgetControl records the new state data and raises a + * window event. + * 5. NXWidgets::CWindowEventHandlerList will give the event to + * NxWM::CWindowControl. + * 6. NxWM::CWindowControl will send the a message on a well-known message + * queue. + * 7. This CStartWindow::startWindow task will receive and process that + * message. + */ + + static int startWindow(int argc, char *argv[]); /** * Called when the window minimize button is pressed. @@ -107,7 +163,7 @@ namespace NxWM * Stop all applications */ - void stopAllApplications(void); + void removeAllApplications(void); /** * Handle a widget action event. For CImage, this is a mouse button pre-release event. @@ -202,18 +258,15 @@ namespace NxWM * Add the application to the start window. The general sequence for * setting up the start window is: * - * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - * 2. Use the window to instantiate CStartWindow - * 3. Call CStartWindow::addApplication numerous times to install applications - * in the start window. - * 4. Call CTaskBar::startApplication (initially minimized) to start the start - * window application. + * 1. Call IAppicationFactory::create to a new instance of the application + * 2. Call CStartWindow::addApplication to add the application to the + * start window. * * @param app. The new application to add to the start window * @return true on success */ - bool addApplication(IApplication *app); + bool addApplication(IApplicationFactory *app); /** * Simulate a mouse click on the icon at index. This inline method is only diff --git a/nxwm/include/cwindowcontrol.hxx b/nxwm/include/cwindowcontrol.hxx index acec12727..91e430c5c 100644 --- a/nxwm/include/cwindowcontrol.hxx +++ b/nxwm/include/cwindowcontrol.hxx @@ -43,6 +43,8 @@ #include #include +#include + #include #include @@ -61,6 +63,12 @@ namespace NxWM { + /** + * Forward references. + */ + + class IApplication; + /** * The class CWindowControl integrates the widget control with some special * handling of mouse and keyboard inputs neesed by NxWM @@ -70,6 +78,9 @@ namespace NxWM private NXWidgets::CWindowEventHandler { private: + mqd_t m_mqd; /**< Message queue descriptor used to commincate with the + ** start window thread. */ + /** * Handle an NX window mouse input event. * @@ -105,6 +116,16 @@ namespace NxWM */ ~CWindowControl(void); + + /** + * Destroy the application window and everything in it. This is + * handled by CWindowControl (vs just calling the destructors) because + * in the case where an application destroys itself (because of pressing + * the stop button), then we need to unwind and get out of the application + * logic before destroying all of its objects. + */ + + void destroy(IApplication *app); }; } #endif // __cplusplus diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 0d33db7bc..45067d900 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -44,6 +44,8 @@ #include "cnxstring.hxx" #include "ibitmap.hxx" + +#include "cwindowcontrol.hxx" #include "capplicationwindow.hxx" /**************************************************************************** @@ -65,14 +67,25 @@ namespace NxWM class IApplication { protected: - // These values (and the accessors that go with them) violate the "purity" - // of the base class. These are really part of the task bar implementation: - // Each application provides this state information needed by the taskbar. + /** + * These values (and the accessors that go with them) violate the "purity" + * of the base class. These are really part of the task bar implementation: + * Each application provides this state information needed by the taskbar. + */ bool m_minimized; /**< True if the application is minimized */ bool m_topapp; /**< True if this application is at the top in the hiearchy */ public: + /** + * A virtual destructor is required in order to override the IApplication + * destructor. We do this because if we delete IApplication, we want the + * destructor of the class that inherits from IApplication to run, not this + * one. + */ + + virtual ~IApplication(void) { } + /** * Each implementation of IApplication must provide a method to recover * the contained CApplicationWindow instance. @@ -80,6 +93,18 @@ namespace NxWM virtual IApplicationWindow *getWindow(void) const = 0; + /** + * Get the window widget control. + * + * @return The widget control of the underlying window instance. + */ + + virtual inline CWindowControl *getWindowControl(void) const + { + IApplicationWindow *window = getWindow(); + return window->getWindowControl(); + } + /** * Get the icon associated with the application * @@ -181,6 +206,31 @@ namespace NxWM virtual bool isFullScreen(void) const = 0; }; + + /** + * IApplicationFactory provides a mechanism for creating multiple instances + * of an application. + */ + + class IApplicationFactory + { + public: + /** + * Create a new instance of an application. + */ + + virtual IApplication *create(void) = 0; + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + virtual NXWidgets::IBitmap *getIcon(void) = 0; + }; } #endif // __cplusplus diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx index b00a03fa2..fe8830c2f 100644 --- a/nxwm/include/iapplicationwindow.hxx +++ b/nxwm/include/iapplicationwindow.hxx @@ -42,13 +42,10 @@ #include -#include "cnxtkwindow.hxx" -#include "cnxtoolbar.hxx" -#include "cwidgeteventargs.hxx" -#include "cwidgeteventhandler.hxx" -#include "cimage.hxx" -#include "clabel.hxx" -#include "crlepalettebitmap.hxx" +#include "inxwindow.hxx" +#include "cnxstring.hxx" + +#include "cwindowcontrol.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -121,6 +118,14 @@ namespace NxWM virtual NXWidgets::INxWindow *getWindow(void) const = 0; + /** + * Recover the contained window control + * + * @return. The window control used by this application + */ + + virtual CWindowControl *getWindowControl(void) const = 0; + /** * Set the window label * diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 34721d777..3605f8c4f 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -263,6 +263,19 @@ * CONFIG_NXWM_STARTWINDOW_VSPACING - Vertical spacing. Default: 2 pixels * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon + * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue + * Used to communicated from CWindowControl tothe start window thread. + * Default: "/dev/nxwm" + * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue + * before blocking. Defualt 32 + * CONFIG_NXWM_STARTWINDOW_MXMPRIO - The message priority. Default: 42. + * CONFIG_NXWM_STARTWINDOW_PRIO - Priority of the NxConsole task. Default: + * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than + * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. + * Such errors would most likely appear as duplicated rows of data on the + * display. + * CONFIG_NXWM_STARTWINDOW_STACKSIZE - The stack size to use when starting the + * NxConsole task. Default: 2048 bytes. */ #ifndef CONFIG_NXWM_STARTWINDOW_VSPACING @@ -281,6 +294,39 @@ # define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap #endif +/** + * Start window task parameters + */ + +#ifndef CONFIG_NXWM_STARTWINDOW_MQNAME +# define CONFIG_NXWM_STARTWINDOW_MQNAME "/dev/nxwm" +#endif + +#ifndef CONFIG_NXWM_STARTWINDOW_MXMSGS +# ifdef CONFIG_NX_MXCLIENTMSGS +# define CONFIG_NXWM_STARTWINDOW_MXMSGS CONFIG_NX_MXCLIENTMSGS +# else +# define CONFIG_NXWM_STARTWINDOW_MXMSGS 32 +# endif +#endif + +#ifndef CONFIG_NXWM_STARTWINDOW_MXMPRIO +# define CONFIG_NXWM_STARTWINDOW_MXMPRIO 42 +#endif + +#ifndef CONFIG_NXWM_STARTWINDOW_PRIO +# define CONFIG_NXWM_STARTWINDOW_PRIO SCHED_PRIORITY_DEFAULT +#endif + +#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO" +# warning" -- This can result in data overrun errors" +#endif + +#ifndef CONFIG_NXWM_STARTWINDOW_STACKSIZE +# define CONFIG_NXWM_STARTWINDOW_STACKSIZE 2048 +#endif + /* NxConsole Window *********************************************************/ /** * NxConsole Window Configuration @@ -347,7 +393,7 @@ * CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO - Priority of the touchscreen listener * thread. Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK - Touchscreen listener thread stack - * size. Default 2048 + * size. Default 1024 */ #ifndef CONFIG_NXWM_TOUCHSCREEN_DEVNO @@ -367,7 +413,7 @@ #endif #ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK -# define CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK 2048 +# define CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK 1024 #endif /* Calibration display ******************************************************/ diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index df8c69f11..15d4a4a9d 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -413,6 +413,18 @@ NXWidgets::INxWindow *CApplicationWindow::getWindow(void) const return static_cast(m_window); } +/** + * Recover the contained window control + * + * @return. The window control used by this application + */ + +CWindowControl *CApplicationWindow::getWindowControl(void) const +{ + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + return static_cast(control); +} + /** * Set the window label * diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 2f9adb2e0..248aca838 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/src/capplicationwindow.cxx + * NxWidgets/nxwm/src/ccalibration.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -107,6 +107,11 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, CCalibration::~CCalibration(void) { + // Make sure that the application is not running (it should already + // have been stopped) + + stop(); + // Although we did not create the window, the rule is that I have to dispose // of it @@ -788,4 +793,71 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) return true; } +/** + * CCalibrationFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate calibration + * @param touchscreen. An instance of the class that wraps the + * touchscreen device. + */ +CCalibrationFactory::CCalibrationFactory(CTaskbar *taskbar, CTouchscreen *touchscreen) +{ + m_taskbar = taskbar; + m_touchscreen = touchscreen; +} + +/** + * Create a new instance of an CCalibration (as IApplication). + */ + +IApplication *CCalibrationFactory::create(void) +{ + // Call CTaskBar::openFullScreenWindow to create a full screen window for + // the calibation application + + CFullScreenWindow *window = m_taskbar->openFullScreenWindow(); + if (!window) + { + gdbg("ERROR: Failed to create CFullScreenWindow\n"); + return (IApplication *)0; + } + + // Open the window (it is hot in here) + + if (!window->open()) + { + gdbg("ERROR: Failed to open CFullScreenWindow \n"); + delete window; + return (IApplication *)0; + } + + // Instantiate the application, providing the window to the application's + // constructor + + CCalibration *calibration = new CCalibration(m_taskbar, window, m_touchscreen); + if (!calibration) + { + gdbg("ERROR: Failed to instantiate CCalibration\n"); + delete window; + return (IApplication *)0; + } + + return static_cast(calibration); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CCalibrationFactory::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_CALIBRATION_ICON); + + return bitmap; +} diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index 7d63b02d7..40647d8e9 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -127,6 +127,18 @@ NXWidgets::INxWindow *CFullScreenWindow::getWindow(void) const return static_cast(m_window); } +/** + * Recover the contained window control + * + * @return. The window control used by this application + */ + +CWindowControl *CFullScreenWindow::getWindowControl(void) const +{ + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + return static_cast(control); +} + /** * Set the window label * diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index ec43c5656..577bf661e 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -141,6 +142,11 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) CNxConsole::~CNxConsole(void) { + // There would be a problem if we were stopped with the NxConsole task + // running... that should never happen but we'll check anyway: + + stop(); + // Although we didn't create it, we are responsible for deleting the // application window @@ -504,6 +510,72 @@ void CNxConsole::close(void) m_taskbar->stopApplication(static_cast(this)); } +/** + * CNxConsoleFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate the console + */ + +CNxConsoleFactory::CNxConsoleFactory(CTaskbar *taskbar) +{ + m_taskbar = taskbar; +} + +/** + * Create a new instance of an CNxConsole (as IApplication). + */ + +IApplication *CNxConsoleFactory::create(void) +{ + // Call CTaskBar::openFullScreenWindow to create a full screen window for + // the NxConsole application + + CApplicationWindow *window = m_taskbar->openApplicationWindow(); + if (!window) + { + gdbg("ERROR: Failed to create CApplicationWindow\n"); + return (IApplication *)0; + } + + // Open the window (it is hot in here) + + if (!window->open()) + { + gdbg("ERROR: Failed to open CApplicationWindow\n"); + delete window; + return (IApplication *)0; + } + + // Instantiate the application, providing the window to the application's + // constructor + + CNxConsole *nxconsole = new CNxConsole(m_taskbar, window); + if (!nxconsole) + { + gdbg("ERROR: Failed to instantiate CNxConsole\n"); + delete window; + return (IApplication *)0; + } + + return static_cast(nxconsole); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CNxConsoleFactory::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXCONSOLE_ICON); + + return bitmap; +} + /** * One time NSH initialization. This function must be called exactly * once during the boot-up sequence to initialize the NSH library. diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index de35662d5..1c997fbb7 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -39,6 +39,13 @@ #include +#include +#include +#include +#include + +#include + #include "cwidgetcontrol.hxx" #include "nxwmconfig.hxx" @@ -51,7 +58,7 @@ ********************************************************************************************/ /******************************************************************************************** - * CNxConsole Method Implementations + * CStartWindow Method Implementations ********************************************************************************************/ using namespace NxWM; @@ -70,6 +77,10 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) m_taskbar = taskbar; m_window = window; + // The start window task is not running + + m_taskId = -1; + // Add our personalized window label NXWidgets::CNxString myName = getName(); @@ -86,6 +97,11 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) CStartWindow::~CStartWindow(void) { + // There would be a problem if we were stopped with the start window task + // running... that should never happen but we'll check anyway: + + stop(); + // Although we didn't create it, we are responsible for deleting the // application window @@ -96,7 +112,7 @@ CStartWindow::~CStartWindow(void) // Then stop and delete all applications - stopAllApplications(); + removeAllApplications(); } /** @@ -144,9 +160,24 @@ NXWidgets::CNxString CStartWindow::getName(void) bool CStartWindow::run(void) { - // We don't have a thread of execution. We only respond to button presses + // Some sanity checking - return true; + if (m_taskId >= 0) + { + // The start window task is already running??? + + return false; + } + + // Start the start window task + + m_taskId = TASK_CREATE("StartWindow", CONFIG_NXWM_STARTWINDOW_PRIO, + CONFIG_NXWM_STARTWINDOW_STACKSIZE, startWindow, + (FAR const char **)0); + + // Did we successfully start the NxConsole task? + + return m_taskId >= 0; } /** @@ -155,7 +186,20 @@ bool CStartWindow::run(void) void CStartWindow::stop(void) { - // We don't have a thread of execution. We only respond to button presses + // Delete the start window task --- what are we doing? This should never + // happen because the start window task is persistent! + + if (m_taskId >= 0) + { + // Call task_delete(), possibly stranding resources + + pid_t pid = m_taskId; + m_taskId = -1; + + // Then delete the NSH task + + task_delete(pid); + } } /** @@ -293,21 +337,17 @@ bool CStartWindow::isFullScreen(void) const } /** - * Add the application to the start window. The general sequence for - * setting up the start window is: + * Add the application to the start window. The general sequence is: * - * 1. Call CTaskBar::openApplicationWindow to create a window for the start window, - * 2. Use the window to instantiate CStartWindow - * 3. Call CStartWindow::addApplication numerous times to install applications - * in the start window. - * 4. Call CTaskBar::startApplication (initially minimized) to start the start - * window application. + * 1. Call IAppicationFactory::create to a new instance of the application + * 2. Call CStartWindow::addApplication to add the application to the + * start window. * * @param app. The new application to add to the start window * @return true on success */ -bool CStartWindow::addApplication(IApplication *app) +bool CStartWindow::addApplication(IApplicationFactory *app) { // Recover the NXTK window instance contained in the application window @@ -418,18 +458,17 @@ void CStartWindow::getIconBounds(void) * Stop all applications */ -void CStartWindow::stopAllApplications(void) +void CStartWindow::removeAllApplications(void) { - // Stop all applications and remove them from the task bar. Clearly, there + // Stop all applications and remove them from the start window. Clearly, there // are some ordering issues here... On an orderly system shutdown, disconnection // should really occur priority to deleting instances while (!m_slots.empty()) { - // Stop the application (and remove it from the task bar) + // Remove the application factory from the start menu - IApplication *app = m_slots.at(0).app; - m_taskbar->stopApplication(app); + IApplicationFactory *app = m_slots.at(0).app; // Now, delete the image and the application @@ -459,12 +498,125 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) NXWidgets::CImage *image = m_slots.at(i).image; if (image->isClicked()) { - // Start a new copy of the application + // Create a new copy of the application - m_taskbar->startApplication(m_slots.at(i).app, false); + IApplication *app = m_slots.at(i).app->create(); + if (app) + { + // Start the new copy of the application - // Then break out of the loop + if (m_taskbar->startApplication(app, false)) + { + // Then break out of the loop + break; + } + else + { + // If we cannot start the app. Destroy the + // instance we created and see what happens next. + + CWindowControl *control = app->getWindowControl(); + control->destroy(app); + } + } + } + } +} + +/** + * This is the start window task. This function receives window events from + * the NX listener threads indirectly through this sequence: + * + * 1. NX listener thread receives a windows event. This may be a + * positional change notification, a redraw request, or mouse or + * keyboard input. + * 2. The NX listener thread performs the callback by calling a + * NXWidgets::CCallback method associated with the window. + * 3. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process + * the event. + * 4. NXWidgets::CWidgetControl records the new state data and raises a + * window event. + * 5. NXWidgets::CWindowEventHandlerList will give the event to + * NxWM::CWindowControl. + * 6. NxWM::CWindowControl will send the a message on a well-known message + * queue. + * 7. This CStartWindow::startWindow task will receive and process that + * message. + */ + +int CStartWindow::startWindow(int argc, char *argv[]) +{ + /* Open a well-known message queue for reading */ + + struct mq_attr attr; + attr.mq_maxmsg = CONFIG_NXWM_STARTWINDOW_MXMSGS; + attr.mq_msgsize = sizeof(struct SStartWindowMessage); + attr.mq_flags = 0; + + mqd_t mqd = mq_open(CONFIG_NXWM_STARTWINDOW_MQNAME, O_RDONLY|O_CREAT, 0666, &attr); + if (mqd == (mqd_t)-1) + { + gdbg("ERROR: mq_open(%s) failed: %d\n", CONFIG_NXWM_STARTWINDOW_MQNAME, errno); + return EXIT_FAILURE; + } + + // Now loop forever, receiving and processing messages. Ultimately, all + // widget driven events (button presses, etc.) are driven by this logic + // on this thread. + + for (;;) + { + // Receive the next message + + struct SStartWindowMessage msg; + ssize_t nbytes = mq_receive(mqd, &msg, sizeof(struct SStartWindowMessage), 0); + if (nbytes < 0) + { + // EINTR is not an error. The wait was interrupted by a signal and + // we just need to try reading again. + + if (errno != EINTR) + { + gdbg("ERROR: mq_receive failed: %d\n", errno); + } + } + while (nbytes < 0); + + gvdbg("Received msgid=%d nbytes=%d\n", msg.msgId, nbytes); + DEBUGASSERT(nbytes = sizeof(struct SStartWindowMessage) && msg.instance); + + // Dispatch the message to the appropriate CWidgetControl and to the + // appropriate CWidgetControl method + + switch (msg.msgId) + { + break; + + case MSGID_MOUSE_INPUT: // New mouse input is available + case MSGID_KEYBOARD_INPUT: // New keyboard input is available + { + // Handle all new window input events by calling the CWidgetControl::pollEvents() method + + NXWidgets::CWidgetControl *control = (NXWidgets::CWidgetControl *)msg.instance; + control->pollEvents(); + } + break; + + case MSGID_DESTROY_APP: // Destroy the application + { + // Handle all destroy application events + + gdbg("Deleting app=%p\n", msg.instance); + IApplication *app = (IApplication *)msg.instance; + delete app; + } + break; + + case MSGID_POSITIONAL_CHANGE: // Change in window positional data (not used) + case MSGID_REDRAW_REQUEST: // Request to redraw a portion of the window (not used) + default: + gdbg("ERROR: Unrecognized or unsupported msgId: %d\n", (int)msg.msgId); break; } } diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index ec3d8460b..ab686f81c 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -609,7 +609,9 @@ bool CTaskbar::stopApplication(IApplication *app) hideApplicationWindow(app); - // Stop the application (whatever this means to the application) + // Stop the application (whatever this means to the application). We + // separate stopping from destroying to get the application a chance + // to put things in order before being destroyed. app->stop(); @@ -631,6 +633,11 @@ bool CTaskbar::stopApplication(IApplication *app) } } + // destroy the application + + CWindowControl *control = app->getWindowControl(); + control->destroy(app); + // Re-draw the new top, non-minimized application bool ret = redrawTopWindow(); diff --git a/nxwm/src/cwindowcontrol.cxx b/nxwm/src/cwindowcontrol.cxx index 841397a14..2c575d35b 100644 --- a/nxwm/src/cwindowcontrol.cxx +++ b/nxwm/src/cwindowcontrol.cxx @@ -36,9 +36,16 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include +#include +#include + +#include + +#include "nxwmconfig.hxx" +#include "cstartwindow.hxx" #include "cwindowcontrol.hxx" /******************************************************************************************** @@ -62,6 +69,20 @@ using namespace NxWM; CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) : NXWidgets::CWidgetControl(style) { + // Open a message queue to communicate with the start window task. We need to create + // the message queue if it does not exist. + + struct mq_attr attr; + attr.mq_maxmsg = CONFIG_NXWM_STARTWINDOW_MXMSGS; + attr.mq_msgsize = sizeof(struct SStartWindowMessage); + attr.mq_flags = 0; + + m_mqd = mq_open(CONFIG_NXWM_STARTWINDOW_MQNAME, O_WRONLY|O_CREAT, 0666, &attr); + if (m_mqd == (mqd_t)-1) + { + gdbg("ERROR: mq_open(%s) failed: %d\n", CONFIG_NXWM_STARTWINDOW_MQNAME, errno); + } + // Add ourself as the window callback addWindowEventHandler(this); @@ -73,11 +94,41 @@ CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) CWindowControl::~CWindowControl(void) { + // Close the message queue + + (void)mq_close(m_mqd); + // Remove ourself from the window callback removeWindowEventHandler(this); } +/** + * Destroy the application window and everything in it. This is + * handled by CWindowControl (vs just calling the destructors) because + * in the case where an application destroys itself (because of pressing + * the stop button), then we need to unwind and get out of the application + * logic before destroying all of its objects. + */ + +void CWindowControl::destroy(IApplication *app) +{ + // Send a message to destroy the window isntance at a later time + + struct SStartWindowMessage outmsg; + outmsg.msgId = MSGID_DESTROY_APP; + outmsg.instance = (FAR void *)app; + + gdbg("Sending MSGID_DESTROY_APP with instance=%p\n", app); + int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), + CONFIG_NXWM_STARTWINDOW_MXMPRIO); + if (ret < 0) + { + gdbg("ERROR: mq_send failed: %d\n", errno); + } + +} + /** * Handle an NX window mouse input event. * @@ -89,24 +140,40 @@ void CWindowControl::handleMouseEvent(void) { // The logic path here is tortuous but flexible: // - // 1. A listener thread receives mouse input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the mouse input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update mouse information then raise the - // mouse event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the widget control to process - // the mouse input. + // 1. A listener thread receives mouse or touchscreen input and injects + // that into NX via nx_mousein + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the mouse input + // and send a window event message to the NX listener thread. + // 4. The NX listener thread receives a windows event. The NX listener thread + // which is part of CTaskBar and was created when NX server connection was + // established). This event may be a positional change notification, a + // redraw request, or mouse or keyboard input. In this case, mouse input. + // 5. The NX listener thread handles the message by calling nx_eventhandler(). + // nx_eventhandler() dispatches the message by calling a method in the + // NXWidgets::CCallback instance associated with the window. + // NXWidgets::CCallback is a part of the CWidgetControl. + // 6. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process + // the event. + // 7. NXWidgets::CWidgetControl records the new state data and raises a + // window event. + // 8. NXWidgets::CWindowEventHandlerList will give the event to this method + // NxWM::CWindowControl. + // 9. This NxWM::CWindowControl method will send the a message on a well- + // known message queue. + // 10. This CStartWindow::startWindow task will receive and process that + // message by calling CWidgetControl::pollEvents() - // Perform the poll + struct SStartWindowMessage outmsg; + outmsg.msgId = MSGID_MOUSE_INPUT; + outmsg.instance = (FAR void *)static_cast(this); - pollEvents(); + int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), + CONFIG_NXWM_STARTWINDOW_MXMPRIO); + if (ret < 0) + { + gdbg("ERROR: mq_send failed: %d\n", errno); + } } #endif @@ -119,25 +186,39 @@ void CWindowControl::handleKeyboardEvent(void) { // The logic path here is tortuous but flexible: // - // 1. A listener thread receives keyboard input and injects that into NX - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the keyboard input - // and send a message to the listener. - // 4. The listener will call the NX message dispatcher will will do the - // message callback. - // 5. The callback goes into an instance of NXWidgets::CCallback that is - // part of the CWidget control. - // 6. That callback will update keyboard information then raise the - // keyboard event, - // 7. Which will finally call this function -- still running deep on the - // stack in the listener thread. - // 8. This function will then call back into the widget control to process - // the keyboard input. + // 1. A listener thread receives keyboard input and injects that into NX + // via nx_kbdin. + // 2. In the multi-user mode, this will send a message to the NX server + // 3. The NX server will determine which window gets the keyboard input + // and send a window event message to the NX listener thread. + // 4. The NX listener thread receives a windows event. The NX listener thread + // which is part of CTaskBar and was created when NX server connection was + // established). This event may be a positional change notification, a + // redraw request, or mouse or keyboard input. In this case, keyboard input. + // 5. The NX listener thread handles the message by calling nx_eventhandler(). + // nx_eventhandler() dispatches the message by calling a method in the + // NXWidgets::CCallback instance associated with the window. + // NXWidgets::CCallback is a part of the CWidgetControl. + // 6. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process + // the event. + // 7. NXWidgets::CWidgetControl records the new state data and raises a + // window event. + // 8. NXWidgets::CWindowEventHandlerList will give the event to this method + // NxWM::CWindowControl. + // 9. This NxWM::CWindowControl method will send the a message on a well- + // known message queue. + // 10. This CStartWindow::startWindow task will receive and process that + // message by calling CWidgetControl::pollEvents() - // Perform the poll + struct SStartWindowMessage outmsg; + outmsg.msgId = MSGID_KEYBOARD_INPUT; + outmsg.instance = (FAR void *)static_cast(this); - pollEvents(); + int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), + CONFIG_NXWM_STARTWINDOW_MXMPRIO); + if (ret < 0) + { + gdbg("ERROR: mq_send failed: %d\n", errno); + } } #endif - - From 87e557af843a87c3297bff0be2f4ef90feefd3a8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 17 May 2012 16:55:13 +0000 Subject: [PATCH 060/390] Fix a C++ link issue: If constant strings used only in constructor, the don't get linked into the final executable git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4743 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/src/cwidgetcontrol.cxx | 2 +- nxwm/include/cstartwindow.hxx | 6 ++++++ nxwm/src/cstartwindow.cxx | 22 +++++++++++++++++----- nxwm/src/cwindowcontrol.cxx | 9 ++++----- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 9d2c5c7e9..644abd714 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -803,7 +803,7 @@ bool CWidgetControl::pollMouseEvents(CNxWidget *widget) else if (m_mouse.leftDrag) { // The left button is still being held down - + if (m_clickedWidget != (CNxWidget *)NULL) { // Handle a mouse drag event diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index b0cad6127..8b5fd92d3 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -85,6 +85,12 @@ namespace NxWM enum EStartWindowMessageOpcodes msgId; /**< The message opcode */ FAR void *instance; /**< Object instance. */ }; + + /** + * The well-known name for the Start Window's message queue. + */ + + extern FAR const char *g_startWindowMqName; /** * This class is the the start window application. diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 1c997fbb7..2b7ecbe66 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cnxconsole.cxx + * NxWidgets/nxwm/src/cstartwindow.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,6 +57,16 @@ * Pre-Processor Definitions ********************************************************************************************/ +/******************************************************************************************** + * Global Data + ********************************************************************************************/ + +/** + * The well-known name for the Start Window's message queue. + */ + +FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME; + /******************************************************************************************** * CStartWindow Method Implementations ********************************************************************************************/ @@ -554,10 +564,10 @@ int CStartWindow::startWindow(int argc, char *argv[]) attr.mq_msgsize = sizeof(struct SStartWindowMessage); attr.mq_flags = 0; - mqd_t mqd = mq_open(CONFIG_NXWM_STARTWINDOW_MQNAME, O_RDONLY|O_CREAT, 0666, &attr); + mqd_t mqd = mq_open(g_startWindowMqName, O_RDONLY|O_CREAT, 0666, &attr); if (mqd == (mqd_t)-1) { - gdbg("ERROR: mq_open(%s) failed: %d\n", CONFIG_NXWM_STARTWINDOW_MQNAME, errno); + gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); return EXIT_FAILURE; } @@ -573,12 +583,14 @@ int CStartWindow::startWindow(int argc, char *argv[]) ssize_t nbytes = mq_receive(mqd, &msg, sizeof(struct SStartWindowMessage), 0); if (nbytes < 0) { + int errval = errno; + // EINTR is not an error. The wait was interrupted by a signal and // we just need to try reading again. - if (errno != EINTR) + if (errval != EINTR) { - gdbg("ERROR: mq_receive failed: %d\n", errno); + gdbg("ERROR: mq_receive failed: %d\n", errval); } } while (nbytes < 0); diff --git a/nxwm/src/cwindowcontrol.cxx b/nxwm/src/cwindowcontrol.cxx index 2c575d35b..6c2144bad 100644 --- a/nxwm/src/cwindowcontrol.cxx +++ b/nxwm/src/cwindowcontrol.cxx @@ -77,10 +77,10 @@ CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) attr.mq_msgsize = sizeof(struct SStartWindowMessage); attr.mq_flags = 0; - m_mqd = mq_open(CONFIG_NXWM_STARTWINDOW_MQNAME, O_WRONLY|O_CREAT, 0666, &attr); + m_mqd = mq_open(g_startWindowMqName, O_WRONLY|O_CREAT, 0666, &attr); if (m_mqd == (mqd_t)-1) { - gdbg("ERROR: mq_open(%s) failed: %d\n", CONFIG_NXWM_STARTWINDOW_MQNAME, errno); + gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); } // Add ourself as the window callback @@ -126,7 +126,6 @@ void CWindowControl::destroy(IApplication *app) { gdbg("ERROR: mq_send failed: %d\n", errno); } - } /** @@ -166,7 +165,7 @@ void CWindowControl::handleMouseEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_MOUSE_INPUT; - outmsg.instance = (FAR void *)static_cast(this); + outmsg.instance = (FAR void *)this; int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); @@ -212,7 +211,7 @@ void CWindowControl::handleKeyboardEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_KEYBOARD_INPUT; - outmsg.instance = (FAR void *)static_cast(this); + outmsg.instance = (FAR void *)this; int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); From daa19c57c60c7a7d782f07330d500ebf84134796 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 17 May 2012 22:16:02 +0000 Subject: [PATCH 061/390] Implement an NX interface to block flush message queues in multi-user mode. This is necessary to prevent stale window handles when a window is closed git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4745 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/ccallback.hxx | 77 ++++++---- libnxwidgets/include/cwidgetcontrol.hxx | 25 ++++ libnxwidgets/include/cwindoweventhandler.hxx | 6 + .../include/cwindoweventhandlerlist.hxx | 6 + libnxwidgets/src/ccallback.cxx | 140 +++++++++++------- libnxwidgets/src/cwindoweventhandlerlist.cxx | 11 ++ 6 files changed, 187 insertions(+), 78 deletions(-) diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 0e0d5de8b..ca3313a9b 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -99,16 +99,16 @@ namespace NXWidgets * either be the context of the owning thread or, in the case of multi- * user NX, the context of the NX event listener thread. * - * @param hWindow Handle to a specific NX window. - * @param pRect The rectangle that needs to be re-drawn (in window + * @param hwnd Handle to a specific NX window. + * @param rect The rectangle that needs to be re-drawn (in window * relative coordinates). * @param bMore true: More re-draw requests will follow. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - static void redraw(NXHANDLE hWindow, FAR const struct nxgl_rect_s *pRect, - bool bMore, FAR void *pvArg); + static void redraw(NXHANDLE hwnd, FAR const struct nxgl_rect_s *rect, + bool bMore, FAR void *arg); /** * Position Callback. The new positional data is handled by @@ -118,19 +118,19 @@ namespace NXWidgets * either be the context of the owning thread or, in the case of multi- * user NX, the context of the NX event listener thread. * - * @param hWindow Handle to a specific NX window. - * @param pSize The size of the window. - * @param pPos The position of the upper left hand corner of the window on + * @param hwnd Handle to a specific NX window. + * @param size The size of the window. + * @param pos The position of the upper left hand corner of the window on * the overall display. - * @param pBounds The bounding rectangle that describes the entire display. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param bounds The bounding rectangle that describes the entire display. + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - static void position(NXHANDLE hWindow, FAR const struct nxgl_size_s *pSize, - FAR const struct nxgl_point_s *pPos, - FAR const struct nxgl_rect_s *pBounds, - FAR void *pvArg); + static void position(NXHANDLE hwnd, FAR const struct nxgl_size_s *size, + FAR const struct nxgl_point_s *pos, + FAR const struct nxgl_rect_s *bounds, + FAR void *arg); /** * New mouse data is available for the window. The new mouse @@ -144,16 +144,17 @@ namespace NXWidgets * The GUI thread is probably sleeping a semaphore, waiting to be * awakened by a mouse or keyboard event. * - * @param hWindow Handle to a specific NX window. - * @param pPos The (x,y) position of the mouse. + * @param hwnd Handle to a specific NX window. + * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ #ifdef CONFIG_NX_MOUSE - static void newMouseEvent(NXHANDLE hWindow, FAR const struct nxgl_point_s *pPos, - uint8_t buttons, FAR void *pvArg); + static void newMouseEvent(NXHANDLE hwnd, + FAR const struct nxgl_point_s *pos, + uint8_t buttons, FAR void *arg); #endif /* CONFIG_NX_MOUSE */ /** @@ -168,27 +169,49 @@ namespace NXWidgets * The GUI thread is probably sleeping a semaphore, waiting to be * awakened by a mouse or keyboard event. * - * @param hWindow Handle to a specific NX window. - * @param nCh The number of characters that are available in pStr[]. - * @param pStr The array of characters. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param hwnd Handle to a specific NX window. + * @param nCh The number of characters that are available in str[]. + * @param str The array of characters. + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ #ifdef CONFIG_NX_KBD - static void newKeyboardEvent(NXHANDLE hWindow, uint8_t nCh, FAR const uint8_t *pStr, - FAR void *pvArg); + static void newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, + FAR const uint8_t *str, FAR void *arg); #endif // CONFIG_NX_KBD + /** + * This callback is the response from nx_block (or nxtk_block). Those + * blocking interfaces are used to assure that no further messages are + * directed to the window. Receipt of the blocked callback signifies + * that (1) there are no further pending callbacks and (2) that the + * window is now 'defunct' and will receive no further callbacks. + * + * This callback supports coordinated destruction of a window in multi- + * user mode. In multi-use mode, the client window logic must stay + * intact until all of the queued callbacks are processed. Then the + * window may be safely closed. Closing the window prior with pending + * callbacks can lead to bad behavior when the callback is executed. + * + * @param hwnd. Window handle of the blocked window + * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * nxtk_openwindow, or nxtk_opentoolbar) + */ + +#ifdef CONFIG_NX_MULTIUSER + static void windowBlocked(NXWINDOW hwnd, FAR void *arg); +#endif + public: /** * Constructor. * - * @param pWidgetControl Control object associated with this window + * @param widgetControl Control object associated with this window */ - CCallback(CWidgetControl *pWidgetControl); + CCallback(CWidgetControl *widgetControl); /** * Destructor. diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 757dc1c5b..453cc1115 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -596,6 +596,31 @@ namespace NXWidgets void newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr); #endif + /** + * This event is the response from nx_block (or nxtk_block). Those + * blocking interfaces are used to assure that no further messages are + * directed to the window. Receipt of the blocked callback signifies + * that (1) there are no further pending events and (2) that the + * window is now 'defunct' and will receive no further events. + * + * This event supports coordinated destruction of a window in multi- + * user mode. In multi-use mode, the client window logic must stay + * intact until all of the queued callbacks are processed. Then the + * window may be safely closed. Closing the window prior with pending + * callbacks can lead to bad behavior when the callback is executed. + * + * @param hwnd. Window handle of the blocked window + * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * nxtk_openwindow, or nxtk_opentoolbar) + */ + +#ifdef CONFIG_NX_MULTIUSER + inline void windowBlocked(void) + { + m_eventHandlers.raiseBlockedEvent(); + } +#endif + /** * This event means that cursor control data is available for the window. * diff --git a/libnxwidgets/include/cwindoweventhandler.hxx b/libnxwidgets/include/cwindoweventhandler.hxx index 1cea0ba68..c414abadb 100644 --- a/libnxwidgets/include/cwindoweventhandler.hxx +++ b/libnxwidgets/include/cwindoweventhandler.hxx @@ -105,6 +105,12 @@ namespace NXWidgets #ifdef CONFIG_NX_KBD virtual void handleKeyboardEvent(void) { } #endif + + /** + * Handle a NX window blocked event + */ + + virtual void handleBlockedEvent(void) { } }; } diff --git a/libnxwidgets/include/cwindoweventhandlerlist.hxx b/libnxwidgets/include/cwindoweventhandlerlist.hxx index 582805691..d9e17de09 100644 --- a/libnxwidgets/include/cwindoweventhandlerlist.hxx +++ b/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -160,6 +160,12 @@ namespace NXWidgets #ifdef CONFIG_NX_KBD void raiseKeyboardEvent(void); #endif + + /** + * Raise an NX window blocked event. + */ + + void raiseBlockedEvent(void); }; } diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 25cb228b3..09dc53a5a 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -60,108 +60,113 @@ using namespace NXWidgets; /** * Constructor. * - * @param pWidgetControl Control object associated with this window + * @param widgetControl Control object associated with this window */ -CCallback::CCallback(CWidgetControl *pWidgetControl) +CCallback::CCallback(CWidgetControl *widgetControl) { // Initialize the callback vtable m_callbacks.redraw = redraw; m_callbacks.position = position; +#ifdef CONFIG_NX_MOUSE m_callbacks.mousein = newMouseEvent; +#endif +#ifdef CONFIG_NX_KBD m_callbacks.kbdin = newKeyboardEvent; +#endif + m_callbacks.blocked = windowBlocked; } /** * ReDraw Callback. The redraw action is handled by CWidgetControl:redrawEvent. * - * @param hWindow Handle to a specific NX window. - * @param pRect The rectangle that needs to be re-drawn (in window + * @param hwnd Handle to a specific NX window. + * @param rect The rectangle that needs to be re-drawn (in window * relative coordinates). * @param bMore true: More re-draw requests will follow. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ -void CCallback::redraw(NXHANDLE hWindow, - FAR const struct nxgl_rect_s *pRect, - bool bMore, FAR void *pvArg) +void CCallback::redraw(NXHANDLE hwnd, + FAR const struct nxgl_rect_s *rect, + bool bMore, FAR void *arg) { - gvdbg("hWindow=%p pRect={(%d,%d),(%d,%d)} bMore=%s\n", - hWindow, - pRect->pt1.x, pRect->pt1.y, pRect->pt2.x, pRect->pt2.y, + gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} bMore=%s\n", + hwnd, + rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, bMore ? "true" : "false"); // The argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)pvArg; + CWidgetControl *This = (CWidgetControl *)arg; // Just forward the callback to the CWidgetControl::redrawEvent method - This->redrawEvent(pRect, bMore); + This->redrawEvent(rect, bMore); } /** * Position Callback. The new positional data is handled by * CWidgetControl::geometryEvent. * - * @param hWindow Handle to a specific NX window. - * @param pSize The size of the window. - * @param pPos The position of the upper left hand corner of the window on + * @param hwnd Handle to a specific NX window. + * @param size The size of the window. + * @param pos The position of the upper left hand corner of the window on * the overall display. - * @param pBounds The bounding rectangle that describes the entire display. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param bounds The bounding rectangle that describes the entire display. + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ -void CCallback::position(NXHANDLE hWindow, - FAR const struct nxgl_size_s *pSize, - FAR const struct nxgl_point_s *pPos, - FAR const struct nxgl_rect_s *pBounds, - FAR void *pvArg) +void CCallback::position(NXHANDLE hwnd, + FAR const struct nxgl_size_s *size, + FAR const struct nxgl_point_s *pos, + FAR const struct nxgl_rect_s *bounds, + FAR void *arg) { - gvdbg("hWindow=%p pSize=(%d,%d) pPos=(%d,%d) pBounds={(%d,%d),(%d,%d)} pvArg=%p\n", - hWindow, pSize->w, pSize->h, pPos->x, pPos->y, - pBounds->pt1.x, pBounds->pt1.y, pBounds->pt2.x, pBounds->pt2.y, - pvArg); + gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)} arg=%p\n", + hwnd, size->w, size->h, pos->x, pos->y, + bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y, + arg); // The argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)pvArg; + CWidgetControl *This = (CWidgetControl *)arg; // Just forward the callback to the CWidgetControl::geometry method - This->geometryEvent(hWindow, pSize, pPos, pBounds); + This->geometryEvent(hwnd, size, pos, bounds); } /** * New mouse data is available for the window. The new mouse data is * handled by CWidgetControl::newMouseEvent. * - * @param hWindow Handle to a specific NX window. - * @param pPos The (x,y) position of the mouse. + * @param hwnd Handle to a specific NX window. + * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - + #ifdef CONFIG_NX_MOUSE -void CCallback::newMouseEvent(NXHANDLE hWindow, - FAR const struct nxgl_point_s *pPos, - uint8_t buttons, FAR void *pvArg) +void CCallback::newMouseEvent(NXHANDLE hwnd, + FAR const struct nxgl_point_s *pos, + uint8_t buttons, FAR void *arg) { - gvdbg("hWindow=%p pPos=(%d,%d) buttons=%02x pvArg=%p\n", - hWindow, pPos->x, pPos->y, buttons, pvArg); + gvdbg("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", + hwnd, pos->x, pos->y, buttons, arg); // The argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)pvArg; + CWidgetControl *This = (CWidgetControl *)arg; // Just forward the callback to the CWidgetControl::newMouseEvent method - This->newMouseEvent(pPos, buttons); + This->newMouseEvent(pos, buttons); } #endif /* CONFIG_NX_MOUSE */ @@ -169,27 +174,60 @@ void CCallback::newMouseEvent(NXHANDLE hWindow, * New keyboard/keypad data is available for the window. The new keyboard * data is handled by CWidgetControl::newKeyboardEvent. * - * @param hWindow Handle to a specific NX window. - * @param nCh The number of characters that are available in pStr[]. - * @param pStr The array of characters. - * @param pvArg User provided argument (see nx_openwindow, nx_requestbg, + * @param hwnd Handle to a specific NX window. + * @param nCh The number of characters that are available in str[]. + * @param str The array of characters. + * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ #ifdef CONFIG_NX_KBD -void CCallback::newKeyboardEvent(NXHANDLE hWindow, uint8_t nCh, - FAR const uint8_t *pStr, - FAR void *pvArg) +void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, + FAR const uint8_t *str, + FAR void *arg) { - gvdbg("hWindow=%p nCh=%d pvArg=%p\n", - hWindow, nCh, pvArg); + gvdbg("hwnd=%p nCh=%d arg=%p\n", hwnd, nCh, arg); // The argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)pvArg; + CWidgetControl *This = (CWidgetControl *)arg; // Just forward the callback to the CWidgetControl::newKeyboardEvent method - This->newKeyboardEvent(nCh, pStr); + This->newKeyboardEvent(nCh, str); } + +/** + * This callback is the response from nx_block (or nxtk_block). Those + * blocking interfaces are used to assure that no further messages are + * directed to the window. Receipt of the blocked callback signifies + * that (1) there are no further pending callbacks and (2) that the + * window is now 'defunct' and will receive no further callbacks. + * + * This callback supports coordinated destruction of a window in multi- + * user mode. In multi-use more, the client window logic must stay + * intact until all of the queued callbacks are processed. Then the + * window may be safely closed. Closing the window prior with pending + * callbacks can lead to bad behavior when the callback is executed. + * + * @param hwnd. Window handle of the blocked window + * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * nxtk_openwindow, or nxtk_opentoolbar) + */ + +#ifdef CONFIG_NX_MULTIUSER +void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg) +{ + gvdbg("hwnd=%p arg=%p\n", hwnd, arg); + + // The argument must be the CWidgetControl instance + + CWidgetControl *This = (CWidgetControl *)arg; + + // Just forward the callback to the CWidgetControl::windowBlocked method + + This->windowBlocked(); +} +#endif + #endif // CONFIG_NX_KBD diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index 5f3048b63..15b2c65ff 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -160,3 +160,14 @@ void CWindowEventHandlerList::raiseKeyboardEvent(void) #endif } +/** + * Raise an NX window blocked event. + */ + +void CWindowEventHandlerList::raiseBlockedEvent(void) +{ + for (int i = 0; i < m_eventHandlers.size(); ++i) + { + m_eventHandlers.at(i)->handleBlockedEvent(); + } +} From ad63005d6a85a6b13b9a3e38b61c8d0cabe832de Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 18 May 2012 23:08:34 +0000 Subject: [PATCH 062/390] Final refactoring and implementation of delayed window deletion logic. Works worse now, but the changes are important and need to be checked in now git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4747 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/nxwm/main.cxx | 52 +++++++-- libnxwidgets/include/ibitmap.hxx | 9 ++ libnxwidgets/include/ilistbox.hxx | 8 ++ .../include/ilistdataeventhandler.hxx | 9 ++ libnxwidgets/include/inxwindow.hxx | 8 ++ libnxwidgets/include/iscrollable.hxx | 9 ++ libnxwidgets/include/islider.hxx | 8 ++ libnxwidgets/include/itextbox.hxx | 8 ++ libnxwidgets/src/ccallback.cxx | 2 +- libnxwidgets/src/cnxwindow.cxx | 2 +- nxwm/Makefile | 12 ++- nxwm/doc/NxWM-ThreadingModel.ppt | Bin 92672 -> 126464 bytes nxwm/include/capplicationwindow.hxx | 30 ++++-- nxwm/include/ccalibration.hxx | 13 +++ nxwm/include/cfullscreenwindow.hxx | 30 ++++-- nxwm/include/cnxconsole.hxx | 21 +++- nxwm/include/cstartwindow.hxx | 56 +++++----- nxwm/include/ctaskbar.hxx | 37 ++----- ...windowcontrol.hxx => cwindowmessenger.hxx} | 27 ++--- nxwm/include/iapplication.hxx | 29 +++-- nxwm/include/iapplicationwindow.hxx | 41 +++++-- nxwm/include/nxwmconfig.hxx | 2 +- nxwm/src/capplicationwindow.cxx | 73 +++++++++---- nxwm/src/ccalibration.cxx | 30 ++++++ nxwm/src/cfullscreenwindow.cxx | 40 +++++-- nxwm/src/cnxconsole.cxx | 37 ++++++- nxwm/src/cstartwindow.cxx | 90 ++++++++++++++-- nxwm/src/ctaskbar.cxx | 100 +++++++++++++++--- ...windowcontrol.cxx => cwindowmessenger.cxx} | 43 +++----- 29 files changed, 602 insertions(+), 224 deletions(-) rename nxwm/include/{cwindowcontrol.hxx => cwindowmessenger.hxx} (81%) rename nxwm/src/{cwindowcontrol.cxx => cwindowmessenger.cxx} (87%) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 6a2e952d8..86ea324d5 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -46,10 +46,13 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" -#include "ctouchscreen.hxx" -#include "ccalibration.hxx" #include "cnxconsole.hxx" +#ifdef CONFIG_NXWM_TOUCHSCREEN +# include "ctouchscreen.hxx" +# include "ccalibration.hxx" +#endif + ///////////////////////////////////////////////////////////////////////////// // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// @@ -67,10 +70,19 @@ #ifdef CONFIG_HAVE_FILENAME # define showTestStepMemory(msg) \ _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) -# define showTestCaseMemory(msg) \ - _showTestCaseMemory((FAR const char*)__FILE__, (int)__LINE__, msg) -# define showTestMemory(msg) \ - _showTestMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +#endif + +#ifdef CONFIG_NXWIDGET_MEMMONITOR +# ifdef CONFIG_HAVE_FILENAME +# define showTestCaseMemory(msg) \ + _showTestCaseMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# define showTestMemory(msg) \ + _showTestMemory((FAR const char*)__FILE__, (int)__LINE__, msg) +# endif +#else +# define initMemoryUsage() +# define showTestCaseMemory(msg) +# define showTestMemory(msg) #endif ///////////////////////////////////////////////////////////////////////////// @@ -85,9 +97,11 @@ struct SNxWmTest NxWM::CTouchscreen *touchscreen; // The touchscreen struct NxWM::SCalibrationData calibData; // Calibration data #endif +#ifdef CONFIG_NXWIDGET_MEMMONITOR unsigned int mmInitial; // Initial memory usage unsigned int mmStep; // Memory Usage at beginning of test step unsigned int mmSubStep; // Memory Usage at beginning of test sub-step +#endif }; ///////////////////////////////////////////////////////////////////////////// @@ -112,6 +126,7 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // Name: updateMemoryUsage ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void updateMemoryUsage(unsigned int *previous, FAR const char *file, int line, @@ -145,11 +160,13 @@ static void updateMemoryUsage(unsigned int *previous, *previous = mmcurrent.uordblks; } +#endif ///////////////////////////////////////////////////////////////////////////// // Name: showTestCaseMemory ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void _showTestCaseMemory(FAR const char *file, int line, FAR const char *msg) { @@ -163,11 +180,13 @@ static void showTestCaseMemory(FAR const char *msg) g_nxwmtest.mmSubStep = g_nxwmtest.mmInitial; } #endif +#endif ///////////////////////////////////////////////////////////////////////////// // Name: showTestMemory ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR #ifdef CONFIG_HAVE_FILENAME static void _showTestMemory(FAR const char *file, int line, FAR const char *msg) { @@ -179,11 +198,13 @@ static void showTestMemory(FAR const char *msg) updateMemoryUsage(&g_nxwmtest.mmInitial, msg); } #endif +#endif ///////////////////////////////////////////////////////////////////////////// // Name: initMemoryUsage ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWIDGET_MEMMONITOR static void initMemoryUsage(void) { struct mallinfo mmcurrent; @@ -198,6 +219,7 @@ static void initMemoryUsage(void) g_nxwmtest.mmStep = mmcurrent.uordblks; g_nxwmtest.mmSubStep = mmcurrent.uordblks; } +#endif ///////////////////////////////////////////////////////////////////////////// // Name: cleanup @@ -361,7 +383,7 @@ static bool startWindowManager(void) return false; } - showTestCaseMemory("AstartWindowManager: fter starting the window manager"); + showTestCaseMemory("startWindowManager: After starting the window manager"); return true; } @@ -497,12 +519,16 @@ static bool createNxConsole(void) #ifdef CONFIG_HAVE_FILENAME void _showTestStepMemory(FAR const char *file, int line, FAR const char *msg) { +#ifdef CONFIG_NXWIDGET_MEMMONITOR updateMemoryUsage(&g_nxwmtest.mmSubStep, file, line, msg); +#endif } #else void showTestStepMemory(FAR const char *msg) { +#ifdef CONFIG_NXWIDGET_MEMMONITOR updateMemoryUsage(&g_nxwmtest.mmSubStep, msg); +#endif } #endif @@ -608,19 +634,23 @@ int MAIN_NAME(int argc, char *argv[]) } #endif - // Wait a little bit for the display to stabilize. The simulation pressing of + // Wait a little bit for the display to stabilize. Then simulate pressing of // the 'start window' icon in the task bar #ifndef CONFIG_NXWM_TOUCHSCREEN sleep(2); - g_nxwmtest.taskbar->clickIcon(0); + g_nxwmtest.taskbar->clickIcon(0, true); + usleep(500*1000); + g_nxwmtest.taskbar->clickIcon(0, false); showTestCaseMemory(MAIN_STRING "After clicking the start window icon"); - // Wait bit to see the result of the button press. The press the first icon + // Wait bit to see the result of the button press. Then press the first icon // in the start menu. That should be the NxConsole icon. sleep(2); - g_nxwmtest.startwindow->clickIcon(0); + g_nxwmtest.startwindow->clickIcon(0, true); + usleep(500*1000); + g_nxwmtest.startwindow->clickIcon(0, false); showTestCaseMemory(MAIN_STRING "After clicking the NxConsole icon"); #endif diff --git a/libnxwidgets/include/ibitmap.hxx b/libnxwidgets/include/ibitmap.hxx index 5eaa5b3c9..923df407a 100644 --- a/libnxwidgets/include/ibitmap.hxx +++ b/libnxwidgets/include/ibitmap.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IBitmap { public: + /** + * A virtual destructor is required in order to override the IBitmap + * destructor. We do this because if we delete IBitmap, we want the + * destructor of the class that inherits from IBitmap to run, not this + * one. + */ + + virtual ~IBitmap(void) { } + /** * Get the bitmap's color format. * diff --git a/libnxwidgets/include/ilistbox.hxx b/libnxwidgets/include/ilistbox.hxx index 9184f23c8..0eb33bc3b 100644 --- a/libnxwidgets/include/ilistbox.hxx +++ b/libnxwidgets/include/ilistbox.hxx @@ -102,6 +102,14 @@ namespace NXWidgets class IListBox { public: + /** + * A virtual destructor is required in order to override the IListBox + * destructor. We do this because if we delete IListBox, we want the + * destructor of the class that inherits from IListBox to run, not this + * one. + */ + + virtual ~IListBox(void) { } /** * Add a new option to the widget using default colors. diff --git a/libnxwidgets/include/ilistdataeventhandler.hxx b/libnxwidgets/include/ilistdataeventhandler.hxx index b6119a2ae..26bf1411b 100644 --- a/libnxwidgets/include/ilistdataeventhandler.hxx +++ b/libnxwidgets/include/ilistdataeventhandler.hxx @@ -103,6 +103,15 @@ namespace NXWidgets class IListDataEventHandler { public: + /** + * A virtual destructor is required in order to override the IListDataEventHandler + * destructor. We do this because if we delete IListDataEventHandler, we want the + * destructor of the class that inherits from IListDataEventHandler to run, not this + * one. + */ + + virtual ~IListDataEventHandler(void) { } + /** * Handle data changes. * diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index c38052de0..750994a71 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -79,6 +79,14 @@ namespace NXWidgets class INxWindow { public: + /** + * 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. + */ + + virtual ~INxWindow(void) { } /** * Creates a new window. Window creation is separate from diff --git a/libnxwidgets/include/iscrollable.hxx b/libnxwidgets/include/iscrollable.hxx index 21a69e487..b0e65a9db 100644 --- a/libnxwidgets/include/iscrollable.hxx +++ b/libnxwidgets/include/iscrollable.hxx @@ -102,6 +102,15 @@ namespace NXWidgets class IScrollable { public: + /** + * A virtual destructor is required in order to override the IScrollable + * destructor. We do this because if we delete IScrollable, we want the + * destructor of the class that inherits from IScrollable to run, not this + * one. + */ + + virtual ~IScrollable(void) { } + /** * Gets the x coordinate of the virtual canvas. * diff --git a/libnxwidgets/include/islider.hxx b/libnxwidgets/include/islider.hxx index 5ea821e42..5a9340923 100644 --- a/libnxwidgets/include/islider.hxx +++ b/libnxwidgets/include/islider.hxx @@ -99,6 +99,14 @@ namespace NXWidgets class ISlider { public: + /** + * A virtual destructor is required in order to override the ISlider + * destructor. We do this because if we delete ISlider, we want the + * destructor of the class that inherits from ISlider to run, not this + * one. + */ + + virtual ~ISlider(void) { } /** * Get the smallest value that the slider can represent. diff --git a/libnxwidgets/include/itextbox.hxx b/libnxwidgets/include/itextbox.hxx index 78de7e502..0e2e7b824 100644 --- a/libnxwidgets/include/itextbox.hxx +++ b/libnxwidgets/include/itextbox.hxx @@ -115,6 +115,14 @@ namespace NXWidgets class ITextBox { 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 ~ITextBox(void) { } /** * Sets the cursor display mode. diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 09dc53a5a..32c5b7d64 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index 599335972..5ba4d734c 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/Makefile b/nxwm/Makefile index d951d11b2..b0b33c73d 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -41,10 +41,16 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = + + # Window Manager -CXXSRCS = capplicationwindow.cxx ccalibration.cxx cfullscreenwindow.cxx -CXXSRCS += cnxconsole.cxx cstartwindow.cxx ctaskbar.cxx ctouchscreen.cxx -CXXSRCS += cwindowcontrol.cxx +CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx cnxconsole.cxx +CXXSRCS += cstartwindow.cxx ctaskbar.cxx cwindowmessenger.cxx + +ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) +CXXSRCS += ccalibration.cxx ctouchscreen.cxx +endif + # Images CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/doc/NxWM-ThreadingModel.ppt b/nxwm/doc/NxWM-ThreadingModel.ppt index 382f69dd84bc787bb639cc4ffe0563e0affb942c..b532eaa659e45903c928aa6d20d60f0e62a4842c 100644 GIT binary patch delta 16011 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 delta 1332 zcmYjRdrTZ<5TDt-y*uvqZV&G0o)qXE#aQ7ePn94D4MZy~uNoA>0ln7J(K^1V7jriw4`4b#wFowSRb?YpfDrpX4}_7&8q;Q07S=`1~5k} z7>Zs13)799VS-G!FEH^i5t-b@#1t1PuFZOl<2S@&x<|QJ%7v&>Ogj`c&B$jV0Dp-* zotNUNe4zf2D{M0jsZ%1g1w8sMDKd&f>bU;r%AwteiP? z8Fc2_7L(f@r;n_?fQgLul9u}@i`KnHw466bd5kpY^Vm2U^jqoK{8@C<)`Cvq#rx>n zf=wBxOPAX}!E|1{{UX+Ck-Xe~aVfb{vi0qSqh?E~(~rm0E?p{Vc8cqqSM+V`?UH?k z{JE^j3Yeln+FA1o^>um@Q(1*d*bGlX5ISH7JVl>XzyIcy+62p|30bym+kSmv^CN=T zVSRue-twCDA1P$nX#FaILbFZ!rsgf8C0Uv@|L$B(dP}ePy17%ovo%o^FD6b>S$nT# zrFqHYP9D)C?dN5x-z#I0{!aJzC_Lw&$>S*!vhA@@!@k0Vx9rP{o1mY2RiVnxmm<3W z_<34xIJYlNsHz+bWKgKD4X0?juS{8C>=XmG&+J6fs_^r8h)#yngkzOd-kMXippCv9;NHT(+tjrum06$cc?nCYVXxc0 z4eZfOR)w&8`Y?=hq|x&+<2F#@@sl)mt;AU$-)DZ!L=VkeD?|@D7gUam1=O^V!>r(9 zHGQ|Rj#;tAej1JioNc$Jd3hQ&pRkj6!GT_u*vc@tIKnWt`1l5Z9@S?oC&Un7j{Wl) z72xID0RkNWA9Mq}(aUH4R`_Y*tDkfjHy>UI8?JGW5t3-1Df^rm?|)FcbQ@YDwRO1P zrCqH>MI9^zNa4wBoT|BLYiV`pi=?$-qeVCj+NE;zM-DxK1JY<{I&xt<*4q^JT-_Y7 zdRBX^2JaXRHE0t(n6CMD;f6@&PMmd)2`1AJE3R1uoRo}5PMa1n_e>~&k<4LiQnl+E m9*oEn7*Zo2e~4WQ$0}1K@C{D+g&)IO>>}>MaxMG^j{FC8&~GXL diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index f923f28b4..686150d14 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -44,6 +44,7 @@ #include "cnxtkwindow.hxx" #include "cnxtoolbar.hxx" +#include "cwidgetcontrol.hxx" #include "cwidgeteventargs.hxx" #include "cwidgeteventhandler.hxx" #include "cimage.hxx" @@ -151,12 +152,19 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - CWindowControl *getWindowControl(void) const ; + NXWidgets::CWidgetControl *getWidgetControl(void) const; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + void block(void); /** * Set the window label @@ -195,21 +203,25 @@ namespace NxWM } /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickMinimizeIcon(int index); + void clickMinimizePosition(bool click); #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickStopIcon(int index); + void clickStopIcon(bool click); #endif }; } diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 55cef6d84..e9b5d400f 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -52,6 +52,7 @@ #include "ctaskbar.hxx" #include "iapplication.hxx" #include "cfullscreenwindow.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-processor Definitions @@ -143,6 +144,7 @@ namespace NxWM * CCalibration state data */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */ CFullScreenWindow *m_window; /**< The window for the calibration display */ CTouchscreen *m_touchscreen; /**< The touchscreen device */ @@ -289,6 +291,17 @@ namespace NxWM void stop(void); + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + void destroy(void); + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index 2e3fbd45d..1bab37543 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -43,6 +43,7 @@ #include #include "cnxwindow.hxx" +#include "cwidgetcontrol.hxx" #include "iapplicationwindow.hxx" @@ -115,12 +116,19 @@ namespace NxWM NXWidgets::INxWindow *getWindow(void) const; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - CWindowControl *getWindowControl(void) const; + NXWidgets::CWidgetControl *getWidgetControl(void) const; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + void block(void); /** * Set the window label @@ -147,21 +155,25 @@ namespace NxWM void registerCallbacks(IApplicationCallback *callback); /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickMinimizeIcon(int index); + void clickMinimizePosition(bool click); #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - void clickStopIcon(int index); + void clickStopIcon(bool click); #endif }; } diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index b95c86406..bf3606f05 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -49,6 +49,7 @@ #include "iapplication.hxx" #include "capplicationwindow.hxx" #include "ctaskbar.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -78,10 +79,11 @@ namespace NxWM class CNxConsole : public IApplication, private IApplicationCallback { 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 */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ + 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 @@ -166,6 +168,17 @@ namespace NxWM void stop(void); + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + void destroy(void); + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 8b5fd92d3..3a5325cb7 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -48,6 +48,7 @@ #include "iapplication.hxx" #include "capplicationwindow.hxx" +#include "cwindowmessenger.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -115,11 +116,12 @@ namespace NxWM * CStartWindow state data */ - CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ - CApplicationWindow *m_window; /**< Reference to the application window */ - TNxArray m_slots; /**< List of apps in the start window */ - struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ - pid_t m_taskId; /**< ID of the start window task */ + CWindowMessenger m_messenger; /**< Window event handler/messenger */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + TNxArray m_slots; /**< List of apps in the start window */ + struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ + pid_t m_taskId; /**< ID of the start window task */ /** * This is the start window task. This function receives window events from @@ -138,8 +140,8 @@ namespace NxWM * 4. NXWidgets::CWidgetControl records the new state data and raises a * window event. * 5. NXWidgets::CWindowEventHandlerList will give the event to - * NxWM::CWindowControl. - * 6. NxWM::CWindowControl will send the a message on a well-known message + * NxWM::CWindowMessenger. + * 6. NxWM::CWindowMessenger will send the a message on a well-known message * queue. * 7. This CStartWindow::startWindow task will receive and process that * message. @@ -235,6 +237,17 @@ namespace NxWM void stop(void); + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + void destroy(void); + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy) @@ -275,32 +288,15 @@ namespace NxWM bool addApplication(IApplicationFactory *app); /** - * Simulate a mouse click on the icon at index. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - inline void clickIcon(int index) - { - if (index < m_slots.size()) - { - // Get the image widget at this index - - NXWidgets::CImage *image = m_slots.at(index).image; - - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - image->getSize(imageSize); - - struct nxgl_point_s imagePos; - image->getPos(imagePos); - - // And click the image at its center - - image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } - } + void clickIcon(int index, bool click); #endif }; } diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index cf98d10d9..a78fb1739 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -110,12 +110,12 @@ namespace NxWM /** * Create a raw window. * - * 1) Create a dumb CWindowControl instance - * 2) Pass the dumb CWindowControl instance to the window constructor - * that inherits from INxWindow. This will "smarten" the CWindowControl + * 1) Create a dumb NXWidgets::CWidgetControl instance + * 2) Pass the dumb NXWidgets::CWidgetControl instance to the window constructor + * that inherits from INxWindow. This will "smarten" the NXWidgets::CWidgetControl * instance with some window knowlede * 3) Call the open() method on the window to display the window. - * 4) After that, the fully smartened CWindowControl instance can + * 4) After that, the fully smartened NXWidgets::CWidgetControl instance can * be used to generate additional widgets by passing it to the * widget constructor */ @@ -398,32 +398,15 @@ namespace NxWM void getDisplaySize(FAR struct nxgl_size_s &size); /** - * Simulate a mouse click on the icon at index. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - inline void clickIcon(int index) - { - if (index < m_slots.size()) - { - // Get the image widget at this index - - NXWidgets::CImage *image = m_slots.at(index).image; - - // Get the size and position of the widget - - struct nxgl_size_s imageSize; - image->getSize(imageSize); - - struct nxgl_point_s imagePos; - image->getPos(imagePos); - - // And click the image at its center - - image->click(imagePos.x + (imageSize.w >> 1), imagePos.y + (imageSize.h >> 1)); - } - } + void clickIcon(int index, bool click); #endif }; } diff --git a/nxwm/include/cwindowcontrol.hxx b/nxwm/include/cwindowmessenger.hxx similarity index 81% rename from nxwm/include/cwindowcontrol.hxx rename to nxwm/include/cwindowmessenger.hxx index 91e430c5c..645e750cb 100644 --- a/nxwm/include/cwindowcontrol.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/include/cwindowcontrol.hxx + * NxWidgets/nxwm/include/cwindowmessenger.hxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CWINDOWCONTROL_HXX -#define __INCLUDE_CWINDOWCONTROL_HXX +#ifndef __INCLUDE_CWINDOWMESSENGER_HXX +#define __INCLUDE_CWINDOWMESSENGER_HXX /**************************************************************************** * Included Files @@ -70,12 +70,11 @@ namespace NxWM class IApplication; /** - * The class CWindowControl integrates the widget control with some special + * The class CWindowMessenger integrates the widget control with some special * handling of mouse and keyboard inputs neesed by NxWM */ - class CWindowControl : public NXWidgets::CWidgetControl, - private NXWidgets::CWindowEventHandler + class CWindowMessenger : public NXWidgets::CWindowEventHandler { private: mqd_t m_mqd; /**< Message queue descriptor used to commincate with the @@ -102,24 +101,20 @@ namespace NxWM public: /** - * Constructor - * - * @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. + * CWindowMessenger Constructor */ - CWindowControl(FAR const NXWidgets::CWidgetStyle *style = (const NXWidgets::CWidgetStyle *)NULL); + CWindowMessenger(void); /** - * Destructor. + * CWindowMessenger Destructor. */ - ~CWindowControl(void); + ~CWindowMessenger(void); /** * Destroy the application window and everything in it. This is - * handled by CWindowControl (vs just calling the destructors) because + * handled by CWindowMessenger (vs just calling the destructors) because * in the case where an application destroys itself (because of pressing * the stop button), then we need to unwind and get out of the application * logic before destroying all of its objects. @@ -130,4 +125,4 @@ namespace NxWM } #endif // __cplusplus -#endif // __INCLUDE_CWINDOWCONTROL_HXX +#endif // __INCLUDE_CWINDOWMESSENGER_HXX diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 45067d900..28e50e013 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -45,8 +45,7 @@ #include "cnxstring.hxx" #include "ibitmap.hxx" -#include "cwindowcontrol.hxx" -#include "capplicationwindow.hxx" +#include "iapplicationwindow.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -93,18 +92,6 @@ namespace NxWM virtual IApplicationWindow *getWindow(void) const = 0; - /** - * Get the window widget control. - * - * @return The widget control of the underlying window instance. - */ - - virtual inline CWindowControl *getWindowControl(void) const - { - IApplicationWindow *window = getWindow(); - return window->getWindowControl(); - } - /** * Get the icon associated with the application * @@ -132,11 +119,23 @@ namespace NxWM virtual bool run(void) = 0; /** - * Stop the application. + * Stop the application, put all widgets in a deactivated/disabled state + * and wait to see what happens next. */ virtual void stop(void) = 0; + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + virtual void destroy(void) = 0; + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx index fe8830c2f..ed221797d 100644 --- a/nxwm/include/iapplicationwindow.hxx +++ b/nxwm/include/iapplicationwindow.hxx @@ -44,8 +44,7 @@ #include "inxwindow.hxx" #include "cnxstring.hxx" - -#include "cwindowcontrol.hxx" +#include "cwidgetcontrol.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -88,6 +87,15 @@ namespace NxWM class IApplicationWindow { public: + /** + * A virtual destructor is required in order to override the IApplicationWindow + * destructor. We do this because if we delete IApplicationWindow, we want the + * destructor of the class that inherits from IApplicationWindow to run, not this + * one. + */ + + virtual ~IApplicationWindow(void) { } + /** * Initialize window. Window initialization is separate from * object instantiation so that failures can be reported. @@ -119,12 +127,19 @@ namespace NxWM virtual NXWidgets::INxWindow *getWindow(void) const = 0; /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ - virtual CWindowControl *getWindowControl(void) const = 0; + virtual NXWidgets::CWidgetControl *getWidgetControl(void) const = 0; + + /** + * Block further activity on this window in preparation for window + * shutdown. + */ + + virtual void block(void) = 0; /** * Set the window label @@ -151,21 +166,25 @@ namespace NxWM virtual void registerCallbacks(IApplicationCallback *callback) = 0; /** - * Simulate a mouse click on the minimize icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - virtual void clickMinimizeIcon(int index) = 0; + virtual void clickMinimizePosition(bool click) = 0; #endif /** - * Simulate a mouse click on the stop applicaiton icon. This inline method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) - virtual void clickStopIcon(int index) = 0; + virtual void clickStopIcon(bool click) = 0; #endif }; } diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 3605f8c4f..25a8beb66 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -264,7 +264,7 @@ * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue - * Used to communicated from CWindowControl tothe start window thread. + * Used to communicated from CWindowMessenger to the start window thread. * Default: "/dev/nxwm" * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue * before blocking. Defualt 32 diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 15d4a4a9d..c0bc9ed62 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -47,7 +47,6 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" -#include "cwindowcontrol.hxx" #include "capplicationwindow.hxx" /******************************************************************************************** @@ -153,9 +152,9 @@ CApplicationWindow::~CApplicationWindow(void) bool CApplicationWindow::open(void) { - // Create one of our special window controls for the tool bar + // Create a widget control for the tool bar - CWindowControl *control = new CWindowControl(); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl(); if (!control) { return false; @@ -414,15 +413,31 @@ NXWidgets::INxWindow *CApplicationWindow::getWindow(void) const } /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ -CWindowControl *CApplicationWindow::getWindowControl(void) const +NXWidgets::CWidgetControl *CApplicationWindow::getWidgetControl(void) const { + return m_window->getWidgetControl(); +} + +/** + * Block further activity on this window in preparation for window + * shutdown. + */ + +void CApplicationWindow::block(void) +{ + // Get the widget control from the NXWidgets::CNxWindow instance + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - return static_cast(control); + + // And then block further reporting activity on the underlying + // NX framed window + + nxtk_block(control->getWindowHandle()); } /** @@ -459,12 +474,14 @@ void CApplicationWindow::registerCallbacks(IApplicationCallback *callback) } /** - * Simulate a mouse click on the minimize icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CApplicationWindow::clickMinimizeIcon(int index) +void CApplicationWindow::clickMinimizePosition(bool click) { // Get the size and position of the widget @@ -474,20 +491,30 @@ void CApplicationWindow::clickMinimizeIcon(int index) struct nxgl_point_s imagePos; m_minimizeImage->getPos(imagePos); - // And click the image at its center + // And click or release the image at its center - m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), - imagePos.y + (imageSize.h >> 1)); + if (click) + { + m_minimizeImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + m_minimizeImage->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } } #endif /** - * Simulate a mouse click on the stop applicaiton icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CApplicationWindow::clickStopIcon(int index) +void CApplicationWindow::clickStopIcon(bool click) { // The stop icon will not be available for "persistent" applications @@ -501,10 +528,18 @@ void CApplicationWindow::clickStopIcon(int index) struct nxgl_point_s imagePos; m_stopImage->getPos(imagePos); - // And click the image at its center + // And click or release the image at its center - m_stopImage->click(imagePos.x + (imageSize.w >> 1), - imagePos.y + (imageSize.h >> 1)); + if (click) + { + m_stopImage->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + m_stopImage->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } } } #endif diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 248aca838..d93f56a47 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -99,6 +99,11 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, m_calthread = CALTHREAD_NOTRUNNING; m_calphase = CALPHASE_NOT_STARTED; m_touched = false; + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -112,6 +117,11 @@ CCalibration::~CCalibration(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we did not create the window, the rule is that I have to dispose // of it @@ -199,6 +209,26 @@ void CCalibration::stop(void) } } +/** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + +void CCalibration::destroy(void) +{ + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} + /** * The application window is hidden (either it is minimized or it is * maximized, but it is not at the top of the hierarchy) diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index 40647d8e9..0c34166c0 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -128,15 +128,31 @@ NXWidgets::INxWindow *CFullScreenWindow::getWindow(void) const } /** - * Recover the contained window control + * Recover the contained widget control * - * @return. The window control used by this application + * @return. The widget control used by this application */ -CWindowControl *CFullScreenWindow::getWindowControl(void) const +NXWidgets::CWidgetControl *CFullScreenWindow::getWidgetControl(void) const { + return m_window->getWidgetControl(); +} + +/** + * Block further activity on this window in preparation for window + * shutdown. + */ + +void CFullScreenWindow::block(void) +{ + // Get the widget control from the NXWidgets::CNxWindow instance + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - return static_cast(control); + + // And then block further reporting activity on the underlying + // NX raw window + + nx_block(control->getWindowHandle()); } /** @@ -171,23 +187,27 @@ void CFullScreenWindow::registerCallbacks(IApplicationCallback *callback) } /** - * Simulate a mouse click on the minimize icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the minimize icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CFullScreenWindow::clickMinimizeIcon(int index) +void CFullScreenWindow::clickMinimizePosition(bool click) { } #endif /** - * Simulate a mouse click on the stop applicaiton icon. This method is only - * used during automated testing of NxWM. + * Simulate a mouse click or release on the stop icon. This method + * is only available for automated testing of NxWM. + * + * @param click. True to click; false to release; */ #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) -void CFullScreenWindow::clickStopIcon(int index) +void CFullScreenWindow::clickStopIcon(bool click) { } #endif diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 577bf661e..64321ddfb 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -129,9 +129,14 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) NXWidgets::CNxString myName = getName(); window->setWindowLabel(myName); - // Add our callbacks to the application window + // Add our callbacks with the application window window->registerCallbacks(static_cast(this)); + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -147,13 +152,15 @@ CNxConsole::~CNxConsole(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we didn't create it, we are responsible for deleting the // application window - if (m_window) - { - delete m_window; - } + delete m_window; } /** @@ -321,6 +328,26 @@ void CNxConsole::stop(void) } } +/** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + +void CNxConsole::destroy(void) +{ + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} + /** * The application window is hidden (either it is minimized or it is * maximized, but not at the top of the hierarchy diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 2b7ecbe66..3dfab5097 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -99,6 +99,11 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); + + // Add our messenger as the window callback + + NXWidgets::CWidgetControl *control = window->getWidgetControl(); + control->addWindowEventHandler(&m_messenger); } /** @@ -112,13 +117,15 @@ CStartWindow::~CStartWindow(void) stop(); + // Remove ourself from the window callback + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + control->removeWindowEventHandler(&m_messenger); + // Although we didn't create it, we are responsible for deleting the // application window - if (m_window) - { - delete m_window; - } + delete m_window; // Then stop and delete all applications @@ -211,6 +218,28 @@ void CStartWindow::stop(void) task_delete(pid); } } +/** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + +void CStartWindow::destroy(void) +{ + // What are we doing? This should never happen because the start + // window task is persistent! + + // Block any further window messages + + m_window->block(); + + // Make sure that the application is stopped + + stop(); +} /** * The application window is hidden (either it is minimized or it is @@ -404,6 +433,47 @@ bool CStartWindow::addApplication(IApplicationFactory *app) return true; } +/** + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CStartWindow::clickIcon(int index, bool click) +{ + if (index < m_slots.size()) + { + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click or release the image at its center + + if (click) + { + image->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + image->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + } +} +#endif + /** * Called when the window minimize button is pressed. */ @@ -523,11 +593,11 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } else { - // If we cannot start the app. Destroy the - // instance we created and see what happens next. + // If we cannot start the app. Destroy the instance we + // created and see what happens next. Could be interesting. - CWindowControl *control = app->getWindowControl(); - control->destroy(app); + app->stop(); + app->destroy(); } } } @@ -548,8 +618,8 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) * 4. NXWidgets::CWidgetControl records the new state data and raises a * window event. * 5. NXWidgets::CWindowEventHandlerList will give the event to - * NxWM::CWindowControl. - * 6. NxWM::CWindowControl will send the a message on a well-known message + * NxWM::CWindowMessenger. + * 6. NxWM::CWindowMessenger will send the a message on a well-known message * queue. * 7. This CStartWindow::startWindow task will receive and process that * message. diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index ab686f81c..b4df0bb86 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -47,7 +47,6 @@ #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" -#include "cwindowcontrol.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -68,11 +67,11 @@ using namespace NxWM; CTaskbar::CTaskbar(void) { - m_taskbar = (NXWidgets::CNxWindow *)0; - m_background = (NXWidgets::CNxWindow *)0; - m_backImage = (NXWidgets::CImage *)0; - m_topApp = (IApplication *)0; - m_started = false; + m_taskbar = (NXWidgets::CNxWindow *)0; + m_background = (NXWidgets::CNxWindow *)0; + m_backImage = (NXWidgets::CImage *)0; + m_topApp = (IApplication *)0; + m_started = false; } /** @@ -81,6 +80,9 @@ CTaskbar::CTaskbar(void) CTaskbar::~CTaskbar(void) { + // The disconnect,putting the instance back in the state that it + // was before it was constructed. + disconnect(); } @@ -107,7 +109,8 @@ bool CTaskbar::connect(void) } /** - * Disconnect from the server + * Disconnect from the server. This method restores the taskbar to the + * same state that it was in when it was constructed. */ void CTaskbar::disconnect(void) @@ -141,6 +144,7 @@ void CTaskbar::disconnect(void) // Then delete the task bar window delete m_taskbar; + m_taskbar = (NXWidgets::CNxWindow *)0; } if (m_background) @@ -157,8 +161,22 @@ void CTaskbar::disconnect(void) // Then delete the background delete m_background; + m_background = (NXWidgets::CNxWindow *)0; } + // Delete the background image + + if (m_backImage) + { + delete m_backImage; + m_backImage = (NXWidgets::CImage *)0; + } + + // Reset other variables + + m_topApp = (IApplication *)0; + m_started = false; + // And disconnect from the server CNxServer::disconnect(); @@ -279,7 +297,9 @@ bool CTaskbar::startWindowManager(void) continue; } - // Hide all appliations except for the top application + // Hide all applications except for the top application. NOTE: + // topIndex may still be -1, meaning that there is no application + // and that all applications should be hidden. if (i != topIndex) { @@ -303,6 +323,17 @@ bool CTaskbar::startWindowManager(void) i++; } + // If there is no top appliation (i.e., no applications or all applications + // are minimized), then draw the background image + + if (!m_topApp) + { + if (!redrawBackgroundWindow()) + { + return false; + } + } + // Draw the taskbar. It will be draw at a higher level than the application. return redrawTaskbarWindow(); @@ -418,7 +449,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) { // Get the widget control associated with the task bar window - NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); + NXWidgets::CWidgetControl *control = m_taskbar->getWidgetControl(); // Get the bitmap icon that goes with this application @@ -633,10 +664,10 @@ bool CTaskbar::stopApplication(IApplication *app) } } - // destroy the application + // Destroy the application (actually, this just sets up the application for + // later destruction. - CWindowControl *control = app->getWindowControl(); - control->destroy(app); + app->destroy(); // Re-draw the new top, non-minimized application @@ -673,6 +704,47 @@ void CTaskbar::getDisplaySize(FAR struct nxgl_size_s &size) rect.getSize(size); } +/** + * Simulate a mouse click or release on the icon at index. This method + * is only available during automated testing of NxWM. + * + * @param index. Selects the icon in the start window + * @param click. True to click and false to release + */ + +#if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN) +void CTaskbar::clickIcon(int index, bool click) +{ + if (index < m_slots.size()) + { + // Get the image widget at this index + + NXWidgets::CImage *image = m_slots.at(index).image; + + // Get the size and position of the widget + + struct nxgl_size_s imageSize; + image->getSize(imageSize); + + struct nxgl_point_s imagePos; + image->getPos(imagePos); + + // And click or release the image at its center + + if (click) + { + image->click(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + else + { + image->release(imagePos.x + (imageSize.w >> 1), + imagePos.y + (imageSize.h >> 1)); + } + } +} +#endif + /** * Create a raw window. * @@ -690,7 +762,7 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { // Initialize the widget control using the default style - CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. @@ -727,7 +799,7 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { // Initialize the widget control using the default style - CWindowControl *control = new CWindowControl((NXWidgets::CWidgetStyle *)NULL); + NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the framed window as a class // that derives from INxWindow. diff --git a/nxwm/src/cwindowcontrol.cxx b/nxwm/src/cwindowmessenger.cxx similarity index 87% rename from nxwm/src/cwindowcontrol.cxx rename to nxwm/src/cwindowmessenger.cxx index 6c2144bad..4e458566d 100644 --- a/nxwm/src/cwindowcontrol.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cwindowcontrol.cxx + * NxWidgets/nxwm/src/cwindowmessenger.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,28 +46,23 @@ #include "nxwmconfig.hxx" #include "cstartwindow.hxx" -#include "cwindowcontrol.hxx" +#include "cwindowmessenger.hxx" /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ /******************************************************************************************** - * CWindowControl Method Implementations + * CWindowMessenger Method Implementations ********************************************************************************************/ using namespace NxWM; /** - * Constructor - * - * @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. + * CWindowMessenger Constructor */ -CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) -: NXWidgets::CWidgetControl(style) +CWindowMessenger::CWindowMessenger(void) { // Open a message queue to communicate with the start window task. We need to create // the message queue if it does not exist. @@ -82,36 +77,28 @@ CWindowControl::CWindowControl(FAR const NXWidgets::CWidgetStyle *style) { gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); } - - // Add ourself as the window callback - - addWindowEventHandler(this); } /** - * Destructor. + * CWindowMessenger Destructor. */ -CWindowControl::~CWindowControl(void) +CWindowMessenger::~CWindowMessenger(void) { // Close the message queue (void)mq_close(m_mqd); - - // Remove ourself from the window callback - - removeWindowEventHandler(this); } /** * Destroy the application window and everything in it. This is - * handled by CWindowControl (vs just calling the destructors) because + * handled by CWindowMessenger (vs just calling the destructors) because * in the case where an application destroys itself (because of pressing * the stop button), then we need to unwind and get out of the application * logic before destroying all of its objects. */ -void CWindowControl::destroy(IApplication *app) +void CWindowMessenger::destroy(IApplication *app) { // Send a message to destroy the window isntance at a later time @@ -135,7 +122,7 @@ void CWindowControl::destroy(IApplication *app) */ #ifdef CONFIG_NX_MOUSE -void CWindowControl::handleMouseEvent(void) +void CWindowMessenger::handleMouseEvent(void) { // The logic path here is tortuous but flexible: // @@ -157,8 +144,8 @@ void CWindowControl::handleMouseEvent(void) // 7. NXWidgets::CWidgetControl records the new state data and raises a // window event. // 8. NXWidgets::CWindowEventHandlerList will give the event to this method - // NxWM::CWindowControl. - // 9. This NxWM::CWindowControl method will send the a message on a well- + // NxWM::CWindowMessenger. + // 9. This NxWM::CWindowMessenger method will send the a message on a well- // known message queue. // 10. This CStartWindow::startWindow task will receive and process that // message by calling CWidgetControl::pollEvents() @@ -181,7 +168,7 @@ void CWindowControl::handleMouseEvent(void) */ #ifdef CONFIG_NX_KBD -void CWindowControl::handleKeyboardEvent(void) +void CWindowMessenger::handleKeyboardEvent(void) { // The logic path here is tortuous but flexible: // @@ -203,8 +190,8 @@ void CWindowControl::handleKeyboardEvent(void) // 7. NXWidgets::CWidgetControl records the new state data and raises a // window event. // 8. NXWidgets::CWindowEventHandlerList will give the event to this method - // NxWM::CWindowControl. - // 9. This NxWM::CWindowControl method will send the a message on a well- + // NxWM::CWindowMessenger. + // 9. This NxWM::CWindowMessenger method will send the a message on a well- // known message queue. // 10. This CStartWindow::startWindow task will receive and process that // message by calling CWidgetControl::pollEvents() From c6c67e8987efda75fac3fc0bae558462354c43fb Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 May 2012 01:01:00 +0000 Subject: [PATCH 063/390] NxWM: Add a missing part of the message blocking logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4748 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/include/ccallback.hxx | 5 +- libnxwidgets/include/cwidgetcontrol.hxx | 8 +-- libnxwidgets/include/cwindoweventhandler.hxx | 4 +- .../include/cwindoweventhandlerlist.hxx | 6 +- libnxwidgets/src/ccallback.cxx | 13 +++-- libnxwidgets/src/cwindoweventhandlerlist.cxx | 6 +- nxwm/include/capplicationwindow.hxx | 4 +- nxwm/include/cfullscreenwindow.hxx | 4 +- nxwm/include/cwindowmessenger.hxx | 18 +++--- nxwm/include/iapplication.hxx | 8 ++- nxwm/include/iapplicationwindow.hxx | 12 +++- nxwm/src/capplicationwindow.cxx | 6 +- nxwm/src/ccalibration.cxx | 10 ++-- nxwm/src/cfullscreenwindow.cxx | 8 ++- nxwm/src/cnxconsole.cxx | 2 +- nxwm/src/cstartwindow.cxx | 2 +- nxwm/src/cwindowmessenger.cxx | 57 +++++++++++-------- 17 files changed, 103 insertions(+), 70 deletions(-) diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index ca3313a9b..09cb83a8a 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -195,12 +195,13 @@ namespace NXWidgets * callbacks can lead to bad behavior when the callback is executed. * * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * @param arg1. User provided argument (see nx_openwindow, nx_requestbkgd, * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg2 - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER - static void windowBlocked(NXWINDOW hwnd, FAR void *arg); + static void windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2); #endif public: diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 453cc1115..e709271a0 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -609,15 +609,13 @@ namespace NXWidgets * window may be safely closed. Closing the window prior with pending * callbacks can lead to bad behavior when the callback is executed. * - * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, - * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER - inline void windowBlocked(void) + inline void windowBlocked(FAR void *arg) { - m_eventHandlers.raiseBlockedEvent(); + m_eventHandlers.raiseBlockedEvent(arg); } #endif diff --git a/libnxwidgets/include/cwindoweventhandler.hxx b/libnxwidgets/include/cwindoweventhandler.hxx index c414abadb..574c24b55 100644 --- a/libnxwidgets/include/cwindoweventhandler.hxx +++ b/libnxwidgets/include/cwindoweventhandler.hxx @@ -108,9 +108,11 @@ namespace NXWidgets /** * Handle a NX window blocked event + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ - virtual void handleBlockedEvent(void) { } + virtual void handleBlockedEvent(FAR void *arg) { } }; } diff --git a/libnxwidgets/include/cwindoweventhandlerlist.hxx b/libnxwidgets/include/cwindoweventhandlerlist.hxx index d9e17de09..035e6a7b9 100644 --- a/libnxwidgets/include/cwindoweventhandlerlist.hxx +++ b/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -163,9 +163,11 @@ namespace NXWidgets /** * Raise an NX window blocked event. + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ - void raiseBlockedEvent(void); + void raiseBlockedEvent(FAR void *arg); }; } diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 32c5b7d64..b2256c6bb 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -211,22 +211,23 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, * callbacks can lead to bad behavior when the callback is executed. * * @param hwnd. Window handle of the blocked window - * @param arg. User provided argument (see nx_openwindow, nx_requestbkgd, + * @param arg1. User provided argument (see nx_openwindow, nx_requestbkgd, * nxtk_openwindow, or nxtk_opentoolbar) + * @param arg2 - User provided argument (see nx_block or nxtk_block) */ #ifdef CONFIG_NX_MULTIUSER -void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg) +void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) { - gvdbg("hwnd=%p arg=%p\n", hwnd, arg); + gvdbg("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); - // The argument must be the CWidgetControl instance + // The first argument must be the CWidgetControl instance - CWidgetControl *This = (CWidgetControl *)arg; + CWidgetControl *This = (CWidgetControl *)arg1; // Just forward the callback to the CWidgetControl::windowBlocked method - This->windowBlocked(); + This->windowBlocked(arg2); } #endif diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index 15b2c65ff..dfdabcf08 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -162,12 +162,14 @@ void CWindowEventHandlerList::raiseKeyboardEvent(void) /** * Raise an NX window blocked event. + * + * @param arg - User provided argument (see nx_block or nxtk_block) */ -void CWindowEventHandlerList::raiseBlockedEvent(void) +void CWindowEventHandlerList::raiseBlockedEvent(FAR void *arg) { for (int i = 0; i < m_eventHandlers.size(); ++i) { - m_eventHandlers.at(i)->handleBlockedEvent(); + m_eventHandlers.at(i)->handleBlockedEvent(arg); } } diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 686150d14..46e4e90d2 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -162,9 +162,11 @@ namespace NxWM /** * Block further activity on this window in preparation for window * shutdown. + * + * @param app. The application to be blocked */ - void block(void); + void block(IApplication *app); /** * Set the window label diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index 1bab37543..70da9fee5 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -126,9 +126,11 @@ namespace NxWM /** * Block further activity on this window in preparation for window * shutdown. + * + * @param app. The application to be blocked */ - void block(void); + void block(IApplication *app); /** * Set the window label diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index 645e750cb..0aa8961bb 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -98,6 +98,14 @@ namespace NxWM void handleKeyboardEvent(void); #endif + /** + * Handle a NX window blocked event + * + * @param arg - User provided argument (see nx_block or nxtk_block) + */ + + void handleBlockedEvent(FAR void *arg); + public: /** @@ -111,16 +119,6 @@ namespace NxWM */ ~CWindowMessenger(void); - - /** - * Destroy the application window and everything in it. This is - * handled by CWindowMessenger (vs just calling the destructors) because - * in the case where an application destroys itself (because of pressing - * the stop button), then we need to unwind and get out of the application - * logic before destroying all of its objects. - */ - - void destroy(IApplication *app); }; } #endif // __cplusplus diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 28e50e013..456202c6d 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -45,8 +45,6 @@ #include "cnxstring.hxx" #include "ibitmap.hxx" -#include "iapplicationwindow.hxx" - /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -59,6 +57,12 @@ namespace NxWM { + /** + * Foward references + */ + + class IApplicationWindow; + /** * IApplication provides the abstract base class for each NxWM application. */ diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx index ed221797d..60f1b332c 100644 --- a/nxwm/include/iapplicationwindow.hxx +++ b/nxwm/include/iapplicationwindow.hxx @@ -46,6 +46,8 @@ #include "cnxstring.hxx" #include "cwidgetcontrol.hxx" +#include "iapplication.hxx" + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -58,6 +60,12 @@ namespace NxWM { + /** + * Foward references + */ + + class IApplication; + /** * This callback class is used by the application to get notification of toolbar * related events. @@ -137,9 +145,11 @@ namespace NxWM /** * Block further activity on this window in preparation for window * shutdown. + * + * @param app. The application to be blocked */ - virtual void block(void) = 0; + virtual void block(IApplication *app) = 0; /** * Set the window label diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index c0bc9ed62..5cf172ea6 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -426,9 +426,11 @@ NXWidgets::CWidgetControl *CApplicationWindow::getWidgetControl(void) const /** * Block further activity on this window in preparation for window * shutdown. + * + * @param app. The application to be blocked */ -void CApplicationWindow::block(void) +void CApplicationWindow::block(IApplication *app) { // Get the widget control from the NXWidgets::CNxWindow instance @@ -437,7 +439,7 @@ void CApplicationWindow::block(void) // And then block further reporting activity on the underlying // NX framed window - nxtk_block(control->getWindowHandle()); + nxtk_block(control->getWindowHandle(), (FAR void *)app); } /** diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index d93f56a47..6f5976100 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -220,13 +220,13 @@ void CCalibration::stop(void) void CCalibration::destroy(void) { - // Block any further window messages - - m_window->block(); - - // Make sure that the application is stopped + // Make sure that the application is stopped (should already be stopped) stop(); + + // Block any further window messages + + m_window->block(this); } /** diff --git a/nxwm/src/cfullscreenwindow.cxx b/nxwm/src/cfullscreenwindow.cxx index 0c34166c0..6ec5bf802 100644 --- a/nxwm/src/cfullscreenwindow.cxx +++ b/nxwm/src/cfullscreenwindow.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -141,9 +141,11 @@ NXWidgets::CWidgetControl *CFullScreenWindow::getWidgetControl(void) const /** * Block further activity on this window in preparation for window * shutdown. + * + * @param app. The application to be blocked */ -void CFullScreenWindow::block(void) +void CFullScreenWindow::block(IApplication *app) { // Get the widget control from the NXWidgets::CNxWindow instance @@ -152,7 +154,7 @@ void CFullScreenWindow::block(void) // And then block further reporting activity on the underlying // NX raw window - nx_block(control->getWindowHandle()); + nx_block(control->getWindowHandle(), (FAR void *)app); } /** diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 64321ddfb..6a64afc1b 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -341,7 +341,7 @@ void CNxConsole::destroy(void) { // Block any further window messages - m_window->block(); + m_window->block(this); // Make sure that the application is stopped diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 3dfab5097..af46e7b82 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -234,7 +234,7 @@ void CStartWindow::destroy(void) // Block any further window messages - m_window->block(); + m_window->block(this); // Make sure that the application is stopped diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 4e458566d..b467f533c 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -90,31 +90,6 @@ CWindowMessenger::~CWindowMessenger(void) (void)mq_close(m_mqd); } -/** - * Destroy the application window and everything in it. This is - * handled by CWindowMessenger (vs just calling the destructors) because - * in the case where an application destroys itself (because of pressing - * the stop button), then we need to unwind and get out of the application - * logic before destroying all of its objects. - */ - -void CWindowMessenger::destroy(IApplication *app) -{ - // Send a message to destroy the window isntance at a later time - - struct SStartWindowMessage outmsg; - outmsg.msgId = MSGID_DESTROY_APP; - outmsg.instance = (FAR void *)app; - - gdbg("Sending MSGID_DESTROY_APP with instance=%p\n", app); - int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), - CONFIG_NXWM_STARTWINDOW_MXMPRIO); - if (ret < 0) - { - gdbg("ERROR: mq_send failed: %d\n", errno); - } -} - /** * Handle an NX window mouse input event. * @@ -208,3 +183,35 @@ void CWindowMessenger::handleKeyboardEvent(void) } } #endif + +/** + * Handle a NX window blocked event. This handler is called when we + * receive the BLOCKED message meaning that there are no further pending + * actions on the window. It is now safe to delete the window. + * + * This is handled by sending a message to the start window thread (vs just + * calling the destructors) because in the case where an application + * destroys itself (because of pressing the stop button), then we need to + * unwind and get out of the application logic before destroying all of its + * objects. + * + * @param arg - User provided argument (see nx_block or nxtk_block) + */ + +void CWindowMessenger::handleBlockedEvent(FAR void *arg) +{ + // Send a message to destroy the window isntance at a later time + + struct SStartWindowMessage outmsg; + outmsg.msgId = MSGID_DESTROY_APP; + outmsg.instance = arg; + + gdbg("Sending MSGID_DESTROY_APP with instance=%p\n", arg); + int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), + CONFIG_NXWM_STARTWINDOW_MXMPRIO); + if (ret < 0) + { + gdbg("ERROR: mq_send failed: %d\n", errno); + } +} + From e40d54e2f762692185dad19b2df75e0756eeec1e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 May 2012 04:20:56 +0000 Subject: [PATCH 064/390] NxWM unit test now appears bug free (other than some NxConsole-related issues). git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4750 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/doc/NxWM-ThreadingModel.ppt | Bin 126464 -> 126464 bytes nxwm/include/ccalibration.hxx | 2 -- nxwm/include/cnxconsole.hxx | 2 -- nxwm/include/cstartwindow.hxx | 2 -- nxwm/include/ctaskbar.hxx | 9 +++++++-- nxwm/include/cwindowmessenger.hxx | 16 +++++++++++++--- nxwm/src/capplicationwindow.cxx | 7 ++++--- nxwm/src/ccalibration.cxx | 10 ---------- nxwm/src/cnxconsole.cxx | 14 ++------------ nxwm/src/cstartwindow.cxx | 10 ---------- nxwm/src/ctaskbar.cxx | 16 +++++++++++----- nxwm/src/ctouchscreen.cxx | 2 +- nxwm/src/cwindowmessenger.cxx | 19 ++++++++++++++++--- 13 files changed, 54 insertions(+), 55 deletions(-) diff --git a/nxwm/doc/NxWM-ThreadingModel.ppt b/nxwm/doc/NxWM-ThreadingModel.ppt index b532eaa659e45903c928aa6d20d60f0e62a4842c..acae788c2d15f44d8e880f13edb894af282722c6 100644 GIT binary patch delta 1109 zcmY*YZBUd|6u$Sp@5g=Ly}Jv-x(n?P3p9Kz;sUJ}g4K^0Oo1_mDTS6G`%$K@P#Os{ z=xTprlJ%6!lo~TyI0X~SEht+_(`2Rr`xs!N)@-b4n5F_6B()E^yYi!cJaf){?lb3} z=bX76QLQ7Y4RldF!Gp9;wp~I9F##-~2}lB|9GgeYa-01UfyeWc`S+;|lQ#RyeD;nv zBr>mN^I%#dCglm)5KOZH^HA91D&c3t~AA3f)RHPPKH9a z9sY6qNLJ#P(2!pStiS>9<@@9knup`Eyj9om%D616z$crNmg(0De#CY`J0P_BF`@2v z#MR7m4Ljm$wJ@e$rgyq194w6D6lg5kjt619sKzz1{a3E_}+~%$1Tl3t4Bm!JnuwDI|f7@!ggC4Q)ivGu*~ue)Ewn67kVWsNH&;{-yY} zP4sge{Lx4G!*yGUW>q5U&z4-^z82E0?&i4-iG=)=_z9FXwP-eVDLKg&*R)=IfKd=|AOqNVJqMfKavAEJfSIIx_!z=2!f^iO>5}B6aOMGNX_@?hb5wXpj(l7?lJ@)OoE)M z9R6A7Iij7{PfA@%5f64%V^YIf`47QX88W)-wYO;sO{FF9@zDUSGIr5gJ;wz8BThJX zRprlwR$wh+H0meJXZfM-4JK_Jo5rWvCO&y`qb|*uct-za5^uCbKOj|$MvKGkv{XMX zMdgSNk?9%UGnh)Wu+GRCrI4S0ztXJzVYyrJDq(KB&>(9&EI#!kb1Uo{Z6TfPSw25{ zr}BT7n%8g;CoAVQSq{PxZn-Zya(OCu)UJT)R|1^PbeX|@g4PPfy$ z^jD>CS@Mlq4XE<#^J11Jkf%04Bz|(YxrNn CzE~;% delta 1021 zcmYLIYfKzf6uxKf%-)${c38?|M_duKjT?6ct2FpXR0MCz{?OPOACMRjA2rf8-P%|iu(oSOu&B`)FzJu)o_o%{ zIp25Axi@x>#m=$eUKw`qgxo0ReohF{EPw@OL9lQO2j`em>~xP&jFjf^3;7z*PWOxa z+O4k%^t!{#69ta~eZb|#L_scB3j;vA+{@1HqH4HDci9Plqw;d%m}N*N(ZtD2+Y0F~ zEL%wAw0&;aur`^5rbGPN9qVK~;?rOShW&0laiH8SG*qE0-^VYNCmd|OUIc^gHr{z} zqfRUJ1%9?VL!w#QmwcwCTV*GeyH%gs!`pV$3p6YTaH8QT`%8+jfIP|D8aZVy=_ALi z?nPfXO8XrVJ`m2L^m5iGc%nJV@*Mx>Waswsl3f!Tga>9GR*VC_o2`OqoKQp!Q0Lki=@^S|O^qM1IdwexUahlp!ZJJ~z3E@#UP zSYgKHXVvHB7G--z-(e5GXd1v~)OO{BbCyH@mJC*$Tst6?tKla|F^`NFJ z*~_*(?Pq*{q|<3Ce?vrctC_@^oY{!MMC_SV_`BUS!OE^4N$$FPc9pGP0bUQHc?ho91`ZKWkuYUir zz+SMp4{IlpPj@<_j=1U?N ztH!;AbUk4WbRQw3uM)D>`iQ+(329Fg(sZ4W>N!G6&96mpgOQxEjp>qL|EL2tY!Uj2 xd0!CjGNIa9T-DZ%H-gaTHS24jJQ1lgU*7`-X5lliHMz0_zKg>C m_slots; /**< List of apps in the start window */ diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index a78fb1739..c8468877a 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -110,14 +110,19 @@ namespace NxWM /** * Create a raw window. * - * 1) Create a dumb NXWidgets::CWidgetControl instance - * 2) Pass the dumb NXWidgets::CWidgetControl instance to the window constructor + * 1) Create a dumb NXWidgets::CWidgetControl instance (See not). + * 2) Pass the dumb NXWidgets::CWindowMessenger instance to the window constructor * that inherits from INxWindow. This will "smarten" the NXWidgets::CWidgetControl * instance with some window knowlede * 3) Call the open() method on the window to display the window. * 4) After that, the fully smartened NXWidgets::CWidgetControl instance can * be used to generate additional widgets by passing it to the * widget constructor + * + * NOTE: Actually, NxWM uses the CWindowMessenger class that inherits from + * CWidgetControl. That class just adds some unrelated messenging capability; + * It cohabitates with CWidgetControl only becuase it nees the CWidgetControl + * this point. */ NXWidgets::CNxWindow *openRawWindow(void); diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index 0aa8961bb..d2e862a7c 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -49,6 +49,7 @@ #include #include "cwindoweventhandler.hxx" +#include "cwidgetstyle.hxx" #include "cwidgetcontrol.hxx" /**************************************************************************** @@ -71,10 +72,15 @@ namespace NxWM /** * The class CWindowMessenger integrates the widget control with some special - * handling of mouse and keyboard inputs neesed by NxWM + * handling of mouse and keyboard inputs neesed by NxWM. It use used + * in place of CWidgetControl whenever an NxWM window is created. + * + * CWindowMessenger cohabitates with CWidgetControl only becuase it nees the + * CWidgetControl as an argument in its messenging. */ - class CWindowMessenger : public NXWidgets::CWindowEventHandler + class CWindowMessenger : public NXWidgets::CWindowEventHandler, + public NXWidgets::CWidgetControl { private: mqd_t m_mqd; /**< Message queue descriptor used to commincate with the @@ -110,9 +116,13 @@ namespace NxWM /** * CWindowMessenger Constructor + * + * @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. */ - CWindowMessenger(void); + CWindowMessenger(FAR const NXWidgets::CWidgetStyle *style = (const NXWidgets::CWidgetStyle *)NULL); /** * CWindowMessenger Destructor. diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 5cf172ea6..65de1b1a4 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -47,6 +47,7 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" +#include "cwindowmessenger.hxx" #include "capplicationwindow.hxx" /******************************************************************************************** @@ -152,15 +153,15 @@ CApplicationWindow::~CApplicationWindow(void) bool CApplicationWindow::open(void) { - // Create a widget control for the tool bar + // Create the widget control (with the window messenger) using the default style - NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl(); + CWindowMessenger *control = new CWindowMessenger(); if (!control) { return false; } - // Open the toolbar + // Open the toolbar using the widget control m_toolbar = m_window->openToolbar(CONFIG_NXWM_TOOLBAR_HEIGHT, control); if (!m_toolbar) diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 6f5976100..8ba8d0173 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -99,11 +99,6 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, m_calthread = CALTHREAD_NOTRUNNING; m_calphase = CALPHASE_NOT_STARTED; m_touched = false; - - // Add our messenger as the window callback - - NXWidgets::CWidgetControl *control = window->getWidgetControl(); - control->addWindowEventHandler(&m_messenger); } /** @@ -117,11 +112,6 @@ CCalibration::~CCalibration(void) stop(); - // Remove ourself from the window callback - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - control->removeWindowEventHandler(&m_messenger); - // Although we did not create the window, the rule is that I have to dispose // of it diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 6a64afc1b..30105910b 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -132,11 +132,6 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) // Add our callbacks with the application window window->registerCallbacks(static_cast(this)); - - // Add our messenger as the window callback - - NXWidgets::CWidgetControl *control = window->getWidgetControl(); - control->addWindowEventHandler(&m_messenger); } /** @@ -152,11 +147,6 @@ CNxConsole::~CNxConsole(void) stop(); - // Remove ourself from the window callback - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - control->removeWindowEventHandler(&m_messenger); - // Although we didn't create it, we are responsible for deleting the // application window @@ -303,7 +293,7 @@ void CNxConsole::stop(void) // Delete the NxConsole task if it is still running (this could strand // resources). If we get here due to CTaskbar::stopApplication() processing // initialed by CNxConsole::exitHandler, then do *not* delete the task (it - // is already being delete). + // is already being deleted). if (m_pid >= 0) { @@ -320,7 +310,7 @@ void CNxConsole::stop(void) } // Destroy the NX console device - + if (m_nxcon) { nxcon_unregister(m_nxcon); diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index af46e7b82..5c54cba3a 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -99,11 +99,6 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) // Add our callbacks to the application window window->registerCallbacks(static_cast(this)); - - // Add our messenger as the window callback - - NXWidgets::CWidgetControl *control = window->getWidgetControl(); - control->addWindowEventHandler(&m_messenger); } /** @@ -117,11 +112,6 @@ CStartWindow::~CStartWindow(void) stop(); - // Remove ourself from the window callback - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - control->removeWindowEventHandler(&m_messenger); - // Although we didn't create it, we are responsible for deleting the // application window diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index b4df0bb86..6b0510017 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -47,6 +47,7 @@ #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" +#include "cwindowmessenger.hxx" #include "ctaskbar.hxx" /******************************************************************************************** @@ -748,7 +749,7 @@ void CTaskbar::clickIcon(int index, bool click) /** * Create a raw window. * - * 1) Create a dumb CWigetControl instance + * 1) Create a dumb CWigetControl instance (see note below) * 2) Pass the dumb CWidgetControl instance to the window constructor * that inherits from INxWindow. This will "smarten" the CWidgetControl * instance with some window knowlede @@ -756,13 +757,18 @@ void CTaskbar::clickIcon(int index, bool click) * 4) After that, the fully smartened CWidgetControl instance can * be used to generate additional widgets by passing it to the * widget constructor + * + * NOTE: Actually, NxWM uses the CWindowMessenger class that inherits from + * CWidgetControl. That class just adds some unrelated messenging capability; + * It cohabitates with CWidgetControl only becuase it nees the CWidgetControl + * this point. */ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { - // Initialize the widget control using the default style + // Create the widget control (with the window messenger) using the default style - NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); + CWindowMessenger *control = new CWindowMessenger((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the background window as a class // that derives from INxWindow. @@ -797,9 +803,9 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { - // Initialize the widget control using the default style + // Create the widget control (with the window messenger) using the default style - NXWidgets::CWidgetControl *control = new NXWidgets::CWidgetControl((NXWidgets::CWidgetStyle *)NULL); + CWindowMessenger *control = new CWindowMessenger((NXWidgets::CWidgetStyle *)NULL); // Get an (uninitialized) instance of the framed window as a class // that derives from INxWindow. diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 1a8a5e967..ba25dd95f 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index b467f533c..032dd1bf2 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -60,9 +60,14 @@ using namespace NxWM; /** * CWindowMessenger Constructor + * + * @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. */ -CWindowMessenger::CWindowMessenger(void) +CWindowMessenger::CWindowMessenger(FAR const NXWidgets::CWidgetStyle *style) +: NXWidgets::CWidgetControl(style) { // Open a message queue to communicate with the start window task. We need to create // the message queue if it does not exist. @@ -77,6 +82,10 @@ CWindowMessenger::CWindowMessenger(void) { gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); } + + // Add ourself to the list of window event handlers + + addWindowEventHandler(this); } /** @@ -85,6 +94,10 @@ CWindowMessenger::CWindowMessenger(void) CWindowMessenger::~CWindowMessenger(void) { + // Remove ourself from the list of the window event handlers + + removeWindowEventHandler(this); + // Close the message queue (void)mq_close(m_mqd); @@ -127,7 +140,7 @@ void CWindowMessenger::handleMouseEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_MOUSE_INPUT; - outmsg.instance = (FAR void *)this; + outmsg.instance = (FAR void *)static_cast(this); int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); @@ -173,7 +186,7 @@ void CWindowMessenger::handleKeyboardEvent(void) struct SStartWindowMessage outmsg; outmsg.msgId = MSGID_KEYBOARD_INPUT; - outmsg.instance = (FAR void *)this; + outmsg.instance = (FAR void *)static_cast(this); int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), CONFIG_NXWM_STARTWINDOW_MXMPRIO); From 9083c67595d89fcafb54debdef1e863edb87e6f7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 May 2012 15:26:38 +0000 Subject: [PATCH 065/390] Prep for 6.18 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4751 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 8 ++-- README.txt | 2 +- ReleaseNotes.txt | 78 +++++++++++++++++++++++++++---- TODO.txt | 65 +++++++++++++++++++++++++- nxwm/include/ctaskbar.hxx | 4 +- nxwm/include/cwindowmessenger.hxx | 6 +-- nxwm/src/ctaskbar.cxx | 4 +- 7 files changed, 145 insertions(+), 22 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1a51aacda..80101c920 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,7 +2,7 @@ * The initial release of the NxWidgets package -1.1 2012-xx-xx Gregory Nutt +1.1 2012-05-19 Gregory Nutt * Updated and verified the NxWidgets DOxygen documentation. Contributed by Jose Pablo Carballo. @@ -93,14 +93,14 @@ * NXWidgets::CNxTkWindow: Reported size of a framed window must exclude the height of the tool bar (if present) * TODO.txt: Add a file to keep track of issues. -* NXWidgets::CStartWindow and IApplicationFactory: This is a substantial +* NxWM::CStartWindow and IApplicationFactory: This is a substantial redesign. IApplication wraps an application. However, if we want to be able to start multiple copies of an application, then we need to be able to create multiple IApplication instances from the start window. Enter IApplicationFactory. Icons in the start window now correspond to application factories; icons in the task bar no correspond to application instances. -* NXWidgetes::CStartWindow and CWindowControl: The above change necessitated +* NxWM::CStartWindow and CWindowControl: The above change necessitated another architectural change: When create applications, it is sometimes necessary to wait for windows events. The above change moved the application creation to the window event thread, hence, causing deadlocks @@ -109,3 +109,5 @@ asynchronously and can wait for windoew events. * doc/NxWM-ThreadingModel.ppt: Documented the now rather complex NxWM threading model. + +1.2 2012-xx-xx Gregory Nutt diff --git a/README.txt b/README.txt index e4ed3be3a..7bb16820c 100644 --- a/README.txt +++ b/README.txt @@ -74,7 +74,7 @@ nxwm small display. The window manager consists of a task bar with icons representing the - running tasks. If you touch the tas'ks icon, it comes to the top. Each + running tasks. If you touch the task's icon, it comes to the top. Each window has a toolbar with (1) a title, (2) a minimize button, and (3) a stop application button using the standard icons for these things. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index dea4771a3..d140d45d1 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,9 +1,69 @@ -NxWidgets-1.0 -============= - -The initial version of NxWidgets was released on March 22, 2012. This -package has been used in several projects prior to its release to open -source and is considered stable its initial release (although not all -features have been fully verified). - - +NxWidgets-1.0 +============= + +The initial version of NxWidgets was released on March 22, 2012. This +package has been used in several projects prior to its release to open +source and is considered stable its initial release (although not all +features have been fully verified). + +NxWidgets-1.1 +============= + +The 2nd release of the NxWidgets package as made on May 19, 2012. The +headline new feature in this release is: + +* NxWM, the tiny window manager based on NX and NxWidgets. NxWM is true + multiple window manager but only one window is displayed at a time. + This simplification helps performance on LCD based products (in the + same way that a tiled window manager helps) and also makes the best + use of small displays. It is awkward from a human factors point-of-view + trying to manage multiple windows on a small display. + + The window manager consists of a task bar with icons representing the + running tasks. If you touch the task's icon, it comes to the top. Each + window has a toolbar with (1) a title, (2) a minimize button, and (3) a + stop application button using the standard icons for these things. User + input via a touchscreen or mouse and keyboard is supported. + + There is always a start window that is available in the task bar. When + you touch the start window icon, it brings up the start window containing + icons representing all of the available applications. If you touch an + icon in the start window, it will be started and added to the task bar. + + There is a base class that defines an add-on application and an + interface that supports incorporation of new application. The only + application that is provided is NxConsole. This is an NSH session + running in a window. You should be able to select the NX icon in the start + menu and create as many NSH sessions in windows as you want. (keybard input + still comes through serial). + + This initial realease of NxWM should be considered an alpha release. + All know issues are listed in the top-level TODO list. + +Other important new features include: + +* NxWidgets::IBitmap and NxWidgets::CRlePalettBitmap: Extended to + support different color look-up-tables (LUTs). This allows images + to be highlighted when touched, for example. +* NxWidgets::CImage: Extended to support button-like behavior. CImage + widgets now work well as touchable icons. +* NxWidgets::CWidgetControl: Add a semaphore to force clients to wait if the + size or position of the window is not yet known (multi-user mode only). + Enabled and verified creation of framed windows. +* NxWidgets::CWindowEventHandler and NxWidgets::CWindowEventHandler: Add + support for getting callbacks for window events. +* DOxygen documentation support. Contributed by Jose Pablo Carballo. + +An effort is underway to simplify NxWidgets and reduce its memory footprint: + +* NxWidgets::CNxWidget: Removed support for "shelving" widgets, reference + constants, and close types. Remove all support for widgets in a "vertical" + hierarchy. Now widgets exist in a flat, two-dimensional space and should + not overlap. Removed built-in modal loops. + +Bug fixes include changes to the following (see the ChangeLog for details): + +* NxWidgets::CRlePalettBitmap, NxWidgets::CRlePalettBitmap, + NxWidgets::CGraphicsPort, NxWidgets::CWidgetControl + + diff --git a/TODO.txt b/TODO.txt index 009ce9039..6264d2f3d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,6 +4,24 @@ NxWidgets NxWM ---- + (3) General issues + (3) NxConsole issues + (1) Platform specific issues + +o General NxWM Issues + ------------------- + + Title: DISPLAY INTIALIZATION + Description: During the initialization of the display, the basic frame of the + start window is draw momentarily. The is just the empty window + frame. This is a consequence of how NX creates windows: The + are enabled all of the time so the windows are visible when they + are being created. The solution would be to add some disable + logic in NX so that that nothing gets displayed when a window + is created until it is fully initialized and enable. + Status: Open + Priority: Medium + Title: DRAGGING ACROSS WINDOWS Description: Need some indication if the touch/mouse drags from one window to another then is release. Release event is lost in this case. @@ -26,6 +44,20 @@ NxWM Status: Open Priority: Medium low + Title: THREAD SAFETY + Description: I am not sure how thread-safe the NxWidgets are. There is + is very little mutli-thread in the widgets now. The "NX listener" + thread interacts to update mouse (and keyboard) data but all + of the heavy work is done on the "start window" thread. I think + everything is okay now, but it may be necessary in the future + to introduce some semaphore protection in theCWidgetControl methods + to make them thread safe. + Status: Open + Priority: Low + +o NxConsole Issues + ---------------- + Title: MULTIPLE COPIES OF AN NxCONSOLE Description: From the start window, you an create multiple copies of the NxConsole. However, there is a problem in the current @@ -41,5 +73,34 @@ NxWM port. The necessary change is to create an NX input device for /dev/console that will get its input from NX. Status: Open - Priority: Medium High - \ No newline at end of file + Priority: Medium high, basically prohibits the use of multiple NSH windows. + + Title: CLOSING AN NxCONSOLE + Description: If you open multiple NxConsole applications, they all receive + serial input (as noted in the previous bug). However, if + you close one of the NxConsoles, then the others no longer + received input (or no long generate output -- that cannot be + distinguished). + Status: Open + Priority: Medium high, basically prohibits the use of multiple NSH windows. + + Title: DOUBLE DISPLAY UPDATES + Description: When the NxConsole window is first opened, there are usually + double updates, i.e., the display forms twice. + Status: Open + Priorioty: Low, this would be necessary to fix to productize the windows. + +o Platform specific issues + ------------------------ + + Title: MISSING TOUCH RELEASE + Description: Using the STM3240G-EVAL board with the STMPE11 touchscreen, you + will find that there are occasional missing indications of when + you release a icon. This is believed to be a data overrun in the + STPMPE11 data path. The STMPE11 generates data a very high + rate and it is believe that it sometimes misses the interrupt + that indicates that the touch is released. The symptom in NxWM + is that you touch an icon, it is highlighted but when you release + the touch nothing happens. The icon stays highlighted. Touching + the icon again usually works around this problem. + Status: Open diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index c8468877a..2578a3ce9 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -120,8 +120,8 @@ namespace NxWM * widget constructor * * NOTE: Actually, NxWM uses the CWindowMessenger class that inherits from - * CWidgetControl. That class just adds some unrelated messenging capability; - * It cohabitates with CWidgetControl only becuase it nees the CWidgetControl + * CWidgetControl. That class just adds some unrelated messaging capability; + * It cohabitates with CWidgetControl only becuase it needs the CWidgetControl * this point. */ diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index d2e862a7c..11a48645b 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -72,11 +72,11 @@ namespace NxWM /** * The class CWindowMessenger integrates the widget control with some special - * handling of mouse and keyboard inputs neesed by NxWM. It use used + * handling of mouse and keyboard inputs needs by NxWM. It use used * in place of CWidgetControl whenever an NxWM window is created. * - * CWindowMessenger cohabitates with CWidgetControl only becuase it nees the - * CWidgetControl as an argument in its messenging. + * CWindowMessenger cohabitates with CWidgetControl only because it needs the + * CWidgetControl as an argument in its messaging. */ class CWindowMessenger : public NXWidgets::CWindowEventHandler, diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 6b0510017..2130293c2 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -759,8 +759,8 @@ void CTaskbar::clickIcon(int index, bool click) * widget constructor * * NOTE: Actually, NxWM uses the CWindowMessenger class that inherits from - * CWidgetControl. That class just adds some unrelated messenging capability; - * It cohabitates with CWidgetControl only becuase it nees the CWidgetControl + * CWidgetControl. That class just adds some unrelated messaging capability; + * It cohabitates with CWidgetControl only becuase it needs the CWidgetControl * this point. */ From 43cae03680063b02678714538f82aa4ee251a1c7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 May 2012 18:56:14 +0000 Subject: [PATCH 066/390] NxWM::CNxConsole and NXWidgets::CCallback can now redirect keyboard input to the NxConsole driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4754 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 13 ++++++ libnxwidgets/include/cbgwindow.hxx | 21 ++++++++++ libnxwidgets/include/ccallback.hxx | 32 ++++++++++++++- libnxwidgets/include/cnxtkwindow.hxx | 21 ++++++++++ libnxwidgets/include/cnxtoolbar.hxx | 21 ++++++++++ libnxwidgets/include/cnxwindow.hxx | 21 ++++++++++ libnxwidgets/include/inxwindow.hxx | 22 ++++++++++ libnxwidgets/include/nxconfig.hxx | 8 ++++ libnxwidgets/src/cbgwindow.cxx | 3 +- libnxwidgets/src/ccallback.cxx | 61 ++++++++++++++++++++-------- libnxwidgets/src/cnxtkwindow.cxx | 3 +- libnxwidgets/src/cnxtoolbar.cxx | 2 +- libnxwidgets/src/cnxwindow.cxx | 3 +- nxwm/src/cnxconsole.cxx | 43 +++++++++++++++++++- 14 files changed, 251 insertions(+), 23 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 80101c920..c61d48375 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -111,3 +111,16 @@ threading model. 1.2 2012-xx-xx Gregory Nutt + +* NXWidgets::CCallback: callback arguement is now type CCallback and not + CWidgetControl; Added a method to redirect keyboard contacts to either + the widgets in the window (via CWidgetControl) or to an NxConsole (via + nxcon_kbdin()). +* NXWidgets::INxWindow, CBgWindow, CNxTkWindow, CNxToolbar, CNxWindow: + Now pass the CCallback intances as the callback argument instead of + the CWidgetControl instance. New method redirectNxConsole() will + support redirection of any window keyboard input to the NxConsole + (via CCallback). +* NxWM:CNxConsole: Configures the NxConsole window to redirectin keyboard + input to the NxConsole; redirects standard input to the NxConsole + device driver. diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 435fdffbf..21b75799d 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -206,6 +206,27 @@ namespace NXWidgets bool lower(void); + /** + * Each window implementation also inherits from CCallback. CCallback, + * by default, forwards NX keyboard input to the various widgets residing + * in the window. But NxConsole is a different usage model; In this case, + * keyboard input needs to be directed to the NxConsole character driver. + * This method can be used to enable (or disable) redirection of NX + * keyboard input from the window widgets to the NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void redirectNxConsole(NXCONSOLE handle) + { + setNxConsole(handle); + } +#endif + /** * Set an individual pixel in the window with the specified color. * diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 09cb83a8a..8d3c13cd2 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -48,7 +48,10 @@ #include #include -#include + +#ifdef CONFIG_NXCONSOLE_NXKBDIN +# include +#endif #include "crect.hxx" @@ -88,7 +91,11 @@ namespace NXWidgets class CCallback { private: - struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ + CWidgetControl *m_widgetControl; /**< The widget control instance for this window */ + struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ +#ifdef CONFIG_NXCONSOLE_NXKBDIN + NXCONSOLE m_nxconsole; /**< The NxConsole handle for redirection of keyboard input */ +#endif // Methods in the callback vtable @@ -235,6 +242,27 @@ namespace NXWidgets { return &m_callbacks; } + + /** + * By default, NX keyboard input is given to the various widgets + * residing in the window. But NxConsole is a different usage model; + * In this case, keyboard input needs to be directed to the NxConsole + * character driver. This method can be used to enable (or disable) + * redirection of NX keyboard input from the window widgets to the + * NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void setNxConsole(NXCONSOLE handle) + { + m_nxconsole = handle; + } +#endif }; } diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 8fda121a9..16a0bee92 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -227,6 +227,27 @@ namespace NXWidgets bool lower(void); + /** + * Each window implementation also inherits from CCallback. CCallback, + * by default, forwards NX keyboard input to the various widgets residing + * in the window. But NxConsole is a different usage model; In this case, + * keyboard input needs to be directed to the NxConsole character driver. + * This method can be used to enable (or disable) redirection of NX + * keyboard input from the window widgets to the NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void redirectNxConsole(NXCONSOLE handle) + { + setNxConsole(handle); + } +#endif + /** * Set an individual pixel in the window with the specified color. * diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index 8e016c15e..69a004da5 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -196,6 +196,27 @@ namespace NXWidgets bool lower(void); + /** + * Each window implementation also inherits from CCallback. CCallback, + * by default, forwards NX keyboard input to the various widgets residing + * in the window. But NxConsole is a different usage model; In this case, + * keyboard input needs to be directed to the NxConsole character driver. + * This method can be used to enable (or disable) redirection of NX + * keyboard input from the window widgets to the NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void redirectNxConsole(NXCONSOLE handle) + { + setNxConsole(handle); + } +#endif + /** * Set an individual pixel in the toolbar with the specified color. * diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index e39c3cc81..50822cc83 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -200,6 +200,27 @@ namespace NXWidgets bool lower(void); + /** + * Each window implementation also inherits from CCallback. CCallback, + * by default, forwards NX keyboard input to the various widgets residing + * in the window. But NxConsole is a different usage model; In this case, + * keyboard input needs to be directed to the NxConsole character driver. + * This method can be used to enable (or disable) redirection of NX + * keyboard input from the window widgets to the NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + inline void redirectNxConsole(NXCONSOLE handle) + { + setNxConsole(handle); + } +#endif + /** * Set an individual pixel in the window with the specified color. * diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 750994a71..210a1e6ce 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -47,6 +47,10 @@ #include #include +#ifdef CONFIG_NXCONSOLE_NXKBDIN +# include +#endif + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ @@ -168,6 +172,24 @@ namespace NXWidgets virtual bool lower(void) = 0; + /** + * Each window implementation also inherits from CCallback. CCallback, + * by default, forwards NX keyboard input to the various widgets residing + * in the window. But NxConsole is a different usage model; In this case, + * keyboard input needs to be directed to the NxConsole character driver. + * This method can be used to enable (or disable) redirection of NX + * keyboard input from the window widgets to the NxConsole + * + * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard + * input will be directed to the NxConsole driver using this + * handle; If NULL (the default), NX keyboard input will be + * directed to the widgets within the window. + */ + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + virtual void redirectNxConsole(NXCONSOLE handle) = 0; +#endif + /** * Set an individual pixel in the window with the specified color. * diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 5ab883ab1..699686822 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -184,6 +184,14 @@ # error "Only a single color plane is supported (CONFIG_NX_NPLANES)" #endif +/* NxConsole checks. This just simplifies the conditional compilation by + * reducing the AND of these three conditions to a single condition. + */ + +#if !defined(CONFIG_NX_KBD) || !defined(CONFIG_NXCONSOLE) +# undef CONFIG_NXCONSOLE_NXKBDIN +#endif + /* NX Server/Device Configuration *******************************************/ /** * LCD device number (in case there are more than one LCDs connected) diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx index 58ecc1f51..268bc5d80 100644 --- a/libnxwidgets/src/cbgwindow.cxx +++ b/libnxwidgets/src/cbgwindow.cxx @@ -101,7 +101,8 @@ bool CBgWindow::open(void) // Request the background the window - int ret = nx_requestbkgd(m_hNxServer, vtable, (FAR void *)m_widgetControl); + int ret = nx_requestbkgd(m_hNxServer, vtable, + (FAR void *)static_cast(this)); if (ret < 0) { return false; diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index b2256c6bb..374502a38 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -44,6 +44,10 @@ #include #include +#ifdef CONFIG_NXCONSOLE_NXKBDIN +# include +#endif + #include "cwidgetcontrol.hxx" #include "ccallback.hxx" @@ -65,6 +69,10 @@ using namespace NXWidgets; CCallback::CCallback(CWidgetControl *widgetControl) { + // Save the widgetControl + + m_widgetControl = widgetControl; + // Initialize the callback vtable m_callbacks.redraw = redraw; @@ -76,6 +84,12 @@ CCallback::CCallback(CWidgetControl *widgetControl) m_callbacks.kbdin = newKeyboardEvent; #endif m_callbacks.blocked = windowBlocked; + + // Keyboard input is initially direct to the widgets within the window + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + m_nxconsole = (NXCONSOLE)0; +#endif } /** @@ -98,13 +112,13 @@ void CCallback::redraw(NXHANDLE hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, bMore ? "true" : "false"); - // The argument must be the CWidgetControl instance + // The argument must be the CCallback instance - CWidgetControl *This = (CWidgetControl *)arg; + CCallback *This = (CCallback *)arg; // Just forward the callback to the CWidgetControl::redrawEvent method - This->redrawEvent(rect, bMore); + This->m_widgetControl->redrawEvent(rect, bMore); } /** @@ -132,13 +146,13 @@ void CCallback::position(NXHANDLE hwnd, arg); - // The argument must be the CWidgetControl instance + // The argument must be the CCallback instance - CWidgetControl *This = (CWidgetControl *)arg; + CCallback *This = (CCallback *)arg; // Just forward the callback to the CWidgetControl::geometry method - This->geometryEvent(hwnd, size, pos, bounds); + This->m_widgetControl->geometryEvent(hwnd, size, pos, bounds); } /** @@ -160,13 +174,13 @@ void CCallback::newMouseEvent(NXHANDLE hwnd, gvdbg("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", hwnd, pos->x, pos->y, buttons, arg); - // The argument must be the CWidgetControl instance + // The argument must be the CCallback instance - CWidgetControl *This = (CWidgetControl *)arg; + CCallback *This = (CCallback *)arg; // Just forward the callback to the CWidgetControl::newMouseEvent method - This->newMouseEvent(pos, buttons); + This->m_widgetControl->newMouseEvent(pos, buttons); } #endif /* CONFIG_NX_MOUSE */ @@ -188,13 +202,28 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, { gvdbg("hwnd=%p nCh=%d arg=%p\n", hwnd, nCh, arg); - // The argument must be the CWidgetControl instance + // The argument must be the CCallback instance - CWidgetControl *This = (CWidgetControl *)arg; + CCallback *This = (CCallback *)arg; - // Just forward the callback to the CWidgetControl::newKeyboardEvent method + // Is NX keyboard input being directed to the widgets within the window + // (default) OR is NX keyboard input being re-directed to an NxConsole + // driver? - This->newKeyboardEvent(nCh, str); +#ifdef CONFIG_NXCONSOLE_NXKBDIN + if (This->m_nxconsole) + { + // Keyboard input is going to an NxConsole + + nxcon_kbdin(This->m_nxconsole, str, nCh); + } + else +#endif + { + // Just forward the callback to the CWidgetControl::newKeyboardEvent method + + This->m_widgetControl->newKeyboardEvent(nCh, str); + } } /** @@ -221,13 +250,13 @@ void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) { gvdbg("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); - // The first argument must be the CWidgetControl instance + // The first argument must be the CCallback instance - CWidgetControl *This = (CWidgetControl *)arg1; + CCallback *This = (CCallback *)arg1; // Just forward the callback to the CWidgetControl::windowBlocked method - This->windowBlocked(arg2); + This->m_widgetControl->windowBlocked(arg2); } #endif diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 6a9c115e1..b1d7be9e2 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -118,7 +118,8 @@ bool CNxTkWindow::open(void) // Create the window - m_hNxTkWindow = nxtk_openwindow(m_hNxServer, vtable, (FAR void *)m_widgetControl); + m_hNxTkWindow = nxtk_openwindow(m_hNxServer, vtable, + (FAR void *)static_cast(this)); return m_hNxTkWindow != NULL; } diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 12b6bea4c..725a368fa 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -119,7 +119,7 @@ bool CNxToolbar::open(void) // Create the toolbar int ret = nxtk_opentoolbar(m_hNxTkWindow, m_height, vtable, - (FAR void *)m_widgetControl); + (FAR void *)static_cast(this)); return ret == OK; } diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index 5ba4d734c..b38667d8d 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -99,7 +99,8 @@ bool CNxWindow::open(void) // Create the window - m_hNxWindow = nx_openwindow(m_hNxServer, vtable, (FAR void *)m_widgetControl); + m_hNxWindow = nx_openwindow(m_hNxServer, vtable, + (FAR void *)static_cast(this)); return m_hNxWindow != NULL; } diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 30105910b..63cd21eb6 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -36,6 +36,11 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ +#include // REMOVE ME +#define CONFIG_DEBUG 1 // REMOVE ME +#define CONFIG_DEBUG_VERBOSE 1 // REMOVE ME +#define CONFIG_DEBUG_GRAPHICS 1 // REMOVE ME +#include // REMOVE ME #include @@ -202,6 +207,7 @@ bool CNxConsole::run(void) if (m_pid >= 0 || m_nxcon != 0) { + gdbg("ERROR: All ready running or connected\n"); return false; } @@ -211,6 +217,7 @@ bool CNxConsole::run(void) { // This might fail if a signal is received while we are waiting. + gdbg("ERROR: Failed to get semaphore\n"); return false; } @@ -252,6 +259,7 @@ bool CNxConsole::run(void) bool result = true; if (m_pid < 0) { + gdbg("ERROR: Failed to create the NxConsole task\n"); result = false; } else @@ -267,14 +275,22 @@ bool CNxConsole::run(void) if (ret == OK && g_nxconvars.result) { + // Re-direct NX keyboard input to the new NxConsole driver + + DEBUGASSERT(g_nxconvars.nxcon != 0); +#ifdef CONFIG_NXCONSOLE_NXKBDIN + window->redirectNxConsole(g_nxconvars.nxcon); +#endif // Save the handle to use in the stop method m_nxcon = g_nxconvars.nxcon; } else { - // Stop the application + // sem_timedwait failed OR the NxConsole task reported a + // failure. Stop the application + gdbg("ERROR: Failed start the NxConsole task\n"); stop(); result = false; } @@ -313,6 +329,15 @@ void CNxConsole::stop(void) if (m_nxcon) { + // Re-store NX keyboard input routing + +#ifdef CONFIG_NXCONSOLE_NXKBDIN + NXWidgets::INxWindow *window = m_window->getWindow(); + window->redirectNxConsole((NXCONSOLE)0); +#endif + + // Unregister the NxConsole driver + nxcon_unregister(m_nxcon); m_nxcon = 0; } @@ -405,6 +430,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) if (on_exit(exitHandler, g_nxconvars.console) != 0) { + gdbg("ERROR: on_exit failed\n"); goto errout; } @@ -414,6 +440,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) g_nxconvars.minor); if (!g_nxconvars.nxcon) { + gdbg("ERROR: Failed register the console device\n"); goto errout; } @@ -428,9 +455,14 @@ int CNxConsole::nxconsole(int argc, char *argv[]) // Open the NxConsole driver +#ifdef CONFIG_NXCONSOLE_NXKBDIN + fd = open(devname, O_RDWR); +#else fd = open(devname, O_WRONLY); +#endif if (fd < 0) { + gdbg("ERROR: Failed open the console device\n"); goto errout_with_nxcon; } @@ -442,12 +474,21 @@ int CNxConsole::nxconsole(int argc, char *argv[]) (void)std::fflush(stdout); (void)std::fflush(stderr); +#ifdef CONFIG_NXCONSOLE_NXKBDIN + (void)std::fclose(stdin); +#endif (void)std::fclose(stdout); (void)std::fclose(stderr); +#ifdef CONFIG_NXCONSOLE_NXKBDIN + (void)std::dup2(fd, 0); +#endif (void)std::dup2(fd, 1); (void)std::dup2(fd, 2); +#ifdef CONFIG_NXCONSOLE_NXKBDIN + (void)std::fdopen(0, "r"); +#endif (void)std::fdopen(1, "w"); (void)std::fdopen(2, "w"); From 2de19911f1102b367d2f413f6e002b8694578b79 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 May 2012 22:10:34 +0000 Subject: [PATCH 067/390] Add an NxWM console/keyboard thread and eliminate all issues with NxConsole window serial input git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4755 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 12 ++ TODO.txt | 8 +- UnitTests/nxwm/main.cxx | 45 +++++- libnxwidgets/include/ccallback.hxx | 2 +- nxwm/Makefile | 4 + nxwm/doc/NxWM-ThreadingModel.ppt | Bin 126464 -> 129024 bytes nxwm/include/ckeyboard.hxx | 133 ++++++++++++++++ nxwm/include/ctaskbar.hxx | 10 +- nxwm/include/nxwmconfig.hxx | 39 ++++- nxwm/src/ckeyboard.cxx | 245 +++++++++++++++++++++++++++++ nxwm/src/ctaskbar.cxx | 49 ++++-- 11 files changed, 529 insertions(+), 18 deletions(-) create mode 100644 nxwm/include/ckeyboard.hxx create mode 100644 nxwm/src/ckeyboard.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index c61d48375..9a5855252 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -124,3 +124,15 @@ * NxWM:CNxConsole: Configures the NxConsole window to redirectin keyboard input to the NxConsole; redirects standard input to the NxConsole device driver. +* NxWM:CKeyboard: Add a new class that implements a keyboard listener + thread. This thread reads from /dev/console and injects the keyboard + input into NX. NX will determine which window is at the top of the + heirarchy and re-direct the keyboard input to only that top window. + This solves an important problem with, for example, running multiple + copies of the NxConsole: On the copy of the NxConsole at the top of + the heirarchy should get the keyboard input. +* UnitTests/nxwm/main.cxx: Now starts the keyboard thread if + CONFIG_NXWM_KEYBOARD is defined. +* NxWM::CTaskbar: After drawing the task bar, need to raise the + application window otherwise the taskbar will be on the top and + keyboard input will not be received by the top application. diff --git a/TODO.txt b/TODO.txt index 6264d2f3d..e47b3cf1a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -72,7 +72,9 @@ o NxConsole Issues NxConsoles get their input from /dev/console which is the serial port. The necessary change is to create an NX input device for /dev/console that will get its input from NX. - Status: Open + Status: Closed with was fixed with the last check of 5/20/2012 (about + SVN version 4754). The fixed version is available in SVN but + won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. Title: CLOSING AN NxCONSOLE @@ -81,7 +83,9 @@ o NxConsole Issues you close one of the NxConsoles, then the others no longer received input (or no long generate output -- that cannot be distinguished). - Status: Open + Status: Closed with was fixed with the last check of 5/20/2012 (about + SVN version 4754). The fixed version is available in SVN but + won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. Title: DOUBLE DISPLAY UPDATES diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 86ea324d5..3cc85dc43 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -53,6 +53,10 @@ # include "ccalibration.hxx" #endif +#ifdef CONFIG_NXWM_KEYBOARD +# include "ckeyboard.hxx" +#endif + ///////////////////////////////////////////////////////////////////////////// // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// @@ -408,7 +412,7 @@ static bool createTouchScreen(void) printf("createTouchScreen: ERROR: Failed to create CTouchscreen\n"); return false; } - showTestCaseMemory("createTouchScreen: createTouchScreen: After creating CTouchscreen"); + showTestCaseMemory("createTouchScreen: After creating CTouchscreen"); printf("createTouchScreen: Start touchscreen listener\n"); if (!g_nxwmtest.touchscreen->start()) @@ -423,6 +427,35 @@ static bool createTouchScreen(void) } #endif +///////////////////////////////////////////////////////////////////////////// +// Name: createKeyboard +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_KEYBOARD +static bool createKeyboard(void) +{ + printf("createKeyboard: Creating CKeyboard\n"); + NxWM::CKeyboard *keyboard = new NxWM::CKeyboard(g_nxwmtest.taskbar); + if (!keyboard) + { + printf("createKeyboard: ERROR: Failed to create CKeyboard\n"); + return false; + } + showTestCaseMemory("createKeyboard After creating CKeyboard"); + + printf("createKeyboard: Start keyboard listener\n"); + if (!keyboard->start()) + { + printf("createKeyboard: ERROR: Failed start the keyboard listener\n"); + delete keyboard; + return false; + } + + showTestCaseMemory("createKeyboard: After starting the keyboard listener"); + return true; +} +#endif + ///////////////////////////////////////////////////////////////////////////// // Name: createCalibration ///////////////////////////////////////////////////////////////////////////// @@ -574,6 +607,16 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the keyboard device + +#ifdef CONFIG_NXWM_KEYBOARD + if (!createKeyboard()) + { + printf(MAIN_STRING "ERROR: Failed to create the keyboard\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Create the touchscreen device #ifdef CONFIG_NXWM_TOUCHSCREEN diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 8d3c13cd2..714ed1a7f 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/Makefile b/nxwm/Makefile index b0b33c73d..01b8d4513 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -51,6 +51,10 @@ ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) CXXSRCS += ccalibration.cxx ctouchscreen.cxx endif +ifeq ($(CONFIG_NXWM_KEYBOARD),y) +CXXSRCS += ckeyboard.cxx +endif + # Images CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx diff --git a/nxwm/doc/NxWM-ThreadingModel.ppt b/nxwm/doc/NxWM-ThreadingModel.ppt index acae788c2d15f44d8e880f13edb894af282722c6..1b7b43622d843eadd99b83d4566820c154e0ad61 100644 GIT binary patch delta 5121 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 delta 3653 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 diff --git a/nxwm/include/ckeyboard.hxx b/nxwm/include/ckeyboard.hxx new file mode 100644 index 000000000..8f16bd506 --- /dev/null +++ b/nxwm/include/ckeyboard.hxx @@ -0,0 +1,133 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/keyboard.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CKEYBOARD_HXX +#define __INCLUDE_CKEYBOARD_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxserver.hxx" +#include "ccalibration.hxx" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +namespace NxWM +{ + /** + * The CKeyboard class provides the the calibration window and obtains + * callibration data. + */ + + class CKeyboard + { + private: + /** + * The state of the listener thread. + */ + + enum EListenerState + { + LISTENER_NOTRUNNING = 0, /**< The listener thread has not yet been started */ + LISTENER_STARTED, /**< The listener thread has been started, but is not yet running */ + LISTENER_RUNNING, /**< The listener thread is running normally */ + LISTENER_STOPREQUESTED, /**< The listener thread has been requested to stop */ + LISTENER_TERMINATED, /**< The listener thread terminated normally */ + LISTENER_FAILED /**< The listener thread terminated abnormally */ + }; + + /** + * CKeyboard state data + */ + + NXWidgets::CNxServer *m_server; /**< The current NX server */ + int m_kbdFd; /**< File descriptor of the opened keyboard device */ + pthread_t m_thread; /**< The listener thread ID */ + volatile enum EListenerState m_state; /**< The state of the listener thread */ + sem_t m_waitSem; /**< Used to synchronize with the listener thread */ + + /** + * The keyboard listener thread. This is the entry point of a thread that + * listeners for and dispatches keyboard events to the NX server. + * + * @param arg. The CKeyboard 'this' pointer cast to a void*. + * @return This function normally does not return but may return NULL on + * error conditions. + */ + + static FAR void *listener(FAR void *arg); + + public: + + /** + * CKeyboard Constructor + * + * @param server. An instance of the NX server. This will be needed for + * injecting mouse data. + */ + + CKeyboard(NXWidgets::CNxServer *server); + + /** + * CKeyboard Destructor + */ + + ~CKeyboard(void); + + /** + * Start the keyboard listener thread. + * + * @return True if the keyboard listener thread was correctly started. + */ + + bool start(void); + }; +} + +#endif // __INCLUDE_CKEYBOARD_HXX diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 2578a3ce9..5aab9e6bf 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -184,7 +184,15 @@ namespace NxWM * @return true on success */ - bool redrawTopWindow(void); + bool redrawTopApplication(void); + + /** + * Raise the top window to the top of the NXheirarchy. + * + * @return true on success + */ + + void raiseTopApplication(void); /** * (Re-)draw the background window. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 25a8beb66..8a7700af4 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -65,6 +65,7 @@ * CONFIG_NXWM_DEFAULT_FONTID - the NxWM default font ID. Default: * NXFONT_DEFAULT * CONFIG_NXWM_TOUCHSCREEN - Define to build in touchscreen support. + * CONFIG_NXWM_KEYBOARD - Define to build in touchscreen support. */ #ifndef CONFIG_HAVE_CXX @@ -386,7 +387,7 @@ * * CONFIG_NXWM_TOUCHSCREEN_DEVNO - Touchscreen device minor number, i.e., the * N in /dev/inputN. Default: 0 - * CONFIG_NXWM_TOUCHSCREEN_DEVNO - The full path to the touchscreen device. + * CONFIG_NXWM_TOUCHSCREEN_DEVPATH - The full path to the touchscreen device. * Default: "/dev/input0" * CONFIG_NXWM_TOUCHSCREEN_SIGNO - The realtime signal used to wake up the * touchscreen listener thread. Default: 5 @@ -416,6 +417,42 @@ # define CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK 1024 #endif +/* Keyboard device **********************************************************/ +/** + * Keyboard device settings + * + * CONFIG_NXWM_KEYBOARD_DEVNO - The full path to the touchscreen device. + * Default: "/dev/console" + * CONFIG_NXWM_KEYBOARD_SIGNO - The realtime signal used to wake up the + * touchscreen listener thread. Default: 6 + * CONFIG_NXWM_KEYBOARD_BUFSIZE - The size of the keyboard read data buffer. + * Default: 16 + * CONFIG_NXWM_KEYBOARD_LISTENERPRIO - Priority of the touchscreen listener + * thread. Default: SCHED_PRIORITY_DEFAULT + * CONFIG_NXWM_KEYBOARD_LISTENERSTACK - Keyboard listener thread stack + * size. Default 1024 + */ + +#ifndef CONFIG_NXWM_KEYBOARD_DEVPATH +# define CONFIG_NXWM_KEYBOARD_DEVPATH "/dev/console" +#endif + +#ifndef CONFIG_NXWM_KEYBOARD_SIGNO +# define CONFIG_NXWM_KEYBOARD_SIGNO 6 +#endif + +#ifndef CONFIG_NXWM_KEYBOARD_BUFSIZE +# define CONFIG_NXWM_KEYBOARD_BUFSIZE 6 +#endif + +#ifndef CONFIG_NXWM_KEYBOARD_LISTENERPRIO +# define CONFIG_NXWM_KEYBOARD_LISTENERPRIO SCHED_PRIORITY_DEFAULT +#endif + +#ifndef CONFIG_NXWM_KEYBOARD_LISTENERSTACK +# define CONFIG_NXWM_KEYBOARD_LISTENERSTACK 1024 +#endif + /* Calibration display ******************************************************/ /** * Calibration display settings: diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx new file mode 100644 index 000000000..6e9d7b818 --- /dev/null +++ b/nxwm/src/ckeyboard.cxx @@ -0,0 +1,245 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/ckeyboard.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ +#include // REMOVE ME +#define CONFIG_DEBUG 1 // REMOVE ME +#define CONFIG_DEBUG_VERBOSE 1 // REMOVE ME +#define CONFIG_DEBUG_GRAPHICS 1 // REMOVE ME +#include // REMOVE ME + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "nxwmconfig.hxx" +#include "ckeyboard.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * CKeyboard Method Implementations + ********************************************************************************************/ + +using namespace NxWM; + +/** + * CKeyboard Constructor + * + * @param server. An instance of the NX server. This will be needed for + * injecting mouse data. + */ + +CKeyboard::CKeyboard(NXWidgets::CNxServer *server) +{ + m_server = server; // Save the NX server + m_kbdFd = -1; // Device driver is not opened + m_state = LISTENER_NOTRUNNING; // The listener thread is not running yet + + // Initialize the semaphore used to synchronize with the listener thread + + sem_init(&m_waitSem, 0, 0); +} + +/** + * CKeyboard Destructor + */ + +CKeyboard::~CKeyboard(void) +{ + // Stop the listener thread + + m_state = LISTENER_STOPREQUESTED; + + // Wake up the listener thread so that it will use our buffer + // to receive data + // REVISIT: Need wait here for the listener thread to terminate + + (void)pthread_kill(m_thread, CONFIG_NXWM_KEYBOARD_SIGNO); + + // Close the keyboard device (or should these be done when the thread exits?) + + if (m_kbdFd >= 0) + { + std::close(m_kbdFd); + } +} + +/** + * Start the keyboard listener thread. + * + * @return True if the keyboard listener thread was correctly started. + */ + +bool CKeyboard::start(void) +{ + pthread_attr_t attr; + + gvdbg("Starting listener\n"); + + // Start a separate thread to listen for keyboard events + + (void)pthread_attr_init(&attr); + + struct sched_param param; + param.sched_priority = CONFIG_NXWM_KEYBOARD_LISTENERPRIO; + (void)pthread_attr_setschedparam(&attr, ¶m); + + (void)pthread_attr_setstacksize(&attr, CONFIG_NXWM_KEYBOARD_LISTENERSTACK); + + m_state = LISTENER_STARTED; // The listener thread has been started, but is not yet running + + int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); + if (ret != 0) + { + gdbg("CKeyboard::start: pthread_create failed: %d\n", ret); + return false; + } + + // Detach from the thread + + (void)pthread_detach(m_thread); + + // Don't return until we are sure that the listener thread is running + // (or until it reports an error). + + while (m_state == LISTENER_STARTED) + { + // Wait for the listener thread to wake us up when we really + // are connected. + + (void)sem_wait(&m_waitSem); + } + + // Then return true only if the listener thread reported successful + // initialization. + + gvdbg("Listener m_state=%d\n", (int)m_state); + return m_state == LISTENER_RUNNING; +} + + /** + * The keyboard listener thread. This is the entry point of a thread that + * listeners for and dispatches keyboard events to the NX server. + * + * @param arg. The CKeyboard 'this' pointer cast to a void*. + * @return This function normally does not return but may return NULL on + * error conditions. + */ + +FAR void *CKeyboard::listener(FAR void *arg) +{ + CKeyboard *This = (CKeyboard *)arg; + + gvdbg("Listener started\n"); + + // Open the keyboard device + + This->m_kbdFd = std::open(CONFIG_NXWM_KEYBOARD_DEVPATH, O_RDONLY); + if (This->m_kbdFd < 0) + { + gdbg("ERROR Failed to open %s for reading: %d\n", + CONFIG_NXWM_KEYBOARD_DEVPATH, errno); + This->m_state = LISTENER_FAILED; + sem_post(&This->m_waitSem); + return (FAR void *)0; + } + + // Indicate that we have successfully initialized + + This->m_state = LISTENER_RUNNING; + sem_post(&This->m_waitSem); + + // Now loop, reading and dispatching keyboard data + + while (This->m_state == LISTENER_RUNNING) + { + // Read one keyboard sample + + gvdbg("Listening for keyboard input\n"); + + uint8_t rxbuffer[CONFIG_NXWM_KEYBOARD_BUFSIZE]; + ssize_t nbytes = read(This->m_kbdFd, rxbuffer, CONFIG_NXWM_KEYBOARD_BUFSIZE); +dbg("nbytes=%d\n"); // REMOVE ME + // Check for errors + + if (nbytes < 0) + { + // The only expect error is to be interrupt by a signal +#ifdef CONFIG_DEBUG + int errval = errno; + + gdbg("ERROR: read %s failed: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errval); + DEBUGASSERT(errval == EINTR); +#endif + } + + // Give the keyboard input to NX + + else if (nbytes > 0) + { + // Looks like good keyboard input... process it. + // First, get the server handle + + NXHANDLE handle = This->m_server->getServer(); + + // Then inject the keyboard input into NX + + int ret = nx_kbdin(handle, (uint8_t)nbytes, rxbuffer); + if (ret < 0) + { + gdbg("ERROR: nx_kbdin failed\n"); + } + } + } + + // We should get here only if we were asked to terminate via + // m_state = LISTENER_STOPREQUESTED + + gvdbg("Listener exiting\n"); + This->m_state = LISTENER_TERMINATED; + return (FAR void *)0; +} diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 2130293c2..111d800e9 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -610,7 +610,7 @@ bool CTaskbar::minimizeApplication(IApplication *app) // Re-draw the new top, non-minimized application - return redrawTopWindow(); + return redrawTopApplication(); } return false; @@ -672,7 +672,7 @@ bool CTaskbar::stopApplication(IApplication *app) // Re-draw the new top, non-minimized application - bool ret = redrawTopWindow(); + bool ret = redrawTopApplication(); if (ret) { // And redraw the task bar (without the icon for this task) @@ -1184,6 +1184,11 @@ bool CTaskbar::redrawTaskbarWindow(void) } #endif } + + // If there is a top application then we must now raise it above the task + // bar so that itwill get the keyboard input. + + raiseTopApplication(); } // Return success (it is not a failure if the window manager is not started @@ -1198,7 +1203,7 @@ bool CTaskbar::redrawTaskbarWindow(void) * @return true on success */ -bool CTaskbar::redrawTopWindow(void) +bool CTaskbar::redrawTopApplication(void) { // Check if there is already a top application @@ -1236,6 +1241,30 @@ bool CTaskbar::redrawTopWindow(void) } } +/** + * Raise the top window to the top of the NXheirarchy. + * + * @return true on success + */ + +void CTaskbar::raiseTopApplication(void) +{ + if (m_topApp) + { + // Every application provides a method to obtain its application window + + IApplicationWindow *appWindow = m_topApp->getWindow(); + + // Each application window provides a method to get the underlying NX window + + NXWidgets::INxWindow *window = appWindow->getWindow(); + + // Raise the application window to the top of the hierarchy + + window->raise(); + } +} + /** * (Re-)draw the background window. * @@ -1301,18 +1330,14 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) m_backImage->disableDrawing(); + // Raise to top application to the top of the NX window heirarchy + + raiseTopApplication(); + // Every application provides a method to obtain its application window IApplicationWindow *appWindow = app->getWindow(); - // Each application window provides a method to get the underlying NX window - - NXWidgets::INxWindow *window = appWindow->getWindow(); - - // Raise the application window to the top of the hierarchy - - window->raise(); - // Re-draw the application window toolbar appWindow->redraw(); @@ -1333,7 +1358,7 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) void CTaskbar::hideApplicationWindow(IApplication *app) { // The hidden window is certainly not the top application any longer - // If it was before then redrawTopWindow() will pick a new one (rather + // If it was before then redrawTopApplication() will pick a new one (rather // arbitrarily). if (app->isTopApplication()) From 1dcdf1619b0d55fccb9d605c510c052650ec731e Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 20 May 2012 22:24:43 +0000 Subject: [PATCH 068/390] Updat NxWidgets TODO list git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4756 42af7a65-404d-4744-a932-0658087f49c3 --- TODO.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.txt b/TODO.txt index e47b3cf1a..6d74b6917 100644 --- a/TODO.txt +++ b/TODO.txt @@ -73,7 +73,7 @@ o NxConsole Issues port. The necessary change is to create an NX input device for /dev/console that will get its input from NX. Status: Closed with was fixed with the last check of 5/20/2012 (about - SVN version 4754). The fixed version is available in SVN but + SVN version 4755). The fixed version is available in SVN but won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. @@ -84,7 +84,7 @@ o NxConsole Issues received input (or no long generate output -- that cannot be distinguished). Status: Closed with was fixed with the last check of 5/20/2012 (about - SVN version 4754). The fixed version is available in SVN but + SVN version 4755). The fixed version is available in SVN but won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. From 6ae1b32952574cc37e826902211914ceda8d9548 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 21 May 2012 13:34:09 +0000 Subject: [PATCH 069/390] Fix NxWM bug: old window being minimized when new window open git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4757 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 ++++ TODO.txt | 15 ++++++++++++++- nxwm/src/ckeyboard.cxx | 7 +------ nxwm/src/ctaskbar.cxx | 10 +++------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9a5855252..b763d5ee5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -136,3 +136,7 @@ * NxWM::CTaskbar: After drawing the task bar, need to raise the application window otherwise the taskbar will be on the top and keyboard input will not be received by the top application. +* NxWM::CTaskbar: Bugfix... previous window should now be minimized + when a new window is started. It should stay in a maximized state + so that it will re-appear with the window above it is closed or + minimized. diff --git a/TODO.txt b/TODO.txt index 6d74b6917..c0b9c5373 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,7 +4,7 @@ NxWidgets NxWM ---- - (3) General issues + (4) General issues (3) NxConsole issues (1) Platform specific issues @@ -55,6 +55,19 @@ o General NxWM Issues Status: Open Priority: Low + Title: COMBINE CTouchscreen AND CKeyboard THREADS + Description: Right now, two separate threads handle touchscreen and keyboard/ + console input. Each just waits on read() and when toushcscreen + or keyboard input is received, it injects the data into NX. + These two threads should be combined into one thread that waits + on poll for read data from either device. Then when read data + becomes ready for either device, it could perform the read and + data inject from a single thread. + Status: Open + Priority: Low, this is not a product but a text example. If NxWM were + to be productized, this change should be done in order to reduce + stack memory consumption. + o NxConsole Issues ---------------- diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index 6e9d7b818..0f3f11d37 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -36,11 +36,6 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ -#include // REMOVE ME -#define CONFIG_DEBUG 1 // REMOVE ME -#define CONFIG_DEBUG_VERBOSE 1 // REMOVE ME -#define CONFIG_DEBUG_GRAPHICS 1 // REMOVE ME -#include // REMOVE ME #include @@ -203,7 +198,7 @@ FAR void *CKeyboard::listener(FAR void *arg) uint8_t rxbuffer[CONFIG_NXWM_KEYBOARD_BUFSIZE]; ssize_t nbytes = read(This->m_kbdFd, rxbuffer, CONFIG_NXWM_KEYBOARD_BUFSIZE); -dbg("nbytes=%d\n"); // REMOVE ME + // Check for errors if (nbytes < 0) diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 111d800e9..c494fcba3 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -506,8 +506,7 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) return false; } - // Has the window manager been started? Or were we ask to start - // the application minimized? + // Were we ask to start the application minimized? if (minimized) { @@ -551,11 +550,8 @@ bool CTaskbar::topApplication(IApplication *app) if (m_topApp) { - // Yes.. then minimize the application - - m_topApp->setMinimized(true); - - // And make the application non-visible + // Yes.. make the application non-visible (it is still maximized and + // will reappear when the window above it is minimized or closed). hideApplicationWindow(m_topApp); } From 8ef9f39b43c86cd4c8f08b7f3b2649faf3d1ab5b Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 21 May 2012 17:36:26 +0000 Subject: [PATCH 070/390] Add a timeout to the STMPE11 touchscreen driver to catch missing pen up events git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4758 42af7a65-404d-4744-a932-0658087f49c3 --- TODO.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/TODO.txt b/TODO.txt index c0b9c5373..edd203210 100644 --- a/TODO.txt +++ b/TODO.txt @@ -8,6 +8,8 @@ NxWM (3) NxConsole issues (1) Platform specific issues +See also the NuttX TODO list graphics/ section for related issues. + o General NxWM Issues ------------------- @@ -85,7 +87,7 @@ o NxConsole Issues NxConsoles get their input from /dev/console which is the serial port. The necessary change is to create an NX input device for /dev/console that will get its input from NX. - Status: Closed with was fixed with the last check of 5/20/2012 (about + Status: Closed with was fixed with the check-in of 5/20/2012 (about SVN version 4755). The fixed version is available in SVN but won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. @@ -96,7 +98,7 @@ o NxConsole Issues you close one of the NxConsoles, then the others no longer received input (or no long generate output -- that cannot be distinguished). - Status: Closed with was fixed with the last check of 5/20/2012 (about + Status: Closed with was fixed with the check-in of 5/20/2012 (about SVN version 4755). The fixed version is available in SVN but won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. @@ -120,4 +122,8 @@ o Platform specific issues is that you touch an icon, it is highlighted but when you release the touch nothing happens. The icon stays highlighted. Touching the icon again usually works around this problem. - Status: Open + Status: Closed with was fixed with the check-in of 5/21/2012 (about + SVN version 4758). The was change made to NuttX, not NxWidgets. + The fixed version is available in SVN but won't be in a released + version until NuttX-6.198 is released. + Priorioty: Low, but really annoying. From 2c9a38193bf67346a3f70fb0c0fc9db49c8bc882 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 21 May 2012 23:56:29 +0000 Subject: [PATCH 071/390] Some debug garbage was left in the files git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4759 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/include/cnxconsole.hxx | 2 +- nxwm/src/cnxconsole.cxx | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index c04caeff9..f33f1182d 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -104,7 +104,7 @@ namespace NxWM void minimize(void); /** - * Called when the window minimize close is pressed. + * Called when the window close button is pressed. */ void close(void); diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 63cd21eb6..41e153400 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -36,11 +36,6 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ -#include // REMOVE ME -#define CONFIG_DEBUG 1 // REMOVE ME -#define CONFIG_DEBUG_VERBOSE 1 // REMOVE ME -#define CONFIG_DEBUG_GRAPHICS 1 // REMOVE ME -#include // REMOVE ME #include @@ -560,7 +555,7 @@ void CNxConsole::minimize(void) } /** - * Called when the window minimize close is pressed. + * Called when the window close button is pressed. */ void CNxConsole::close(void) From 654aadaed8e6c5f122c61fd7ff6d82817910195d Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 22 May 2012 19:29:22 +0000 Subject: [PATCH 072/390] Add a hex calculator example to NxWM git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4760 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 + Doxygen/Doxyfile | 4 +- UnitTests/nxwm/main.cxx | 38 ++ libnxwidgets/doc/mainpage.h | 33 ++ nxwm/Makefile | 21 +- nxwm/images/calculator.png | Bin 0 -> 263 bytes nxwm/include/chexcalculator.hxx | 276 ++++++++++ nxwm/include/cstartwindow.hxx | 3 +- nxwm/include/nxwmconfig.hxx | 18 + nxwm/include/nxwmglyphs.hxx | 1 + nxwm/src/ccalibration.cxx | 2 +- nxwm/src/chexcalculator.cxx | 898 ++++++++++++++++++++++++++++++++ nxwm/src/glyph_calculator.cxx | 191 +++++++ 13 files changed, 1478 insertions(+), 9 deletions(-) create mode 100644 nxwm/images/calculator.png create mode 100644 nxwm/include/chexcalculator.hxx create mode 100644 nxwm/src/chexcalculator.cxx create mode 100644 nxwm/src/glyph_calculator.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index b763d5ee5..ecee1021c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -140,3 +140,5 @@ when a new window is started. It should stay in a maximized state so that it will re-appear with the window above it is closed or minimized. +* NxWM::CHexCalculator: Add a hexadecimal/decimal calculator + example. diff --git a/Doxygen/Doxyfile b/Doxygen/Doxyfile index 0451ce6a0..979f5720f 100644 --- a/Doxygen/Doxyfile +++ b/Doxygen/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = NXWidgets # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.0" +PROJECT_NUMBER = "1.1" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -574,7 +574,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = "../libnxwidgets" +INPUT = "../libnxwidgets" "../nxwm" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/main.cxx index 3cc85dc43..f61252904 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/main.cxx @@ -47,6 +47,7 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" #include "cnxconsole.hxx" +#include "chexcalculator.hxx" #ifdef CONFIG_NXWM_TOUCHSCREEN # include "ctouchscreen.hxx" @@ -540,6 +541,35 @@ static bool createNxConsole(void) return true; } +///////////////////////////////////////////////////////////////////////////// +// Name: createHexCalculator +///////////////////////////////////////////////////////////////////////////// + +static bool createHexCalculator(void) +{ + // Add the hex calculator application to the start window + + printf("createHexCalculator: Creating the hex calculator application\n"); + NxWM::CHexCalculatorFactory *calculator = new NxWM::CHexCalculatorFactory(g_nxwmtest.taskbar); + if (!calculator) + { + printf("createHexCalculator: ERROR: Failed to instantiate CHexCalculatorFactory\n"); + return false; + } + showTestCaseMemory("createHexCalculator: After creating the hex calculator application"); + + printf("createHexCalculator: Adding the hex calculator application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calculator)) + { + printf("createHexCalculator: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + delete calculator; + return false; + } + + showTestCaseMemory("createHexCalculator: After adding the hex calculator application"); + return true; +} + ///////////////////////////////////////////////////////////////////////////// // Public Functions ///////////////////////////////////////////////////////////////////////////// @@ -645,6 +675,14 @@ int MAIN_NAME(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the hex calculator application and add it to the start window + + if (!createHexCalculator()) + { + printf(MAIN_STRING "ERROR: Failed to create the hex calculator application\n"); + testCleanUpAndExit(EXIT_FAILURE); + } + // Call CTaskBar::startWindowManager to start the display with applications in place. if (!startWindowManager()) diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index 9eb5ded83..ccd399e6a 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -47,4 +47,37 @@ * Some of the graphic objects supported by NXWidgets include labels, * buttons, text boxes, button arrays, check boxes, cycle buttons, images, * sliders, scrollable list boxes, progress bars, and more. + * + * \subsection NXWM\ + * + * NxWM isthe tiny window manager based on NX and NxWidgets. NxWM is a true + * multiple window manager but only one window is displayed at a time. This + * simplification helps performance on LCD based products (in the same way + * that a tiled window manager helps) and also makes the best use of small + * displays. It is awkward from a human factors point-of-view trying to + * manage multiple windows on a small display. + * + * The window manager consists of a task bar with icons representing the + * running tasks. If you touch the task's icon, it comes to the top. Each + * window has a toolbar with (1) a title, (2) a minimize button, and (3) a + * stop application button using the standard icons for these things. User + * input via a touchscreen or mouse and keyboard is supported. + * + * There is always a start window that is available in the task bar. When + * you touch the start window icon, it brings up the start window containing + * icons representing all of the available applications. If you touch an + * icon in the start window, it will be started and added to the task bar. + * + * There is a base class that defines an add-on application and an interface + * that supports incorporation of new applications. The only application + * that is provided is NxConsole. This is an NSH session running in a window. + * You should be able to select the NX icon in the start menu and create as + * many NSH sessions in windows as you want. (keybard input still comes + * through serial). + * + * Note 1: NwWM requires NuttX-6.18 or above. + * + * Note 2: Many of the fundamental classes in NxWidgets derive from the Antony + * Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style + * license. See the COPYING file for details. */ diff --git a/nxwm/Makefile b/nxwm/Makefile index 01b8d4513..6b2e4ce77 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -44,20 +44,31 @@ CSRCS = # Window Manager -CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx cnxconsole.cxx -CXXSRCS += cstartwindow.cxx ctaskbar.cxx cwindowmessenger.cxx +CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx ctaskbar.cxx cwindowmessenger.cxx + +# Device support ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) -CXXSRCS += ccalibration.cxx ctouchscreen.cxx +CXXSRCS += ctouchscreen.cxx endif ifeq ($(CONFIG_NXWM_KEYBOARD),y) CXXSRCS += ckeyboard.cxx endif +# Applications + +CXXSRCS = cstartwindow.cxx cnxconsole.cxx chexcalculator.cxx + +ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) +CXXSRCS += ccalibration.cxx +endif + + # Images -CXXSRCS += glyph_calibration.cxx glyph_cmd.cxx glyph_minimize.cxx glyph_nsh.cxx -CXXSRCS += glyph_play.cxx glyph_start.cxx glyph_stop.cxx +CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx +CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx +CXXSRCS += glyph_stop.cxx SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/images/calculator.png b/nxwm/images/calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..fe3ad3e86d5a7d577c1168f242101936cfeeb56c GIT binary patch literal 263 zcmeAS@N?(olHy`uVBq!ia0vp^5k44ofy`glX(f`a29w(7Bet# z3xhBt!>lr0Z}ac?O}k^iHKwk9RU7$dlk@iSCx2Y`*Dy>!!K~Y-_uwDUkqn-$elF{r G5}E)ojb&;8 literal 0 HcmV?d00001 diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx new file mode 100644 index 000000000..d73e17faf --- /dev/null +++ b/nxwm/include/chexcalculator.hxx @@ -0,0 +1,276 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/chexcalculator.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CHEXCALCULATOR_HXX +#define __INCLUDE_CHEXCALCULATOR_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "cbuttonarray.hxx" +#include "clabel.hxx" + +#include "iapplication.hxx" +#include "capplicationwindow.hxx" +#include "ctaskbar.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +#define NXWM_HEXCALCULATOR_NROWS 6 +#define NXWM_HEXCALCULATOR_NCOLUMNS 6 + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This class implements the NxConsole application. + */ + + class CHexCalculator : public IApplication, + private IApplicationCallback, + private NXWidgets::CWidgetEventHandler + { + private: + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + NXWidgets::CButtonArray *m_keypad; /**< The calculator keyboard */ + NXWidgets::CLabel *m_text; /**< The accumulator text display */ + struct nxgl_size_s m_windowSize; /**< The size of the calculator window */ + struct nxgl_size_s m_keypadSize; /**< The size the calculator keypad */ + struct nxgl_size_s m_buttonSize; /**< The size of one calculator button */ + struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */ + struct nxgl_point_s m_keypadPos; /**< The position the calculator keypad */ + struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */ + uint64_t m_operand; /**< Previously entered operand */ + uint64_t m_accum; /**< The current accumulated value */ + uint64_t m_memory; /**< The current value in memory */ + uint8_t m_pending; /**< The pending operation */ + bool m_hexMode; /**< True if in hex mode */ + + /** + * Select the geometry of the calculator given the current window size. + * Only called as part of construction. + */ + + inline void setGeometry(void); + + /** + * Create the calculator keypad. Only start as part of the applicaiton + * start method. + */ + + inline bool createCalculator(void); + + /** + * Applies labels to the keys. + */ + + void labelKeypad(void); + + /** + * Show the current value of the accumulator. + */ + + void updateText(void); + + /** + * Called when the window minimize button is pressed. + */ + + void minimize(void); + + /** + * Called when the window minimize close is pressed. + */ + + void close(void); + + /** + * Handle a widget action event. For CImage, this is a button pre- + * release event. + * + * @param e The event data. + */ + + void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); + + public: + /** + * CHexCalculator constructor + * + * @param window. The application window + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + + CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window); + + /** + * CHexCalculator destructor + */ + + ~CHexCalculator(void); + + /** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + + IApplicationWindow *getWindow(void) const; + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + NXWidgets::CNxString getName(void); + + /** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + + bool run(void); + + /** + * Stop the application. + */ + + void stop(void); + + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + void destroy(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + void hide(void); + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + + void redraw(void); + + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; + }; + + class CHexCalculatorFactory : public IApplicationFactory + { + private: + CTaskbar *m_taskbar; /**< The taskbar */ + + public: + /** + * CHexCalculatorFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate calibration + */ + + CHexCalculatorFactory(CTaskbar *taskbar); + + /** + * CHexCalculatorFactory Destructor + */ + + inline ~CHexCalculatorFactory(void) { } + + /** + * Create a new instance of an CHexCalculator (as IApplication). + */ + + IApplication *create(void); + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + }; +} +#endif // __cplusplus + +#endif // __INCLUDE_CHEXCALCULATOR_HXX diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index c7a812abf..671b01087 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -172,7 +172,8 @@ namespace NxWM void removeAllApplications(void); /** - * Handle a widget action event. For CImage, this is a mouse button pre-release event. + * Handle a widget action event. For CButtonArray, this is a mouse + * button pre-release event. * * @param e The event data. */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 8a7700af4..ad51e7884 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -509,6 +509,24 @@ # define CONFIG_NXWM_CALIBRATION_LISTENERSTACK 2048 #endif +/* Hexcalculator applications ***********************************************/ +/** + * Calibration display settings: + * + * CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR - The background color of the + * calculator display. Default: Same as CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR + * CONFIG_NXWM_HEXCALCULATOR_ICON - The ICON to use for the hex calculator + * application. Default: NxWM::g_calculatorBitmap + */ + +#ifndef CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR +# define CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +#endif + +#ifndef CONFIG_NXWM_HEXCALCULATOR_ICON +# define CONFIG_NXWM_HEXCALCULATOR_ICON NxWM::g_calculatorBitmap +#endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 64f9a5262..7db02fd17 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -57,6 +57,7 @@ namespace NxWM { + extern const struct NXWidgets::SRlePaletteBitmap g_calculatorBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_calibrationBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 8ba8d0173..32aeb5ee6 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -536,7 +536,7 @@ void CCalibration::stateMachine(void) // Fill the entire window with the background color port->drawFilledRect(0, 0, windowSize.w, windowSize.h, - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); + CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR); // Then draw the first calibration screen diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx new file mode 100644 index 000000000..0217574e2 --- /dev/null +++ b/nxwm/src/chexcalculator.cxx @@ -0,0 +1,898 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/chexcalculator.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "chexcalculator.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * Private Types + ********************************************************************************************/ + +/******************************************************************************************** + * Private Data + ********************************************************************************************/ + +namespace NxWM +{ + /** + * This enumeration value describes a key + */ + + enum EKeyType + { + KEY_NONE = 0, // Used to represent no pending operation + + // Values: {0-9, A-F} + + KEY_VALUE, // Key is a value + + // Unary operators + + KEY_NOT, // 1's complement + KEY_NEGATE, // 2's complement + + // Binary operators + + KEY_XOR, // Exclusive OR + KEY_DIVIDE, // Division + KEY_RSH, // Right shift + KEY_LSH, // Left shift + KEY_MULTIPLY, // Multiplication + KEY_AND, // Bit-wise AND + KEY_OR, // Bit-wise OR + KEY_MINUS, // Subtraction + KEY_PLUS, // Additions + + // Special operations + + KEY_EQUAL, // Equal/Enter key + + KEY_DECIMAL, // Decimal mode + KEY_HEXADECIMAL, // Hexadecimal mode + + KEY_MRECALL, // Recall from memory + KEY_MPLUS, // Add to memory + KEY_MMINUS, // Subtract from memory + + KEY_MCLR, // Clear memory + KEY_CLRENTRY, // Clear entry + KEY_CLR // Clear all + }; + + /** + * This structure value describes a key + */ + + struct SKeyDesc + { + uint16_t hexMode : 1; // Key applies in hex mode + uint16_t decMode : 1; // Key applies in decimal mode + uint16_t keyType : 5; // Describes the key (see enum EKeyType) + uint16_t value : 4; // Value (if the key has an associated value) + }; + + /** + * This array provides the possible labels for each key + */ + + static FAR const char *g_labels[NXWM_HEXCALCULATOR_NCOLUMNS*NXWM_HEXCALCULATOR_NROWS] = + { + "MR", "M+", "M-", "MC", "CE", "C", + "A", "B", "C", "D", "E", "F", + "NOT", "XOR", "7", "8", "9", "/", + "RSH", "LSH", "4", "5", "6", "*", + "AND", "OR", "1", "2", "3", "-", + "DEC", "HEX", "+/-", "0", "=", "+" + }; + + /** + * This array manages the behavior when each key is pressed + */ + + static struct SKeyDesc g_keyDesc[NXWM_HEXCALCULATOR_NCOLUMNS*NXWM_HEXCALCULATOR_NROWS] = + { + {1, 1, KEY_MRECALL, 0}, + {1, 1, KEY_MPLUS, 0}, + {1, 1, KEY_MMINUS, 0}, + {1, 1, KEY_MCLR, 0}, + {1, 1, KEY_CLRENTRY, 0}, + {1, 1, KEY_CLR, 0}, + + {1, 0, KEY_VALUE, 10}, + {1, 0, KEY_VALUE, 11}, + {1, 0, KEY_VALUE, 12}, + {1, 0, KEY_VALUE, 13}, + {1, 0, KEY_VALUE, 14}, + {1, 0, KEY_VALUE, 15}, + + {1, 0, KEY_NOT, 0}, + {1, 0, KEY_XOR, 0}, + {1, 1, KEY_VALUE, 7}, + {1, 1, KEY_VALUE, 8}, + {1, 1, KEY_VALUE, 9}, + {1, 1, KEY_DIVIDE, 0}, + + {1, 0, KEY_RSH, 0}, + {1, 0, KEY_LSH, 0}, + {1, 1, KEY_VALUE, 4}, + {1, 1, KEY_VALUE, 5}, + {1, 1, KEY_VALUE, 6}, + {1, 1, KEY_MULTIPLY, 0}, + + {1, 0, KEY_AND, 0}, + {1, 0, KEY_OR, 0}, + {1, 1, KEY_VALUE, 1}, + {1, 1, KEY_VALUE, 2}, + {1, 1, KEY_VALUE, 3}, + {1, 1, KEY_MINUS, 0}, + + {1, 0, KEY_DECIMAL, 0}, + {0, 1, KEY_HEXADECIMAL, 0}, + {1, 1, KEY_NEGATE, 0}, + {1, 1, KEY_VALUE, 0}, + {1, 1, KEY_EQUAL, 0}, + {1, 1, KEY_PLUS, 0} + }; +} + +/******************************************************************************************** + * Private Functions + ********************************************************************************************/ + +/******************************************************************************************** + * CHexCalculator Method Implementations + ********************************************************************************************/ + +using namespace NxWM; + +/** + * CHexCalculator constructor + * + * @param window. The application window + */ + +CHexCalculator::CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window) +{ + // Save the constructor data + + m_taskbar = taskbar; + m_window = window; + + // Nullify widgets that will be instantiated when the window is started + + m_keypad = (NXWidgets::CButtonArray *)0; + m_text = (NXWidgets::CLabel *)0; + + // Reset other values + + m_operand = 0; // No previously entered operand + m_accum = 0; // The accumulator is initially zero + m_memory = 0; // No value in memory + m_pending = (uint8_t)KEY_NONE; // No pending operation */ + m_hexMode = 0; // Decimal mode + + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + + // Add our callbacks with the application window + + window->registerCallbacks(static_cast(this)); + + // Set the geometry of the calculator + + setGeometry(); +} + +/** + * CHexCalculator destructor + * + * @param window. The application window + */ + +CHexCalculator::~CHexCalculator(void) +{ + // Destroy widgets + + if (m_text) + { + delete m_text; + } + + if (m_keypad) + { + delete m_keypad; + } + + // Although we didn't create it, we are responsible for deleting the + // application window + + delete m_window; +} + +/** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + +IApplicationWindow *CHexCalculator::getWindow(void) const +{ + return static_cast(m_window); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CHexCalculator::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_HEXCALCULATOR_ICON); + + return bitmap; +} + +/** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + +NXWidgets::CNxString CHexCalculator::getName(void) +{ + return NXWidgets::CNxString("Hex Calculator"); +} + +/** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + +bool CHexCalculator::run(void) +{ + // Create the widgets (if we have not already done so) + + if (!m_keypad) + { + // Create the widgets + + if (!createCalculator()) + { + gdbg("ERROR: Failed to create widgets\n"); + return false; + } + + // Apply initial labels + + labelKeypad(); + } + + return true; +} + +/** + * Stop the application. + */ + +void CHexCalculator::stop(void) +{ + // Just disable further drawing + + m_keypad->disableDrawing(); + m_keypad->setRaisesEvents(false); + + m_text->disableDrawing(); +} + +/** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + +void CHexCalculator::destroy(void) +{ + // Make sure that the widgets are stopped + + stop(); + + // Block any further window messages + + m_window->block(this); +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + +void CHexCalculator::hide(void) +{ + // Disable drawing and events + + stop(); +} + +/** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + +void CHexCalculator::redraw(void) +{ + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, + CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR); + + // Enable and redraw widgets + + m_keypad->enableDrawing(); + m_keypad->redraw(); + m_keypad->setRaisesEvents(true); + + m_text->enableDrawing(); + m_text->redraw(); +} + +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CHexCalculator::isFullScreen(void) const +{ + return m_window->isFullScreen(); +} + +/** + * Select the geometry of the calculator given the current window size. + */ + +void CHexCalculator::setGeometry(void) +{ + // Recover the NXTK window instance contained in the application window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the window + + (void)window->getSize(&m_windowSize); + + // Pick a height and width of a button to fill the entire window. + // For the height, we will assume that the text window is 1.5 times + // as high as a button + + m_buttonSize.w = m_windowSize.w / NXWM_HEXCALCULATOR_NCOLUMNS; + m_buttonSize.h = (m_windowSize.h << 1) / (2 * NXWM_HEXCALCULATOR_NROWS + 3); + + // Limit aspect ratio. (1) Button should no be taller than it is wide, + // (2) Button should be no more than twice as wide as it is tall. + + if (m_buttonSize.h > m_buttonSize.w) + { + m_buttonSize.h = m_buttonSize.w; + } + else if (m_buttonSize.w > (m_buttonSize.h << 1)) + { + m_buttonSize.w = (m_buttonSize.h << 1); + } + + // Get the size of the entry calculator m_keypad + + m_keypadSize.w = NXWM_HEXCALCULATOR_NCOLUMNS * m_buttonSize.w; + m_keypadSize.h = NXWM_HEXCALCULATOR_NROWS * m_buttonSize.h; + + // Get the size of the text box. Same width as the m_keypad + + m_textSize.w = m_keypadSize.w; + m_textSize.h = m_windowSize.h - NXWM_HEXCALCULATOR_NROWS * m_buttonSize.h; + + // Limit the height of the text box to twice the height of a button. + + if (m_textSize.h > (m_buttonSize.h << 1)) + { + m_textSize.h = (m_buttonSize.h << 1); + } + + // Pick an X/Y position such that the m_keypad+textbox will be centered + // in the display + + struct nxgl_point_s calculatorPos; + calculatorPos.x = (m_windowSize.w - m_keypadSize.w) >> 1; + calculatorPos.y = (m_windowSize.h - m_textSize.h - m_keypadSize.h) >> 1; + + // Now pick the set of the text box and the m_keypad + + m_textPos.x = calculatorPos.x; + m_textPos.y = calculatorPos.y; + + m_keypadPos.x = calculatorPos.x; + m_keypadPos.y = calculatorPos.y + m_textSize.h; +} + +/** + * Create the calculator widgets. Only start as part of the applicaiton + * start method. + */ + +bool CHexCalculator::createCalculator(void) +{ + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Create the button array + + m_keypad = new NXWidgets::CButtonArray(control, + m_keypadPos.x, m_keypadPos.y, + NXWM_HEXCALCULATOR_NCOLUMNS, + NXWM_HEXCALCULATOR_NROWS, + m_buttonSize.w, m_buttonSize.h); + if (!m_keypad) + { + gdbg("ERROR: Failed to create CButtonArray\n"); + return false; + } + + // Disable drawing and events until we are asked to redraw the window + + m_keypad->disableDrawing(); + m_keypad->setRaisesEvents(false); + + // Register to receive events from the keypad + + m_keypad->addWidgetEventHandler(this); + + // Create a label to show the accumulator. A simple label is used + // because the power of a text box is un-necessary in this application. + + m_text = new NXWidgets::CLabel(control, + m_textPos.x, m_textPos.y, + m_textSize.w, m_textSize.h, + "0"); + if (!m_text) + { + gdbg("ERROR: Failed to create CLabel\n"); + return false; + } + + // Align text on the left + + m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_RIGHT); + + // Disable drawing and events until we are asked to redraw the window + + m_text->disableDrawing(); + m_text->setRaisesEvents(false); + return true; +} + +/** + * Applies labels to the keys. + */ + +void CHexCalculator::labelKeypad(void) +{ + // Make sure that drawing is disabled from this operation + + bool isEnabled = m_keypad->isDrawingEnabled(); + m_keypad->disableDrawing(); + + // Add the labels to each button. + + for (int j = 0; j < NXWM_HEXCALCULATOR_NROWS; j++) + { + for (int i = 0; i < NXWM_HEXCALCULATOR_NCOLUMNS; i++) + { + int index = j * NXWM_HEXCALCULATOR_NCOLUMNS + i; + + // What mode are we in? Does the button label appear in this mode? + + FAR const char *label; + if ((m_hexMode && g_keyDesc[index].hexMode) || + (!m_hexMode && g_keyDesc[index].decMode)) + { + label = g_labels[index]; + } + else + { + label = ""; + } + + // Set the text in the label + + m_keypad->setText(i, j, label); + } + } + + // Then redraw the display + + if (isEnabled) + { + m_keypad->enableDrawing(); + m_keypad->redraw(); + } +} + +/** + * Show the current value of the accumulator. + */ + +void CHexCalculator::updateText(void) +{ + char buffer[24]; + + if (m_hexMode) + { + snprintf(buffer, 24, "%16lx", m_accum); + } + else + { + snprintf(buffer, 24, "%ld", m_accum); + } + + // setText will perform the redraw as well + + m_text->setText(buffer); +} + +/** + * Called when the window minimize button is pressed. + */ + +void CHexCalculator::minimize(void) +{ + m_taskbar->minimizeApplication(static_cast(this)); +} + +/** + * Called when the window close button is pressed. + */ + +void CHexCalculator::close(void) +{ + m_taskbar->stopApplication(static_cast(this)); +} + +/** + * Handle a widget action event. For CButtonArray, this is a button pre- + * release event. + * + * @param e The event data. + */ + +void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) +{ + // A button should now be clicked + + int column; + int row; + + if (m_keypad->isButtonClicked(column, row)) + { + // Handle the key according to its type + + int index = row * NXWM_HEXCALCULATOR_NCOLUMNS + column; + + // First, make sure that the keypress is valid in this mode + + if ((m_hexMode && !g_keyDesc[index].hexMode) || + (!m_hexMode && !g_keyDesc[index].decMode)) + { + // Ignore the key in this mode + + return; + } + + // Process the keypress + + switch (g_keyDesc[index].keyType) + { + // Values: {0-9, A-F} + + case KEY_VALUE: // Key is a value + { + m_accum <<= 4; + m_accum |= (uint64_t)g_keyDesc[index].value; + updateText(); + } + break; + + // Unary operators + + case KEY_NOT: // 1's complement + { + m_accum = ~m_accum; + updateText(); + } + break; + + case KEY_NEGATE: // 2's complement + { + m_accum = -m_accum; + updateText(); + } + break; + + // Binary operators + + case KEY_XOR: // Exclusive OR + case KEY_DIVIDE: // Division + case KEY_RSH: // Right shift + case KEY_LSH: // Left shift + case KEY_MULTIPLY: // Multiplication + case KEY_AND: // Bit-wise AND + case KEY_OR: // Bit-wise OR + case KEY_MINUS: // Subtraction + case KEY_PLUS: // Additions + { + m_operand = m_accum; + m_accum = 0; + m_pending = g_keyDesc[index].keyType; + updateText(); + } + break; + + // Special operations + + case KEY_EQUAL: // Equal/Enter key + { + switch (m_pending) + { + case KEY_NONE: // Do nothing if there is no pending operation + return; + + case KEY_XOR: // Exclusive OR + m_accum ^= m_operand; + break; + + case KEY_DIVIDE: // Division + m_accum = m_operand / m_accum; + break; + + case KEY_RSH: // Right shift + m_accum = m_operand >> m_accum; + break; + + case KEY_LSH: // Left shift + m_accum = m_operand << m_accum; + break; + + case KEY_MULTIPLY: // Multiplication + m_accum *= m_operand; + break; + + case KEY_AND: // Bit-wise AND + m_accum &= m_operand; + break; + + case KEY_OR: // Bit-wise OR + m_accum |= m_operand; + break; + + case KEY_MINUS: // Subtraction + m_accum = m_operand - m_accum; + break; + + case KEY_PLUS: // Additions + m_accum += m_operand; + break; + + default: + gdbg("ERROR: Unexpected pending operation %d\n", m_pending); + m_pending = KEY_NONE; + return; + } + + m_operand = 0; + m_pending = KEY_NONE; + updateText(); + } + break; + + case KEY_DECIMAL: // Decimal mode + { + if (m_hexMode) + { + m_hexMode = false; + labelKeypad(); + m_keypad->redraw(); + } + } + break; + + case KEY_HEXADECIMAL: // Hexadecimal mode + { + if (!m_hexMode) + { + m_hexMode = true; + labelKeypad(); + m_keypad->redraw(); + } + } + break; + + case KEY_MRECALL: // Recall from memory + { + m_accum = m_memory; + updateText(); + } + break; + + case KEY_MPLUS: // Add to memory + { + m_memory += m_accum; + } + break; + + case KEY_MMINUS: // Subtract from memory + { + m_memory -= m_accum; + } + break; + + case KEY_MCLR: // Clear memory + { + m_memory = 0; + } + break; + + case KEY_CLRENTRY: // Clear entry + { + m_accum = 0; + updateText(); + } + break; + + case KEY_CLR: // Clear all + { + m_accum = 0; + m_operand = 0; + m_pending = KEY_NONE; + updateText(); + } + break; + + case KEY_NONE: + default: + gdbg("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); + break; + } + } +} + +/** + * CHexCalculatorFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate the console + */ + +CHexCalculatorFactory::CHexCalculatorFactory(CTaskbar *taskbar) +{ + m_taskbar = taskbar; +} + +/** + * Create a new instance of an CHexCalculator (as IApplication). + */ + +IApplication *CHexCalculatorFactory::create(void) +{ + // Call CTaskBar::openFullScreenWindow to create a application window for + // the NxConsole application + + CApplicationWindow *window = m_taskbar->openApplicationWindow(); + if (!window) + { + gdbg("ERROR: Failed to create CApplicationWindow\n"); + return (IApplication *)0; + } + + // Open the window (it is hot in here) + + if (!window->open()) + { + gdbg("ERROR: Failed to open CApplicationWindow\n"); + delete window; + return (IApplication *)0; + } + + // Instantiate the application, providing the window to the application's + // constructor + + CHexCalculator *hexCalculator = new CHexCalculator(m_taskbar, window); + if (!hexCalculator) + { + gdbg("ERROR: Failed to instantiate CHexCalculator\n"); + delete window; + return (IApplication *)0; + } + + return static_cast(hexCalculator); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CHexCalculatorFactory::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_HEXCALCULATOR_ICON); + + return bitmap; +} diff --git a/nxwm/src/glyph_calculator.cxx b/nxwm/src/glyph_calculator.cxx new file mode 100644 index 000000000..3d8bb97bd --- /dev/null +++ b/nxwm/src/glyph_calculator.cxx @@ -0,0 +1,191 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_calculator.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 25 +#define BITMAP_NCOLUMNS 24 +#define BITMAP_NLUTCODES 8 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xfcfcfc, 0xb8bcbc, 0xf8f8f8, 0x6890c8, 0x384c80, 0xe8e8e8, 0x646464, 0x909090 /* Codes 0-7 */ +}; + +static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffffff, 0xc9cccc, 0xf9f9f9, 0x8dabd5, 0x69789f, 0xededed, 0x8a8a8a, 0xababab /* Codes 0-7 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0xbdf7, 0xffdf, 0x6c99, 0x3a70, 0xef5d, 0x632c, 0x9492 /* Codes 0-7 */ +}; + +static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0xce79, 0xffdf, 0x8d5a, 0x6bd3, 0xef7d, 0x8c51, 0xad55 /* Codes 0-7 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xfc, 0xba, 0xf8, 0x8a, 0x4b, 0xe8, 0x64, 0x90 /* Codes 0-7 */ +}; + +static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xcb, 0xf9, 0xa6, 0x77, 0xed, 0x8a, 0xab /* Codes 0-7 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xb7, 0xff, 0x73, 0x2a, 0xff, 0x6d, 0x92 /* Codes 0-7 */ +}; + +static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xdb, 0xff, 0x97, 0x6e, 0xff, 0x92, 0xb6 /* Codes 0-7 */ +}; + +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_calculatorRleEntries[] = +{ + { 23, 0}, { 1, 1}, /* Row 0 */ + { 1, 0}, { 21, 1}, { 1, 2}, { 1, 1}, /* Row 1 */ + { 1, 0}, { 1, 1}, { 19, 3}, { 1, 4}, { 1, 0}, { 1, 1}, /* Row 2 */ + { 1, 0}, { 1, 1}, { 19, 3}, { 1, 4}, { 1, 0}, { 1, 1}, /* Row 3 */ + { 1, 0}, { 1, 1}, { 19, 3}, { 1, 4}, { 1, 0}, { 1, 1}, /* Row 4 */ + { 1, 0}, { 1, 1}, { 19, 3}, { 1, 4}, { 1, 0}, { 1, 1}, /* Row 5 */ + { 1, 0}, { 1, 1}, { 19, 3}, { 1, 4}, { 1, 0}, { 1, 1}, /* Row 6 */ + { 1, 2}, { 1, 1}, { 20, 4}, { 1, 0}, { 1, 1}, /* Row 7 */ + { 1, 2}, { 1, 1}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, /* Row 8 */ + { 4, 5}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 9 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 10 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 11 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 20, 6}, { 1, 0}, { 1, 1}, /* Row 12 */ + { 1, 0}, { 1, 1}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, /* Row 13 */ + { 4, 5}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 14 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 15 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 16 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 0}, { 1, 1}, { 20, 6}, { 1, 0}, { 1, 1}, /* Row 17 */ + { 1, 2}, { 1, 1}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, { 4, 5}, { 1, 6}, /* Row 18 */ + { 4, 5}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 2}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 19 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 2}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 20 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 2}, { 1, 1}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, /* Row 21 */ + { 1, 5}, { 3, 7}, { 1, 6}, { 1, 5}, { 3, 7}, { 1, 6}, { 1, 0}, { 1, 1}, + { 1, 2}, { 1, 1}, { 20, 6}, { 1, 0}, { 1, 1}, /* Row 22 */ + { 23, 0}, { 1, 1}, /* Row 23 */ + { 24, 1} /* Row 24 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Defintions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calculatorNormalLut, // Index 0: Unselected LUT + g_calculatorBrightlLut, // Index 1: Selected LUT + }, + g_calculatorRleEntries // data - Pointer to the beginning of the RLE data +}; From 8a19aea00bff0606d25abfc2915f28c4c2dd050e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 22 May 2012 21:01:42 +0000 Subject: [PATCH 073/390] CHexCalculator fixes + back out change to CNxtkWindow git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4761 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ libnxwidgets/src/cnxtkwindow.cxx | 10 ++-------- nxwm/include/chexcalculator.hxx | 6 +++--- nxwm/src/chexcalculator.cxx | 22 +++++++++++++++------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ecee1021c..349dbac57 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -142,3 +142,5 @@ minimized. * NxWM::CHexCalculator: Add a hexadecimal/decimal calculator example. +* NXWidgets::CNxTkWindow: Back out height adjustment in the getSize() + method. The code was correct as it was before. diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index b1d7be9e2..05241817c 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -298,15 +298,9 @@ bool CNxTkWindow::getPosition(FAR struct nxgl_point_s *pos) bool CNxTkWindow::getSize(FAR struct nxgl_size_s *size) { // Get the size of the NXTK window (this will exclude the thickness of - // the frame). + // the frame and the height of the toolbar, if any). - bool ret = m_widgetControl->getWindowSize(size); - - // Subtract the height of the toolbar (if any) to get the size of the - // drawable region in the window. - - size->h -= m_toolbarHeight; - return ret; + return m_widgetControl->getWindowSize(size); } /** diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx index d73e17faf..3ac50f71c 100644 --- a/nxwm/include/chexcalculator.hxx +++ b/nxwm/include/chexcalculator.hxx @@ -87,9 +87,9 @@ namespace NxWM struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */ struct nxgl_point_s m_keypadPos; /**< The position the calculator keypad */ struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */ - uint64_t m_operand; /**< Previously entered operand */ - uint64_t m_accum; /**< The current accumulated value */ - uint64_t m_memory; /**< The current value in memory */ + int64_t m_operand; /**< Previously entered operand */ + int64_t m_accum; /**< The current accumulated value */ + int64_t m_memory; /**< The current value in memory */ uint8_t m_pending; /**< The pending operation */ bool m_hexMode; /**< True if in hex mode */ diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index 0217574e2..48409f4d9 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -455,7 +455,7 @@ void CHexCalculator::setGeometry(void) // Get the size of the text box. Same width as the m_keypad m_textSize.w = m_keypadSize.w; - m_textSize.h = m_windowSize.h - NXWM_HEXCALCULATOR_NROWS * m_buttonSize.h; + m_textSize.h = m_windowSize.h - m_keypadSize.h; // Limit the height of the text box to twice the height of a button. @@ -594,11 +594,11 @@ void CHexCalculator::updateText(void) if (m_hexMode) { - snprintf(buffer, 24, "%16lx", m_accum); + std::snprintf(buffer, 24, "%16llx", m_accum); } else { - snprintf(buffer, 24, "%ld", m_accum); + std::snprintf(buffer, 24, "%lld", m_accum); } // setText will perform the redraw as well @@ -662,8 +662,16 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) case KEY_VALUE: // Key is a value { - m_accum <<= 4; - m_accum |= (uint64_t)g_keyDesc[index].value; + if (m_hexMode) + { + m_accum <<= 4; + m_accum |= (uint64_t)g_keyDesc[index].value; + } + else + { + m_accum *= 10; + m_accum += (uint64_t)g_keyDesc[index].value; + } updateText(); } break; @@ -766,7 +774,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { m_hexMode = false; labelKeypad(); - m_keypad->redraw(); + updateText(); } } break; @@ -777,7 +785,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { m_hexMode = true; labelKeypad(); - m_keypad->redraw(); + updateText(); } } break; From 0c093cee78108601e06350da6c46afefe5c4d31b Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 22 May 2012 22:10:57 +0000 Subject: [PATCH 074/390] Add some minimal support for precedence of operations git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4762 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/include/chexcalculator.hxx | 59 +++++++++- nxwm/src/chexcalculator.cxx | 185 +++++++++++++++++++++----------- 2 files changed, 178 insertions(+), 66 deletions(-) diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx index 3ac50f71c..9f9b61a9b 100644 --- a/nxwm/include/chexcalculator.hxx +++ b/nxwm/include/chexcalculator.hxx @@ -77,23 +77,63 @@ namespace NxWM private NXWidgets::CWidgetEventHandler { private: + /** + * The structure defines a pending operation. + */ + + struct SPendingOperation + { + int64_t value; /**< Accumulated value */ + uint8_t operation; /**< Identifies the operations */ + }; + + /** + * Calculator state data. + */ + + /** + * Cached constructor parameters. + */ + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ CApplicationWindow *m_window; /**< Reference to the application window */ + + /** + * Widgets + */ + NXWidgets::CButtonArray *m_keypad; /**< The calculator keyboard */ NXWidgets::CLabel *m_text; /**< The accumulator text display */ + + /** + * Calculator geometry. This stuff does not really have to be retained + * in memory. If you are pinched for memory, get rid of these. + */ + struct nxgl_size_s m_windowSize; /**< The size of the calculator window */ struct nxgl_size_s m_keypadSize; /**< The size the calculator keypad */ struct nxgl_size_s m_buttonSize; /**< The size of one calculator button */ struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */ struct nxgl_point_s m_keypadPos; /**< The position the calculator keypad */ struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */ - int64_t m_operand; /**< Previously entered operand */ + + /** + * Calculator computational data. Note: Since we do not support + * parentheses and support only two levels of operator precedence, it is + * not necessary to maintain a stack of operations. Within there + * limitations, there can be at most only one pending low prececence + * operation and one pending high precedence operation. If you want + * to support parentheses or more levels of precedence, they you will + * have to extend the design. + */ + int64_t m_accum; /**< The current accumulated value */ - int64_t m_memory; /**< The current value in memory */ - uint8_t m_pending; /**< The pending operation */ + int64_t m_memory; /**< The current value saved in memory */ + struct SPendingOperation m_low; /**< Low precedence pending operation */ + struct SPendingOperation m_high; /**< Hight precedence pending operation */ bool m_hexMode; /**< True if in hex mode */ - /** + /** * Select the geometry of the calculator given the current window size. * Only called as part of construction. */ @@ -113,6 +153,17 @@ namespace NxWM void labelKeypad(void); + /** + * Evaluate a binary operation. + * + * @param value1. The first value + * @param value2. The second value + * + * @return The result of the operation + */ + + int64_t evaluateBinaryOperation(uint8_t operation, int64_t value1, int64_t value2); + /** * Show the current value of the accumulator. */ diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index 48409f4d9..d865817b9 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -213,11 +213,13 @@ CHexCalculator::CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window) // Reset other values - m_operand = 0; // No previously entered operand - m_accum = 0; // The accumulator is initially zero - m_memory = 0; // No value in memory - m_pending = (uint8_t)KEY_NONE; // No pending operation */ - m_hexMode = 0; // Decimal mode + m_accum = 0; // The accumulator is initially zero + m_memory = 0; // No value in memory + m_high.operation = (uint8_t)KEY_NONE; // No pending high precedence operation + m_high.value = 0; + m_low.operation = (uint8_t)KEY_NONE; // No pending high precedence operation + m_low.value = 0; + m_hexMode = 0; // Decimal mode // Add our personalized window label @@ -584,6 +586,55 @@ void CHexCalculator::labelKeypad(void) } } +/** + * Evaluate a binary operation. The result is left in m_accum. + * + * @param value1. The first value + * @param value2. The second value + * + * @return The result of the operation + */ + +int64_t CHexCalculator::evaluateBinaryOperation(uint8_t operation, int64_t value1, int64_t value2) +{ + switch (operation) + { + case KEY_NONE: // Do nothing if there is no pending operation + return 0; + + case KEY_XOR: // Exclusive OR + return value1 ^ value2; + + case KEY_DIVIDE: // Division + return value1 / value2; + + case KEY_RSH: // Right shift + return value1 >> value2; + + case KEY_LSH: // Left shift + return value1 << value2; + + case KEY_MULTIPLY: // Multiplication + return value1 * value2; + + case KEY_AND: // Bit-wise AND + return value1 & value2; + + case KEY_OR: // Bit-wise OR + return value1 | value2; + + case KEY_MINUS: // Subtraction + return value1 - value2; + + case KEY_PLUS: // Additions + return value1 + value2; + + default: + gdbg("ERROR: Unexpected pending operation %d\n", m_pending); + return 0; + } +} + /** * Show the current value of the accumulator. */ @@ -692,21 +743,60 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } break; - // Binary operators + // Low precedence Binary operators case KEY_XOR: // Exclusive OR + case KEY_OR: // Bit-wise OR + case KEY_MINUS: // Subtraction + case KEY_PLUS: // Additions + { + // Is there a high precedence operation? + + if (m_high.operation != (uint8_t)KEY_NONE) + { + m_accum = evaluateBinaryOperation(m_high.operation, m_high.value, m_accum); + m_high.operation = (uint8_t)KEY_NONE; + m_high.value = 0; + } + + // Is there a pending low precedence operation? + + if (m_low.operation != (uint8_t)KEY_NONE) + { + m_accum = evaluateBinaryOperation(m_low.operation, m_low.value, m_accum); + } + + // Save the new low precedence operation + + m_low.operation = (uint8_t) g_keyDesc[index].keyType; + m_low.value = m_accum; + m_accum = 0; + + updateText(); + } + break; + + // High precedence Binary operators + case KEY_DIVIDE: // Division case KEY_RSH: // Right shift case KEY_LSH: // Left shift case KEY_MULTIPLY: // Multiplication case KEY_AND: // Bit-wise AND - case KEY_OR: // Bit-wise OR - case KEY_MINUS: // Subtraction - case KEY_PLUS: // Additions { - m_operand = m_accum; - m_accum = 0; - m_pending = g_keyDesc[index].keyType; + // Is there a high precedence operation? + + if (m_high.operation != (uint8_t)KEY_NONE) + { + m_accum = evaluateBinaryOperation(m_high.operation, m_high.value, m_accum); + } + + // Save the new high precedence operation + + m_high.operation = (uint8_t) g_keyDesc[index].keyType; + m_high.value = m_accum; + m_accum = 0; + updateText(); } break; @@ -715,55 +805,24 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) case KEY_EQUAL: // Equal/Enter key { - switch (m_pending) + // Is there a high precedence operation? + + if (m_high.operation != (uint8_t)KEY_NONE) { - case KEY_NONE: // Do nothing if there is no pending operation - return; - - case KEY_XOR: // Exclusive OR - m_accum ^= m_operand; - break; - - case KEY_DIVIDE: // Division - m_accum = m_operand / m_accum; - break; - - case KEY_RSH: // Right shift - m_accum = m_operand >> m_accum; - break; - - case KEY_LSH: // Left shift - m_accum = m_operand << m_accum; - break; - - case KEY_MULTIPLY: // Multiplication - m_accum *= m_operand; - break; - - case KEY_AND: // Bit-wise AND - m_accum &= m_operand; - break; - - case KEY_OR: // Bit-wise OR - m_accum |= m_operand; - break; - - case KEY_MINUS: // Subtraction - m_accum = m_operand - m_accum; - break; - - case KEY_PLUS: // Additions - m_accum += m_operand; - break; - - default: - gdbg("ERROR: Unexpected pending operation %d\n", m_pending); - m_pending = KEY_NONE; - return; + m_accum = evaluateBinaryOperation(m_high.operation, m_high.value, m_accum); + m_high.operation = (uint8_t)KEY_NONE; + m_high.value = 0; } - - m_operand = 0; - m_pending = KEY_NONE; + + // Is there a pending low precedence operation? + + if (m_low.operation != (uint8_t)KEY_NONE) + { + m_accum = evaluateBinaryOperation(m_low.operation, m_low.value, m_accum); + m_low.operation = (uint8_t)KEY_NONE; + m_low.value = 0; + } + updateText(); } break; @@ -824,9 +883,11 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) case KEY_CLR: // Clear all { - m_accum = 0; - m_operand = 0; - m_pending = KEY_NONE; + m_accum = 0; + m_high.operation = (uint8_t)KEY_NONE; + m_high.value = 0; + m_low.operation = (uint8_t)KEY_NONE; + m_low.value = 0; updateText(); } break; From 357e4b55dd55c0a255ea532152bf9e0a0d928674 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 22 May 2012 23:49:15 +0000 Subject: [PATCH 075/390] Hack for font background when we cannot read from the LCD; Candidate fix for ILI9325 LCD git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4763 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 8 +++++++ TODO.txt | 15 +++++++++++++ libnxwidgets/include/cgraphicsport.hxx | 30 ++++++++++++++++++++++++++ libnxwidgets/src/cbuttonarray.cxx | 18 +++++++++++++++- 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 349dbac57..f688f846c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -144,3 +144,11 @@ example. * NXWidgets::CNxTkWindow: Back out height adjustment in the getSize() method. The code was correct as it was before. +* NXWidgets::CButtonArray and NXWidgets::CGraphicsPort: There is + a kludge in there to handle the case where we cannot read the + background data because the LCD does not support read operations. + In that case, we just use the default background color. However, + that doesn't work either for the case where the background color + changes when the widget is selected. Thenthe background color + in the font is wrong. Fixed in CButtonArrary, but the problem + probably exists in other places as well. diff --git a/TODO.txt b/TODO.txt index edd203210..ebf136798 100644 --- a/TODO.txt +++ b/TODO.txt @@ -127,3 +127,18 @@ o Platform specific issues The fixed version is available in SVN but won't be in a released version until NuttX-6.198 is released. Priorioty: Low, but really annoying. + + Title: BUGS WHEN CANNOT READ FROM LCD + Description: There is a kludge in there to handle the case where we cannot + read the background data because the LCD does not support read + operations. You cannot read from the STM3240G-EVAL LCD right + now (it might be possible, but I have not figured out how yet). + + In that case, we just use the default background color. However, + that doesn't work either for the case where the background color + changes when the widget is selected. Then the background color + in the font is wrong. There is a hack in in CButtonArrary that + fixed this problem, but the problem certainly exists in other + places as well and begs for a better solution. + Status: Open + Priority: Medium-Low diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index 8eea3d689..b9fbc4d41 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -151,6 +151,36 @@ namespace NXWidgets const nxgl_coord_t getY(void) const; + /** + * Get the background color that will be used to fill in the spaces + * when rendering fonts. This background color is ONLY used if the + * LCD device does not support reading GRAM contents. + * + * @return. The current background color being used. + */ + +#ifdef CONFIG_NX_WRITEONLY + nxgl_mxpixel_t getBackColor(void) const + { + return m_backColor; + } +#endif + + /** + * Set the background color that will be used to fill in the spaces + * when rendering fonts. This background color is ONLY used if the + * LCD device does not support reading GRAM contents. + * + * @return. The current background color being used. + */ + +#ifdef CONFIG_NX_WRITEONLY + void setBackColor(nxgl_mxpixel_t backColor) + { + m_backColor = backColor; + } +#endif + /** * Draw a pixel into the window. * diff --git a/libnxwidgets/src/cbuttonarray.cxx b/libnxwidgets/src/cbuttonarray.cxx index 642a0a562..28f14062b 100644 --- a/libnxwidgets/src/cbuttonarray.cxx +++ b/libnxwidgets/src/cbuttonarray.cxx @@ -519,9 +519,25 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use pos.x = x + alignX; pos.y = y + alignY; - // And draw the button text + // Set the CGraphicsControl background to match the selected background color. + // This is only necessary if we cannot read from the LCD. If we cannot read + // from then the font background is set to this background color. + // REVISIT: This begs for a more generalized solution. + +#ifdef CONFIG_NX_WRITEONLY + nxgl_mxpixel_t saveColor = port->getBackColor(); + port->setBackColor(backColor); +#endif + + // And draw the button text. port->drawText(&pos, &rect, getFont(), *text, 0, text->getLength(), textColor); + + // Restore the default background color + +#ifdef CONFIG_NX_WRITEONLY + port->setBackColor(saveColor); +#endif } /** From faa17026c3fb955c67011ef3d71a68555526a399 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 23 May 2012 01:19:18 +0000 Subject: [PATCH 076/390] Update STM3240G-EVAL defconfig to support NxConsole keyboard input; increase spacing of icons on the start window git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4765 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 1 + TODO.txt | 22 ++++++++++++++++++---- nxwm/include/nxwmconfig.hxx | 8 ++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f688f846c..83d0e8912 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -152,3 +152,4 @@ changes when the widget is selected. Thenthe background color in the font is wrong. Fixed in CButtonArrary, but the problem probably exists in other places as well. +* NxWM: Increase default spacing of icons on the Start Window. diff --git a/TODO.txt b/TODO.txt index ebf136798..b767f3536 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,9 +4,10 @@ NxWidgets NxWM ---- - (4) General issues - (3) NxConsole issues - (1) Platform specific issues + (4) General Issues + (3) NxConsole Issues + (1) CHexCalculator Issues + (1) Platform specific Issues See also the NuttX TODO list graphics/ section for related issues. @@ -109,7 +110,20 @@ o NxConsole Issues Status: Open Priorioty: Low, this would be necessary to fix to productize the windows. -o Platform specific issues +o CHexCalculator Issues + --------------------- + + Title: NEW DATA ENTRY IS APPENDED TO PREVIOUS RESULT + Description: For example 1+2= and 3 is shown. But if you enter 4, then + 34 is shown. You have to manually clear the calculator ("C") + before entering the next number. + Status: Open + Priority: Low, this is only a demo. This would, of course, have to be + fixed if you wanted a production quality calculator (but then + you would probably also want to add quite a few more features + as well). + +o Platform specific Issues ------------------------ Title: MISSING TOUCH RELEASE diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index ad51e7884..46cfa7410 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -261,8 +261,8 @@ /** * 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 + * CONFIG_NXWM_STARTWINDOW_VSPACING - Vertical spacing. Default: 4 pixels + * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 4 rows * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue * Used to communicated from CWindowMessenger to the start window thread. @@ -280,11 +280,11 @@ */ #ifndef CONFIG_NXWM_STARTWINDOW_VSPACING -# define CONFIG_NXWM_STARTWINDOW_VSPACING (2) +# define CONFIG_NXWM_STARTWINDOW_VSPACING (4) #endif #ifndef CONFIG_NXWM_STARTWINDOW_HSPACING -# define CONFIG_NXWM_STARTWINDOW_HSPACING (2) +# define CONFIG_NXWM_STARTWINDOW_HSPACING (4) #endif /** From f6f6b80f164c8e498d3ac8c31a036ca0d8763676 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 23 May 2012 01:42:20 +0000 Subject: [PATCH 077/390] Fix 'make export' target for NxWM git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4766 42af7a65-404d-4744-a932-0658087f49c3 --- nxwm/COPYING | 41 +++++++++++++++++++++++++++++++++++++++++ nxwm/Makefile | 4 +--- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 nxwm/COPYING diff --git a/nxwm/COPYING b/nxwm/COPYING new file mode 100644 index 000000000..4273aec03 --- /dev/null +++ b/nxwm/COPYING @@ -0,0 +1,41 @@ +COPYING -- Describes the terms under which NxWM is distributed. A +copy of the BSD-style licensing is included in this file. In my +words -- I believe that you should free to use NxWM in any +environment, private, private, commercial, open, closed, etc. +provided only that you repect the modest copyright notices as +described in license (below). Please feel free to contact me if you +have any licensing concerns. + +/************************************************************************* + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, NxWM 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. + * + *************************************************************************/ diff --git a/nxwm/Makefile b/nxwm/Makefile index 6b2e4ce77..4d4ecb4d2 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -42,7 +42,6 @@ NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets ASRCS = CSRCS = - # Window Manager CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx ctaskbar.cxx cwindowmessenger.cxx @@ -64,7 +63,6 @@ ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) CXXSRCS += ccalibration.cxx endif - # Images CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx @@ -140,6 +138,6 @@ distclean: clean @rm -f Make.dep .depend export: $(BIN) - zip -r nxwidgets-export.zip include $(BIN) COPYING + zip -r nxwm-export.zip include $(BIN) COPYING -include Make.dep From 70c2bc8810d7fb3e2efe7d112bdc4df94511327a Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 23 May 2012 12:53:57 +0000 Subject: [PATCH 078/390] Various improvements to NxWM hex calculator display git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4767 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ nxwm/include/chexcalculator.hxx | 3 ++ nxwm/include/nxwmconfig.hxx | 6 ++++ nxwm/src/chexcalculator.cxx | 63 ++++++++++++++++++++++++++++++--- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 83d0e8912..ad617f4b7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -153,3 +153,5 @@ in the font is wrong. Fixed in CButtonArrary, but the problem probably exists in other places as well. * NxWM: Increase default spacing of icons on the Start Window. +* NxWM::CHexCalculator: Fix some non-standard calculator behavior + after = is pressed. Use upper case hex. Increase font size. diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx index 9f9b61a9b..69ee37624 100644 --- a/nxwm/include/chexcalculator.hxx +++ b/nxwm/include/chexcalculator.hxx @@ -48,6 +48,7 @@ #include "cbuttonarray.hxx" #include "clabel.hxx" +#include "cnxfont.hxx" #include "iapplication.hxx" #include "capplicationwindow.hxx" @@ -104,6 +105,7 @@ namespace NxWM NXWidgets::CButtonArray *m_keypad; /**< The calculator keyboard */ NXWidgets::CLabel *m_text; /**< The accumulator text display */ + NXWidgets::CNxFont *m_font; /**< The font used in the calculator */ /** * Calculator geometry. This stuff does not really have to be retained @@ -132,6 +134,7 @@ namespace NxWM struct SPendingOperation m_low; /**< Low precedence pending operation */ struct SPendingOperation m_high; /**< Hight precedence pending operation */ bool m_hexMode; /**< True if in hex mode */ + bool m_result ; /**< True if the accumulator holds a previoius result */ /** * Select the geometry of the calculator given the current window size. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 46cfa7410..578fc5be8 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -517,6 +517,8 @@ * calculator display. Default: Same as CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR * CONFIG_NXWM_HEXCALCULATOR_ICON - The ICON to use for the hex calculator * application. Default: NxWM::g_calculatorBitmap + * CONFIG_NXWM_HEXCALCULATOR_FONTID - The font used with the calculator. + * Default: CONFIG_NXWM_DEFAULT_FONTID */ #ifndef CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR @@ -527,6 +529,10 @@ # define CONFIG_NXWM_HEXCALCULATOR_ICON NxWM::g_calculatorBitmap #endif +#ifndef CONFIG_NXWM_HEXCALCULATOR_FONTID +# define CONFIG_NXWM_HEXCALCULATOR_FONTID CONFIG_NXWM_DEFAULT_FONTID +#endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index d865817b9..167c114b7 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -210,6 +210,7 @@ CHexCalculator::CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window) m_keypad = (NXWidgets::CButtonArray *)0; m_text = (NXWidgets::CLabel *)0; + m_font = (NXWidgets::CNxFont *)0; // Reset other values @@ -219,7 +220,8 @@ CHexCalculator::CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window) m_high.value = 0; m_low.operation = (uint8_t)KEY_NONE; // No pending high precedence operation m_low.value = 0; - m_hexMode = 0; // Decimal mode + m_hexMode = false; // Decimal mode + m_result = false; // Accumulator does not hot a result // Add our personalized window label @@ -255,6 +257,11 @@ CHexCalculator::~CHexCalculator(void) delete m_keypad; } + if (m_font) + { + delete m_font; + } + // Although we didn't create it, we are responsible for deleting the // application window @@ -489,6 +496,17 @@ void CHexCalculator::setGeometry(void) bool CHexCalculator::createCalculator(void) { + // Select a font for the calculator + + m_font = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_HEXCALCULATOR_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, + CONFIG_NXWM_TRANSPARENT_COLOR); + if (!m_font) + { + gdbg("ERROR failed to create font\n"); + return false; + } + // Get the widget control associated with the application window NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); @@ -511,6 +529,10 @@ bool CHexCalculator::createCalculator(void) m_keypad->disableDrawing(); m_keypad->setRaisesEvents(false); + // Select the font + + m_keypad->setFont(m_font); + // Register to receive events from the keypad m_keypad->addWidgetEventHandler(this); @@ -536,6 +558,10 @@ bool CHexCalculator::createCalculator(void) m_text->disableDrawing(); m_text->setRaisesEvents(false); + + // Select the font + + m_text->setFont(m_font); return true; } @@ -645,7 +671,7 @@ void CHexCalculator::updateText(void) if (m_hexMode) { - std::snprintf(buffer, 24, "%16llx", m_accum); + std::snprintf(buffer, 24, "%16llX", m_accum); } else { @@ -707,13 +733,25 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Process the keypress + bool result = false; switch (g_keyDesc[index].keyType) { // Values: {0-9, A-F} case KEY_VALUE: // Key is a value { - if (m_hexMode) + // If the accumulator current holds the result of a previous + // operation, then start fresh + + if (m_result) + { + m_accum = (uint64_t)g_keyDesc[index].value; + } + + // Otherwise, add the new value to the accumulator. The way + // in which it is added depends on the mode + + else if (m_hexMode) { m_accum <<= 4; m_accum |= (uint64_t)g_keyDesc[index].value; @@ -770,9 +808,12 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) m_low.operation = (uint8_t) g_keyDesc[index].keyType; m_low.value = m_accum; - m_accum = 0; + + // Update the display with the value in the accumulator, but + // then clear the accumulator in preparation for the next input updateText(); + m_accum = 0; } break; @@ -795,9 +836,12 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) m_high.operation = (uint8_t) g_keyDesc[index].keyType; m_high.value = m_accum; - m_accum = 0; + + // Update the display with the value in the accumulator, but + // then clear the accumulator in preparation for the next input updateText(); + m_accum = 0; } break; @@ -823,7 +867,12 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) m_low.value = 0; } + // Update the display with the value in the accumulator. Flag that + // this is a result meaning that (1) it can be used as an accumulator + // for the next operation, but new input values cannot be appended to it. + updateText(); + result = true; } break; @@ -897,6 +946,10 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) gdbg("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); break; } + + // Remember if the accumulator contains a special reault + + m_result = result; } } From f2ccd473b48bdd6b706f24d617bb6a4eb5627d9d Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 30 May 2012 16:52:56 +0000 Subject: [PATCH 079/390] Fix error in NxWM makefile that creapt in with recent check-ins git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4787 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 +++ nxwm/Makefile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ad617f4b7..b017b2033 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -155,3 +155,6 @@ * NxWM: Increase default spacing of icons on the Start Window. * NxWM::CHexCalculator: Fix some non-standard calculator behavior after = is pressed. Use upper case hex. Increase font size. +* nxwm/Makefile: Fix error that creapt in during some other + recent check-ins. + diff --git a/nxwm/Makefile b/nxwm/Makefile index 4d4ecb4d2..e50863494 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -57,7 +57,7 @@ endif # Applications -CXXSRCS = cstartwindow.cxx cnxconsole.cxx chexcalculator.cxx +CXXSRCS += cstartwindow.cxx cnxconsole.cxx chexcalculator.cxx ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) CXXSRCS += ccalibration.cxx From 604b4c53d1c523a8da3e57b568ea26489a28a5c1 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 15 Jun 2012 16:23:17 +0000 Subject: [PATCH 080/390] Prep for 6.19 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4847 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 9 +++++---- ReleaseNotes.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b017b2033..b74ba32bc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -110,7 +110,7 @@ * doc/NxWM-ThreadingModel.ppt: Documented the now rather complex NxWM threading model. -1.2 2012-xx-xx Gregory Nutt +1.2 2012-06-15 Gregory Nutt * NXWidgets::CCallback: callback arguement is now type CCallback and not CWidgetControl; Added a method to redirect keyboard contacts to either @@ -121,7 +121,7 @@ the CWidgetControl instance. New method redirectNxConsole() will support redirection of any window keyboard input to the NxConsole (via CCallback). -* NxWM:CNxConsole: Configures the NxConsole window to redirectin keyboard +* NxWM:CNxConsole: Configures the NxConsole window to redirection keyboard input to the NxConsole; redirects standard input to the NxConsole device driver. * NxWM:CKeyboard: Add a new class that implements a keyboard listener @@ -136,7 +136,7 @@ * NxWM::CTaskbar: After drawing the task bar, need to raise the application window otherwise the taskbar will be on the top and keyboard input will not be received by the top application. -* NxWM::CTaskbar: Bugfix... previous window should now be minimized +* NxWM::CTaskbar: Bugfix... previous window should not be minimized when a new window is started. It should stay in a maximized state so that it will re-appear with the window above it is closed or minimized. @@ -149,7 +149,7 @@ background data because the LCD does not support read operations. In that case, we just use the default background color. However, that doesn't work either for the case where the background color - changes when the widget is selected. Thenthe background color + changes when the widget is selected. Then the background color in the font is wrong. Fixed in CButtonArrary, but the problem probably exists in other places as well. * NxWM: Increase default spacing of icons on the Start Window. @@ -158,3 +158,4 @@ * nxwm/Makefile: Fix error that creapt in during some other recent check-ins. +1.3 2012-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index d140d45d1..96ce29e1a 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -66,4 +66,34 @@ Bug fixes include changes to the following (see the ChangeLog for details): * NxWidgets::CRlePalettBitmap, NxWidgets::CRlePalettBitmap, NxWidgets::CGraphicsPort, NxWidgets::CWidgetControl +NxWidgets-1.2 +============= + +The 3rd release of the NxWidgets package as made on June 15, 2012. This +release depends on NuttX-6.19 or above and should not be used with older +NuttX releases. + +New features and enhancements include: + +* NxWM::CNxConsole: The NxWM NxConsole windows now correctly receive keyboard + input. In version 1.1, NxConsoles received input from /dev/console. That, + of course, leads to chaos when there a multiple windows trying to get input + from the same device. There is now a keyboard listener task that will + accept input from /dev/console and inject that input into the NX keyboard + interface. NX will give the keyboard input only to the top window that + has focus, eliminating the chaos. + +* NxWM::CHexcalculator: The NxWM demonstration/unit test now includes a hex + calculator applications. This demonstrates the use of arrays of buttons + within a window. + +Bugfixes: + +* NxWM::CTaskbar: Was inappropriately minimizing some windows. Fixes + some window raising/lowering bugs. + +* NXWidgets::CButtonArray: Fix some coloring problems when rending button + text in cases where we cannot read from the display device. + +As well as other, less critical bugs (see the ChangeLog for details) From 8038b6c441e73fbbc20f0b916524d3e14f5fd5c3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 13 Sep 2012 17:32:42 +0000 Subject: [PATCH 081/390] Email address change in misc/ git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5144 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/COPYING | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/COPYING b/libnxwidgets/COPYING index 5e78c2ac2..f12e7b82e 100644 --- a/libnxwidgets/COPYING +++ b/libnxwidgets/COPYING @@ -3,7 +3,7 @@ * Graphical Widgets for the NuttX RTOS * * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,4 +67,4 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ********************************************************************************/ - \ No newline at end of file + From 66f26d33fc558eef9d855b7fbf07069b7b1ab57f Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Sep 2012 15:23:54 +0000 Subject: [PATCH 082/390] Update all unit tests to conform to recent naming convention changes in NuttX git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5151 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 ++ UnitTests/CButton/Makefile | 2 +- .../CButton/{main.cxx => cbutton_main.cxx} | 28 ++++---- UnitTests/CButton/cbuttontest.hxx | 10 --- UnitTests/CButtonArray/Makefile | 2 +- .../{main.cxx => cbuttonarray_main.cxx} | 32 ++++----- UnitTests/CButtonArray/cbuttonarraytest.hxx | 10 --- UnitTests/CCheckBox/Makefile | 2 +- .../{main.cxx => ccheckbox_main.cxx} | 28 ++++---- UnitTests/CCheckBox/ccheckboxtest.hxx | 10 --- UnitTests/CGlyphButton/Makefile | 2 +- .../{main.cxx => cglyphbutton_main.cxx} | 28 ++++---- UnitTests/CGlyphButton/cglyphbuttontest.hxx | 10 --- UnitTests/CImage/Makefile | 2 +- .../CImage/{main.cxx => cimage_main.cxx} | 20 +++--- UnitTests/CImage/cimagetest.hxx | 10 --- UnitTests/CKeypad/Makefile | 2 +- .../CKeypad/{main.cxx => ckeypad_main.cxx} | 32 ++++----- UnitTests/CKeypad/ckeypadtest.hxx | 10 --- UnitTests/CLabel/Makefile | 2 +- .../CLabel/{main.cxx => clabel_main.cxx} | 20 +++--- UnitTests/CLabel/clabeltest.hxx | 10 --- UnitTests/CLatchButton/Makefile | 2 +- .../{main.cxx => clatchbutton_main.cxx} | 30 ++++---- UnitTests/CLatchButton/clatchbuttontest.hxx | 10 --- UnitTests/CLatchButtonArray/Makefile | 2 +- .../{main.cxx => clatchbuttonarray_main.cxx} | 30 ++++---- .../clatchbuttonarraytest.hxx | 10 --- UnitTests/CListBox/Makefile | 2 +- .../CListBox/{main.cxx => clistbox_main.cxx} | 70 +++++++++---------- UnitTests/CListBox/clistboxtest.hxx | 10 --- UnitTests/CProgressBar/Makefile | 2 +- .../{main.cxx => cprogressbar_main.cxx} | 38 +++++----- UnitTests/CProgressBar/cprogressbartest.hxx | 10 --- UnitTests/CRadioButton/Makefile | 2 +- .../{main.cxx => cradiobutton_main.cxx} | 40 +++++------ UnitTests/CRadioButton/cradiobuttontest.hxx | 10 --- UnitTests/CScrollbarHorizontal/Makefile | 2 +- .../cscrollbarhorizontaltest.hxx | 10 --- UnitTests/CScrollbarVertical/Makefile | 2 +- .../{main.cxx => cscrollbarvertical_main.cxx} | 38 +++++----- .../cscrollbarverticaltest.hxx | 10 --- UnitTests/CSliderHorizonal/Makefile | 2 +- .../{main.cxx => csliderhorizontal_main.cxx} | 38 +++++----- .../csliderhorizontaltest.hxx | 10 --- UnitTests/CSliderVertical/Makefile | 2 +- .../{main.cxx => cslidervertical_main.cxx} | 38 +++++----- .../CSliderVertical/csliderverticaltest.hxx | 10 --- UnitTests/CTextBox/Makefile | 2 +- .../CTextBox/{main.cxx => ctextbox_main.cxx} | 20 +++--- UnitTests/CTextBox/ctextboxtest.hxx | 10 --- UnitTests/nxwm/Makefile | 2 +- UnitTests/nxwm/{main.cxx => nxwm_main.cxx} | 52 ++++++-------- 53 files changed, 308 insertions(+), 484 deletions(-) rename UnitTests/CButton/{main.cxx => cbutton_main.cxx} (84%) rename UnitTests/CButtonArray/{main.cxx => cbuttonarray_main.cxx} (89%) rename UnitTests/CCheckBox/{main.cxx => ccheckbox_main.cxx} (87%) rename UnitTests/CGlyphButton/{main.cxx => cglyphbutton_main.cxx} (87%) rename UnitTests/CImage/{main.cxx => cimage_main.cxx} (92%) rename UnitTests/CKeypad/{main.cxx => ckeypad_main.cxx} (88%) rename UnitTests/CLabel/{main.cxx => clabel_main.cxx} (87%) rename UnitTests/CLatchButton/{main.cxx => clatchbutton_main.cxx} (85%) rename UnitTests/CLatchButtonArray/{main.cxx => clatchbuttonarray_main.cxx} (89%) rename UnitTests/CListBox/{main.cxx => clistbox_main.cxx} (78%) rename UnitTests/CProgressBar/{main.cxx => cprogressbar_main.cxx} (82%) rename UnitTests/CRadioButton/{main.cxx => cradiobutton_main.cxx} (82%) rename UnitTests/CScrollbarVertical/{main.cxx => cscrollbarvertical_main.cxx} (80%) rename UnitTests/CSliderHorizonal/{main.cxx => csliderhorizontal_main.cxx} (81%) rename UnitTests/CSliderVertical/{main.cxx => cslidervertical_main.cxx} (81%) rename UnitTests/CTextBox/{main.cxx => ctextbox_main.cxx} (87%) rename UnitTests/nxwm/{main.cxx => nxwm_main.cxx} (93%) diff --git a/ChangeLog.txt b/ChangeLog.txt index b74ba32bc..cdd26cb89 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -159,3 +159,7 @@ recent check-ins. 1.3 2012-xx-xx Gregory Nutt + +* UnitTests/*/main.cxx: Change entry point name to be consistent + with with entry point naming conventions introduced in NuttX + 6.22. diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 4e1ae042f..77ba7e986 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cbuttontest.cxx +CXXSRCS = cbutton_main.cxx cbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CButton/main.cxx b/UnitTests/CButton/cbutton_main.cxx similarity index 84% rename from UnitTests/CButton/main.cxx rename to UnitTests/CButton/cbutton_main.cxx index 13e9099d9..973a2cd8a 100644 --- a/UnitTests/CButton/main.cxx +++ b/UnitTests/CButton/cbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CButton/main.cxx +// NxWidgets/UnitTests/CButton/cbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -68,7 +68,7 @@ static const char g_pushme[] = "Push Me"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -78,29 +78,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cbutton_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CButtonTest instance\n"); + printf("cbutton_main: Create CButtonTest instance\n"); CButtonTest *test = new CButtonTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CButtonTest instance to the NX server\n"); + printf("cbutton_main: Connect the CButtonTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CButtonTest instance to the NX server\n"); + printf("cbutton_main: Failed to connect the CButtonTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("cbutton_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("cbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -110,26 +110,26 @@ int MAIN_NAME(int argc, char *argv[]) CButton *button = test->createButton(g_pushme); if (!button) { - printf(MAIN_STRING "Failed to create a button\n"); + printf("cbutton_main: Failed to create a button\n"); delete test; return 1; } // Show the button - printf(MAIN_STRING "Show the button\n"); + printf("cbutton_main: Show the button\n"); test->showButton(button); // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - printf(MAIN_STRING "Click the button\n"); + printf("cbutton_main: Click the button\n"); test->click(); // Poll for the mouse click event (of course this can hang if something fails) bool clicked = test->poll(button); - printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + printf("cbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a second, then release the mouse buttone @@ -139,7 +139,7 @@ int MAIN_NAME(int argc, char *argv[]) // Poll for the mouse release event (of course this can hang if something fails) clicked = test->poll(button); - printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + printf("cbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a few more seconds so that the tester can ponder the result @@ -147,7 +147,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("cbutton_main: Clean-up and exit\n"); delete button; delete test; return 0; diff --git a/UnitTests/CButton/cbuttontest.hxx b/UnitTests/CButton/cbuttontest.hxx index cba947b73..10465c06e 100644 --- a/UnitTests/CButton/cbuttontest.hxx +++ b/UnitTests/CButton/cbuttontest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cbutton_main -# define MAIN_STRING "cbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index a37e49142..a5a33b3b0 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cbuttonarraytest.cxx +CXXSRCS = cbuttonarray_main.cxx cbuttonarraytest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CButtonArray/main.cxx b/UnitTests/CButtonArray/cbuttonarray_main.cxx similarity index 89% rename from UnitTests/CButtonArray/main.cxx rename to UnitTests/CButtonArray/cbuttonarray_main.cxx index fa02413a4..c247d73e5 100644 --- a/UnitTests/CButtonArray/main.cxx +++ b/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CButtonArray/main.cxx +// NxWidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -82,7 +82,7 @@ static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cbuttonarray_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -196,7 +196,7 @@ static void checkHighlighting(CButtonArray *buttonArray) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cbuttonarray_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -204,16 +204,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the button array test - printf(MAIN_STRING "Create CButtonArrayTest instance\n"); + printf("cbuttonarray_main: Create CButtonArrayTest instance\n"); CButtonArrayTest *test = new CButtonArrayTest(); updateMemoryUsage(g_mmPrevious, "After creating CButtonArrayTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CButtonArrayTest instance to the NX server\n"); + printf("cbuttonarray_main: Connect the CButtonArrayTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CButtonArrayTest instance to the NX server\n"); + printf("cbuttonarray_main: Failed to connect the CButtonArrayTest instance to the NX server\n"); delete test; return 1; } @@ -221,10 +221,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("cbuttonarray_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("cbuttonarray_main: Failed to create a window\n"); delete test; return 1; } @@ -235,7 +235,7 @@ int MAIN_NAME(int argc, char *argv[]) CButtonArray *buttonArray = test->createButtonArray(); if (!buttonArray) { - printf(MAIN_STRING "Failed to create a button array\n"); + printf("cbuttonarray_main: Failed to create a button array\n"); delete test; return 1; } @@ -248,7 +248,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + printf("cbuttonarray_main: Label (%d,%d): %s\n", i, j, *ptr); CNxString string = *ptr++; buttonArray->setText(i, j, string); } @@ -257,7 +257,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button array - printf(MAIN_STRING "Show the button array\n"); + printf("cbuttonarray_main: Show the button array\n"); test->showButton(buttonArray); sleep(1); @@ -272,7 +272,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("cbuttonarray_main: Click the button (%d,%d)\n", i, j); test->click(buttonArray, i, j); // Poll for the mouse click event @@ -285,13 +285,13 @@ int MAIN_NAME(int argc, char *argv[]) int clickRow; if (buttonArray->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } else { - printf(MAIN_STRING "ERROR: No button is clicked\n"); + printf("cbuttonarray_main: ERROR: No button is clicked\n"); } // Wait a bit, then release the mouse button @@ -304,7 +304,7 @@ int MAIN_NAME(int argc, char *argv[]) test->poll(buttonArray); if (buttonArray->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } @@ -315,7 +315,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("cbuttonarray_main: Clean-up and exit\n"); delete buttonArray; updateMemoryUsage(g_mmPrevious, "After deleting the button array"); delete test; diff --git a/UnitTests/CButtonArray/cbuttonarraytest.hxx b/UnitTests/CButtonArray/cbuttonarraytest.hxx index 1a75ac2c3..b8a9e15e5 100644 --- a/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cbuttonarray_main -# define MAIN_STRING "cbuttonarray_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 6b31286df..9b46cef8d 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ccheckboxtest.cxx +CXXSRCS = ccheckbox_main.cxx ccheckboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CCheckBox/main.cxx b/UnitTests/CCheckBox/ccheckbox_main.cxx similarity index 87% rename from UnitTests/CCheckBox/main.cxx rename to UnitTests/CCheckBox/ccheckbox_main.cxx index e9e8b516f..949cbc35f 100644 --- a/UnitTests/CCheckBox/main.cxx +++ b/UnitTests/CCheckBox/ccheckbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CCheckBox/main.cxx +// NxWidgets/UnitTests/CCheckBox/ccheckbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ccheckbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ccheckbox_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,31 +143,31 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CCheckBoxTest instance\n"); + message("ccheckbox_main: Create CCheckBoxTest instance\n"); CCheckBoxTest *test = new CCheckBoxTest(); updateMemoryUsage(g_mmprevious, "After creating CCheckBoxTest"); // Connect the NX server - message(MAIN_STRING "Connect the CCheckBoxTest instance to the NX server\n"); + message("ccheckbox_main: Connect the CCheckBoxTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CCheckBoxTest instance to the NX server\n"); + message("ccheckbox_main: Failed to connect the CCheckBoxTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "ccheckbox_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("ccheckbox_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("ccheckbox_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "ccheckbox_main: After creating a window"); // Show the initial state of the checkbox @@ -177,21 +177,21 @@ int MAIN_NAME(int argc, char *argv[]) // Now click the checkbox - message(MAIN_STRING "Click 1\n"); + message("ccheckbox_main: Click 1\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 1"); usleep(500*1000); - message(MAIN_STRING "Click 2\n"); + message("ccheckbox_main: Click 2\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 2"); usleep(500*1000); - message(MAIN_STRING "Click 3\n"); + message("ccheckbox_main: Click 3\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); @@ -200,7 +200,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("ccheckbox_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); diff --git a/UnitTests/CCheckBox/ccheckboxtest.hxx b/UnitTests/CCheckBox/ccheckboxtest.hxx index 73e72e282..0397b37dd 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ccheckbox_main -# define MAIN_STRING "ccheckbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 01e843555..5f2522e49 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cglyphbuttontest.cxx +CXXSRCS = cglyphbutton_main.cxx cglyphbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CGlyphButton/main.cxx b/UnitTests/CGlyphButton/cglyphbutton_main.cxx similarity index 87% rename from UnitTests/CGlyphButton/main.cxx rename to UnitTests/CGlyphButton/cglyphbutton_main.cxx index 7812fa9e9..95e255dcc 100644 --- a/UnitTests/CGlyphButton/main.cxx +++ b/UnitTests/CGlyphButton/cglyphbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CGlyphButton/main.cxx +// NxWidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -72,7 +72,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cglyphbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -134,7 +134,7 @@ static void initMemoryUsage(void) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cglyphbutton_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -142,16 +142,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the font test - message(MAIN_STRING "Create CGlyphButtonTest instance\n"); + message("cglyphbutton_main: Create CGlyphButtonTest instance\n"); CGlyphButtonTest *test = new CGlyphButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CGlyphButtonTest"); // Connect the NX server - message(MAIN_STRING "Connect the CGlyphButtonTest instance to the NX server\n"); + message("cglyphbutton_main: Connect the CGlyphButtonTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CGlyphButtonTest instance to the NX server\n"); + message("cglyphbutton_main: Failed to connect the CGlyphButtonTest instance to the NX server\n"); delete test; return 1; } @@ -159,10 +159,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cglyphbutton_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cglyphbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -173,7 +173,7 @@ int MAIN_NAME(int argc, char *argv[]) CGlyphButton *button = test->createButton(&g_arrowDown, &g_arrowUp); if (!button) { - message(MAIN_STRING "Failed to create a button\n"); + message("cglyphbutton_main: Failed to create a button\n"); delete test; return 1; } @@ -181,21 +181,21 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button - message(MAIN_STRING "Show the button\n"); + message("cglyphbutton_main: Show the button\n"); test->showButton(button); updateMemoryUsage(g_mmprevious, "After showing the glyph button"); // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - message(MAIN_STRING "Click the button\n"); + message("cglyphbutton_main: Click the button\n"); test->click(); updateMemoryUsage(g_mmprevious, "After clicking glyph button"); // Poll for the mouse click event (of course this can hang if something fails) bool clicked = test->poll(button); - message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a second, then release the mouse buttone @@ -206,7 +206,7 @@ int MAIN_NAME(int argc, char *argv[]) // Poll for the mouse release event (of course this can hang if something fails) clicked = test->poll(button); - message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a few more seconds so that the tester can ponder the result @@ -214,7 +214,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cglyphbutton_main: Clean-up and exit\n"); delete button; updateMemoryUsage(g_mmprevious, "After deleting the glyph button"); delete test; diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/UnitTests/CGlyphButton/cglyphbuttontest.hxx index 940d82a9f..b3e5bb656 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -76,16 +76,6 @@ # define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cglyphbutton_main -# define MAIN_STRING "cglyphbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 8db783364..46e69c495 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cimagetest.cxx +CXXSRCS = cimage_main.cxx cimagetest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CImage/main.cxx b/UnitTests/CImage/cimage_main.cxx similarity index 92% rename from UnitTests/CImage/main.cxx rename to UnitTests/CImage/cimage_main.cxx index dd066b809..30cf49d3e 100644 --- a/UnitTests/CImage/main.cxx +++ b/UnitTests/CImage/cimage_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CImage/main.cxx +// NxWidgets/UnitTests/CImage/cimage_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static struct mallinfo g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cimage_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -149,7 +149,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cimage_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -157,16 +157,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the font test - message(MAIN_STRING "Create CImageTest instance\n"); + message("cimage_main: Create CImageTest instance\n"); CImageTest *test = new CImageTest(); updateMemoryUsage(&g_mmprevious, "After creating CImageTest"); // Connect the NX server - message(MAIN_STRING "Connect the CImageTest instance to the NX server\n"); + message("cimage_main: Connect the CImageTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CImageTest instance to the NX server\n"); + message("cimage_main: Failed to connect the CImageTest instance to the NX server\n"); delete test; return 1; } @@ -174,10 +174,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cimage_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cimage_main: Failed to create a window\n"); delete test; return 1; } @@ -193,7 +193,7 @@ int MAIN_NAME(int argc, char *argv[]) CImage *image = test->createImage(static_cast(nuttxBitmap)); if (!image) { - message(MAIN_STRING "Failed to create a image\n"); + message("cimage_main: Failed to create a image\n"); delete test; return 1; } @@ -207,7 +207,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cimage_main: Clean-up and exit\n"); delete image; updateMemoryUsage(&g_mmprevious, "After deleting CImage"); diff --git a/UnitTests/CImage/cimagetest.hxx b/UnitTests/CImage/cimagetest.hxx index 64592ee23..9592f2936 100644 --- a/UnitTests/CImage/cimagetest.hxx +++ b/UnitTests/CImage/cimagetest.hxx @@ -71,16 +71,6 @@ # define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cimage_main -# define MAIN_STRING "cimage_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index ddb8fb962..3d37c26fe 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ckeypadtest.cxx +CXXSRCS = ckeypad_main.cxx ckeypadtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CKeypad/main.cxx b/UnitTests/CKeypad/ckeypad_main.cxx similarity index 88% rename from UnitTests/CKeypad/main.cxx rename to UnitTests/CKeypad/ckeypad_main.cxx index 1c7679ee2..896ef5013 100644 --- a/UnitTests/CKeypad/main.cxx +++ b/UnitTests/CKeypad/ckeypad_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CKeypad/main.cxx +// NxWidgets/UnitTests/CKeypad/ckeypad_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -72,7 +72,7 @@ static unsigned int g_mmPeak; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ckeypad_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -142,7 +142,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) { for (int i = 0; i < KEYPAD_NCOLUMNS; i++) { - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("clickButtons: Click the button (%d,%d)\n", i, j); test->click(keypad, i, j); // Poll for the mouse click event @@ -155,13 +155,13 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) int clickRow; if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + printf("clickButtons: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } else { - printf(MAIN_STRING "ERROR: No button is clicked\n"); + printf("clickButtons: ERROR: No button is clicked\n"); } // Wait a bit, then release the mouse button @@ -174,7 +174,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) test->poll(keypad); if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + printf("clickButtons: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } @@ -192,7 +192,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ckeypad_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -200,16 +200,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the keypad test - printf(MAIN_STRING "Create CKeypadTest instance\n"); + printf("ckeypad_main: Create CKeypadTest instance\n"); CKeypadTest *test = new CKeypadTest(); updateMemoryUsage(g_mmPrevious, "After creating CKeypadTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CKeypadTest instance to the NX server\n"); + printf("ckeypad_main: Connect the CKeypadTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CKeypadTest instance to the NX server\n"); + printf("ckeypad_main: Failed to connect the CKeypadTest instance to the NX server\n"); delete test; return 1; } @@ -217,10 +217,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("ckeypad_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("ckeypad_main: Failed to create a window\n"); delete test; return 1; } @@ -231,7 +231,7 @@ int MAIN_NAME(int argc, char *argv[]) CKeypad *keypad = test->createKeypad(); if (!keypad) { - printf(MAIN_STRING "Failed to create a keypad\n"); + printf("ckeypad_main: Failed to create a keypad\n"); delete test; return 1; } @@ -239,7 +239,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the keypad in alphabetic mode - printf(MAIN_STRING "Show the keypad in alphabetic mode\n"); + printf("ckeypad_main: Show the keypad in alphabetic mode\n"); keypad->setKeypadMode(false); test->showKeypad(keypad); sleep(1); @@ -251,7 +251,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the keypad in numeric mode - printf(MAIN_STRING "Show the keypad in numeric mode\n"); + printf("ckeypad_main: Show the keypad in numeric mode\n"); keypad->setKeypadMode(true); sleep(1); @@ -262,7 +262,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("ckeypad_main: Clean-up and exit\n"); delete keypad; updateMemoryUsage(g_mmPrevious, "After deleting the keypad"); delete test; diff --git a/UnitTests/CKeypad/ckeypadtest.hxx b/UnitTests/CKeypad/ckeypadtest.hxx index c1c7ba79e..d11c92375 100644 --- a/UnitTests/CKeypad/ckeypadtest.hxx +++ b/UnitTests/CKeypad/ckeypadtest.hxx @@ -72,16 +72,6 @@ # define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ckeypad_main -# define MAIN_STRING "ckeypad_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 4e49a7f5c..e04adc7de 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clabeltest.cxx +CXXSRCS = clabel_main.cxx clabeltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CLabel/main.cxx b/UnitTests/CLabel/clabel_main.cxx similarity index 87% rename from UnitTests/CLabel/main.cxx rename to UnitTests/CLabel/clabel_main.cxx index 953e6afbc..2b800dcab 100644 --- a/UnitTests/CLabel/main.cxx +++ b/UnitTests/CLabel/clabel_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLabel/main.cxx +// NxWidgets/UnitTests/CLabel/clabel_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -68,7 +68,7 @@ static const char g_hello[] = "Hello, World!"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clabel_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -78,29 +78,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clabel_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CLabelTest instance\n"); + printf("clabel_main: Create CLabelTest instance\n"); CLabelTest *test = new CLabelTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CLabelTest instance to the NX server\n"); + printf("clabel_main: Connect the CLabelTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLabelTest instance to the NX server\n"); + printf("clabel_main: Failed to connect the CLabelTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clabel_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clabel_main: Failed to create a window\n"); delete test; return 1; } @@ -110,7 +110,7 @@ int MAIN_NAME(int argc, char *argv[]) CLabel *label = test->createLabel(g_hello); if (!label) { - printf(MAIN_STRING "Failed to create a label\n"); + printf("clabel_main: Failed to create a label\n"); delete test; return 1; } @@ -122,7 +122,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clabel_main: Clean-up and exit\n"); delete label; delete test; return 0; diff --git a/UnitTests/CLabel/clabeltest.hxx b/UnitTests/CLabel/clabeltest.hxx index f7e13fdfb..47bb7684b 100644 --- a/UnitTests/CLabel/clabeltest.hxx +++ b/UnitTests/CLabel/clabeltest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLABELTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clabel_main -# define MAIN_STRING "clabel_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index d953c3e99..7444c50be 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clatchbuttontest.cxx +CXXSRCS = clatchbutton_main.cxx clatchbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CLatchButton/main.cxx b/UnitTests/CLatchButton/clatchbutton_main.cxx similarity index 85% rename from UnitTests/CLatchButton/main.cxx rename to UnitTests/CLatchButton/clatchbutton_main.cxx index d51f613c1..13ed0613e 100644 --- a/UnitTests/CLatchButton/main.cxx +++ b/UnitTests/CLatchButton/clatchbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLatchButton/main.cxx +// NxWidgets/UnitTests/CLatchButton/clatchbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -68,7 +68,7 @@ static const char g_pushme[] = "Push Me"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clatchbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -83,13 +83,13 @@ static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) bool nowClicked = button->isClicked(); bool nowLatched = button->isLatched(); - printf(MAIN_STRING "Button state: %s and %s\n", + printf("showButtonState: Button state: %s and %s\n", nowClicked ? "clicked" : "released", nowLatched ? "latched" : "unlatched"); if (clicked != nowClicked || latched != nowLatched) { - printf(MAIN_STRING "ERROR: Expected %s and %s\n", + printf("showButtonState: ERROR: Expected %s and %s\n", clicked ? "clicked" : "released", latched ? "latched" : "unlatched"); @@ -106,29 +106,29 @@ static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clatchbutton_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CLatchButtonTest instance\n"); + printf("clatchbutton_main: Create CLatchButtonTest instance\n"); CLatchButtonTest *test = new CLatchButtonTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CLatchButtonTest instance to the NX server\n"); + printf("clatchbutton_main: Connect the CLatchButtonTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLatchButtonTest instance to the NX server\n"); + printf("clatchbutton_main: Failed to connect the CLatchButtonTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clatchbutton_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clatchbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -138,14 +138,14 @@ int MAIN_NAME(int argc, char *argv[]) CLatchButton *button = test->createButton(g_pushme); if (!button) { - printf(MAIN_STRING "Failed to create a button\n"); + printf("clatchbutton_main: Failed to create a button\n"); delete test; return 1; } // Show the button - printf(MAIN_STRING "Show the button\n"); + printf("clatchbutton_main: Show the button\n"); test->showButton(button); bool clicked = false; @@ -159,7 +159,7 @@ int MAIN_NAME(int argc, char *argv[]) // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - printf(MAIN_STRING "Click the button\n"); + printf("clatchbutton_main: Click the button\n"); test->click(); test->poll(button); @@ -173,7 +173,7 @@ int MAIN_NAME(int argc, char *argv[]) // And release the button after 0.5 seconds usleep(500 * 1000); - printf(MAIN_STRING "Release the button\n"); + printf("clatchbutton_main: Release the button\n"); test->release(); test->poll(button); @@ -191,7 +191,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clatchbutton_main: Clean-up and exit\n"); delete button; delete test; return 0; diff --git a/UnitTests/CLatchButton/clatchbuttontest.hxx b/UnitTests/CLatchButton/clatchbuttontest.hxx index 62405ac88..783b1a57c 100644 --- a/UnitTests/CLatchButton/clatchbuttontest.hxx +++ b/UnitTests/CLatchButton/clatchbuttontest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLATCHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clatchbutton_main -# define MAIN_STRING "clatchbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index ddd44f8b3..a6ac9118b 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clatchbuttonarraytest.cxx +CXXSRCS = clatchbuttonarray_main.cxx clatchbuttonarraytest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CLatchButtonArray/main.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx similarity index 89% rename from UnitTests/CLatchButtonArray/main.cxx rename to UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index d38651ae9..ad7646560 100644 --- a/UnitTests/CLatchButtonArray/main.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLatchButtonArray/main.cxx +// NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarry_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -82,7 +82,7 @@ static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clatchbuttonarray_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -98,14 +98,14 @@ static void showButtonState(CLatchButtonArray *buttonArray, int i, int j, bool nowClicked = buttonArray->isThisButtonClicked(i,j); bool nowLatched = buttonArray->isThisButtonLatched(i,j); - printf(MAIN_STRING "Button(%d,%d) state: %s and %s\n", + printf("showButtonState: Button(%d,%d) state: %s and %s\n", i, j, nowClicked ? "clicked" : "released", nowLatched ? "latched" : "unlatched"); if (clicked != nowClicked || latched != nowLatched) { - printf(MAIN_STRING "ERROR: Expected %s and %s\n", + printf("showButtonState: ERROR: Expected %s and %s\n", clicked ? "clicked" : "released", latched ? "latched" : "unlatched"); @@ -174,7 +174,7 @@ static void initMemoryUsage(void) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clatchbuttonarray_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -182,16 +182,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the button array test - printf(MAIN_STRING "Create CLatchButtonArrayTest instance\n"); + printf("clatchbuttonarray_main: Create CLatchButtonArrayTest instance\n"); CLatchButtonArrayTest *test = new CLatchButtonArrayTest(); updateMemoryUsage(g_mmPrevious, "After creating CLatchButtonArrayTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CLatchButtonArrayTest instance to the NX server\n"); + printf("clatchbuttonarray_main: Connect the CLatchButtonArrayTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLatchButtonArrayTest instance to the NX server\n"); + printf("clatchbuttonarray_main: Failed to connect the CLatchButtonArrayTest instance to the NX server\n"); delete test; return 1; } @@ -199,10 +199,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clatchbuttonarray_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clatchbuttonarray_main: Failed to create a window\n"); delete test; return 1; } @@ -213,7 +213,7 @@ int MAIN_NAME(int argc, char *argv[]) CLatchButtonArray *buttonArray = test->createButtonArray(); if (!buttonArray) { - printf(MAIN_STRING "Failed to create a button array\n"); + printf("clatchbuttonarray_main: Failed to create a button array\n"); delete test; return 1; } @@ -226,7 +226,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + printf("clatchbuttonarray_main: Label (%d,%d): %s\n", i, j, *ptr); CNxString string = *ptr++; buttonArray->setText(i, j, string); } @@ -235,7 +235,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button array - printf(MAIN_STRING "Show the button array\n"); + printf("clatchbuttonarray_main: Show the button array\n"); test->showButton(buttonArray); sleep(1); @@ -254,7 +254,7 @@ int MAIN_NAME(int argc, char *argv[]) latched = false; showButtonState(buttonArray, i, j, clicked, latched); - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("clatchbuttonarray_main: Click the button (%d,%d)\n", i, j); test->click(buttonArray, i, j); // Poll for the mouse click event @@ -289,7 +289,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clatchbuttonarray_main: Clean-up and exit\n"); delete buttonArray; updateMemoryUsage(g_mmPrevious, "After deleting the button array"); delete test; diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index f8642f089..98c0a3bb3 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clatchbuttonarray_main -# define MAIN_STRING "clatchbuttonarray_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 4f933ad98..f06873817 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clistboxtest.cxx +CXXSRCS = clistbox_main.cxx clistboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CListBox/main.cxx b/UnitTests/CListBox/clistbox_main.cxx similarity index 78% rename from UnitTests/CListBox/main.cxx rename to UnitTests/CListBox/clistbox_main.cxx index 5783e255d..8711f06e8 100644 --- a/UnitTests/CListBox/main.cxx +++ b/UnitTests/CListBox/clistbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CListBox/main.cxx +// NxWidgets/UnitTests/CListBox/clistbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -108,7 +108,7 @@ static FAR const char *g_options[] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clistbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -174,7 +174,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clistbox_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -182,43 +182,43 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the listbox test - message(MAIN_STRING "Create CListBoxTest instance\n"); + message("clistbox_main: Create CListBoxTest instance\n"); CListBoxTest *test = new CListBoxTest(); updateMemoryUsage(g_mmPrevious, "After creating CListBoxTest"); // Connect the NX server - message(MAIN_STRING "Connect the CListBoxTest instance to the NX server\n"); + message("clistbox_main: Connect the CListBoxTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CListBoxTest instance to the NX server\n"); + message("clistbox_main: Failed to connect the CListBoxTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("clistbox_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("clistbox_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After creating a window"); // Create a listbox - message(MAIN_STRING "Create a ListBox\n"); + message("clistbox_main: Create a ListBox\n"); CListBox *listbox = test->createListBox(); if (!listbox) { - message(MAIN_STRING "Failed to create a listbox\n"); + message("clistbox_main: Failed to create a listbox\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a listbox"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After creating a listbox"); // Show the initial state of the listbox @@ -228,23 +228,23 @@ int MAIN_NAME(int argc, char *argv[]) // Now add items to the list box (in reverse alphabetical order) - message(MAIN_STRING "Add options to the ListBox\n"); + message("clistbox_main: Add options to the ListBox\n"); for (int i = NOPTIONS - 1; i >= 0; i--) { listbox->addOption(g_options[i],i); test->showListBox(listbox); - message(MAIN_STRING "%d. New option %s\n", i, g_options[i]); + message("clistbox_main: %d. New option %s\n", i, g_options[i]); usleep(500000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After adding the listbox items"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After adding the listbox items"); sleep(1); // Sort the list box - message(MAIN_STRING "Sort the ListBox\n"); + message("clistbox_main: Sort the ListBox\n"); listbox->sort(); test->showListBox(listbox); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After sorting the listbox"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After sorting the listbox"); sleep(1); // Select and remove items from the listbox @@ -253,69 +253,69 @@ int MAIN_NAME(int argc, char *argv[]) int nOptions; while ((nOptions = listbox->getOptionCount()) > 0) { - message(MAIN_STRING "Option count: %d\n", nOptions); + message("clistbox_main: Option count: %d\n", nOptions); if (nOptions <= 5) { - message(MAIN_STRING "Selecting all remaining options\n"); + message("clistbox_main: Selecting all remaining options\n"); listbox->selectAllOptions(); test->showListBox(listbox); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting all options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting all options"); sleep(1); - message(MAIN_STRING "Removing all remaining options\n"); + message("clistbox_main: Removing all remaining options\n"); listbox->removeAllOptions(); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing all options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After removing all options"); test->showListBox(listbox); } else { int selected[5]; - message(MAIN_STRING "Selecting five options\n"); + message("clistbox_main: Selecting five options\n"); for (int i = 0; i < 5; i++) { selected[i] = ((nOptions - 1) * rand()) / MAX_RAND; - message(MAIN_STRING "Selecting option %d\n", selected[i]); + message("clistbox_main: Selecting option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting five options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting five options"); - message(MAIN_STRING "De-selecting options\n"); + message("clistbox_main: De-selecting options\n"); int index; int count = 0; while ((index = listbox->getSelectedIndex()) >= 0) { - message(MAIN_STRING "De-selecting option %d\n", index); + message("clistbox_main: De-selecting option %d\n", index); listbox->deselectOption(index); test->showListBox(listbox); count++; usleep(500000); } - message(MAIN_STRING "%s: %d options de-selected\n", + message("clistbox_main: %s: %d options de-selected\n", count == 5 ? "OK" : "ERROR", count); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After de-selecting options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options"); - message(MAIN_STRING "Removing the selected options\n"); + message("clistbox_main: Removing the selected options\n"); for (int i = 0; i < 5; i++) { - message(MAIN_STRING "Removing option %d\n", selected[i]); + message("clistbox_main: Removing option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing five options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After removing five options"); } sleep(1); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After the listbox is empty again"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After the listbox is empty again"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("clistbox_main: Clean-up and exit\n"); delete listbox; updateMemoryUsage(g_mmPrevious, "After deleting the listbox"); delete test; diff --git a/UnitTests/CListBox/clistboxtest.hxx b/UnitTests/CListBox/clistboxtest.hxx index 88e41f3bf..a19a2fabc 100644 --- a/UnitTests/CListBox/clistboxtest.hxx +++ b/UnitTests/CListBox/clistboxtest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clistbox_main -# define MAIN_STRING "clistbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index a1e09ed57..5ee346b52 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cprogressbartest.cxx +CXXSRCS = cprogressbar_main.cxx cprogressbartest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CProgressBar/main.cxx b/UnitTests/CProgressBar/cprogressbar_main.cxx similarity index 82% rename from UnitTests/CProgressBar/main.cxx rename to UnitTests/CProgressBar/cprogressbar_main.cxx index 525c509d3..cb5fa130e 100644 --- a/UnitTests/CProgressBar/main.cxx +++ b/UnitTests/CProgressBar/cprogressbar_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CProgressBar/main.cxx +// NxWidgets/UnitTests/CProgressBar/cprogressbar_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cprogressbar_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cprogressbar_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,43 +143,43 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CProgressBarTest instance\n"); + message("cprogressbar_main: Create CProgressBarTest instance\n"); CProgressBarTest *test = new CProgressBarTest(); updateMemoryUsage(g_mmprevious, "After creating CProgressBarTest"); // Connect the NX server - message(MAIN_STRING "Connect the CProgressBarTest instance to the NX server\n"); + message("cprogressbar_main: Connect the CProgressBarTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CProgressBarTest instance to the NX server\n"); + message("cprogressbar_main: Failed to connect the CProgressBarTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cprogressbar_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cprogressbar_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After creating a window"); // Create a progress bar - message(MAIN_STRING "Create a ProgressBar\n"); + message("cprogressbar_main: Create a ProgressBar\n"); CProgressBar *bar = test->createProgressBar(); if (!bar) { - message(MAIN_STRING "Failed to create a progress bar\n"); + message("cprogressbar_main: Failed to create a progress bar\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a progress bar"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After creating a progress bar"); // Set the progress bar minimum and maximum values @@ -187,7 +187,7 @@ int MAIN_NAME(int argc, char *argv[]) bar->setMaximumValue(MAX_PROGRESSBAR); bar->setValue(0); bar->hidePercentageText(); - message(MAIN_STRING "ProgressBar range %d->%d Initial value %d\n", + message("cprogressbar_main: ProgressBar range %d->%d Initial value %d\n", bar->getMinimumValue(), bar->getMaximumValue(), bar->getValue()); @@ -202,10 +202,10 @@ int MAIN_NAME(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #1"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #1"); usleep(500*1000); // Now move the progress bar up from 0 to 100% (with percentages off) @@ -219,15 +219,15 @@ int MAIN_NAME(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #2"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #2"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cprogressbar_main: Clean-up and exit\n"); delete bar; updateMemoryUsage(g_mmprevious, "After deleting the progress bar"); delete test; diff --git a/UnitTests/CProgressBar/cprogressbartest.hxx b/UnitTests/CProgressBar/cprogressbartest.hxx index 99312cf8f..a7a4238e7 100644 --- a/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/UnitTests/CProgressBar/cprogressbartest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cprogressbar_main -# define MAIN_STRING "cprogressbar_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index f861326e9..57190e8d3 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cradiobuttontest.cxx +CXXSRCS = cradiobutton_main.cxx cradiobuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CRadioButton/main.cxx b/UnitTests/CRadioButton/cradiobutton_main.cxx similarity index 82% rename from UnitTests/CRadioButton/main.cxx rename to UnitTests/CRadioButton/cradiobutton_main.cxx index d53cd4a09..0ec1ca196 100644 --- a/UnitTests/CRadioButton/main.cxx +++ b/UnitTests/CRadioButton/cradiobutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CRadioButton/main.cxx +// NxWidgets/UnitTests/CRadioButton/cradiobutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cradiobutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cradiobutton_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,60 +143,60 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the radio button test - message(MAIN_STRING "Create CRadioButtonTest instance\n"); + message("cradiobutton_main: Create CRadioButtonTest instance\n"); CRadioButtonTest *test = new CRadioButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CRadioButtonTest"); // Connect the NX server - message(MAIN_STRING "Connect the CRadioButtonTest instance to the NX server\n"); + message("cradiobutton_main: Connect the CRadioButtonTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CRadioButtonTest instance to the NX server\n"); + message("cradiobutton_main: Failed to connect the CRadioButtonTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cradiobutton_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cradiobutton_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating a window"); // Create three radio buttons CRadioButton *button1 = test->newRadioButton(); if (!button1) { - message(MAIN_STRING "Failed to create radio button 1\n"); + message("cradiobutton_main: Failed to create radio button 1\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 1"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 1"); CRadioButton *button2 = test->newRadioButton(); if (!button2) { - message(MAIN_STRING "Failed to create radio button 2\n"); + message("cradiobutton_main: Failed to create radio button 2\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 2"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 2"); CRadioButton *button3 = test->newRadioButton(); if (!button3) { - message(MAIN_STRING "Failed to create radio button 3\n"); + message("cradiobutton_main: Failed to create radio button 3\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 3"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 3"); // Show the initial state of the buttons @@ -206,21 +206,21 @@ int MAIN_NAME(int argc, char *argv[]) // Now push some buttons - message(MAIN_STRING "Pushing button 1\n"); + message("cradiobutton_main: Pushing button 1\n"); test->pushButton(button1); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 1"); usleep(500*1000); - message(MAIN_STRING "Pushing button 2\n"); + message("cradiobutton_main: Pushing button 2\n"); test->pushButton(button2); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 2"); usleep(500*1000); - message(MAIN_STRING "Pushing button 3\n"); + message("cradiobutton_main: Pushing button 3\n"); test->pushButton(button3); usleep(500*1000); test->showButtonState(); @@ -229,7 +229,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cradiobutton_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); diff --git a/UnitTests/CRadioButton/cradiobuttontest.hxx b/UnitTests/CRadioButton/cradiobuttontest.hxx index 00cded78c..540d5019b 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -70,16 +70,6 @@ # define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cradiobutton_main -# define MAIN_STRING "cradiobutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index a6abb461b..191324a96 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cscrollbarhorizontaltest.cxx +CXXSRCS = cscrollbarhorizontal_main.cxx cscrollbarhorizontaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index fac165033..774225091 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cscrollbarhorizontal_main -# define MAIN_STRING "cscrollbarhorizontal_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index ad7ae2a38..a2777e752 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cscrollbarverticaltest.cxx +CXXSRCS = cscrollbarvertical_main.cxx cscrollbarverticaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CScrollbarVertical/main.cxx b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx similarity index 80% rename from UnitTests/CScrollbarVertical/main.cxx rename to UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx index 16bd9eea6..26dc70dbd 100644 --- a/UnitTests/CScrollbarVertical/main.cxx +++ b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CScrollbarVertical/main.cxx +// NxWidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cscrollbarvertical_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cscrollbarvertical_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CScrollbarVerticalTest instance\n"); + message("cscrollbarvertical_main: Create CScrollbarVerticalTest instance\n"); CScrollbarVerticalTest *test = new CScrollbarVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CScrollbarVerticalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CScrollbarVerticalTest instance to the NX server\n"); + message("cscrollbarvertical_main: Connect the CScrollbarVerticalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); + message("cscrollbarvertical_main: Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cscrollbarvertical_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cscrollbarvertical_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After creating a window"); // Create a scrollbar - message(MAIN_STRING "Create a Scrollbar\n"); + message("cscrollbarvertical_main: Create a Scrollbar\n"); CScrollbarVertical *scrollbar = test->createScrollbar(); if (!scrollbar) { - message(MAIN_STRING "Failed to create a scrollbar\n"); + message("cscrollbarvertical_main: Failed to create a scrollbar\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a scrollbar"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After creating a scrollbar"); // Set the scrollbar minimum and maximum values scrollbar->setMinimumValue(0); scrollbar->setMaximumValue(MAX_SCROLLBAR); scrollbar->setValue(0); - message(MAIN_STRING "Scrollbar range %d->%d Initial value %d\n", + message("cscrollbarvertical_main: Scrollbar range %d->%d Initial value %d\n", scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), scrollbar->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar up"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar up"); // And move the scrollbar down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(5000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar down"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cscrollbarvertical_main: Clean-up and exit\n"); delete scrollbar; updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); delete test; diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index e6005ced9..8b9fb1ee8 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cscrollbarvertical_main -# define MAIN_STRING "cscrollbarvertical_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 0a86aaf5f..0578510d3 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx csliderhorizontaltest.cxx +CXXSRCS = csliderhorizontal_main.cxx csliderhorizontaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CSliderHorizonal/main.cxx b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx similarity index 81% rename from UnitTests/CSliderHorizonal/main.cxx rename to UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx index b99d1c547..a336ba94a 100644 --- a/UnitTests/CSliderHorizonal/main.cxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CSliderHorizontal/main.cxx +// NxWidgets/UnitTests/CSliderHorizontal/csliderhorizontal_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int csliderhorizontal_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int csliderhorizontal_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CSliderHorizontalTest instance\n"); + message("csliderhorizontal_main: Create CSliderHorizontalTest instance\n"); CSliderHorizontalTest *test = new CSliderHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderHorizontalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CSliderHorizontalTest instance to the NX server\n"); + message("csliderhorizontal_main: Connect the CSliderHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CSliderHorizontalTest instance to the NX server\n"); + message("csliderhorizontal_main: Failed to connect the CSliderHorizontalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("csliderhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("csliderhorizontal_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a window"); // Create a slider - message(MAIN_STRING "Create a Slider\n"); + message("csliderhorizontal_main: Create a Slider\n"); CSliderHorizontal *slider = test->createSlider(); if (!slider) { - message(MAIN_STRING "Failed to create a slider\n"); + message("csliderhorizontal_main: Failed to create a slider\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a slider"); // Set the slider minimum and maximum values slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + message("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", slider->getMinimumValue(), slider->getMaximumValue(), slider->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider up"); // And move the slider down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("csliderhorizontal_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index 99d6f739e..9709a2b7c 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME csliderhorizontal_main -# define MAIN_STRING "csliderhorizontal_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 76fd0da57..f37cc8619 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx csliderverticaltest.cxx +CXXSRCS = cslidervertical_main.cxx csliderverticaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CSliderVertical/main.cxx b/UnitTests/CSliderVertical/cslidervertical_main.cxx similarity index 81% rename from UnitTests/CSliderVertical/main.cxx rename to UnitTests/CSliderVertical/cslidervertical_main.cxx index f5a53f018..df356718b 100644 --- a/UnitTests/CSliderVertical/main.cxx +++ b/UnitTests/CSliderVertical/cslidervertical_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CSliderVertical/main.cxx +// NxWidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cslidervertical_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cslidervertical_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CSliderVerticalTest instance\n"); + message("cslidervertical_main: Create CSliderVerticalTest instance\n"); CSliderVerticalTest *test = new CSliderVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderVerticalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CSliderVerticalTest instance to the NX server\n"); + message("cslidervertical_main: Connect the CSliderVerticalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CSliderVerticalTest instance to the NX server\n"); + message("cslidervertical_main: Failed to connect the CSliderVerticalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cslidervertical_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cslidervertical_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After creating a window"); // Create a slider - message(MAIN_STRING "Create a Slider\n"); + message("cslidervertical_main: Create a Slider\n"); CSliderVertical *slider = test->createSlider(); if (!slider) { - message(MAIN_STRING "Failed to create a slider\n"); + message("cslidervertical_main: Failed to create a slider\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After creating a slider"); // Set the slider minimum and maximum values slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + message("cslidervertical_main: Slider range %d->%d Initial value %d\n", slider->getMinimumValue(), slider->getMaximumValue(), slider->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider up"); // And move the slider down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cslidervertical_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/UnitTests/CSliderVertical/csliderverticaltest.hxx b/UnitTests/CSliderVertical/csliderverticaltest.hxx index a0d3df801..3bb174ba0 100644 --- a/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cslidervertical_main -# define MAIN_STRING "cslidervertical_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index bd7d98491..c368cc497 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ctextboxtest.cxx +CXXSRCS = ctextbox_main.cxx ctextboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/CTextBox/main.cxx b/UnitTests/CTextBox/ctextbox_main.cxx similarity index 87% rename from UnitTests/CTextBox/main.cxx rename to UnitTests/CTextBox/ctextbox_main.cxx index b5b8ec4d5..da76c88cf 100644 --- a/UnitTests/CTextBox/main.cxx +++ b/UnitTests/CTextBox/ctextbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CTextBox/main.cxx +// NxWidgets/UnitTests/CTextBox/ctextbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -69,7 +69,7 @@ static const char string2[] = "\b\b\bn Doe\r"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ctextbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -79,29 +79,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ctextbox_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CTextBoxTest instance\n"); + printf("ctextbox_main: Create CTextBoxTest instance\n"); CTextBoxTest *test = new CTextBoxTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CTextBoxTest instance to the NX server\n"); + printf("ctextbox_main: Connect the CTextBoxTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CTextBoxTest instance to the NX server\n"); + printf("ctextbox_main: Failed to connect the CTextBoxTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("ctextbox_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("ctextbox_main: Failed to create a window\n"); delete test; return 1; } @@ -111,7 +111,7 @@ int MAIN_NAME(int argc, char *argv[]) CTextBox *textbox = test->createTextBox(); if (!textbox) { - printf(MAIN_STRING "Failed to create a text box\n"); + printf("ctextbox_main: Failed to create a text box\n"); delete test; return 1; } @@ -133,7 +133,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit sleep(2); - printf(MAIN_STRING "Clean-up and exit\n"); + printf("ctextbox_main: Clean-up and exit\n"); delete textbox; delete test; return 0; diff --git a/UnitTests/CTextBox/ctextboxtest.hxx b/UnitTests/CTextBox/ctextboxtest.hxx index 1d470a1a8..9da8ce09f 100644 --- a/UnitTests/CTextBox/ctextboxtest.hxx +++ b/UnitTests/CTextBox/ctextboxtest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CTEXTBOXTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ctextbox_main -# define MAIN_STRING "ctextbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 9648ad807..11c670ece 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -77,7 +77,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx +CXXSRCS = nxwm_main.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/UnitTests/nxwm/main.cxx b/UnitTests/nxwm/nxwm_main.cxx similarity index 93% rename from UnitTests/nxwm/main.cxx rename to UnitTests/nxwm/nxwm_main.cxx index f61252904..eefc44494 100644 --- a/UnitTests/nxwm/main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/nxwm/main.cxx +// NxWidgets/UnitTests/nxwm/nxwm_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -62,16 +62,6 @@ // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME nxwm_main -# define MAIN_STRING "nxwm_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - #ifdef CONFIG_HAVE_FILENAME # define showTestStepMemory(msg) \ _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) @@ -121,7 +111,7 @@ static struct SNxWmTest g_nxwmtest; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int nxwm_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -503,7 +493,7 @@ static bool createCalibration(void) printf("createCalibration: Start the calibration application\n"); if (!g_nxwmtest.taskbar->startApplication(calibration, false)) { - printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); + printf("createCalibration ERROR: Failed to start the calibration application\n"); delete calibration; return false; } @@ -599,7 +589,7 @@ void showTestStepMemory(FAR const char *msg) // user_start/nxwm_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int nxwm_main(int argc, char *argv[]) { // Call all C++ static constructors @@ -613,19 +603,19 @@ int MAIN_NAME(int argc, char *argv[]) // Initialize the NSH library - printf(MAIN_STRING "Initialize the NSH library\n"); + printf("nxwm_main: Initialize the NSH library\n"); if (!NxWM::nshlibInitialize()) { - printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); + printf("nxwm_main: ERROR: Failed to initialize the NSH library\n"); return EXIT_FAILURE; } - showTestCaseMemory(MAIN_STRING "After initializing the NSH library"); + showTestCaseMemory("nxwm_main: After initializing the NSH library"); // Create the task bar. if (!createTaskbar()) { - printf(MAIN_STRING "ERROR: Failed to create the task bar\n"); + printf("nxwm_main: ERROR: Failed to create the task bar\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -633,7 +623,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createStartWindow()) { - printf(MAIN_STRING "ERROR: Failed to create the start window\n"); + printf("nxwm_main: ERROR: Failed to create the start window\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -642,7 +632,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_KEYBOARD if (!createKeyboard()) { - printf(MAIN_STRING "ERROR: Failed to create the keyboard\n"); + printf("nxwm_main: ERROR: Failed to create the keyboard\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -652,7 +642,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN if (!createTouchScreen()) { - printf(MAIN_STRING "ERROR: Failed to create the touchscreen\n"); + printf("nxwm_main ERROR: Failed to create the touchscreen\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -662,7 +652,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN if (!createCalibration()) { - printf(MAIN_STRING "ERROR: Failed to create the calibration application\n"); + printf("nxwm_main ERROR: Failed to create the calibration application\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -671,7 +661,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createNxConsole()) { - printf(MAIN_STRING "ERROR: Failed to create the NxConsole application\n"); + printf("nxwm_main: ERROR: Failed to create the NxConsole application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -679,7 +669,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createHexCalculator()) { - printf(MAIN_STRING "ERROR: Failed to create the hex calculator application\n"); + printf("nxwm_main: ERROR: Failed to create the hex calculator application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -687,7 +677,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!startWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + printf("nxwm_main: ERROR: Failed to start the window manager\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -697,7 +687,7 @@ int MAIN_NAME(int argc, char *argv[]) // to know whenthe touchscreen has been calibrated. If we really want to know, // we have to poll - printf(MAIN_STRING "Waiting for touchscreen calibration\n"); + printf("nxwm_main: Waiting for touchscreen calibration\n"); while (!g_nxwmtest.touchscreen->isCalibrated()) { std::sleep(2); @@ -708,10 +698,10 @@ int MAIN_NAME(int argc, char *argv[]) // After the touchscreen driver gets it, it will report isCalibrated() == true // and then we can read the calibration data from the touchscreen driver. - printf(MAIN_STRING "Getting calibration data from the touchscreen\n"); + printf("nxwm_main: Getting calibration data from the touchscreen\n"); if (!g_nxwmtest.touchscreen->getCalibrationData(g_nxwmtest.calibData)) { - printf(MAIN_STRING "ERROR: Failed to get calibration data from the touchscreen\n"); + printf("nxwm_main: ERROR: Failed to get calibration data from the touchscreen\n"); } #endif @@ -723,7 +713,7 @@ int MAIN_NAME(int argc, char *argv[]) g_nxwmtest.taskbar->clickIcon(0, true); usleep(500*1000); g_nxwmtest.taskbar->clickIcon(0, false); - showTestCaseMemory(MAIN_STRING "After clicking the start window icon"); + showTestCaseMemory("nxwm_main: After clicking the start window icon"); // Wait bit to see the result of the button press. Then press the first icon // in the start menu. That should be the NxConsole icon. @@ -732,13 +722,13 @@ int MAIN_NAME(int argc, char *argv[]) g_nxwmtest.startwindow->clickIcon(0, true); usleep(500*1000); g_nxwmtest.startwindow->clickIcon(0, false); - showTestCaseMemory(MAIN_STRING "After clicking the NxConsole icon"); + showTestCaseMemory("nxwm_main: After clicking the NxConsole icon"); #endif // Wait bit to see the result of the button press. sleep(2); - showTestMemory(MAIN_STRING "Final memory usage"); + showTestMemory("nxwm_main: Final memory usage"); return EXIT_SUCCESS; } From 58308eb22aea441848525e39bfb2b9104255c964 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 14 Sep 2012 18:14:40 +0000 Subject: [PATCH 083/390] Missed one file in last checking; Gran allocator alignment decoupled from granule size git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5152 42af7a65-404d-4744-a932-0658087f49c3 --- ...main.cxx => cscrollbarhorizontal_main.cxx} | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) rename UnitTests/CScrollbarHorizontal/{main.cxx => cscrollbarhorizontal_main.cxx} (80%) diff --git a/UnitTests/CScrollbarHorizontal/main.cxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx similarity index 80% rename from UnitTests/CScrollbarHorizontal/main.cxx rename to UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx index a6a08cdbd..2b9adab11 100644 --- a/UnitTests/CScrollbarHorizontal/main.cxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CScrollbarHorizontal/main.cxx +// NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cscrollbarhorizontal_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cscrollbarhorizontal_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CScrollbarHorizontalTest instance\n"); + message("cscrollbarhorizontal_main: Create CScrollbarHorizontalTest instance\n"); CScrollbarHorizontalTest *test = new CScrollbarHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CScrollbarHorizontalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CScrollbarHorizontalTest instance to the NX server\n"); + message("cscrollbarhorizontal_main: Connect the CScrollbarHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CScrollbarHorizontalTest instance to the NX server\n"); + message("cscrollbarhorizontal_main: Failed to connect the CScrollbarHorizontalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cscrollbarhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cscrollbarhorizontal_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After creating a window"); // Create a scrollbar - message(MAIN_STRING "Create a Scrollbar\n"); + message("cscrollbarhorizontal_main: Create a Scrollbar\n"); CScrollbarHorizontal *scrollbar = test->createScrollbar(); if (!scrollbar) { - message(MAIN_STRING "Failed to create a scrollbar\n"); + message("cscrollbarhorizontal_main: Failed to create a scrollbar\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a scrollbar"); + updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After creating a scrollbar"); // Set the scrollbar minimum and maximum values scrollbar->setMinimumValue(0); scrollbar->setMaximumValue(MAX_SCROLLBAR); scrollbar->setValue(0); - message(MAIN_STRING "Scrollbar range %d->%d Initial value %d\n", + message("cscrollbarhorizontal_main: Scrollbar range %d->%d Initial value %d\n", scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), scrollbar->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar up"); + updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After moving the scrollbar up"); // And move the scrollbar down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar down"); + updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After moving the scrollbar down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cscrollbarhorizontal_main: Clean-up and exit\n"); delete scrollbar; updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); delete test; From 451a817700c4feaecf6b3d03168d1d0405425ddd Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 17 Sep 2012 18:43:00 +0000 Subject: [PATCH 084/390] Resync new repository with old repo r5166 git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5155 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/cbutton_main.cxx | 2 +- UnitTests/CButtonArray/cbuttonarray_main.cxx | 2 +- UnitTests/CCheckBox/ccheckbox_main.cxx | 2 +- UnitTests/CGlyphButton/cglyphbutton_main.cxx | 2 +- UnitTests/CImage/cimage_main.cxx | 2 +- UnitTests/CKeypad/ckeypad_main.cxx | 2 +- UnitTests/CLabel/clabel_main.cxx | 2 +- UnitTests/CLatchButton/clatchbutton_main.cxx | 2 +- .../clatchbuttonarray_main.cxx | 2 +- UnitTests/CListBox/clistbox_main.cxx | 2 +- UnitTests/CProgressBar/cprogressbar_main.cxx | 2 +- UnitTests/CRadioButton/cradiobutton_main.cxx | 2 +- .../cscrollbarhorizontal_main.cxx | 2 +- .../cscrollbarvertical_main.cxx | 2 +- .../csliderhorizontal_main.cxx | 2 +- .../CSliderVertical/cslidervertical_main.cxx | 2 +- UnitTests/CTextBox/ctextbox_main.cxx | 2 +- UnitTests/README.txt | 30 ++++++++++++++++--- UnitTests/nxwm/nxwm_main.cxx | 2 +- 19 files changed, 44 insertions(+), 22 deletions(-) diff --git a/UnitTests/CButton/cbutton_main.cxx b/UnitTests/CButton/cbutton_main.cxx index 973a2cd8a..9418fb0f6 100644 --- a/UnitTests/CButton/cbutton_main.cxx +++ b/UnitTests/CButton/cbutton_main.cxx @@ -75,7 +75,7 @@ extern "C" int cbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cbutton_main(int argc, char *argv[]) diff --git a/UnitTests/CButtonArray/cbuttonarray_main.cxx b/UnitTests/CButtonArray/cbuttonarray_main.cxx index c247d73e5..824ae22c4 100644 --- a/UnitTests/CButtonArray/cbuttonarray_main.cxx +++ b/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -193,7 +193,7 @@ static void checkHighlighting(CButtonArray *buttonArray) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cbuttonarray_main(int argc, char *argv[]) diff --git a/UnitTests/CCheckBox/ccheckbox_main.cxx b/UnitTests/CCheckBox/ccheckbox_main.cxx index 949cbc35f..e2c4bc148 100644 --- a/UnitTests/CCheckBox/ccheckbox_main.cxx +++ b/UnitTests/CCheckBox/ccheckbox_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int ccheckbox_main(int argc, char *argv[]) diff --git a/UnitTests/CGlyphButton/cglyphbutton_main.cxx b/UnitTests/CGlyphButton/cglyphbutton_main.cxx index 95e255dcc..9cf8a73f5 100644 --- a/UnitTests/CGlyphButton/cglyphbutton_main.cxx +++ b/UnitTests/CGlyphButton/cglyphbutton_main.cxx @@ -131,7 +131,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cglyphbutton_main(int argc, char *argv[]) diff --git a/UnitTests/CImage/cimage_main.cxx b/UnitTests/CImage/cimage_main.cxx index 30cf49d3e..bca730202 100644 --- a/UnitTests/CImage/cimage_main.cxx +++ b/UnitTests/CImage/cimage_main.cxx @@ -146,7 +146,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cimage_main(int argc, char *argv[]) diff --git a/UnitTests/CKeypad/ckeypad_main.cxx b/UnitTests/CKeypad/ckeypad_main.cxx index 896ef5013..0b246683a 100644 --- a/UnitTests/CKeypad/ckeypad_main.cxx +++ b/UnitTests/CKeypad/ckeypad_main.cxx @@ -189,7 +189,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int ckeypad_main(int argc, char *argv[]) diff --git a/UnitTests/CLabel/clabel_main.cxx b/UnitTests/CLabel/clabel_main.cxx index 2b800dcab..e80b24476 100644 --- a/UnitTests/CLabel/clabel_main.cxx +++ b/UnitTests/CLabel/clabel_main.cxx @@ -75,7 +75,7 @@ extern "C" int clabel_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int clabel_main(int argc, char *argv[]) diff --git a/UnitTests/CLatchButton/clatchbutton_main.cxx b/UnitTests/CLatchButton/clatchbutton_main.cxx index 13ed0613e..c8f8424d6 100644 --- a/UnitTests/CLatchButton/clatchbutton_main.cxx +++ b/UnitTests/CLatchButton/clatchbutton_main.cxx @@ -103,7 +103,7 @@ static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int clatchbutton_main(int argc, char *argv[]) diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index ad7646560..7ffb9cadc 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -171,7 +171,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int clatchbuttonarray_main(int argc, char *argv[]) diff --git a/UnitTests/CListBox/clistbox_main.cxx b/UnitTests/CListBox/clistbox_main.cxx index 8711f06e8..e97bb8b50 100644 --- a/UnitTests/CListBox/clistbox_main.cxx +++ b/UnitTests/CListBox/clistbox_main.cxx @@ -171,7 +171,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int clistbox_main(int argc, char *argv[]) diff --git a/UnitTests/CProgressBar/cprogressbar_main.cxx b/UnitTests/CProgressBar/cprogressbar_main.cxx index cb5fa130e..4343d887c 100644 --- a/UnitTests/CProgressBar/cprogressbar_main.cxx +++ b/UnitTests/CProgressBar/cprogressbar_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cprogressbar_main(int argc, char *argv[]) diff --git a/UnitTests/CRadioButton/cradiobutton_main.cxx b/UnitTests/CRadioButton/cradiobutton_main.cxx index 0ec1ca196..f2dc30844 100644 --- a/UnitTests/CRadioButton/cradiobutton_main.cxx +++ b/UnitTests/CRadioButton/cradiobutton_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cradiobutton_main(int argc, char *argv[]) diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx index 2b9adab11..f9c322299 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cscrollbarhorizontal_main(int argc, char *argv[]) diff --git a/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx index 26dc70dbd..2bcb3f0d1 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx +++ b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cscrollbarvertical_main(int argc, char *argv[]) diff --git a/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx index a336ba94a..fc57ab98c 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int csliderhorizontal_main(int argc, char *argv[]) diff --git a/UnitTests/CSliderVertical/cslidervertical_main.cxx b/UnitTests/CSliderVertical/cslidervertical_main.cxx index df356718b..cc106cbf0 100644 --- a/UnitTests/CSliderVertical/cslidervertical_main.cxx +++ b/UnitTests/CSliderVertical/cslidervertical_main.cxx @@ -132,7 +132,7 @@ static void initMemoryUsage(void) ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Name: user_start/nxheaders_main +// Name: nxheaders_main ///////////////////////////////////////////////////////////////////////////// int cslidervertical_main(int argc, char *argv[]) diff --git a/UnitTests/CTextBox/ctextbox_main.cxx b/UnitTests/CTextBox/ctextbox_main.cxx index da76c88cf..c4f8c65b8 100644 --- a/UnitTests/CTextBox/ctextbox_main.cxx +++ b/UnitTests/CTextBox/ctextbox_main.cxx @@ -76,7 +76,7 @@ extern "C" int ctextbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// user_start/nxheaders_main +// nxheaders_main ///////////////////////////////////////////////////////////////////////////// int ctextbox_main(int argc, char *argv[]) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index cc01c3855..9952af012 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -74,7 +74,7 @@ Installing and Building the Unit Tests writing *ONLY* the sim/nsh2 and stm321-e-eval configurations have C++ support pre-enabled). - c) Enable Debug Options + d) Enable Debug Options If you are running on a simulated target, then you might also want to enable debug symbols: @@ -84,12 +84,12 @@ Installing and Building the Unit Tests Then you can run the simulation using GDB or DDD which is a very powerful debugging environment! - d) Special configuration requirements for the nxwm unit test: + e) Special configuration requirements for the nxwm unit test: CONFIG_NXCONSOLE=y CONFIG_NX_MULTIUSER=y - e) Other nuttx/.config changes -- NSH configurations only. + f) Other nuttx/.config changes -- NSH configurations only. If the configuration that you are using supports NSH and NSH built-in tasks then all is well. If it is an NSH configuration, then you will have to define @@ -101,7 +101,26 @@ Installing and Building the Unit Tests to change anything further in the nuttx/.config file if you are using either of these configurations. - f) Other apps/.config changes -- NON-NSH configurations only. + g) Other apps/.config changes -- NON-NSH configurations only. + + Entry Point. You will need to set the entry point in the .config file. + For NSH configurations, the entry point will always be "nsh_main" and you + will see that setting like: + + CONFIG_USER_ENTRYPOINT="nsh_main" + + If you are not using in NSH, then each unit test has a unique entry point. + That entry point is the name of the unit test directory in all lower case + plus the suffix "_main". So, for example, the correct entry for the + UnitTests/CButton would be: + + CONFIG_USER_ENTRYPOINT="cbutton_main" + + And the correct entry point for UnitTests/nxwm would be: + + CONFIG_USER_ENTRYPOINT="nxwm_main" + + etc. For non-NSH configurations (such as the sim/touchscreen) you will have to remove the CONFIGURED_APPS seting that contains the user_start function so @@ -306,6 +325,9 @@ Example Do nothing... sim/nsh2 already has C++ support enabled. + Since this is an NSH configuration, the entry point does not need to be + changed. + 3. Install the CButton C++ application (for example) Where: /tool diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index eefc44494..fa05d52e4 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -586,7 +586,7 @@ void showTestStepMemory(FAR const char *msg) #endif ///////////////////////////////////////////////////////////////////////////// -// user_start/nxwm_main +// nxwm_main ///////////////////////////////////////////////////////////////////////////// int nxwm_main(int argc, char *argv[]) From 5bd084b192fa2e8ca6ce38cbcb6a1ef007d2f538 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 25 Sep 2012 21:15:02 +0000 Subject: [PATCH 085/390] Add more LCD-related Kconfig logic; Create a Kconfig file for NxWidgets git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5189 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 + Kconfig | 569 ++++++++++++++++++++++++++++++ libnxwidgets/include/nxconfig.hxx | 2 +- nxwm/include/nxwmconfig.hxx | 12 +- 4 files changed, 579 insertions(+), 7 deletions(-) create mode 100644 Kconfig diff --git a/ChangeLog.txt b/ChangeLog.txt index cdd26cb89..e0a4c9b2e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -163,3 +163,6 @@ * UnitTests/*/main.cxx: Change entry point name to be consistent with with entry point naming conventions introduced in NuttX 6.22. +* Kconfig: Added a mconfig configuration file. Eventually, NxWidgets + needs to get hooked into the NuttX mconf configuration. Still not + exactly sure how to do that. diff --git a/Kconfig b/Kconfig new file mode 100644 index 000000000..c89b4936f --- /dev/null +++ b/Kconfig @@ -0,0 +1,569 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + +menuconfig NxWIDGETS + bool "Enable NxWidgets" + default n + depends on NX && HAVE_CXX + ---help--- + Enable support for NxWidgets + +if NxWIDGETS +comment "NX Server/Device Configuration" + +config NXWIDGETS_DEVNO + int "LCD Device Number" + default 0 + ---help--- + LCD device number (in case there are more than one LCDs connected). + Default: 0 + +config NXWIDGETS_VPLANE + int "Plane Number" + default 0 + ---help--- + Only a single video plane is supported. Default: 0 + +config NXWIDGETS_SERVERPRIO + int "NX Server priority" + default 51 + ---help--- + Priority of the NX server. This applies only if NX is configured in + multi-user mode (NX_MULTIUSER=y). Default: 51. + + NOTE: Of the three priority definitions here, NXWIDGETS_SERVERPRIO + should have the highest priority to avoid data overrun race conditions. + Such errors would most likely appear as duplicated rows of data on the + display. + +config NXWIDGETS_SERVERSTACK + int "NX Server Stack Size" + default 2048 + ---help--- + NX server thread stack size (in multi-user mode). Default 2048 + +config NXWIDGETS_CLIENTPRIO + int "NX Client Priority" + default 50 + ---help--- + The thread that calls CNxServer::connect() will be re-prioritized to + this priority. This applies only if NX is configured in multi-user + mode (NX_MULTIUSER=y). Default: 50 + +config NXWIDGETS_LISTENERPRIO + int "NX Listener Priority" + default 50 + ---help--- + Priority of the NX event listener thread. This applies only if NX + is configured in multi-user mode (NX_MULTIUSER=y). Default: 50 + +config NXWIDGETS_LISTENERSTACK + int "NX Listener Stack Size" + default 2048 + ---help--- + NX listener thread stack size (in multi-user mode). Default 2048 + +config NXWIDGETS_EXTERNINIT + bool "Extern LCD Initialization" + ---help--- + Define to support external display initialization. + +config NXWIDGET_EVENTWAIT + bool "Event Waiting" + default n + ---help--- + Build in support for external window event, modal loop management + logic. This includes methods to wait for windows events to occur + so that looping logic can sleep until something interesting happens + with the window. + +comment "NXWidget Configuration" + +config NXWIDGETS_BPP + int "BPP" + ---help--- + Supported bits-per-pixel {8, 16, 24, 32}. Default: The smallest + BPP configuration supported by NX. + +config NXWIDGETS_SIZEOFCHAR + int "Size of a character (1 or 2 bytes) + range 1 2 + ---help--- + Size of character {1 or 2 bytes}. Default Determined by + NXWIDGETS_SIZEOFCHAR + +comment "NXWidget Default Values" + +config NXWIDGETS_DEFAULT_FONTID + int "Default Font ID" + ---help--- + Default font ID. Default: NXFONT_DEFAULT + +config NXWIDGETS_TNXARRAY_INITIALSIZE + int "Initial Size of Dynamic Arrays" + default 16 + ---help--- + Default dynamic array size (in entries). Default: 16 + +config NXWIDGETS_TNXARRAY_SIZEINCREMENT + int "Dyanamic Array Reallocation Size Increment" + default 8 + ---help--- + Default dynamic array realloctino increment (in entries). Default: 8 + +config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR + hex "Normal Background Color" + ---help--- + Normal background color. Default: RGB(160,160,160) + +config NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR + hex "Selected Background Color" + ---help--- + Default selected background color. Default: RGB(120,192,192) + +config NXWIDGETS_DEFAULT_SHINEEDGECOLOR + hex "Shiny Edge Color" + ---help--- + Shiny side boarder color. Default: RGB(248,248,248) + +config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR + hex "Shadow Edge Color" + ---help--- + Shadowed side border color. Default: RGB(0,0,0) + +config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR + hex "Highlight Color" + ---help--- + Highlight color. Default: RGB(192,192,192) + +config NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR + hex "Disabled Text Color" + ---help--- + Text color on a disabled widget: Default: RGB(192,192,192) + +config NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR + hex "Enabled Text Color" + ---help--- + Text color on a enabled widget. Default: RGB(248,248,248) + +config NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR + hex "Selected Text Color" + ---help--- + Text color on a selected widget. Default: RGB(0,0,0) + +config NXWIDGETS_DEFAULT_FONTCOLOR + hex "Default Font Color" + ---help--- + Default font color. Default: RGB(255,255,255) + +config NXWIDGETS_TRANSPARENT_COLOR + hex "Transparent Color" + ---help--- + Transparent color. Default: RGB(0,0,0) + +comment "Keypad behavior" + +config NXWIDGETS_FIRST_REPEAT_TIME + int "First Repeat Time" + default 500 + ---help--- + Time taken before a key starts repeating (in milliseconds). Default: 500 + +config NXWIDGETS_CONTINUE_REPEAT_TIME + int "Continue Repeat Time" + default 200 + ---help--- + Time taken before a repeating key repeats again (in milliseconds). + Default: 200 + +config NXWIDGETS_DOUBLECLICK_TIME + int "Double Click Time" + default 350 + ---help--- + Left button release-press time for double click (in milliseconds). + Default: 350 + +config NXWIDGETS_KBDBUFFER_SIZE + int "Keybard Buffer Size" + default 16 + ---help--- + Size of incoming character buffer, i.e., the maximum number of + characters that can be entered between NX polling cycles without + losing data. + +config NXWIDGETS_CURSORCONTROL_SIZE + int "Cursor Control Buffer Size" + default 4 + ---help--- + Size of incoming cursor control buffer, i.e., the maximum number + of cursor controls that can between entered by NX polling cycles + without losing data. Default: 4 + +endif + +menuconfig NxWM + bool "Enable NxWM" + default n + depends on NxWIDGETS && NX_MULTIUSER + ---help--- + Enable support for the NuttX Tiny Window Manager (NxWM) + +if NxWM +comment "General settings" + +config NXWM_DEFAULT_FONTID + int "Font ID" + ---help--- + The NxWM default font ID. Default: NXFONT_DEFAULT + +comment "Color configuration" + +config NXWM_DEFAULT_BACKGROUNDCOLOR + hex "Background Color" + ---help--- + Normal background color. Default: RGB(148,189,215) + +config NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR + hex "Normal Background Color" + ---help--- + Select background color. Default: RGB(206,227,241) + +config NXWM_DEFAULT_SHINEEDGECOLOR + hex "Shiny Edge Color" + ---help--- + Color of the bright edge of a border. Default: RGB(255,255,255) + +config NXWM_DEFAULT_SHADOWEDGECOLOR + hex "Shadow Edge Color" + ---help--- + Color of the shadowed edge of a border. Default: RGB(0,0,0) + +config NXWM_DEFAULT_FONTCOLOR + hex "Default Font Color" + ---help--- + Default fong color. Default: RGB(0,0,0) + +config NXWM_TRANSPARENT_COLOR + hex "Transparent Color" + ---help--- + The "transparent" color. Default: RGB(0,0,0) + +comment "Horizontal and vertical spacing of icons in the task bar" + +config NXWM_TASKBAR_VSPACING + int "Vertical Spacing" + default 2 + ---help--- + Vertical spacing. Default: 2 pixels + +config NXWM_TASKBAR_HSPACING + int "Horizontal Spacing" + default 2 + ---help--- + Horizontal spacing. Default: 2 rows + +choice NXWM_TASKBAR_LOCATION + prompt "Taskbar Location" + default NXWM_TASKBAR_TOP + +config NXWM_TASKBAR_TOP + bool "Top" + ---help--- + Task bar is at the top of the display + +config NXWM_TASKBAR_BOTTOM + bool "Bottom" + ---help--- + Task bar is at the bottom of the display + +config NXWM_TASKBAR_LEFT + bool "Left" + ---help--- + Task bar is on the left side of the display + +config NXWM_TASKBAR_RIGHT + bool "Right" + ---help--- + Task bar is on the right side of the display + +endchoice + +config NXWM_TASKBAR_WIDTH + int "Taskbar Width" + ---help--- + Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing + +comment "Tool Bar Configuration" + +config NXWM_TOOLBAR_HEIGHT + int "Toolbar Height" + ---help--- + The height of the tool bar in each application window. At present, + all icons are 21 pixels in height and, hence, require a task bar of + at least that size. + +comment "Background Image" + +config NXWM_BACKGROUND_IMAGE + string "Background Image" + ---help--- + The name of the image to use in the background window. Default: + NXWidgets::g_nuttxBitmap + +comment "Start Window Configuration" + +comment "Horizontal and vertical spacing of icons in the task bar" + +config NXWM_STARTWINDOW_VSPACING + int "Vertical Spacing" + default 4 + ---help--- + Vertical spacing. Default: 4 pixels + +config NXWM_STARTWINDOW_HSPACING + int "Horizontal Spacing" + default 4 + ---help--- + Horizontal spacing. Default: 4 rows + +config NXWM_STARTWINDOW_ICON + string "StartWindow Icon" + ---help--- + The glyph to use as the start window icon. Default: NxWM::g_playBitmap + +config NXWM_STARTWINDOW_MQNAME + string "Message Queue Name" + default "/dev/nxwm" + ---help--- + The well known name of the message queue. Used to communicated from + CWindowMessenger to the start window thread. Default: "/dev/nxwm" + +config NXWM_STARTWINDOW_MXMSGS + int "Max Messages" + default 32 + ---help--- + The maximum number of messages to queue before blocking. Defualt 32 + +config NXWM_STARTWINDOW_MXMPRIO + int "Message Priority" + default 42 + ---help--- + The message priority. Default: 42. + +config NXWM_STARTWINDOW_PRIO + int "StartWindow Task Priority" + default 50 + ---help--- + Priority of the StartWindow task. Default: 50. + + NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else + there may be data overrun errors. Such errors would most likely appear + as duplicated rows of data on the display. + +config NXWM_STARTWINDOW_STACKSIZE + int "StartWindow Task Stack Size" + default 2048 + ---help--- + The stack size to use when starting the StartWindow task. Default: + 2048 bytes. + +comment "NxConsole Window Configuration" + +config NXWM_NXCONSOLE_PRIO + int "NxConsole Task Priority" + default 50 + ---help--- + Priority of the NxConsole task. Default: 50. + + NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or + else there may be data overrun errors. Such errors would most likely + appear as duplicated rows of data on the display. + +config NXWM_NXCONSOLE_STACKSIZE + int "NxConsole Task Stack Size" + default 2048 + ---help--- + The stack size to use when starting the NxConsole task. Default: + 2048 bytes. + +config NXWM_NXCONSOLE_WCOLOR + hex "NxConsole Background Color" + ---help--- + The color of the NxConsole window background. Default: + RGB(192,192,192) + +config NXWM_NXCONSOLE_FONTCOLOR + hex "NxConsole Font Color" + ---help--- + The color of the fonts to use in the NxConsole window. + Default: RGB(0,0,0) + +config NXWM_NXCONSOLE_FONTID + int "NxConsole Font ID" + ---help--- + The ID of the font to use in the NxConsole window. Default: + NXWM_DEFAULT_FONTID + +config NXWM_NXCONSOLE_ICON + string "NxConsole Icon" + ---help--- + The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap + +config NXWM_TOUCHSCREEN + bool "Touchscreen Support" + default y if INPUT + default n if !INPUT + ---help--- + Define to build in touchscreen support. + +if NXWM_TOUCHSCREEN +comment "Touchscreen device settings" + +config NXWM_TOUCHSCREEN_DEVNO + int "Touchscreen Device Number" + default 0 + ---help--- + Touchscreen device minor number, i.e., the N in /dev/inputN. + Default: 0 + +config NXWM_TOUCHSCREEN_DEVPATH + string "Touchscreen Device Path" + default "/dev/input0" + ---help--- + The full path to the touchscreen device. Default: "/dev/input0" + +config NXWM_TOUCHSCREEN_SIGNO + int "Touchscreen Signal Number" + default 5 + ---help--- + The realtime signal used to wake up the touchscreen listener + thread. Default: 5 + +config NXWM_TOUCHSCREEN_LISTENERPRIO + int "Touchscreen Listener Task Priority" + default 50 + ---help--- + Priority of the touchscreen listener thread. Default: 50 + +config NXWM_TOUCHSCREEN_LISTENERSTACK + int "Touchscreen Listener Task Stack Size" + ---help--- + Touchscreen listener thread stack size. Default 1024 + +endif + +config NXWM_KEYBOARD + bool "Keyboard Support" + default n + ---help--- + Define to build in touchscreen support. + +if NXWM_KEYBOARD +comment "Keyboard device settings" + +config NXWM_KEYBOARD_DEVPATH + string "Keyboard Device Path" + default "/dev/console" + ---help--- + The full path to the touchscreen device. Default: "/dev/console" + +config NXWM_KEYBOARD_SIGNO + int "Keyboard Task Signal Number" + default 6 + ---help--- + The realtime signal used to wake up the touchscreen listener thread. + Default: 6 + +config NXWM_KEYBOARD_BUFSIZE + int "Keyboard Buffer Size" + default 16 + ---help--- + The size of the keyboard read data buffer. Default: 16 + +config NXWM_KEYBOARD_LISTENERPRIO + int "Keyboard Listener Task Priority" + default 50 + ---help--- + Priority of the touchscreen listener thread. Default: 50 + +config NXWM_KEYBOARD_LISTENERSTACK + int "Keyboard Listener Task Stack Size" + default 2048 + ---help--- + Keyboard listener thread stack size. Default: 1024 + +endif + +comment "Calibration display settings" + +config NXWM_CALIBRATION_BACKGROUNDCOLOR + hex "Background Color" + ---help--- + The background color of the touchscreen calibration display. + Default: Same as NXWM_DEFAULT_BACKGROUNDCOLOR. + +config NXWM_CALIBRATION_LINECOLOR + hex "Line Color" + ---help--- + The color of the lines used in the touchscreen calibration display. + Default: RGB(0, 0, 128) (dark blue) + +config NXWM_CALIBRATION_CIRCLECOLOR + hex "Normal Circle Color" + ---help--- + The color of the circle in the touchscreen calibration display. + Default: RGB(255, 255, 255) (white) + +config NXWM_CALIBRATION_TOUCHEDCOLOR + hex "Touched Circle Color" + ---help--- + The color of the circle in the touchscreen calibration display after + the touch is recorder. Default: RGB(255, 255, 96) (very light yellow) + +config NXWM_CALIBRATION_ICON + string "Callibration Icon" + ---help--- + The ICON to use for the touchscreen calibration application. Default: + NxWM::g_calibrationBitmap + +config NXWM_CALIBRATION_SIGNO + int "Calibration Signal Number" + default 5 + ---help--- + The realtime signal used to wake up the touchscreen calibration + thread. Default: 5 + +config NXWM_CALIBRATION_LISTENERPRIO + int "Calibration Task Priority" + default 50 + ---help--- + Priority of the calibration listener thread. Default: 50 + +config NXWM_CALIBRATION_LISTENERSTACK + int "Calibration Task Stack Size" + default 2048 + ---help--- + Calibration listener thread stack size. Default 2048 + +comment "Calibration display settings" + +config NXWM_HEXCALCULATOR_BACKGROUNDCOLOR + hex "Calculator Background Color" + ---help--- + The background color of the calculator display. Default: Same + as NXWM_DEFAULT_BACKGROUNDCOLOR + +config NXWM_HEXCALCULATOR_ICON + string "Calculator Icon" + ---help--- + The ICON to use for the hex calculator application. Default: + NxWM::g_calculatorBitmap + +config NXWM_HEXCALCULATOR_FONTID + int "Calculator Font ID" + ---help--- + The font used with the calculator. Default: NXWM_DEFAULT_FONTID + +endif diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 699686822..67d359622 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -117,7 +117,7 @@ * Default: MKRGB(192,192,192) * CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR - Text color on a enabled widget: * Default: MKRGB(248,248,248) - * CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - Text color on a selected widget: + * CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR - Text color on a selected widget: * Default: MKRGB(0,0,0) * CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR - Default font color: Default: * MKRGB(255,255,255) diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 578fc5be8..0c43125bb 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -270,13 +270,13 @@ * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue * before blocking. Defualt 32 * CONFIG_NXWM_STARTWINDOW_MXMPRIO - The message priority. Default: 42. - * CONFIG_NXWM_STARTWINDOW_PRIO - Priority of the NxConsole task. Default: + * CONFIG_NXWM_STARTWINDOW_PRIO - Priority of the StartWindoW task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. * Such errors would most likely appear as duplicated rows of data on the * display. * CONFIG_NXWM_STARTWINDOW_STACKSIZE - The stack size to use when starting the - * NxConsole task. Default: 2048 bytes. + * StartWindow task. Default: 2048 bytes. */ #ifndef CONFIG_NXWM_STARTWINDOW_VSPACING @@ -421,7 +421,7 @@ /** * Keyboard device settings * - * CONFIG_NXWM_KEYBOARD_DEVNO - The full path to the touchscreen device. + * CONFIG_NXWM_KEYBOARD_DEVPATH - The full path to the keyboard device. * Default: "/dev/console" * CONFIG_NXWM_KEYBOARD_SIGNO - The realtime signal used to wake up the * touchscreen listener thread. Default: 6 @@ -464,16 +464,16 @@ * touchscreen calibration display. Default: MKRGB(0, 0, 128) (dark blue) * CONFIG_NXWM_CALIBRATION_CIRCLECOLOR - The color of the circle in the * touchscreen calibration display. Default: MKRGB(255, 255, 255) (white) - * CONFIG_NXWM_CALIBRATION_CIRCLECOLOR - The color of the circle in the + * CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR - The color of the circle in the * touchscreen calibration display after the touch is recorder. Default: * MKRGB(255, 255, 96) (very light yellow) * CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen * calibration application. Default: NxWM::g_calibrationBitmap * CONFIG_NXWM_CALIBRATION_SIGNO - The realtime signal used to wake up the * touchscreen calibration thread. Default: 5 - * CONFIG_NXWM_CALIBRATION_LISTENERPRIO - Priority of the touchscreen listener + * CONFIG_NXWM_CALIBRATION_LISTENERPRIO - Priority of the calibration listener * thread. Default: SCHED_PRIORITY_DEFAULT - * CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Touchscreen listener thread stack + * CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Calibration listener thread stack * size. Default 2048 */ From e13dbaa53f5c8af61022f3896c09c78f101bef22 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 25 Sep 2012 22:04:51 +0000 Subject: [PATCH 086/390] Hook in NxWidgets configuration logic; Add a untested ADS7843E touchscreen support for the Shenzhou board; Complete the Shenzhou NxWM configuration (also untested). git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5190 42af7a65-404d-4744-a932-0658087f49c3 --- Kconfig | 24 +++++++++++++++--------- README.txt | 6 ++++++ libnxwidgets/include/nxconfig.hxx | 12 ++++++------ 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Kconfig b/Kconfig index c89b4936f..1d7852507 100644 --- a/Kconfig +++ b/Kconfig @@ -3,14 +3,14 @@ # see misc/tools/kconfig-language.txt. # -menuconfig NxWIDGETS +menuconfig NXWIDGETS bool "Enable NxWidgets" default n depends on NX && HAVE_CXX ---help--- Enable support for NxWidgets -if NxWIDGETS +if NXWIDGETS comment "NX Server/Device Configuration" config NXWIDGETS_DEVNO @@ -88,7 +88,7 @@ config NXWIDGETS_BPP BPP configuration supported by NX. config NXWIDGETS_SIZEOFCHAR - int "Size of a character (1 or 2 bytes) + int "Size of a character (1 or 2 bytes)" range 1 2 ---help--- Size of character {1 or 2 bytes}. Default Determined by @@ -116,12 +116,12 @@ config NXWIDGETS_TNXARRAY_SIZEINCREMENT config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR hex "Normal Background Color" ---help--- - Normal background color. Default: RGB(160,160,160) + Normal background color. Default: RGB(148,189,215) config NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR hex "Selected Background Color" ---help--- - Default selected background color. Default: RGB(120,192,192) + Default selected background color. Default: RGB(206,227,241) config NXWIDGETS_DEFAULT_SHINEEDGECOLOR hex "Shiny Edge Color" @@ -131,7 +131,7 @@ config NXWIDGETS_DEFAULT_SHINEEDGECOLOR config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR hex "Shadow Edge Color" ---help--- - Shadowed side border color. Default: RGB(0,0,0) + Shadowed side border color. Default: RGB(35,58,73) config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR hex "Highlight Color" @@ -203,14 +203,14 @@ config NXWIDGETS_CURSORCONTROL_SIZE endif -menuconfig NxWM +menuconfig NXWM bool "Enable NxWM" default n - depends on NxWIDGETS && NX_MULTIUSER + depends on NXWIDGETS && NX_MULTIUSER ---help--- Enable support for the NuttX Tiny Window Manager (NxWM) -if NxWM +if NXWM comment "General settings" config NXWM_DEFAULT_FONTID @@ -218,6 +218,12 @@ config NXWM_DEFAULT_FONTID ---help--- The NxWM default font ID. Default: NXFONT_DEFAULT +config NXWM_UNITTEST + bool "NxWM Unit Test" + default n + ---help--- + Enable Hooks for the NxWM Unit Test + comment "Color configuration" config NXWM_DEFAULT_BACKGROUNDCOLOR diff --git a/README.txt b/README.txt index 7bb16820c..81f100d3d 100644 --- a/README.txt +++ b/README.txt @@ -53,6 +53,12 @@ license. See the COPYING file for details. Directory Structure =================== +Kconfig + + This is a Kconfig file that should be provided at apps/NxWidgets/Kconfig. + When copied to that location, it will be used by the NuttX configuration + systems to configure settings for NxWidgets and NxWM + libnxwidgets The source code, header files, and build environment for NxWidgets is diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 67d359622..cd51229c2 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -104,13 +104,13 @@ * Default dynamic array parameters. Default: 16, 8 * * CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default: - * MKRGB(160,160,160) + * MKRGB(148,189,215) * CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR - Default selected background - * color. Default: MKRGB(120,192,192) + * color. Default: MKRGB(206,227,241) * CONFIG_NXWIDGETS_DEFAULT_SHINEEDGECOLOR - Shiny side boarder color. Default * MKRGB(248,248,248) * CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR - Shadowed side border color. - * Default: MKRGB(0,0,0) + * Default: MKRGB(35,58,73) * CONFIG_NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR - Highlight color. Default: * MKRGB(192,192,192) * CONFIG_NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - Text color on a disabled widget: @@ -362,7 +362,7 @@ */ #ifndef CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR -# define CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR MKRGB(160,160,160) +# define CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR MKRGB(148,189,215) #endif /** @@ -370,7 +370,7 @@ */ #ifndef CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR -# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(120,192,192) +# define CONFIG_NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR MKRGB(206,227,241) #endif /** @@ -386,7 +386,7 @@ */ #ifndef CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR -# define CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR MKRGB(0,0,0) +# define CONFIG_NXWIDGETS_DEFAULT_SHADOWEDGECOLOR MKRGB(35,58,73) #endif /** From 5354e2d6379c84a6d57fcb9d50e177145d7068d4 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 26 Sep 2012 14:36:28 +0000 Subject: [PATCH 087/390] Fixes for clean compilation of NxWidgets/NxWM with Kconfig and changes to build system; Fixes to Shenzhou NxWM configuration for clean build git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5193 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ libnxwidgets/Makefile | 8 ++++++++ nxwm/Makefile | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index e0a4c9b2e..840c0640b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -166,3 +166,5 @@ * Kconfig: Added a mconfig configuration file. Eventually, NxWidgets needs to get hooked into the NuttX mconf configuration. Still not exactly sure how to do that. +* libnxwidgets/Makefile and NxWidgets/nxwm/Makefile: Need updates + for consistency with recent changes to NuttX build system (>= 6.22) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 2520e419d..0afb55e69 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -36,6 +36,14 @@ -include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs +# Control build verbosity + +ifeq ($(V),1) +export Q := +else +export Q := @ +endif + NXWIDGETDIR := ${shell pwd | sed -e 's/ /\\ /g'} ASRCS = diff --git a/nxwm/Makefile b/nxwm/Makefile index e50863494..6b60327af 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -36,6 +36,14 @@ -include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs +# Control build verbosity + +ifeq ($(V),1) +export Q := +else +export Q := @ +endif + NXWMDIR := ${shell pwd | sed -e 's/ /\\ /g'} NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets From 9caa2a5828033d7c7a51cab5db6e36c37fbd6076 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 27 Sep 2012 01:26:47 +0000 Subject: [PATCH 088/390] Fixes mostly related to touchscreen on Shenzhou board (still does not work) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5196 42af7a65-404d-4744-a932-0658087f49c3 --- libnxwidgets/src/cnxserver.cxx | 2 +- nxwm/src/chexcalculator.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index be67e5641..8816c73bc 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -214,7 +214,7 @@ bool CNxServer::connect(void) // Start the server task - gvdbg("NxServer::connect: Starting server task\n"); + gvdbg("CNxServer::connect: Starting server task\n"); serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0); if (serverId < 0) diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index 167c114b7..f8f1bb246 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -656,7 +656,7 @@ int64_t CHexCalculator::evaluateBinaryOperation(uint8_t operation, int64_t value return value1 + value2; default: - gdbg("ERROR: Unexpected pending operation %d\n", m_pending); + gdbg("ERROR: Unexpected pending operation %d\n", operation); return 0; } } From e9f58b03afa142ec44d5c1e49d4128cfd155ab32 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 28 Sep 2012 19:24:46 +0000 Subject: [PATCH 089/390] Turn off LCD reading on Shenzhou board (needs some TLC before it will be usable) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5202 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ Kconfig | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 840c0640b..03b416001 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -168,3 +168,5 @@ exactly sure how to do that. * libnxwidgets/Makefile and NxWidgets/nxwm/Makefile: Need updates for consistency with recent changes to NuttX build system (>= 6.22) +* Kconfig: Add option to turn on the memory monitor feature of the + NxWidgets/NxWM unit tests. diff --git a/Kconfig b/Kconfig index 1d7852507..6befd1ace 100644 --- a/Kconfig +++ b/Kconfig @@ -3,7 +3,7 @@ # see misc/tools/kconfig-language.txt. # -menuconfig NXWIDGETS +config NXWIDGETS bool "Enable NxWidgets" default n depends on NX && HAVE_CXX @@ -201,9 +201,16 @@ config NXWIDGETS_CURSORCONTROL_SIZE of cursor controls that can between entered by NX polling cycles without losing data. Default: 4 +config NXWIDGET_MEMMONITOR + bool "Memory Usage Monitor" + default n + ---help--- + Enable memory usage monitor instrumentation. This feature is only + used by the NxWidget/NxWM unit tests. + endif -menuconfig NXWM +config NXWM bool "Enable NxWM" default n depends on NXWIDGETS && NX_MULTIUSER From 4f329c579dcdca13db12872b4545f6e0a1511510 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 29 Sep 2012 15:58:41 +0000 Subject: [PATCH 090/390] Prep for NxWidgets 1.3 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5205 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++- ReleaseNotes.txt | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 03b416001..06709996f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -158,7 +158,7 @@ * nxwm/Makefile: Fix error that creapt in during some other recent check-ins. -1.3 2012-xx-xx Gregory Nutt +1.3 2012-09-29 Gregory Nutt * UnitTests/*/main.cxx: Change entry point name to be consistent with with entry point naming conventions introduced in NuttX @@ -170,3 +170,5 @@ for consistency with recent changes to NuttX build system (>= 6.22) * Kconfig: Add option to turn on the memory monitor feature of the NxWidgets/NxWM unit tests. + +1.4 2012-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 96ce29e1a..7d3fb7aaa 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -97,3 +97,18 @@ Bugfixes: As well as other, less critical bugs (see the ChangeLog for details) +NxWidgets-1.3 +============= + +The 4th release of the NxWidgets package as made on September 29, 2012. This +release depends on NuttX-6.22 or above and should not be used with older +NuttX releases. + +There are no functional changes in this release of NxWidgets. This release +is required in order to retain compatibility with the most recent versions +of NuttX. These comptibility changes include: + +* Naming of function entry points +* Build system changes +* Changes needed for the NuttX configuration tool + From afdb39b3b9ddf8f133b9281b244517bfc30ff023 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 20 Oct 2012 16:07:49 +0000 Subject: [PATCH 091/390] Several bugfixes contributed by Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5238 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 11 +++++++++++ UnitTests/nxwm/Makefile | 4 ++-- libnxwidgets/Makefile | 4 ++-- libnxwidgets/src/ccallback.cxx | 3 ++- libnxwidgets/src/cnxserver.cxx | 2 +- nxwm/Makefile | 4 ++-- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 06709996f..f4aedd828 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -172,3 +172,14 @@ NxWidgets/NxWM unit tests. 1.4 2012-xx-xx Gregory Nutt + +* libnxwidgets/Makefile, NxWidgets/nxwm/Makefile, and + NxWidgets/UnitTests/nxwm/Makefile: Makefile improvements from + submitted by Petteri Aimonen. Other Makefiles in the UnitTests + directory probably also need these changes. +* libnxwidgets/src/ccallback.cxx: Fix misplaced #endif. Provided + by Petteri Aimonen. +* libnxwidgets/src/cnxserver.cxx: Reduce delay to allow NX server + to start. One second was un-necessarily long. Reduced to 50 MS. + Reduction suggested by Petteri Aimonen. + diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 11c670ece..f84a78bcc 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -105,7 +105,7 @@ STACKSIZE = 2048 VPATH = -all: .built +all: chkcxx chklibnxwidgets chklibnxwm .built .PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm # Object file creation targets @@ -163,7 +163,7 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work. $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. -.built: chkcxx chklibnxwidgets chklibnxwm $(OBJS) $(NXWIDGETS_LIB) +.built: $(OBJS) $(NXWIDGETS_LIB) @( for obj in $(OBJS) ; do \ $(call ARCHIVE, $(BIN), $${obj}); \ done ; ) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 0afb55e69..92eb87751 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -92,7 +92,7 @@ CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR DEPPATH = --dep-path src VPATH = src -all: $(BIN) +all: check_nuttx $(BIN) .PHONY = check_nuttx depend clean distclean export $(AOBJS): %$(OBJEXT): %.S @@ -122,7 +122,7 @@ check_nuttx: fi; \ ) -$(BIN): check_nuttx $(OBJS) +$(BIN): $(OBJS) @( for obj in $(OBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 374502a38..269a5cdb1 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -226,6 +226,8 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, } } +#endif // CONFIG_NX_KBD + /** * This callback is the response from nx_block (or nxtk_block). Those * blocking interfaces are used to assure that no further messages are @@ -260,4 +262,3 @@ void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) } #endif -#endif // CONFIG_NX_KBD diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 8816c73bc..4d5a6e681 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -225,7 +225,7 @@ bool CNxServer::connect(void) // Wait a bit to let the server get started - sleep(1); + usleep(50*1000); // Connect to the server diff --git a/nxwm/Makefile b/nxwm/Makefile index 6b60327af..f26ae03bb 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -97,7 +97,7 @@ CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR DEPPATH = --dep-path src VPATH = src -all: $(BIN) +all: check_nuttx $(BIN) .PHONY = check_nuttx depend clean distclean export $(AOBJS): %$(OBJEXT): %.S @@ -127,7 +127,7 @@ check_nuttx: fi; \ ) -$(BIN): check_nuttx $(OBJS) +$(BIN): $(OBJS) @( for obj in $(OBJS) ; do \ $(call ARCHIVE, $@, $${obj}); \ done ; ) From 8c6c3e53e997606986521d4d60a86f08c9dbdeda Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 9 Nov 2012 14:54:29 +0000 Subject: [PATCH 092/390] Several patches from Petteri Aimonen (mostly NxWidgets) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5324 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 19 +++- Kconfig | 16 ++++ nxwm/src/capplicationwindow.cxx | 30 ++++--- nxwm/src/chexcalculator.cxx | 2 + nxwm/src/cstartwindow.cxx | 2 + nxwm/src/ctaskbar.cxx | 19 +++- tools/README.txt | 51 +++++++++++ tools/bitmap_converter.py | 148 ++++++++++++++++++++++++++++++++ tools/install.sh | 2 + 9 files changed, 276 insertions(+), 13 deletions(-) create mode 100755 tools/README.txt create mode 100755 tools/bitmap_converter.py diff --git a/ChangeLog.txt b/ChangeLog.txt index f4aedd828..113945f2f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -182,4 +182,21 @@ * libnxwidgets/src/cnxserver.cxx: Reduce delay to allow NX server to start. One second was un-necessarily long. Reduced to 50 MS. Reduction suggested by Petteri Aimonen. - +* tools/bitmap_converter.py: This script converts from any image type + supported by Python imaging library to the RLE-encoded format used by + NxWidgets. +* NxWidgets/nxwm/src/capplicationwindow.cxx: If the "desktop" is empty, + users have no need to minimize any windows. If the buttons are small, + it's easy to hit minimize button accidentally when trying to close an + application. Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/ctaskbar.cxx: Add an option to eliminate the + background image. Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/chexcalculator.cxx and NxWidgets/nxwm/src/cstartwindow.cxx: + The config settings CONFIG_NXWM_STARTWINDOW_ICON and CONFIG_NXWM_HEXCALCULATOR_ICON + allow changing the icons used for these applications. However, to declare symbols + for these icons user would need to modify NxWidgets header files. + This commit adds a simple forward declaration to the relevant files, based on the + configured icon. If the icon does not exist, linker will give an error about it. + Contributed by Petteri Aimonen. +* NxWidgets/nxwm/src/ctaskbar.cxx: Highlight the current window in the task bar. + Contributed by Petteri Aimonen. diff --git a/Kconfig b/Kconfig index 6befd1ace..59d8856bc 100644 --- a/Kconfig +++ b/Kconfig @@ -308,6 +308,14 @@ config NXWM_TASKBAR_WIDTH ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing +config NXWM_DISABLE_MINIMIZE + bool "Disable Minimize Button" + default n + ---help--- + If the "desktop" is empty, users have no need to minimize any windows. If the buttons + are small, it's easy to hit minimize button accidentally when trying to close an + application. + comment "Tool Bar Configuration" config NXWM_TOOLBAR_HEIGHT @@ -319,8 +327,16 @@ config NXWM_TOOLBAR_HEIGHT comment "Background Image" +config NXWM_DISABLE_BACKGROUND_IMAGE + bool "Disable Background Image" + default n if !NXWM_DISABLE_MINIMIZE + default y if NXWM_DISABLE_MINIMIZE + ---help--- + Disable support for the "Desktop" background image. + config NXWM_BACKGROUND_IMAGE string "Background Image" + depends on !NXWM_DISABLE_BACKGROUND_IMAGE ---help--- The name of the image to use in the background window. Default: NXWidgets::g_nuttxBitmap diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 65de1b1a4..d2e044298 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -241,6 +241,7 @@ bool CApplicationWindow::open(void) m_stopImage->addWidgetEventHandler(this); } +#ifndef CONFIG_NXWM_DISABLE_MINIMIZE // Create MINIMIZE application bitmap container m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&g_minimizeBitmap); @@ -289,6 +290,7 @@ bool CApplicationWindow::open(void) m_minimizeImage->setBorderless(true); m_minimizeImage->addWidgetEventHandler(this); +#endif // The rest of the toolbar will hold the left-justified application label // Create the default font instance @@ -364,12 +366,16 @@ void CApplicationWindow::redraw(void) m_stopImage->setRaisesEvents(true); } - // Draw the minimize image - - m_minimizeImage->enableDrawing(); - m_minimizeImage->redraw(); - m_minimizeImage->setRaisesEvents(true); + // Draw the minimize image (which may not be present if this is a + // mimimization is disabled) + if (m_minimizeImage) + { + m_minimizeImage->enableDrawing(); + m_minimizeImage->redraw(); + m_minimizeImage->setRaisesEvents(true); + } + // And finally draw the window label m_windowLabel->enableDrawing(); @@ -392,11 +398,15 @@ void CApplicationWindow::hide(void) m_stopImage->setRaisesEvents(false); } - // Disable the minimize image - - m_minimizeImage->disableDrawing(); - m_minimizeImage->setRaisesEvents(false); + // Disable the minimize image(which may not be present if this is a + // mimimization is disabled) + if (m_minimizeImage) + { + m_minimizeImage->disableDrawing(); + m_minimizeImage->setRaisesEvents(false); + } + // Disable the window label m_windowLabel->disableDrawing(); @@ -570,7 +580,7 @@ void CApplicationWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Check the minimize image (only if the stop application image is not pressed) - else if (m_minimizeImage->isClicked()) + else if (m_minimizeImage && m_minimizeImage->isClicked()) { // Notify the controlling logic that the application should be miminsed diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index f8f1bb246..eeb0b1d1d 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -191,6 +191,8 @@ namespace NxWM * CHexCalculator Method Implementations ********************************************************************************************/ +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_HEXCALCULATOR_ICON; + using namespace NxWM; /** diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index 5c54cba3a..a99e81d88 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -71,6 +71,8 @@ FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME; * CStartWindow Method Implementations ********************************************************************************************/ +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_STARTWINDOW_ICON; + using namespace NxWM; /** diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index c494fcba3..23d2d23b5 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -991,6 +991,7 @@ bool CTaskbar::createBackgroundWindow(void) bool CTaskbar::createBackgroundImage(void) { +#ifndef CONFIG_NXWM_DISABLE_BACKGROUND_IMAGE // Get the size of the display struct nxgl_size_s windowSize; @@ -1054,6 +1055,8 @@ bool CTaskbar::createBackgroundImage(void) m_backImage->setBorderless(true); m_backImage->setRaisesEvents(false); +#endif + return true; } @@ -1128,6 +1131,10 @@ bool CTaskbar::redrawTaskbarWindow(void) image->disableDrawing(); image->setRaisesEvents(false); + // Highlight the icon for the top-most window + + image->highlight(m_slots.at(i).app == m_topApp); + // Get the size of the icon image NXWidgets::CRect rect; @@ -1302,8 +1309,12 @@ bool CTaskbar::redrawBackgroundWindow(void) // Then re-draw the background image on the window - m_backImage->enableDrawing(); - m_backImage->redraw(); + if (m_backImage) + { + m_backImage->enableDrawing(); + m_backImage->redraw(); + } + return true; } @@ -1330,6 +1341,10 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) raiseTopApplication(); + // Redraw taskbar + + redrawTaskbarWindow(); + // Every application provides a method to obtain its application window IApplicationWindow *appWindow = app->getWindow(); diff --git a/tools/README.txt b/tools/README.txt new file mode 100755 index 000000000..22b2bf2a9 --- /dev/null +++ b/tools/README.txt @@ -0,0 +1,51 @@ +NxWidgets/tools README File +=========================== + +addobjs.sh +---------- + + $0 will add all object (.o) files in directory to an archive. + + Usage: tools/addobjs.sh [OPTIONS] + + Where: + is the full, absolute path to the library to use + is full path to the directory containing the object files to be added + OPTIONS include: + -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-' + -w Use Windows style paths insted of POSIX paths + -d Enable script debug + -h Show this usage information + +bitmap_converter.py +------------------- + + This script converts from any image type supported by Python imaging library to + the RLE-encoded format used by NxWidgets. + +indent.sh +--------- + + This script uses the Linux 'indent' utility to re-format C source files + to match the coding style that I use. It differs from my coding style in that + + - I normally put the traiing */ of a multi-line comment on a separate line, + - I usually align things vertically (like '='in assignments. + +install.sh +---------- + + Install a unit test in the NuttX source tree" + + USAGE: tools/install.sh + + Where: + is the full, absolute path to the NuttX apps/ directory + is the name of a sub-directory in the UnitTests directory + +zipme.sh +-------- + + Pack up the NxWidgets tarball for release. + + USAGE: tools/zipme.sh diff --git a/tools/bitmap_converter.py b/tools/bitmap_converter.py new file mode 100755 index 000000000..2cb7e8869 --- /dev/null +++ b/tools/bitmap_converter.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python + +'''This script converts from any image type supported by +Python imaging library to the RLE-encoded format used by +NxWidgets. +''' + +from PIL import Image + +def get_palette(img, maxcolors = 255): + '''Returns a list of colors. If there are too many colors in the image, + the least used are removed. + ''' + img = img.convert("RGB") + colors = img.getcolors(65536) + colors.sort(key = lambda c: -c[0]) + return [c[1] for c in colors[:maxcolors]] + +def write_palette(outfile, palette): + '''Write the palette (normal and hilight) to the output file.''' + + outfile.write('static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] =\n'); + outfile.write('{\n') + + for i in range(0, len(palette), 4): + outfile.write(' '); + for r, g, b in palette[i:i+4]: + outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) + outfile.write('\n'); + + outfile.write('};\n\n') + + outfile.write('static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] =\n'); + outfile.write('{\n') + + for i in range(0, len(palette), 4): + outfile.write(' '); + for r, g, b in palette[i:i+4]: + r = min(255, r + 50) + g = min(255, g + 50) + b = min(255, b + 50) + outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) + outfile.write('\n'); + + outfile.write('};\n\n') + + +def quantize(color, palette): + '''Return the color index to closest match in the palette.''' + try: + return palette.index(color) + except ValueError: + # No exact match, search for the closest + def distance(color2): + return sum([(a - b)**2 for a, b in zip(color, color2)]) + + return palette.index(min(palette, key = distance)); + +def encode_row(img, palette, y): + '''RLE-encode one row of image data.''' + entries = [] + color = None + repeats = 0 + + for x in range(0, img.size[0]): + c = quantize(img.getpixel((x, y)), palette) + if c == color: + repeats += 1 + else: + if color is not None: + entries.append((repeats, color)) + + repeats = 1 + color = c + + if color is not None: + entries.append((repeats, color)) + + return entries + +def write_image(outfile, img, palette): + '''Write the image contents to the output file.''' + + outfile.write('static const NXWidgets::SRlePaletteBitmapEntry bitmap[] =\n'); + outfile.write('{\n'); + + for y in range(0, img.size[1]): + entries = encode_row(img, palette, y) + row = "" + for r, c in entries: + if len(row) > 60: + outfile.write(' ' + row + '\n') + row = "" + + row += '{%3d, %3d}, ' % (r, c) + + row += ' ' * (73 - len(row)) + outfile.write(' ' + row + '/* Row %d */\n' % y) + + outfile.write('};\n\n'); + +def write_descriptor(outfile, name): + '''Write the public descriptor structure for the image.''' + + outfile.write('extern const struct NXWidgets::SRlePaletteBitmap g_%s =\n' % name) + outfile.write('{\n') + outfile.write(' CONFIG_NXWIDGETS_BPP,\n') + outfile.write(' CONFIG_NXWIDGETS_FMT,\n') + outfile.write(' BITMAP_PALETTESIZE,\n') + outfile.write(' BITMAP_WIDTH,\n') + outfile.write(' BITMAP_HEIGHT,\n') + outfile.write(' {palette, hilight_palette},\n') + outfile.write(' bitmap\n') + outfile.write('};\n') + +if __name__ == '__main__': + import sys + import os.path + + if len(sys.argv) != 3: + print "Usage: bitmap_converter.py source.png output.cxx" + sys.exit(1) + + img = Image.open(sys.argv[1]) + outfile = open(sys.argv[2], 'w') + palette = get_palette(img) + + outfile.write( +''' +/* Automatically NuttX bitmap file. */ +/* Generated from %(src)s by bitmap_converter.py. */ + +#include +#include + +#define BITMAP_WIDTH %(width)s +#define BITMAP_HEIGHT %(height)s +#define BITMAP_PALETTESIZE %(palettesize)s + +''' % {'src': sys.argv[1], 'width': img.size[0], 'height': img.size[1], + 'palettesize': len(palette)} + ) + + name = os.path.splitext(os.path.basename(sys.argv[1]))[0] + + write_palette(outfile, palette) + write_image(outfile, img, palette) + write_descriptor(outfile, name) diff --git a/tools/install.sh b/tools/install.sh index 6917b4b03..dd212b5a6 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -39,6 +39,8 @@ function ShowUsage() { + echo "" + echo "Install a unit test in the NuttX source tree" echo "" echo "USAGE: $0 " echo "" From 58380533f781e6ed5d3672d5d86d7e265374688c Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 11 Nov 2012 16:33:14 +0000 Subject: [PATCH 093/390] Partial change: Removing bash ARCHIVE loop git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5337 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/Makefile | 4 +--- UnitTests/CButtonArray/Makefile | 4 +--- UnitTests/CCheckBox/Makefile | 4 +--- UnitTests/CGlyphButton/Makefile | 4 +--- UnitTests/CImage/Makefile | 4 +--- UnitTests/CKeypad/Makefile | 4 +--- UnitTests/CLabel/Makefile | 4 +--- UnitTests/CLatchButton/Makefile | 4 +--- UnitTests/CLatchButtonArray/Makefile | 4 +--- UnitTests/CListBox/Makefile | 4 +--- UnitTests/CProgressBar/Makefile | 4 +--- UnitTests/CRadioButton/Makefile | 4 +--- UnitTests/CScrollbarHorizontal/Makefile | 4 +--- UnitTests/CScrollbarVertical/Makefile | 4 +--- UnitTests/CSliderHorizonal/Makefile | 4 +--- UnitTests/CSliderVertical/Makefile | 4 +--- UnitTests/CTextBox/Makefile | 4 +--- UnitTests/nxwm/Makefile | 4 +--- libnxwidgets/Makefile | 4 +--- nxwm/Makefile | 4 +--- 20 files changed, 20 insertions(+), 60 deletions(-) diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 77ba7e986..87649ac3c 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index a5a33b3b0..03f7624f9 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 9b46cef8d..715fe4dad 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 5f2522e49..db91bdfbc 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 46e69c495..fb2640446 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 3d37c26fe..36ae2f543 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index e04adc7de..2ddfbbf42 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 7444c50be..a44e7e954 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index a6ac9118b..a11c9bfd6 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index f06873817..a396d4b01 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 5ee346b52..11b802f92 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 57190e8d3..b642ebaf3 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index 191324a96..c952fd1e2 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index a2777e752..81b8ced26 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 0578510d3..e31f1f033 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index f37cc8619..3a86b57e9 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index c368cc497..b73ce8f4a 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -136,9 +136,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index f84a78bcc..cfcdef750 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -164,9 +164,7 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work. $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. .built: $(OBJS) $(NXWIDGETS_LIB) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $(BIN), $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 92eb87751..4673c1f98 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -123,9 +123,7 @@ check_nuttx: ) $(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") .depend: Makefile $(SRCS) @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/nxwm/Makefile b/nxwm/Makefile index f26ae03bb..372f3c186 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -128,9 +128,7 @@ check_nuttx: ) $(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) + $(call ARCHIVE, $@, "$(OBJS)") .depend: Makefile $(SRCS) @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep From 4ef12487143f55beb9e389dda46ee7f1cfbc68c5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 13 Nov 2012 20:24:30 +0000 Subject: [PATCH 094/390] Centralized the definition of the INCDIR script in tools/Config.mk git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5346 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/Makefile | 2 -- UnitTests/CButtonArray/Makefile | 2 -- UnitTests/CCheckBox/Makefile | 2 -- UnitTests/CGlyphButton/Makefile | 2 -- UnitTests/CImage/Makefile | 2 -- UnitTests/CKeypad/Makefile | 2 -- UnitTests/CLabel/Makefile | 2 -- UnitTests/CLatchButton/Makefile | 2 -- UnitTests/CLatchButtonArray/Makefile | 2 -- UnitTests/CListBox/Makefile | 2 -- UnitTests/CProgressBar/Makefile | 2 -- UnitTests/CRadioButton/Makefile | 2 -- UnitTests/CScrollbarHorizontal/Makefile | 2 -- UnitTests/CScrollbarVertical/Makefile | 2 -- UnitTests/CSliderHorizonal/Makefile | 2 -- UnitTests/CSliderVertical/Makefile | 2 -- UnitTests/CTextBox/Makefile | 2 -- UnitTests/nxwm/Makefile | 2 -- libnxwidgets/Makefile | 5 ++--- nxwm/Makefile | 9 ++++----- 20 files changed, 6 insertions(+), 44 deletions(-) diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 87649ac3c..01bca12a5 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 03f7624f9..84d19277e 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 715fe4dad..5aa96e618 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index db91bdfbc..ec0c5d5d3 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index fb2640446..5970d59d1 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 36ae2f543..b0aba9603 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 2ddfbbf42..9a5fa1321 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index a44e7e954..e50db8914 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index a11c9bfd6..544167ec9 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index a396d4b01..1161460b4 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 11b802f92..6fee2fac9 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index b642ebaf3..97e8a398e 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index c952fd1e2..952ec4c6b 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 81b8ced26..4e44699ee 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index e31f1f033..5bc6c84c6 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 3a86b57e9..4c6a660f0 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index b73ce8f4a..8fde36bb0 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index cfcdef750..73cb0b42a 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -35,7 +35,6 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs include $(APPDIR)/Make.defs @@ -45,7 +44,6 @@ NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" -INCDIR=$(TOPDIR)/tools/incdir.sh ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 4673c1f98..880117a24 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -33,7 +33,6 @@ # ################################################################################# --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs # Control build verbosity @@ -87,8 +86,8 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} -CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} DEPPATH = --dep-path src VPATH = src diff --git a/nxwm/Makefile b/nxwm/Makefile index 372f3c186..81b9dcdeb 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -33,7 +33,6 @@ # ################################################################################# --include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs # Control build verbosity @@ -89,10 +88,10 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} -CFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} -CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} -CXXFLAGS += ${shell $(TOPDIR)/tools/incdir.sh $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} DEPPATH = --dep-path src VPATH = src From f5abf6eff99516c48baaac640b98f46458854ae7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 15 Nov 2012 17:43:29 +0000 Subject: [PATCH 095/390] Move some (hopefully) un-necessary quotes in Makefiles for Mike git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5356 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/Makefile | 2 +- UnitTests/CButtonArray/Makefile | 2 +- UnitTests/CCheckBox/Makefile | 2 +- UnitTests/CGlyphButton/Makefile | 2 +- UnitTests/CImage/Makefile | 2 +- UnitTests/CKeypad/Makefile | 2 +- UnitTests/CLabel/Makefile | 2 +- UnitTests/CLatchButton/Makefile | 2 +- UnitTests/CLatchButtonArray/Makefile | 2 +- UnitTests/CListBox/Makefile | 2 +- UnitTests/CProgressBar/Makefile | 2 +- UnitTests/CRadioButton/Makefile | 2 +- UnitTests/CScrollbarHorizontal/Makefile | 2 +- UnitTests/CScrollbarVertical/Makefile | 2 +- UnitTests/CSliderHorizonal/Makefile | 2 +- UnitTests/CSliderVertical/Makefile | 2 +- UnitTests/CTextBox/Makefile | 2 +- UnitTests/nxwm/Makefile | 2 +- libnxwidgets/Makefile | 2 +- nxwm/Makefile | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 01bca12a5..c2dcfcb5d 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 84d19277e..8df0b4213 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 5aa96e618..e363aed44 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index ec0c5d5d3..9b529faee 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 5970d59d1..b35fb2f7c 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index b0aba9603..2003e13f9 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 9a5fa1321..dacfa6274 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index e50db8914..6730a6eb5 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 544167ec9..715ab3e2a 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 1161460b4..52f3ca038 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 6fee2fac9..49eddf188 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 97e8a398e..17b58a7c9 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index 952ec4c6b..9efc5d401 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 4e44699ee..3f6926628 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 5bc6c84c6..97be73810 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 4c6a660f0..1c3791393 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index 8fde36bb0..8a44caee2 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 73cb0b42a..3dd666b11 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -162,7 +162,7 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work. $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. .built: $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 880117a24..222f008b7 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -122,7 +122,7 @@ check_nuttx: ) $(BIN): $(OBJS) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep diff --git a/nxwm/Makefile b/nxwm/Makefile index 81b9dcdeb..d272a8384 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -127,7 +127,7 @@ check_nuttx: ) $(BIN): $(OBJS) - $(call ARCHIVE, $@, "$(OBJS)") + $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep From 57ad695cf5068f8d6728d213c46173fac2ed3e0c Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 16 Nov 2012 15:53:16 +0000 Subject: [PATCH 096/390] Fixes for CCycleButton unit test; Add CNumericEdit. Both from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5363 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 + libnxwidgets/Makefile | 1 + libnxwidgets/include/ccyclebutton.hxx | 12 +- libnxwidgets/include/cnumericedit.hxx | 213 +++++++++++++++++++++ libnxwidgets/src/cnumericedit.cxx | 262 ++++++++++++++++++++++++++ libnxwidgets/src/glyph_cycle.cxx | 4 +- 6 files changed, 488 insertions(+), 8 deletions(-) create mode 100644 libnxwidgets/include/cnumericedit.hxx create mode 100644 libnxwidgets/src/cnumericedit.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 113945f2f..dca1f856d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -200,3 +200,7 @@ Contributed by Petteri Aimonen. * NxWidgets/nxwm/src/ctaskbar.cxx: Highlight the current window in the task bar. Contributed by Petteri Aimonen. +* NxWidgets/libnxwidgets/src/glyph_cycle.cxx: Width of glyph_cycle was wrong; + Desctructor needs to by public. From Petteri Aimonen. +* CNumericEdit. This is basically a label with plus and minus buttons. + Contributed by Petteri, Aimonen. diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 222f008b7..654f1d2fc 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -58,6 +58,7 @@ CXXSRCS += cwindoweventhandlerlist.cxx singletons.cxx CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx CXXSRCS += cglyphbutton.cxx cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx CXXSRCS += clatchbuttonarray.cxx clistbox.cxx clistboxdataitem.cxx cmultilinetextbox.cxx +CXXSRCS += cnumericedit.cxx CXXSRCS += cprogressbar.cxx cradiobutton.cxx cradiobuttongroup.cxx cscrollbarhorizontal.cxx CXXSRCS += cscrollbarpanel.cxx cscrollbarvertical.cxx cscrollinglistbox.cxx CXXSRCS += cscrollingpanel.cxx cscrollingtextbox.cxx csliderhorizontal.cxx diff --git a/libnxwidgets/include/ccyclebutton.hxx b/libnxwidgets/include/ccyclebutton.hxx index 5fd9405d8..f7f965933 100644 --- a/libnxwidgets/include/ccyclebutton.hxx +++ b/libnxwidgets/include/ccyclebutton.hxx @@ -179,12 +179,6 @@ namespace NXWidgets virtual inline void calculateTextPosition(void) { } - /** - * Destructor. - */ - - virtual ~CCycleButton(void) { } - /** * Copy constructor is protected to prevent usage. */ @@ -212,6 +206,12 @@ namespace NXWidgets nxgl_coord_t width, nxgl_coord_t height, CWidgetStyle *style = (CWidgetStyle *)NULL); + /** + * Destructor. + */ + + virtual ~CCycleButton(void) { } + /** * Add a new option to the widget. * diff --git a/libnxwidgets/include/cnumericedit.hxx b/libnxwidgets/include/cnumericedit.hxx new file mode 100644 index 000000000..3de01a4c1 --- /dev/null +++ b/libnxwidgets/include/cnumericedit.hxx @@ -0,0 +1,213 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnumericedit.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Petteri Aimonen + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CNUMERICEDIT_HXX +#define __INCLUDE_CNUMERICEDIT_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CRect; + class CLabel; + class CButton; + class CNxTimer; + + /** + * Numeric edit control, with plus and minus buttons. + */ + + class CNumericEdit : public CNxWidget, public CWidgetEventHandler + { + protected: + CLabel *m_label; + CButton *m_button_minus; + CButton *m_button_plus; + CNxTimer *m_timer; + int m_value; + int m_minimum; + int m_maximum; + int m_increment; + int m_timercount; + + /** + * Resize the widget to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + virtual void handleClickEvent(const CWidgetEventArgs &e); + + virtual void handleReleaseEvent(const CWidgetEventArgs &e); + + virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); + + virtual void handleActionEvent(const CWidgetEventArgs &e); + + virtual void handleDragEvent(const CWidgetEventArgs &e); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CNumericEdit(const CNumericEdit &num) : CNxWidget(num) { }; + + public: + + /** + * Constructor for a numeric edit control. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CNumericEdit(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual ~CNumericEdit(); + + /** + * Insert the dimensions that this widget wants to have into the rect + * passed in as a parameter. All coordinates are relative to the + * widget's parent. + * + * @param rect Reference to a rect to populate with data. + */ + + virtual void getPreferredDimensions(CRect &rect) const; + + /** + * Sets the font. + * + * @param font A pointer to the font to use. + */ + + virtual void setFont(CNxFont *font); + + inline int getValue() const { return m_value; } + void setValue(int value); + + inline int getMaximum() const { return m_maximum; } + inline void setMaximum(int value) { m_maximum = value; setValue(m_value); } + + inline int getMinimum() const { return m_minimum; } + inline void setMinimum(int value) { m_minimum = value; setValue(m_value); } + + inline int getIncrement() const { return m_increment; } + inline void setIncrement(int value) { m_increment = value; setValue(m_value); } + + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLABEL_HXX diff --git a/libnxwidgets/src/cnumericedit.cxx b/libnxwidgets/src/cnumericedit.cxx new file mode 100644 index 000000000..e0df014c5 --- /dev/null +++ b/libnxwidgets/src/cnumericedit.cxx @@ -0,0 +1,262 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cnumericedit.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * Petteri Aimonen + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in all NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "cnumericedit.hxx" +#include "cbutton.hxx" +#include "clabel.hxx" +#include "cnxtimer.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CNumericEdit Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +// Label that passes drag events + +class CDraggableLabel: public CLabel +{ +public: + CDraggableLabel(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, const CNxString &text, + CWidgetStyle *style = (CWidgetStyle *)NULL): + CLabel(pWidgetControl, x, y, width, height, text, style) + { + setDraggable(true); + } + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y) + { + startDragging(x, y); + } +}; + +/** + * Constructor for a numeric edit control. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the text box, relative to its parent. + * @param y The y coordinate of the text box, relative to its parent. + * @param width The width of the textbox. + * @param height The height of the textbox. + * @param style The style that the button should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CNumericEdit::CNumericEdit(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + CWidgetStyle *style) +: CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + m_label = new CDraggableLabel(pWidgetControl, height, 0, width - 2 * height, height, CNxString("0"), style); + m_label->addWidgetEventHandler(this); + addWidget(m_label); + + m_button_minus = new CButton(pWidgetControl, 0, 0, height, height, CNxString("-")); + m_button_minus->addWidgetEventHandler(this); + addWidget(m_button_minus); + + m_button_plus = new CButton(pWidgetControl, width - height, 0, height, height, CNxString("+")); + m_button_plus->addWidgetEventHandler(this); + addWidget(m_button_plus); + + m_timer = new CNxTimer(pWidgetControl, 100, true); + m_timer->addWidgetEventHandler(this); + addWidget(m_timer); + + m_minimum = INT_MIN; + m_maximum = INT_MAX; + m_increment = 1; + setValue(0); +} + +CNumericEdit::~CNumericEdit() +{ + delete m_label; + delete m_button_minus; + delete m_button_plus; +} + +void CNumericEdit::getPreferredDimensions(CRect &rect) const +{ +} + +void CNumericEdit::setFont(CNxFont *font) +{ + m_label->setFont(font); +} + +void CNumericEdit::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ +} + +void CNumericEdit::handleClickEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_button_plus) + { + setValue(m_value + m_increment); + m_timercount = 0; + m_timer->start(); + } + else if (e.getSource() == m_button_minus) + { + setValue(m_value - m_increment); + m_timercount = 0; + m_timer->start(); + } +} + +void CNumericEdit::handleReleaseEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_button_plus || e.getSource() == m_button_minus) + { + m_timer->stop(); + } +} + +void CNumericEdit::handleReleaseOutsideEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_button_plus || e.getSource() == m_button_minus) + { + m_timer->stop(); + } +} + +void CNumericEdit::handleActionEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_timer) + { + m_timercount++; + + int increment = m_increment; + if (m_timercount > 50) + { + increment = m_increment * 100; + } + else if (m_timercount > 10) + { + increment = m_increment * 10; + } + + if (m_button_minus->isClicked()) + { + setValue(m_value - increment); + } + else if (m_button_plus->isClicked()) + { + setValue(m_value + increment); + } + } +} + +void CNumericEdit::handleDragEvent(const CWidgetEventArgs &e) +{ + int x = e.getX() - m_label->getX(); + int width = m_label->getWidth(); + int value = m_minimum + (m_maximum - m_minimum) * x / width; + setValue(value / m_increment * m_increment); +} + +void CNumericEdit::setValue(int value) +{ + if (value < m_minimum) value = m_minimum; + if (value > m_maximum) value = m_maximum; + + m_value = value; + + char buf[10]; + snprintf(buf, sizeof(buf), "%d", m_value); + CNxString text(buf); + + m_label->setText(text); + + m_widgetEventHandlers->raiseValueChangeEvent(); + + redraw(); +} diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx index 5c98b8b90..d706adddb 100644 --- a/libnxwidgets/src/glyph_cycle.cxx +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -145,9 +145,9 @@ const struct SBitmap NXWidgets::g_cycle = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel COLOR_FMT, // fmt - Color format - 7, // width - Width in pixels + 8, // width - Width in pixels 10, // height - Height in rows - (7*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes + (8*CONFIG_NXWIDGETS_BPP + 7) / 8, // stride - Width in bytes g_cycleGlyph // data - Pointer to the beginning of pixel data }; From 0cf7957311d9b9764d9e8b3c15257b5a6ec2007b Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 16 Nov 2012 16:49:21 +0000 Subject: [PATCH 097/390] Patches 4-6 from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5364 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 9 ++++++--- nxwm/src/cstartwindow.cxx | 7 ++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index dca1f856d..ece08e4fd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -198,9 +198,12 @@ This commit adds a simple forward declaration to the relevant files, based on the configured icon. If the icon does not exist, linker will give an error about it. Contributed by Petteri Aimonen. -* NxWidgets/nxwm/src/ctaskbar.cxx: Highlight the current window in the task bar. +* NxWidgets::CTaskBar: Highlight the current window in the task bar. Contributed by Petteri Aimonen. * NxWidgets/libnxwidgets/src/glyph_cycle.cxx: Width of glyph_cycle was wrong; - Desctructor needs to by public. From Petteri Aimonen. -* CNumericEdit. This is basically a label with plus and minus buttons. + Destructor needs to by public. From Petteri Aimonen. +* NxWidgets::CNumericEdit. This is basically a label with plus and minus buttons. Contributed by Petteri, Aimonen. +* NxWM::CStartWindow: Fix mq_receive error handling with signal is recieved. + From Petteri Aimonen. + diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index a99e81d88..cc8802b7c 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -654,8 +654,13 @@ int CStartWindow::startWindow(int argc, char *argv[]) { gdbg("ERROR: mq_receive failed: %d\n", errval); } + else + { + gdbg("mq_receive interrupted by signal\n"); + } + + continue; } - while (nbytes < 0); gvdbg("Received msgid=%d nbytes=%d\n", msg.msgId, nbytes); DEBUGASSERT(nbytes = sizeof(struct SStartWindowMessage) && msg.instance); From ecda1b2df093a1ee899dc48824e14d71d86ca4fe Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 17 Nov 2012 13:50:02 +0000 Subject: [PATCH 098/390] Patches 7-9 from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5365 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 6 + libnxwidgets/include/cimage.hxx | 16 ++- libnxwidgets/include/cnxtimer.hxx | 55 +++----- libnxwidgets/src/cnxtimer.cxx | 224 ++++-------------------------- libnxwidgets/src/cnxtkwindow.cxx | 14 +- nxwm/src/ctaskbar.cxx | 35 ++--- 6 files changed, 86 insertions(+), 264 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ece08e4fd..65022ea15 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -206,4 +206,10 @@ Contributed by Petteri, Aimonen. * NxWM::CStartWindow: Fix mq_receive error handling with signal is recieved. From Petteri Aimonen. +* NxWidgets:CNxTimer: Replace the original (apparently non-functional) signal- + based solution with a work queue-based solution. This raises some isses about + using the internal work queues from user space. I have decided to implemented + user-space work queues (someday) in order to accomplish that functionaliy. + Submitted by Petteri Aimonen. + solutions diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 0fe275624..6093c5f33 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -86,11 +86,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -120,7 +120,7 @@ namespace NXWidgets * @param port The CGraphicsPort to draw to. * @see redraw() */ - + virtual void drawContents(CGraphicsPort *port); /** @@ -150,7 +150,7 @@ namespace NXWidgets */ virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the image. * @@ -201,6 +201,12 @@ namespace NXWidgets virtual inline ~CImage() { } + /** + * Get pointer to the bitmap that this image contains. + */ + + inline FAR IBitmap *getBitmap() const { return m_bitmap; } + /** * Insert the dimensions that this widget wants to have into the rect * passed in as a parameter. All coordinates are relative to the diff --git a/libnxwidgets/include/cnxtimer.hxx b/libnxwidgets/include/cnxtimer.hxx index be6038dac..d4715b378 100644 --- a/libnxwidgets/include/cnxtimer.hxx +++ b/libnxwidgets/include/cnxtimer.hxx @@ -80,6 +80,8 @@ #include #include +#include + #include "cnxwidget.hxx" /**************************************************************************** @@ -108,42 +110,18 @@ namespace NXWidgets class CNxTimer : public CNxWidget { protected: - FAR timer_t m_timerid; /**< POSIX timer */ + struct work_s m_work; /**< Work queue entry */ uint32_t m_timeout; /**< The timeout value in milliseconds */ bool m_isRunning; /**< Indicates whether or not the timer is running */ bool m_isRepeater; /**< Indicates whether or not the timer repeats */ /** - * The SIGALM signal handler that will be called when the timer goes off + * Static function called from work queue when the timeout expires. * - * @param signo The signal number call caused the handler to run (SIGALM) + * @param arg Pointer to the CNxTimer instance. */ - static void signalHandler(int signo); - - /** - * Handle an expired timer - */ - - void handleTimerExpiration(void); - - /** - * Convert a timespec to milliseconds - * - * @param tp The pointer to the timespec to convert - * @return The corresponding time in milliseconds - */ - - uint32_t timespecToMilliseconds(FAR const struct timespec *tp); - - /** - * Convert milliseconds to a timespec - * - * @param milliseconds The milliseconds to be converted - * @param tp The pointer to the location to store the converted timespec - */ - - void millisecondsToTimespec(uint32_t milliseconds, FAR struct timespec *tp); + static void workQueueCallback(FAR void *arg); /** * Copy constructor is protected to prevent usage. @@ -171,15 +149,6 @@ namespace NXWidgets ~CNxTimer(void); - /** - * Return the time remaining on this timer. - * - * @return The number of milliseconds that this timer runs before - * firing an event. Zero is returned if the timer is not running. - */ - - const uint32_t getTimeout(void); - /** * Resets the (running) timer to its initial timeout value. This * call does nothing if the timer is not running. @@ -212,6 +181,18 @@ namespace NXWidgets { m_timeout = timeout; } + + /** + * Return the timeout of this timer. + * + * @return The number of milliseconds that this timer will run before + * firing an event. + */ + + inline uint32_t getTimeout(void) const + { + return m_timeout; + } }; } diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index e351d2357..d663df036 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -70,18 +70,20 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include #include #include #include -#include #include +#include + +#include +#include #include "cnxtimer.hxx" -#include "singletons.hxx" /**************************************************************************** * Pre-Processor Definitions @@ -116,44 +118,9 @@ CNxTimer::CNxTimer(CWidgetControl *pWidgetControl, uint32_t timeout, bool repeat m_isRepeater = repeat; m_isRunning = false; - // Create a POSIX timer (We can't do anything about failures here) + // Reset the work structure - int ret = timer_create(CLOCK_REALTIME, (FAR struct sigevent *)NULL, &m_timerid); - if (ret < 0) - { - gdbg("timer_create() failed\n"); - return; - } - - // If we are the first timer created in the whole system, then create - // the timer list and attach the SIGALRM timer handler. - - if (!g_nxTimers) - { - if (!g_nxTimers) - { - gdbg("Failed to create the timer list\n"); - return; - } - - // Attach the SIGALM signal handler (no harm if this is done multiple times) - - struct sigaction sigact; - sigact.sa_handler = signalHandler; - sigact.sa_flags = 0; - sigemptyset(&sigact.sa_mask); - - ret = sigaction(SIGALRM, &sigact, (FAR struct sigaction *)NULL); - if (ret < 0) - { - gdbg("sigaction() failed\n"); - return; - } - } - - // Add ourself onto the array of timers -#warning "Need to disable SIGALRM here" - g_nxTimers->push_back(this); + memset(&m_work, 0, sizeof(m_work)); } /** @@ -162,54 +129,6 @@ CNxTimer::CNxTimer(CWidgetControl *pWidgetControl, uint32_t timeout, bool repeat CNxTimer::~CNxTimer(void) { - // Locate ourself in the list of timers and remove ourselves - -#warning "Need to disable SIGALRM here" - for (int i = 0; i < g_nxTimers->size(); i++) - { - CNxTimer *timer = g_nxTimers->at(i); - if (timer == this) - { - g_nxTimers->erase(i); - break; - } - } - - // Destroy the timer - - (void)timer_delete(m_timerid); -} - -/** - * Return the timeout of this timer. - * - * @return The number of milliseconds that this timer will run before firing - * an event. - */ - -const uint32_t CNxTimer::getTimeout(void) -{ - // If the timer is not running, then just return the timeout value - - if (!m_isRunning) - { - return m_timeout; - } - else - { - // Get the time remaining on the POSIX timer. Of course, there - // are race conditions here.. the timer could expire at anytime - - struct itimerspec remaining; - int ret = timer_gettime(m_timerid, &remaining); - if (ret < 0) - { - gdbg("timer_gettime() failed\n"); - return 0; - } - - return timespecToMilliseconds(&remaining.it_value); - } } /** @@ -222,11 +141,7 @@ void CNxTimer::reset(void) if (m_isRunning) { - // If the specified timer was already armed when timer_settime() is - // called, this call will reset the time until next expiration to the - // value specified. - - m_isRunning = false; + stop(); start(); } } @@ -241,24 +156,14 @@ void CNxTimer::start(void) if (!m_isRunning) { - // If the specified timer was already armed when timer_settime() is - // called, this call will reset the time until next expiration to the - // value specified. - - struct itimerspec timerspec; - millisecondsToTimespec(m_timeout, &timerspec.it_value); - timerspec.it_interval.tv_sec = 0; - timerspec.it_interval.tv_nsec = 0; + uint32_t ticks = m_timeout / MSEC_PER_TICK; + int ret = work_queue(USRWORK, &m_work, workQueueCallback, this, ticks); - int ret = timer_settime(m_timerid, 0, &timerspec, - (FAR struct itimerspec *)NULL); if (ret < 0) { - gdbg("timer_settime() failed\n"); + gdbg("work_queue failed: %d\n", ret); } - // The timer is now running - m_isRunning = true; } } @@ -271,112 +176,33 @@ void CNxTimer::stop(void) { if (m_isRunning) { - // If the it_value member of value is zero, the timer will be disarmed. - // The effect of disarming or resetting a timer with pending expiration - // notifications is unspecified. + int ret = work_cancel(USRWORK, &m_work); - struct itimerspec nullTime; - memset(&nullTime, 0, sizeof(struct itimerspec)); - - int ret = timer_settime(m_timerid, 0, &nullTime, - (FAR struct itimerspec *)NULL); if (ret < 0) { - gdbg("timer_settime failed\n"); + gdbg("work_cancel failed: %d\n", ret); } - // The time is no longer running - m_isRunning = false; } } -/** - * The SIGALM signal handler that will be called when the timer goes off - * - * @param signo The signal number call caused the handler to run (SIGALM) - */ - -void CNxTimer::signalHandler(int signo) +void CNxTimer::workQueueCallback(FAR void *arg) { - // Call handlerTimerExpiration on every timer instance + CNxTimer* This = (CNxTimer*)arg; - for (int i = 0; i < g_nxTimers->size(); i++) + This->m_isRunning = false; + + // Raise the action event. + + This->m_widgetEventHandlers->raiseActionEvent(); + + // Restart the timer if this is a repeating timer + + if (This->m_isRepeater) { - CNxTimer *timer = g_nxTimers->at(i); - timer->handleTimerExpiration(); + This->start(); } } -/** - * Handle an expired timer - */ - -void CNxTimer::handleTimerExpiration(void) -{ - // Do we think our timer is running? - - if (m_isRunning) - { - // Is it running? It the timer is not running, it will return an - // it_value of zero. - - struct itimerspec status; - int ret = timer_gettime(m_timerid, &status); - if (ret < 0) - { - gdbg("timer_gettime() failed\n"); - return; - } - - // it_value == 0 means that timer is not running - - if (status.it_value.tv_sec == 0 && status.it_value.tv_nsec == 0) - { - // It has expired - - m_isRunning = false; - - // Raise the action event. Hmmm.. are there any issues with - // doing this from a signal handler? We'll find out - - m_widgetEventHandlers->raiseActionEvent(); - - // Restart the timer if this is a repeating timer - - if (m_isRepeater) - { - start(); - } - } - } -} - -/** - * Convert a timespec to milliseconds - * - * @param tp The pointer to the timespec to convert - * @return The corresponding time in milliseconds - */ - -uint32_t CNxTimer::timespecToMilliseconds(FAR const struct timespec *tp) -{ - return (uint32_t)tp->tv_sec * 1000 + (uint32_t)tp->tv_nsec / 10000000; -} - -/** - * Convert milliseconds to a timespec - * - * @param milliseconds The milliseconds to be converted - * @param tp The pointer to the location to store the converted timespec - */ - - void CNxTimer::millisecondsToTimespec(uint32_t milliseconds, - FAR struct timespec *tp) - { - tp->tv_sec = milliseconds / 1000; - uint32_t remainder = milliseconds - (uint32_t)tp->tv_sec * 1000; - tp->tv_nsec = remainder * 1000000; - } - diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 05241817c..57ca5eb2b 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -65,7 +65,7 @@ using namespace NXWidgets; * @param hNxServer Handle to the NX server. * @param widgetControl Controlling widget for this window. */ - + CNxTkWindow::CNxTkWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl) : CCallback(widgetControl) { @@ -101,6 +101,8 @@ CNxTkWindow::~CNxTkWindow(void) // constructed-us. (void)nxtk_closewindow(m_hNxTkWindow); + + delete m_widgetControl; } /** @@ -137,7 +139,7 @@ CWidgetControl *CNxTkWindow::getWidgetControl(void) const /** * Open a toolbar on the framed window. This method both instantiates - * the toolbar object AND calls the INxWindow::open() method to + * the toolbar object AND calls the INxWindow::open() method to * create the toolbar. The toolbar is ready for use upon return. * * @param height. The height in rows of the tool bar @@ -184,7 +186,7 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widget widgetControl->setWidgetStyle(&style); // And create the toolbar - + m_toolbar = new CNxToolbar(this, m_hNxTkWindow, widgetControl, height); if (!m_toolbar) @@ -218,7 +220,7 @@ CNxToolbar *CNxTkWindow::openToolbar(nxgl_coord_t height, CWidgetControl *widget // Provide parent widget control information to new widget control instance. // This information is reported by an NX callback for "normal" windows. But - // the toolbar widget control does not get NX callbacks and has to get the + // the toolbar widget control does not get NX callbacks and has to get the // window size through the setWindowBounds method. // Disable preemption so that we can be assured that all of the following @@ -309,7 +311,7 @@ bool CNxTkWindow::getSize(FAR struct nxgl_size_s *size) * @param pos The new position of the window. * @return True on success, false on any failure. */ - + bool CNxTkWindow::setPosition(FAR const struct nxgl_point_s *pos) { // Set the window size and position @@ -323,7 +325,7 @@ bool CNxTkWindow::setPosition(FAR const struct nxgl_point_s *pos) * @param size The new size of the window. * @return True on success, false on any failure. */ - + bool CNxTkWindow::setSize(FAR const struct nxgl_size_s *size) { // Set the window size diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 23d2d23b5..031edbf3a 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -90,7 +90,7 @@ CTaskbar::~CTaskbar(void) /** * Connect to the server */ - + bool CTaskbar::connect(void) { // Connect to the server @@ -116,7 +116,7 @@ bool CTaskbar::connect(void) void CTaskbar::disconnect(void) { - // Stop all applications and remove them from the task bar. Clearly, there + // Stop all applications and remove them from the task bar. Clearly, there // are some ordering issues here... On an orderly system shutdown, disconnection // should really occur priority to deleting instances @@ -279,7 +279,7 @@ bool CTaskbar::startWindowManager(void) for (int i = 0; i < m_slots.size(); ) { - IApplication *app = m_slots.at(i).app; + IApplication *app = m_slots.at(i).app; gvdbg("Starting app[%d]\n", i); if (!app->run()) @@ -294,7 +294,7 @@ bool CTaskbar::startWindowManager(void) // Then continue with the next application. Notice that i is // not incremented in this case and we will continue with the // next application which will not be at this same index - + continue; } @@ -631,7 +631,7 @@ bool CTaskbar::stopApplication(IApplication *app) app->setTopApplication(false); m_topApp = (IApplication *)0; } - + // Hide the application window. That will move the application to the // bottom of the hiearachy. @@ -655,6 +655,7 @@ bool CTaskbar::stopApplication(IApplication *app) // Yes.. found it. Delete the icon image and remove the entry // from the list of applications + delete m_slots.at(i).image->getBitmap(); delete m_slots.at(i).image; m_slots.erase(i); break; @@ -743,7 +744,7 @@ void CTaskbar::clickIcon(int index, bool click) #endif /** - * Create a raw window. + * Create a raw window. * * 1) Create a dumb CWigetControl instance (see note below) * 2) Pass the dumb CWidgetControl instance to the window constructor @@ -796,7 +797,7 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) * * @return A partially initialized application window instance. */ - + NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { // Create the widget control (with the window messenger) using the default style @@ -892,13 +893,13 @@ void CTaskbar::setApplicationGeometry(NXWidgets::INxWindow *window, bool fullscr * @param pPos The new position of the window. * @return True on success, false on failure. */ - + window->setPosition(&pos); window->setSize(&size); } /** - * Create the task bar window. + * Create the task bar window. * * @return true on success */ @@ -962,7 +963,7 @@ bool CTaskbar::createTaskbarWindow(void) } /** - * Create the background window. + * Create the background window. * * @return true on success */ @@ -984,7 +985,7 @@ bool CTaskbar::createBackgroundWindow(void) } /** - * Create the background image. + * Create the background image. * * @return true on success */ @@ -1056,7 +1057,7 @@ bool CTaskbar::createBackgroundImage(void) m_backImage->setBorderless(true); m_backImage->setRaisesEvents(false); #endif - + return true; } @@ -1132,9 +1133,9 @@ bool CTaskbar::redrawTaskbarWindow(void) image->setRaisesEvents(false); // Highlight the icon for the top-most window - + image->highlight(m_slots.at(i).app == m_topApp); - + // Get the size of the icon image NXWidgets::CRect rect; @@ -1295,7 +1296,7 @@ bool CTaskbar::redrawBackgroundWindow(void) // Raise the background window to the top of the hierarchy m_background->raise(); - + // Fill the entire window with the background color port->drawFilledRect(0, 0, windowSize.w, windowSize.h, @@ -1314,7 +1315,7 @@ bool CTaskbar::redrawBackgroundWindow(void) m_backImage->enableDrawing(); m_backImage->redraw(); } - + return true; } @@ -1344,7 +1345,7 @@ bool CTaskbar::redrawApplicationWindow(IApplication *app) // Redraw taskbar redrawTaskbarWindow(); - + // Every application provides a method to obtain its application window IApplicationWindow *appWindow = app->getWindow(); From e7a39a316d6995177cf5e719b12a2469f3a2698c Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 17 Nov 2012 20:44:02 +0000 Subject: [PATCH 099/390] Finishes all Makefile file changes for Windows native clean git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5368 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/Makefile | 33 +++++++++--------- UnitTests/CButtonArray/Makefile | 33 +++++++++--------- UnitTests/CCheckBox/Makefile | 33 +++++++++--------- UnitTests/CGlyphButton/Makefile | 33 +++++++++--------- UnitTests/CImage/Makefile | 33 +++++++++--------- UnitTests/CKeypad/Makefile | 33 +++++++++--------- UnitTests/CLabel/Makefile | 33 +++++++++--------- UnitTests/CLatchButton/Makefile | 33 +++++++++--------- UnitTests/CLatchButtonArray/Makefile | 33 +++++++++--------- UnitTests/CListBox/Makefile | 33 +++++++++--------- UnitTests/CProgressBar/Makefile | 33 +++++++++--------- UnitTests/CRadioButton/Makefile | 33 +++++++++--------- UnitTests/CScrollbarHorizontal/Makefile | 29 ++++++++-------- UnitTests/CScrollbarVertical/Makefile | 33 +++++++++--------- UnitTests/CSliderHorizonal/Makefile | 33 +++++++++--------- UnitTests/CSliderVertical/Makefile | 33 +++++++++--------- UnitTests/CTextBox/Makefile | 33 +++++++++--------- UnitTests/nxwm/Makefile | 45 +++++++++++++------------ libnxwidgets/Makefile | 17 +++++----- nxwm/Makefile | 23 +++++++------ 20 files changed, 331 insertions(+), 311 deletions(-) diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index c2dcfcb5d..778d46513 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 8df0b4213..39af8ff3a 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index e363aed44..583817857 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 9b529faee..e61f960d1 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index b35fb2f7c..88e786505 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 2003e13f9..873b7a695 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index dacfa6274..5122558ff 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 6730a6eb5..d38872079 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 715ab3e2a..94a2bc49e 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 52f3ca038..ca9055870 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 49eddf188..b9c498df9 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 17b58a7c9..0a96580e0 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index 9efc5d401..0fe12318b 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,7 +148,7 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context @@ -159,10 +159,11 @@ context: .context depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 3f6926628..60fb0b545 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 97be73810..5675c55bf 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 1c3791393..78dc6dc8d 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index 8a44caee2..c913b50a4 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,8 +54,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # Hello, World! C++ Example @@ -70,7 +70,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -120,7 +120,7 @@ endif # Verify that the NXWidget library has been built chklib: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -136,11 +136,11 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -148,21 +148,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 3dd666b11..205caf879 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -36,13 +36,13 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs -include $(APPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS -NXWIDGETS_DIR="$(TESTDIR)/../../libnxwidgets" -NXWIDGETS_INC="$(NXWIDGETS_DIR)/include" -NXWIDGETS_LIB="$(NXWIDGETS_DIR)/libnxwidgets$(LIBEXT)" +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} @@ -54,9 +54,9 @@ endif # Add the path to the NxWM include directory to the CFLAGS -NXWM_DIR="$(TESTDIR)/../../nxwm" -NXWM_INC="$(NXWM_DIR)/include" -NXWM_LIB="$(NXWM_DIR)/libnxwm$(LIBEXT)" +NXWM_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)nxwm" +NXWM_INC="$(NXWM_DIR)$(DELIM)include" +NXWM_LIB="$(NXWM_DIR)$(DELIM)libnxwm$(LIBEXT)" ifeq ($(WINTOOL),y) CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWM_INC)"} @@ -68,8 +68,8 @@ endif # Get the path to the archiver tool -TESTTOOL_DIR="$(TESTDIR)/../../tools" -ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh # NxWM unit test @@ -84,7 +84,7 @@ CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) -POSIX_BIN = "$(APPDIR)/libapps$(LIBEXT)" +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" ifeq ($(WINTOOL),y) BIN = "${shell cygpath -w $(POSIX_BIN)}" else @@ -134,7 +134,7 @@ endif # Verify that the NXWidget library has been built chklibnxwidgets: - @( \ + $(Q) ( \ if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ echo "$(NXWIDGETS_LIB) does not exist."; \ echo "Please go to $(NXWIDGETS_DIR)"; \ @@ -146,7 +146,7 @@ chklibnxwidgets: # Verify that the NxWM library has been built chklibnxwm: - @( \ + $(Q) ( \ if [ ! -e "$(NXWM_LIB)" ]; then \ echo "$(NXWM_LIB) does not exist."; \ echo "Please go to $(NXWM_LIB)"; \ @@ -164,13 +164,13 @@ $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. .built: $(OBJS) $(NXWIDGETS_LIB) $(call ARCHIVE, $@, $(OBJS)) ifeq ($(WINTOOL),y) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) - @$(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) else - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) - @$(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) endif - @touch .built + $(Q) touch .built # Standard housekeeping targets @@ -178,21 +178,22 @@ endif ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) endif - @touch $@ + $(Q) touch $@ context: .context .depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f *.o *~ .*.swp .built + $(call DELFILE .built) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) -include Make.dep diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 654f1d2fc..27a85b428 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -87,8 +87,8 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} -CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} DEPPATH = --dep-path src VPATH = src @@ -105,7 +105,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx $(call COMPILEXX, $<, $@) check_nuttx: - @( \ + $(Q) ( \ if [ -z "$(TOPDIR)" ]; then \ echo "The path to the nuttx directory must be provided on the command line."; \ echo "Usage: make -C $(NXWIDGETDIR) TOPDIR=\"\""; \ @@ -115,7 +115,7 @@ check_nuttx: echo "The nuttx directory (TOPDIR) does not exist: $(TOPDIR)"; \ exit 1; \ fi; \ - if [ ! -f "$(TOPDIR)/.config" ]; then \ + if [ ! -f "$(TOPDIR)$(DELIM).config" ]; then \ echo "The nuttx directory (TOPDIR) has not been configured"; \ echo "Please configure NuttX and try again"; \ exit 1; \ @@ -126,17 +126,18 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) - @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f $(BIN) *.a *.o *~ .*.sw* + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) export: $(BIN) zip -r nxwidgets-export.zip include $(BIN) COPYING diff --git a/nxwm/Makefile b/nxwm/Makefile index d272a8384..b176ce4f7 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -44,7 +44,7 @@ export Q := @ endif NXWMDIR := ${shell pwd | sed -e 's/ /\\ /g'} -NXWIDGETDIR := $(NXWMDIR)/../libnxwidgets +NXWIDGETDIR := $(NXWMDIR)$(DELIM)..$(DELIM)libnxwidgets ASRCS = CSRCS = @@ -88,10 +88,10 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} -CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)/include} -CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)/include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} DEPPATH = --dep-path src VPATH = src @@ -109,7 +109,7 @@ $(CXXOBJS): %$(OBJEXT): %.cxx $(call COMPILEXX, $<, $@) check_nuttx: - @( \ + $(Q) ( \ if [ -z "$(TOPDIR)" ]; then \ echo "The path to the nuttx directory must be provided on the command line."; \ echo "Usage: make -C $(NXWMDIR) TOPDIR=\"\""; \ @@ -119,7 +119,7 @@ check_nuttx: echo "The nuttx directory (TOPDIR) does not exist: $(TOPDIR)"; \ exit 1; \ fi; \ - if [ ! -f "$(TOPDIR)/.config" ]; then \ + if [ ! -f "$(TOPDIR)$(DELIM).config" ]; then \ echo "The nuttx directory (TOPDIR) has not been configured"; \ echo "Please configure NuttX and try again"; \ exit 1; \ @@ -130,17 +130,18 @@ $(BIN): $(OBJS) $(call ARCHIVE, $@, $(OBJS)) .depend: Makefile $(SRCS) - @$(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - @touch $@ + $(Q) $(MKDEP) $(DEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ depend: .depend clean: - @rm -f $(BIN) *.a *.o *~ .*.sw* + $(call DELFILE $(BIN)) $(call CLEAN) distclean: clean - @rm -f Make.dep .depend + $(call DELFILE Make.dep) + $(call DELFILE .depend) export: $(BIN) zip -r nxwm-export.zip include $(BIN) COPYING From d95217b12b4901f867489450133fd2bd748f0cba Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 20 Nov 2012 15:47:41 +0000 Subject: [PATCH 100/390] Missing comma in EVERY DELFILE/DELDIR macro call in every Makefile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5373 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButton/Makefile | 6 +++--- UnitTests/CButtonArray/Makefile | 6 +++--- UnitTests/CCheckBox/Makefile | 6 +++--- UnitTests/CGlyphButton/Makefile | 6 +++--- UnitTests/CImage/Makefile | 6 +++--- UnitTests/CKeypad/Makefile | 6 +++--- UnitTests/CLabel/Makefile | 6 +++--- UnitTests/CLatchButton/Makefile | 6 +++--- UnitTests/CLatchButtonArray/Makefile | 6 +++--- UnitTests/CListBox/Makefile | 6 +++--- UnitTests/CProgressBar/Makefile | 6 +++--- UnitTests/CRadioButton/Makefile | 6 +++--- UnitTests/CScrollbarHorizontal/Makefile | 6 +++--- UnitTests/CScrollbarVertical/Makefile | 6 +++--- UnitTests/CSliderHorizonal/Makefile | 6 +++--- UnitTests/CSliderVertical/Makefile | 6 +++--- UnitTests/CTextBox/Makefile | 6 +++--- UnitTests/nxwm/Makefile | 6 +++--- libnxwidgets/Makefile | 6 +++--- nxwm/Makefile | 6 +++--- 20 files changed, 60 insertions(+), 60 deletions(-) diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 778d46513..d80ef3c76 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 39af8ff3a..b4a3b0571 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 583817857..21e007b3d 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index e61f960d1..1e7faf026 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 88e786505..61978147e 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 873b7a695..d27b90192 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 5122558ff..14e8897d2 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index d38872079..435a4c3cd 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 94a2bc49e..0f6fe639f 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index ca9055870..301424c47 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index b9c498df9..d50d3ed05 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 0a96580e0..ff6c2d247 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index 0fe12318b..a5fab0dda 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 60fb0b545..204b90a52 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 5675c55bf..67f00f622 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 78dc6dc8d..409f361fd 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index c913b50a4..a4c752e6c 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -159,11 +159,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 205caf879..338b83e54 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -189,11 +189,11 @@ context: .context depend: .depend clean: - $(call DELFILE .built) + $(call DELFILE, .built) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) -include Make.dep diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 27a85b428..0c7c922ea 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -132,12 +132,12 @@ $(BIN): $(OBJS) depend: .depend clean: - $(call DELFILE $(BIN)) + $(call DELFILE, $(BIN)) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) export: $(BIN) zip -r nxwidgets-export.zip include $(BIN) COPYING diff --git a/nxwm/Makefile b/nxwm/Makefile index b176ce4f7..0bea357b2 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -136,12 +136,12 @@ $(BIN): $(OBJS) depend: .depend clean: - $(call DELFILE $(BIN)) + $(call DELFILE, $(BIN)) $(call CLEAN) distclean: clean - $(call DELFILE Make.dep) - $(call DELFILE .depend) + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) export: $(BIN) zip -r nxwm-export.zip include $(BIN) COPYING From aecbc4a15c687d9ada11c5d6162e24bf50c50ae6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 14:13:57 +0000 Subject: [PATCH 101/390] Add common Toolchain.defs for AVR/AVR32; Add Toolchain.defs for ARM; Add more toolchain options (from Mike); incdir.sh and .bat now take -s option git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5384 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 65022ea15..f932d5bc2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -212,4 +212,3 @@ user-space work queues (someday) in order to accomplish that functionaliy. Submitted by Petteri Aimonen. - solutions From e9d2baa274ded95864c7abdb3d683e61460cce6c Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 23 Nov 2012 15:49:06 +0000 Subject: [PATCH 102/390] Several changes (mostly graphics related) from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5385 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++- libnxwidgets/src/cnumericedit.cxx | 8 +++++--- libnxwidgets/src/ctext.cxx | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f932d5bc2..c3ae00d6a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -211,4 +211,6 @@ using the internal work queues from user space. I have decided to implemented user-space work queues (someday) in order to accomplish that functionaliy. Submitted by Petteri Aimonen. - +* NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs + (from Petteri Aimonen). + \ No newline at end of file diff --git a/libnxwidgets/src/cnumericedit.cxx b/libnxwidgets/src/cnumericedit.cxx index e0df014c5..993e86fb8 100644 --- a/libnxwidgets/src/cnumericedit.cxx +++ b/libnxwidgets/src/cnumericedit.cxx @@ -158,9 +158,11 @@ CNumericEdit::CNumericEdit(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_ CNumericEdit::~CNumericEdit() { - delete m_label; - delete m_button_minus; - delete m_button_plus; + // CNxWidget destroys all children + + m_label = 0; + m_button_minus = 0; + m_button_plus = 0; } void CNumericEdit::getPreferredDimensions(CRect &rect) const diff --git a/libnxwidgets/src/ctext.cxx b/libnxwidgets/src/ctext.cxx index 688031d88..caa0c02e8 100644 --- a/libnxwidgets/src/ctext.cxx +++ b/libnxwidgets/src/ctext.cxx @@ -276,11 +276,14 @@ const int CText::getLineTrimmedLength(const int lineNumber) const length--; } while (iterator->moveToPrevious() && (length > 0)); + + delete iterator; return length; } // May occur if data has been horribly corrupted somewhere + delete iterator; return 0; } From 0dbe3858ea4f8a9cbc93d220286522bae06b5d31 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 7 Dec 2012 16:00:56 +0000 Subject: [PATCH 103/390] Patches from Petteri Aimonen + stdbool and rand() changes for Freddie Chopin git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5415 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 6 +++- libnxwidgets/include/cnxwidget.hxx | 2 +- libnxwidgets/src/cscrollingpanel.cxx | 46 +++++++++++++++++++++++----- nxwm/include/cstartwindow.hxx | 4 +-- 4 files changed, 47 insertions(+), 11 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c3ae00d6a..7f7b21247 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -213,4 +213,8 @@ Submitted by Petteri Aimonen. * NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs (from Petteri Aimonen). - \ No newline at end of file +* NxWidgets::CScrollingPanel: Usability improvements. It is borderless for now, + because there was no easy way to redraw only the required part of the border. + Contributed by Petteri Aimonen. +* NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub- + classing easier (from Petteri Aimonen). diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 2ca055c1c..dda8efc1d 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -1058,7 +1058,7 @@ namespace NXWidgets * @return True if the click was successful. */ - bool click(nxgl_coord_t x, nxgl_coord_t y); + virtual bool click(nxgl_coord_t x, nxgl_coord_t y); /** * Check if the click is a double-click. diff --git a/libnxwidgets/src/cscrollingpanel.cxx b/libnxwidgets/src/cscrollingpanel.cxx index d3ee40cf9..b7c507bb2 100644 --- a/libnxwidgets/src/cscrollingpanel.cxx +++ b/libnxwidgets/src/cscrollingpanel.cxx @@ -70,11 +70,12 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include #include +#include #include "cwidgetcontrol.hxx" #include "cscrollingpanel.hxx" @@ -113,6 +114,13 @@ CScrollingPanel::CScrollingPanel(CWidgetControl *pWidgetControl, : CNxWidget(pWidgetControl, x, y, width, height, flags, style) { m_widgetControl = pWidgetControl; + + // NOTE: CScrollingPanel is temporarily borderless because there was no + // easy way to redraw only the required part of the border. + + m_flags.permeable = true; + m_flags.borderless = true; + CRect rect; getClientRect(rect); @@ -120,12 +128,10 @@ CScrollingPanel::CScrollingPanel(CWidgetControl *pWidgetControl, m_canvasHeight = rect.getHeight(); m_canvasX = 0; m_canvasY = 0; - + setAllowsVerticalScroll(true); setAllowsHorizontalScroll(true); setContentScrolled(true); - - m_flags.permeable = true; } /** @@ -186,6 +192,24 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) CGraphicsPort *port = m_widgetControl->getGraphicsPort(); port->move(getX(), getY(), dx, dy, rect.getWidth(), rect.getHeight()); + if (dx > 0) + { + revealedRects.push_back(CRect(getX(), getY(), dx, rect.getHeight())); + } + else if (dx < 0) + { + revealedRects.push_back(CRect(getX() + rect.getWidth() + dx, getY(), -dx, rect.getHeight())); + } + + if (dy > 0) + { + revealedRects.push_back(CRect(getX(), getY(), rect.getWidth(), dy)); + } + else if (dy < 0) + { + revealedRects.push_back(CRect(getX(), getY() + rect.getHeight() + dy, rect.getWidth(), -dy)); + } + // Adjust the scroll values m_canvasY += dy; @@ -193,12 +217,20 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) if (revealedRects.size() > 0) { - // Draw revealed sections + // Draw background to revealed sections + // Children will redraw themselves in moveTo. for (int i = 0; i < revealedRects.size(); ++i) { - drawBorder(port); - drawContents(port); + CRect &rrect = revealedRects[i]; + + gvdbg("Redrawing %d,%d,%d,%d after scroll\n", + rrect.getX(), rrect.getY(), + rrect.getWidth(), rrect.getHeight()); + + port->drawFilledRect(rrect.getX(), rrect.getY(), + rrect.getWidth(), rrect.getHeight(), + getBackgroundColor()); } } } diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 671b01087..52a67fbd4 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -97,8 +97,8 @@ namespace NxWM */ class CStartWindow : public IApplication, - private IApplicationCallback, - private NXWidgets::CWidgetEventHandler + protected IApplicationCallback, + protected NXWidgets::CWidgetEventHandler { protected: /** From 33267974c5a235105aed53a160c4b2a7a8079a5f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 20 Dec 2012 20:22:21 +0000 Subject: [PATCH 104/390] Prep for release 6.24 git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5447 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 6 ++++-- ReleaseNotes.txt | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7f7b21247..df9fb2d41 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -171,7 +171,7 @@ * Kconfig: Add option to turn on the memory monitor feature of the NxWidgets/NxWM unit tests. -1.4 2012-xx-xx Gregory Nutt +1.4 2012-12-20 Gregory Nutt * libnxwidgets/Makefile, NxWidgets/nxwm/Makefile, and NxWidgets/UnitTests/nxwm/Makefile: Makefile improvements from @@ -206,7 +206,7 @@ Contributed by Petteri, Aimonen. * NxWM::CStartWindow: Fix mq_receive error handling with signal is recieved. From Petteri Aimonen. -* NxWidgets:CNxTimer: Replace the original (apparently non-functional) signal- +* NxWidgets::CNxTimer: Replace the original (apparently non-functional) signal- based solution with a work queue-based solution. This raises some isses about using the internal work queues from user space. I have decided to implemented user-space work queues (someday) in order to accomplish that functionaliy. @@ -218,3 +218,5 @@ Contributed by Petteri Aimonen. * NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub- classing easier (from Petteri Aimonen). + +1.5 2013-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 7d3fb7aaa..4b155c50e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -9,7 +9,7 @@ features have been fully verified). NxWidgets-1.1 ============= -The 2nd release of the NxWidgets package as made on May 19, 2012. The +The 2nd release of the NxWidgets package was made on May 19, 2012. The headline new feature in this release is: * NxWM, the tiny window manager based on NX and NxWidgets. NxWM is true @@ -69,7 +69,7 @@ Bug fixes include changes to the following (see the ChangeLog for details): NxWidgets-1.2 ============= -The 3rd release of the NxWidgets package as made on June 15, 2012. This +The 3rd release of the NxWidgets package was made on June 15, 2012. This release depends on NuttX-6.19 or above and should not be used with older NuttX releases. @@ -100,7 +100,7 @@ As well as other, less critical bugs (see the ChangeLog for details) NxWidgets-1.3 ============= -The 4th release of the NxWidgets package as made on September 29, 2012. This +The 4th release of the NxWidgets package was made on September 29, 2012. This release depends on NuttX-6.22 or above and should not be used with older NuttX releases. @@ -112,3 +112,35 @@ of NuttX. These comptibility changes include: * Build system changes * Changes needed for the NuttX configuration tool +NxWidgets-1.4 +============= + +The 5th release of the NxWidgets package was made on December 20, 2012. This +release depends on NuttX-6.22 or above and should not be used with older +NuttX releases. This release corresponds to SVN revision r5447. + +Note: Nearly all changes between 1.3 and 1.4 were the result of the efforts +of Petteri Aimonen. + +Additional new features and extended functionality in Version 1.4: + +* NxWdigets::CNxServer: Reduce start-up delay +* NxWM::CApplicationWindow: Option to eliminate minimize button. +* NxWM::CTaskbar: Option to eliminte the background image; highlight current + icon in the task bar. +* NxWidgets::CNumericEdit: New widget. Basically a CLabel with +/- buttons. +* NxWidgets::CNxTimer: Replace the original signal-based solution with a + work queue-based solution. This raises some isses about using the + internal work queues from user space. +* Build System: Misc improvements. +* Tools: bitmap_converter.py will convert images to NxWidgets RLE-encoded format. + +Bugfixes (see the change log for details). Some of these are very important +(marked *critical*): + +* NxWidgets::CCallback: Misplaced #endif +* NxWM::CCalculator and NxWM::CStartWindow: Add forward declaration for icon images. +* glych_cycle: Correct width, destructor needs to be public. +* NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs +* NxWidgets::CScrollingPanel: It is borderless for now because there was no + easy way to redraw only the required part of the border. From 7e7e9979a21e9bc1ae6dc4c1d998aae4c17ca285 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 21 Dec 2012 20:09:32 +0000 Subject: [PATCH 105/390] Patches from Petteri Aimonen (plus a few other things) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5448 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 32 +++ Kconfig | 265 ++++++++++++++++++++--- ReleaseNotes.txt | 2 +- UnitTests/CButton/Makefile | 2 +- UnitTests/CButtonArray/Makefile | 2 +- UnitTests/CCheckBox/Makefile | 2 +- UnitTests/CGlyphButton/Makefile | 2 +- UnitTests/CImage/Makefile | 2 +- UnitTests/CKeypad/Makefile | 2 +- UnitTests/CLabel/Makefile | 2 +- UnitTests/CLatchButton/Makefile | 2 +- UnitTests/CLatchButtonArray/Makefile | 2 +- UnitTests/CListBox/Makefile | 2 +- UnitTests/CProgressBar/Makefile | 2 +- UnitTests/CRadioButton/Makefile | 2 +- UnitTests/CScrollbarHorizontal/Makefile | 2 +- UnitTests/CScrollbarVertical/Makefile | 2 +- UnitTests/CSliderHorizonal/Makefile | 2 +- UnitTests/CSliderVertical/Makefile | 2 +- UnitTests/CTextBox/Makefile | 2 +- UnitTests/nxwm/Makefile | 2 +- libnxwidgets/include/cgraphicsport.hxx | 34 +++ libnxwidgets/include/cscrollingpanel.hxx | 3 +- libnxwidgets/src/ccyclebutton.cxx | 19 -- libnxwidgets/src/cgraphicsport.cxx | 110 +++++++--- libnxwidgets/src/clabel.cxx | 23 +- libnxwidgets/src/cscrollingpanel.cxx | 40 +++- 27 files changed, 466 insertions(+), 98 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index df9fb2d41..744584ed4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -220,3 +220,35 @@ classing easier (from Petteri Aimonen). 1.5 2013-xx-xx Gregory Nutt + +* NxWidgets::CGraphicsPort::move(): Fix typo bug in bounding rectangle + calculation (from Petteri Aimonen). +* NxWM::CScrollingPanel::scrollChildren(): Avoid unnecessary redraws in + CScrollingPanel (contributed by Petteri Aimonen). +* NxWM::CCycleButton: Remove the separator from CCycleButton. It draws in + wrong place, and doesnt look very good in the correct place either. + (from Petteri Aimonen). +* NxWidgets::CGraphicsPort: Many times we only want a constant background. + In that case the old code fills the background, reads it back, renders + the text and then writes it back. When used with LCD's (instead of + framebuffers) this causes unnecessary delay and screen flicker. + This commit adds a variant of drawText that takes background color, + so that the background and text can both be rendered at one go. + The old functions still function as before (Petteri Aimonen). +* NxWidgets::CLabel: The label was drawn as a single rectangular region, + then a text was added to the on top of this. The result is that the + text would flicker when the CLabel was updated. With this change, the + two step update is replaced with a five step update: The background + is updated as four rectangulear regions (leaving the previous text in + place), then the new text is updated. This eliminates the flicker + (Petteri Aimonen). +* Kconfig: Many NxWidgets/NxWM settings do not have meaningful, generic + default values. Colors, for example, depend on pixel depth. Some + geometry settings depending on other geometry settings. Font IDs are + not know-able by the configuration system. etc. In these cases, it + is best if the settings are just not undefined so that the system can + calculate a reasonable default. however, if no default is provided + in the .config file, mconf will complain and generate errors. So work + around this, I added several "enabling" settings to override the + default setting. This is awkward and I preferred the configuration as + it was before, but this avoids the mconf errors and warnings. diff --git a/Kconfig b/Kconfig index 59d8856bc..656399199 100644 --- a/Kconfig +++ b/Kconfig @@ -13,6 +13,18 @@ config NXWIDGETS if NXWIDGETS comment "NX Server/Device Configuration" +config NXWIDGETS_FLICKERFREE + bool "Enable Flicker Reduction Logic" + default y if NX_LCDDRIVER + default n if !NX_LCDDRIVER + ---help--- + Because of their performance an in the manner in which they are + updated, LCDs may be prone to "flicker" in the displays when Widgets + are updated. Often more complex (and slower) options are availble + to reduce the flicker. Enabling this option will enabled those + lower-performance flicker-reductions measures where-ever thay may + be available. + config NXWIDGETS_DEVNO int "LCD Device Number" default 0 @@ -96,10 +108,20 @@ config NXWIDGETS_SIZEOFCHAR comment "NXWidget Default Values" +config NXWIDGETS_SYSTEM_CUSTOM_FONTID + bool "Use a Custom Default Font" + default n + ---help--- + Set to override the system default font id (NXFONT_DEFAULT). + +if NXWIDGETS_SYSTEM_CUSTOM_FONTID config NXWIDGETS_DEFAULT_FONTID int "Default Font ID" + default 0 ---help--- - Default font ID. Default: NXFONT_DEFAULT + Use this default NxWidgets font ID instead of the system font ID + (NXFONT_DEFAULT). Default: 0 +endif config NXWIDGETS_TNXARRAY_INITIALSIZE int "Initial Size of Dynamic Arrays" @@ -113,53 +135,88 @@ config NXWIDGETS_TNXARRAY_SIZEINCREMENT ---help--- Default dynamic array realloctino increment (in entries). Default: 8 +config NXWIDGETS_CUSTOM_FILLCOLORS + bool "Custom Default Fill Colors" + default n + ---help--- + Select custom default colors for the widget background. If defined, + the hexadecimal values for all filled colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n + +if NXWIDGETS_CUSTOM_FILLCOLORS config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR - hex "Normal Background Color" + hex "Default Normal Background Color" ---help--- Normal background color. Default: RGB(148,189,215) config NXWIDGETS_DEFAULT_SELECTEDBACKGROUNDCOLOR - hex "Selected Background Color" + hex "Default Selected Background Color" ---help--- Default selected background color. Default: RGB(206,227,241) +config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR + hex "Default Highlight Color" + ---help--- + Highlight color. Currently this color is only used in clist + boxes, progress bars, and slider grips. Default: RGB(192,192,192) +endif + +config NXWIDGETS_CUSTOM_EDGECOLORS + bool "Custom Default Edge Colors" + default n + ---help--- + Select custom default colors for the widget edges. If defined, + then hexadecimal values for all edge colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n. + +if NXWIDGETS_CUSTOM_EDGECOLORS config NXWIDGETS_DEFAULT_SHINEEDGECOLOR - hex "Shiny Edge Color" + hex "Default Shiny Edge Color" ---help--- Shiny side boarder color. Default: RGB(248,248,248) config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR - hex "Shadow Edge Color" + hex "Default Shadow Edge Color" ---help--- Shadowed side border color. Default: RGB(35,58,73) +endif -config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR - hex "Highlight Color" +config NXWIDGETS_CUSTOM_TEXTCOLORS + bool "Custom Default Text colors" + default n ---help--- - Highlight color. Default: RGB(192,192,192) + Select custom colors for the widget text. If defined, then + hexadecimal values for all text colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n. +if NXWIDGETS_CUSTOM_TEXTCOLORS config NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR - hex "Disabled Text Color" + hex "Default Disabled Text Color" ---help--- Text color on a disabled widget: Default: RGB(192,192,192) config NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR - hex "Enabled Text Color" + hex "Default Enabled Text Color" ---help--- Text color on a enabled widget. Default: RGB(248,248,248) config NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR - hex "Selected Text Color" + hex "Default Selected Text Color" ---help--- Text color on a selected widget. Default: RGB(0,0,0) config NXWIDGETS_DEFAULT_FONTCOLOR - hex "Default Font Color" + hex "Default Default Font Color" ---help--- Default font color. Default: RGB(255,255,255) +endif config NXWIDGETS_TRANSPARENT_COLOR hex "Transparent Color" + default 0x0 ---help--- Transparent color. Default: RGB(0,0,0) @@ -220,10 +277,20 @@ config NXWM if NXWM comment "General settings" +config NXWM_SYSTEM_CUSTOM_FONTID + bool "Use Custom Default Font" + default n + ---help--- + Set to override the system default font id (NXFONT_DEFAULT). + +if NXWM_SYSTEM_CUSTOM_FONTID config NXWM_DEFAULT_FONTID int "Font ID" + default 0 ---help--- - The NxWM default font ID. Default: NXFONT_DEFAULT + Use this NxWM default font ID instead of the system font ID + (NXFONT_DEFAULT). Default: 0 +endif config NXWM_UNITTEST bool "NxWM Unit Test" @@ -233,6 +300,16 @@ config NXWM_UNITTEST comment "Color configuration" +config NXWM_CUSTOM_FILLCOLORS + bool "Custom Default Fill Colors" + default n + ---help--- + Select custom default colors for the widget background. If defined, + the hexadecimal values for all filled colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n + +if NXWM_CUSTOM_FILLCOLORS config NXWM_DEFAULT_BACKGROUNDCOLOR hex "Background Color" ---help--- @@ -242,7 +319,18 @@ config NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR hex "Normal Background Color" ---help--- Select background color. Default: RGB(206,227,241) +endif +config NXWM_CUSTOM_EDGECOLORS + bool "Custom Default Edge Colors" + default n + ---help--- + Select custom default colors for the widget edges. If defined, + then hexadecimal values for all edge colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n. + +if NXWM_CUSTOM_EDGECOLORS config NXWM_DEFAULT_SHINEEDGECOLOR hex "Shiny Edge Color" ---help--- @@ -252,7 +340,18 @@ config NXWM_DEFAULT_SHADOWEDGECOLOR hex "Shadow Edge Color" ---help--- Color of the shadowed edge of a border. Default: RGB(0,0,0) +endif +config NXWM_CUSTOM_TEXTCOLORS + bool "Custom Default Text colors" + default n + ---help--- + Select custom colors for the widget text. If defined, then + hexadecimal values for all text colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n. + +if NXWM_CUSTOM_TEXTCOLORS config NXWM_DEFAULT_FONTCOLOR hex "Default Font Color" ---help--- @@ -260,8 +359,10 @@ config NXWM_DEFAULT_FONTCOLOR config NXWM_TRANSPARENT_COLOR hex "Transparent Color" + default 0x0 ---help--- The "transparent" color. Default: RGB(0,0,0) +endif comment "Horizontal and vertical spacing of icons in the task bar" @@ -303,27 +404,48 @@ config NXWM_TASKBAR_RIGHT endchoice +config NXWM_CUSTOM_TASKBAR_WIDTH + bool "Use Custom Taskbar width" + default n + ---help--- + Set to override the default taskbar thickness (either vertical or + horizontal). The default depends on the selected horizontal or + vertical spacing. Default: 25 + 2*spacing + +if NXWM_CUSTOM_TASKBAR_WIDTH config NXWM_TASKBAR_WIDTH int "Taskbar Width" + default 29 ---help--- - Task bar thickness (either vertical or horizontal). Default: 25 + 2*spacing + Task bar thickness (either vertical or horizontal). Default: 25 + 2*2 +endif config NXWM_DISABLE_MINIMIZE bool "Disable Minimize Button" default n ---help--- - If the "desktop" is empty, users have no need to minimize any windows. If the buttons - are small, it's easy to hit minimize button accidentally when trying to close an - application. + If the "desktop" is empty, users have no need to minimize any + windows. If the buttons are small, it's easy to hit minimize + button accidentally when trying to close an application. comment "Tool Bar Configuration" +config NXWM_CUSTOM_TOOLBAR_HEIGHT + bool "Use Custom Toolbar Height" + default n + ---help--- + Set to override the default tooldar height The default depends on + the selected horizontal or vertical spacing. Default: 21 + 2*spacing + +if NXWM_CUSTOM_TOOLBAR_HEIGHT config NXWM_TOOLBAR_HEIGHT int "Toolbar Height" + default 25 ---help--- The height of the tool bar in each application window. At present, all icons are 21 pixels in height and, hence, require a task bar of - at least that size. + at least that size. Default: 21 + 2*2 +endif comment "Background Image" @@ -357,10 +479,19 @@ config NXWM_STARTWINDOW_HSPACING ---help--- Horizontal spacing. Default: 4 rows +config NXWM_CUSTOM_STARTWINDOW_ICON + bool "Custom Start Window Icon" + default n + ---help--- + Select to override the default Start Window Icon: NxWM::g_playBitmap + +if NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_ICON string "StartWindow Icon" + default "NxWM::g_playBitmap" ---help--- The glyph to use as the start window icon. Default: NxWM::g_playBitmap +endif config NXWM_STARTWINDOW_MQNAME string "Message Queue Name" @@ -417,6 +548,16 @@ config NXWM_NXCONSOLE_STACKSIZE The stack size to use when starting the NxConsole task. Default: 2048 bytes. +config NXWM_NXCONSOLE_CUSTOM_COLORS + bool "Custom NxConsole Colors" + default n + ---help--- + Select custom default colors for the NxConsole window. If defined, + the hexadecimal values for all NxConsole colors must be provided + (there are no default colors because the hexadecimal representation + of the default colors depend on the pixel depth). Default: n + +if NXWM_NXCONSOLE_CUSTOM_COLORS config NXWM_NXCONSOLE_WCOLOR hex "NxConsole Background Color" ---help--- @@ -428,17 +569,36 @@ config NXWM_NXCONSOLE_FONTCOLOR ---help--- The color of the fonts to use in the NxConsole window. Default: RGB(0,0,0) +endif +config NXWM_NXCONSOLE_CUSTOM_FONTID + bool "Use Custom Default Font" + default n + ---help--- + Set to override the system default font id (NXWM_DEFAULT_FONTID). + +if NXWM_NXCONSOLE_CUSTOM_FONTID config NXWM_NXCONSOLE_FONTID int "NxConsole Font ID" + default 0 ---help--- - The ID of the font to use in the NxConsole window. Default: - NXWM_DEFAULT_FONTID + Use this default font ID in the NxConsole window instead of the + NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 +endif +config NXWM_CUSTOM_NXCONSOLE_ICON + bool "Custom NxConsole Icon" + default n + ---help--- + Select to override the default NxConsole Window Icon: NxWM::g_cmdBitmap + +if NXWM_CUSTOM_NXCONSOLE_ICON config NXWM_NXCONSOLE_ICON string "NxConsole Icon" + default "NxWM::g_cmdBitmap" ---help--- The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap +endif config NXWM_TOUCHSCREEN bool "Touchscreen Support" @@ -478,6 +638,7 @@ config NXWM_TOUCHSCREEN_LISTENERPRIO config NXWM_TOUCHSCREEN_LISTENERSTACK int "Touchscreen Listener Task Stack Size" + default 1024 ---help--- Touchscreen listener thread stack size. Default 1024 @@ -527,6 +688,17 @@ endif comment "Calibration display settings" +config NXWM_CALIBRATION_CUSTOM_COLORS + bool "Custom Calibration Colors" + default n + ---help--- + Select custom default colors for the calibration window. If + defined, the hexadecimal values for all calibration window + colors must be provided (there are no default colors because + the hexadecimal representation of the default colors depend + on the pixel depth). Default: n + +if NXWM_CALIBRATION_CUSTOM_COLORS config NXWM_CALIBRATION_BACKGROUNDCOLOR hex "Background Color" ---help--- @@ -550,12 +722,23 @@ config NXWM_CALIBRATION_TOUCHEDCOLOR ---help--- The color of the circle in the touchscreen calibration display after the touch is recorder. Default: RGB(255, 255, 96) (very light yellow) +endif +config NXWM_CUSTOM_CALIBRATION_ICON + bool "Custom Calibration Icon" + default n + ---help--- + Select to override the default Calibration Window Icon: + NxWM::g_calibrationBitmap + +if NXWM_CUSTOM_CALIBRATION_ICON config NXWM_CALIBRATION_ICON string "Callibration Icon" + default "NxWM::g_calibrationBitmap" ---help--- The ICON to use for the touchscreen calibration application. Default: NxWM::g_calibrationBitmap +endif config NXWM_CALIBRATION_SIGNO int "Calibration Signal Number" @@ -576,23 +759,55 @@ config NXWM_CALIBRATION_LISTENERSTACK ---help--- Calibration listener thread stack size. Default 2048 -comment "Calibration display settings" +comment "Hex Calculator display settings" +config NXWM_HEXCALCULATOR_CUSTOM_COLORS + bool "Custom Hex Calculator Colors" + default n + ---help--- + Select custom default colors for the Hex Calcualtor window. If + defined, the hexadecimal values for all hex calculator colors + must be provided (there are no default colors because the + hexadecimal representation of the default colors depend on the + pixel depth). Default: n + +if NXWM_HEXCALCULATOR_CUSTOM_COLORS config NXWM_HEXCALCULATOR_BACKGROUNDCOLOR hex "Calculator Background Color" ---help--- The background color of the calculator display. Default: Same as NXWM_DEFAULT_BACKGROUNDCOLOR +endif -config NXWM_HEXCALCULATOR_ICON - string "Calculator Icon" +config NXWM_CUSTOM_HEXCALCULATOR_ICON + bool "Custom Hex Calculator Icon" + default n ---help--- - The ICON to use for the hex calculator application. Default: + Select to override the default Hex Calculator Window Icon: NxWM::g_calculatorBitmap +if NXWM_CUSTOM_HEXCALCULATOR_ICON +config NXWM_HEXCALCULATOR_ICON + string "Calculator Icon" + default "NxWM::g_calculatorBitmap" + ---help--- + The ICON to use for the hex calculator application. Default: + "NxWM::g_calculatorBitmap" +endif + +config NXWM_HEXCALCULATOR_CUSTOM_FONTID + bool "Use Custom Default Font" + default n + ---help--- + Set to override the system default font id (NXWM_DEFAULT_FONTID). + +if NXWM_HEXCALCULATOR_CUSTOM_FONTID config NXWM_HEXCALCULATOR_FONTID int "Calculator Font ID" + default 0 ---help--- - The font used with the calculator. Default: NXWM_DEFAULT_FONTID + Use this default font ID in the calculator window instead of the + NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 +endif endif diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 4b155c50e..aaaefe6eb 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -116,7 +116,7 @@ NxWidgets-1.4 ============= The 5th release of the NxWidgets package was made on December 20, 2012. This -release depends on NuttX-6.22 or above and should not be used with older +release depends on NuttX-6.24 or above and should not be used with older NuttX releases. This release corresponds to SVN revision r5447. Note: Nearly all changes between 1.3 and 1.4 were the result of the efforts diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index d80ef3c76..ea7b5cf25 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index b4a3b0571..6bb490e34 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 21e007b3d..bd8293983 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 1e7faf026..b69382133 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 61978147e..08e22772f 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index d27b90192..0bbf837d8 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 14e8897d2..4cd3d05d8 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 435a4c3cd..92909ab62 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 0f6fe639f..412174ea2 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 301424c47..58d313b4f 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index d50d3ed05..c57b0cf6e 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index ff6c2d247..1278c8f53 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index a5fab0dda..c1edc8936 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 204b90a52..e3367e167 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 67f00f622..c739fef96 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 409f361fd..82f9c6fc6 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index a4c752e6c..ddd16e95a 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -134,7 +134,7 @@ chklib: $(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. .built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) else diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 338b83e54..76007da1c 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -162,7 +162,7 @@ $(NXWIDGETS_LIB): # Just to keep make happy. chklibnxwidgets does the work. $(NXWM_LIB): # Just to keep make happy. chklibnxwm does the work. .built: $(OBJS) $(NXWIDGETS_LIB) - $(call ARCHIVE, $@, $(OBJS)) + $(call ARCHIVE, $(BIN), $(OBJS)) ifeq ($(WINTOOL),y) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWM_DIR) diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index b9fbc4d41..d3d9e6114 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -111,6 +111,22 @@ namespace NXWidgets nxgl_mxpixel_t m_backColor; /**< The background color to use */ #endif + /** + * The underlying implementation for drawText functions + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param background Color to use for background if transparent is false. + * @param transparent Whether to fill the background. + */ + void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string, int startIndex, int length, + nxgl_mxpixel_t background, bool transparent); + public: /** * Constructor. @@ -329,6 +345,24 @@ namespace NXWidgets void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string, int startIndex, int length); + /** + * Draw a portion of a string to the window and fill the background + * in one go. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param color Foreground color + * @param background Background color + */ + + void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string, int startIndex, int length, + nxgl_mxpixel_t color, nxgl_mxpixel_t background); + /** * Draw an opaque bitmap to the window. * diff --git a/libnxwidgets/include/cscrollingpanel.hxx b/libnxwidgets/include/cscrollingpanel.hxx index 90dcc1ac9..b27176e2f 100644 --- a/libnxwidgets/include/cscrollingpanel.hxx +++ b/libnxwidgets/include/cscrollingpanel.hxx @@ -168,9 +168,10 @@ namespace NXWidgets * * @param dx The horizontal distance to scroll. * @param dy The vertical distance to scroll. + * @param do_redraw Redraw widgets after moving. */ - void scrollChildren(int32_t dx, int32_t dy); + void scrollChildren(int32_t dx, int32_t dy, bool do_redraw); /** * Destructor. diff --git a/libnxwidgets/src/ccyclebutton.cxx b/libnxwidgets/src/ccyclebutton.cxx index b5f96683d..0fdbba73c 100644 --- a/libnxwidgets/src/ccyclebutton.cxx +++ b/libnxwidgets/src/ccyclebutton.cxx @@ -309,30 +309,21 @@ void CCycleButton::drawContents(CGraphicsPort *port) CRect rect; getRect(rect); - nxgl_coord_t glyphSpace = m_borderSize.left - 1; nxgl_coord_t glyphYOffset = (rect.getHeight() - g_cycle.height) >> 1; nxwidget_pixel_t textColor; - nxwidget_pixel_t separatorLeftColor; - nxwidget_pixel_t separatorRightColor; if (!isEnabled()) { textColor = getDisabledTextColor(); - separatorLeftColor = getShadowEdgeColor(); - separatorRightColor = getShineEdgeColor(); } else if (!isClicked()) { textColor = getEnabledTextColor(); - separatorLeftColor = getShadowEdgeColor(); - separatorRightColor = getShineEdgeColor(); } else { textColor = getSelectedTextColor(); - separatorLeftColor = getShineEdgeColor(); - separatorRightColor = getShadowEdgeColor(); } // Draw cycle glyph @@ -341,16 +332,6 @@ void CCycleButton::drawContents(CGraphicsPort *port) g_cycle.width, g_cycle.height, &g_cycle, 0, 0, CONFIG_NXWIDGETS_TRANSPARENT_COLOR); - // Draw separator - - nxgl_coord_t x = getX() + glyphSpace + g_cycle.width; - nxgl_coord_t y = getY(); - nxgl_coord_t w = glyphSpace + g_cycle.width; - nxgl_coord_t h = rect.getHeight() - 1; - - port->drawLine(x, y, w, h, separatorLeftColor); - port->drawLine(x+1, y, w+1, h, separatorRightColor); - // Only draw text if option is selected if (m_options.getSelectedItem() != NULL) diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index d43f3bdfa..73f2352eb 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -653,6 +653,55 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string, int startIndex, int length) +{ + drawText(pos, bound, font, string, startIndex, length, 0, true); +} + +/** + * Draw a portion of a string to the window and fill the background + * in one go. + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param color Foreground color + * @param background Background color + */ + +void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string, + int startIndex, int length, + nxgl_mxpixel_t color, + nxgl_mxpixel_t background) +{ + nxgl_mxpixel_t savedColor = font->getColor(); + font->setColor(color); + + drawText(pos, bound, font, string, startIndex, length, background, false); + + font->setColor(savedColor); +} + +/** + * The underlying implementation for drawText functions + * @param pos The window-relative x/y coordinate of the string. + * @param bound The window-relative bounds of the string. + * @param font The font to draw with. + * @param string The string to output. + * @param startIndex The start index within the string from which + * drawing will commence. + * @param length The number of characters to draw. + * @param background Color to use for background if transparent is false. + * @param transparent Whether to fill the background. + */ +void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string, + int startIndex, int length, + nxgl_mxpixel_t background, + bool transparent) { // Verify index and length @@ -668,6 +717,16 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, endIndex = stringLength; } +#ifdef CONFIG_NX_WRITEONLY + if (transparent) + { + // Can't render transparently without reading memory. + + transparent = false; + background = m_backColor; + } +#endif + // Allocate a bit of memory to hold the largest rendered font unsigned int bmWidth = ((unsigned int)font->getMaxWidth() * CONFIG_NXWIDGETS_BPP + 7) >> 3; @@ -680,7 +739,7 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, struct nxgl_rect_s boundingBox; bound->getNxRect(&boundingBox); - + // Loop setup struct SBitmap bitmap; @@ -707,16 +766,12 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, // Does the letter have height? Spaces have width, but no height - if (metrics.height > 0) + if (metrics.height > 0 || !transparent) { - // Get the height of the font - - nxgl_coord_t fontHeight = (nxgl_coord_t)(metrics.height + metrics.yoffset); - // Set the current, effective size of the bitmap bitmap.width = fontWidth; - bitmap.height = fontHeight; + bitmap.height = bmHeight; bitmap.stride = (fontWidth * bitmap.bpp + 7) >> 3; // Describe the destination of the font as a bounding box @@ -725,7 +780,7 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, dest.pt1.x = pos->x; dest.pt1.y = pos->y; dest.pt2.x = pos->x + fontWidth - 1; - dest.pt2.y = pos->y + fontHeight - 1; + dest.pt2.y = pos->y + bmHeight - 1; // Get the interection of the font box and the bounding box @@ -737,25 +792,28 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, if (!nxgl_nullrect(&intersection)) { - // Initialize the bitmap memory by reading from the display. The - // font renderer always renders the fonts on a transparent background. - // Sometimes a solid background works, sometimes not. But reading - // from graphics memory always works. - -#ifdef CONFIG_NX_WRITEONLY - // Set the glyph memory to the background color - - nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data; - unsigned int npixels = fontWidth * fontHeight; - for (unsigned int j = 0; j < npixels; j++) + // If we have been given a background color, use it to fill the array. + // Otherwise initialize the bitmap memory by reading from the display. + // The font renderer always renders the fonts on a transparent background. + + if (!transparent) { - *bmPtr++ = m_backColor; - } -#else - // Read the current contents of the destination into the glyph memory + // Set the glyph memory to the background color + + nxwidget_pixel_t *bmPtr = (nxwidget_pixel_t *)bitmap.data; + unsigned int npixels = fontWidth * bmHeight; + for (unsigned int j = 0; j < npixels; j++) + { + *bmPtr++ = background; + } + } + else + { + // Read the current contents of the destination into the glyph memory + + m_pNxWnd->getRectangle(&dest, &bitmap); + } - m_pNxWnd->getRectangle(&dest, &bitmap); -#endif // Render the font into the initialized bitmap font->drawChar(&bitmap, letter); @@ -827,7 +885,7 @@ void CGraphicsPort::move(nxgl_coord_t x, nxgl_coord_t y, rect.pt1.x = x; rect.pt1.y = y; rect.pt2.x = x + width - 1; - rect.pt2.y = y = height -1; + rect.pt2.y = y + height - 1; struct nxgl_point_s offset; offset.x = deltaX; diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx index 4c7ea3554..be4fe902d 100644 --- a/libnxwidgets/src/clabel.cxx +++ b/libnxwidgets/src/clabel.cxx @@ -303,8 +303,10 @@ void CLabel::drawContents(CGraphicsPort *port) // Draw the background (excluding the border) +#ifdef CONFIG_NXWIDGETS_FLICKERFREE port->drawFilledRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight(), backColor); +#endif // Get the X/Y position of the text within the Label @@ -312,10 +314,27 @@ void CLabel::drawContents(CGraphicsPort *port) pos.x = rect.getX() + m_align.x; pos.y = rect.getY() + m_align.y; - // Add the text using the selected color +#ifdef CONFIG_NXWIDGETS_FLICKERFREE + CNxFont* font = getFont(); + int height = font->getHeight(); + int width = font->getStringWidth(m_text); + + // Draw the background (excluding the border and the text area) + + port->drawFilledRect(rect.getX(), rect.getY(), + pos.x - rect.getX(), rect.getHeight(), backColor); // Left + port->drawFilledRect(pos.x + width, rect.getY(), + rect.getX2() - (pos.x + width) + 1, rect.getHeight(), backColor); // Right + port->drawFilledRect(pos.x, rect.getY(), + width, pos.y - rect.getY(), backColor); // Top + port->drawFilledRect(pos.x, pos.y + height, + width, rect.getY2() - (pos.y + height) + 1, backColor); // Bottom +#endif + + // Add the text using the selected color and background color port->drawText(&pos, &rect, getFont(), m_text, 0, m_text.getLength(), - textColor); + textColor, backColor); } /** diff --git a/libnxwidgets/src/cscrollingpanel.cxx b/libnxwidgets/src/cscrollingpanel.cxx index b7c507bb2..2541bb572 100644 --- a/libnxwidgets/src/cscrollingpanel.cxx +++ b/libnxwidgets/src/cscrollingpanel.cxx @@ -215,10 +215,13 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) m_canvasY += dy; m_canvasX += dx; + // Move children but do not redraw. + + scrollChildren(dx, dy, false); + if (revealedRects.size() > 0) { // Draw background to revealed sections - // Children will redraw themselves in moveTo. for (int i = 0; i < revealedRects.size(); ++i) { @@ -231,6 +234,18 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) port->drawFilledRect(rrect.getX(), rrect.getY(), rrect.getWidth(), rrect.getHeight(), getBackgroundColor()); + + // Check if any children intersect this region. + // If it does, it should be redrawn. + + for (int j = 0; j < m_children.size(); ++j) + { + CRect crect = m_children[j]->getBoundingBox(); + if (crect.intersects(rrect)) + { + m_children[j]->redraw(); + } + } } } } @@ -240,12 +255,12 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) m_canvasY += dy; m_canvasX += dx; + + // Scroll all child widgets and redraw them + + scrollChildren(dx, dy, true); } - // Scroll all child widgets - - scrollChildren(dx, dy); - // Notify event handlers m_widgetEventHandlers->raiseScrollEvent(dx, dy); @@ -332,9 +347,10 @@ void CScrollingPanel::onClick(nxgl_coord_t x, nxgl_coord_t y) * * @param dx The horizontal distance to scroll. * @param dy The vertical distance to scroll. + * @param do_redraw Redraw widgets after moving. */ -void CScrollingPanel::scrollChildren(int32_t dx, int32_t dy) +void CScrollingPanel::scrollChildren(int32_t dx, int32_t dy, bool do_redraw) { nxgl_coord_t widgetX = 0; nxgl_coord_t widgetY = 0; @@ -345,8 +361,20 @@ void CScrollingPanel::scrollChildren(int32_t dx, int32_t dy) for (int32_t i = 0; i < m_children.size(); i++) { widget = m_children[i]; + bool oldstate = widget->isDrawingEnabled(); + + if (!do_redraw) + { + widget->disableDrawing(); + } + widgetX = (widget->getX() - thisX) + dx; widgetY = (widget->getY() - thisY) + dy; widget->moveTo(widgetX, widgetY); + + if (!do_redraw && oldstate) + { + widget->enableDrawing(); + } } } From 02baadfe5ac4105c2ba7c0fada3b3a84cef3f63f Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 28 Jan 2013 21:55:16 +0000 Subject: [PATCH 106/390] Add syslog.h; rename lib_rawprintf() to syslog() git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5578 42af7a65-404d-4744-a932-0658087f49c3 --- UnitTests/CButtonArray/cbuttonarraytest.hxx | 4 ++-- UnitTests/CCheckBox/ccheckboxtest.hxx | 4 ++-- UnitTests/CGlyphButton/cglyphbuttontest.hxx | 4 ++-- UnitTests/CImage/cimagetest.hxx | 4 ++-- UnitTests/CKeypad/ckeypadtest.hxx | 4 ++-- UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx | 4 ++-- UnitTests/CListBox/clistboxtest.hxx | 4 ++-- UnitTests/CProgressBar/cprogressbartest.hxx | 4 ++-- UnitTests/CRadioButton/cradiobuttontest.hxx | 4 ++-- UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx | 4 ++-- UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx | 4 ++-- UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx | 4 ++-- UnitTests/CSliderVertical/csliderverticaltest.hxx | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/UnitTests/CButtonArray/cbuttonarraytest.hxx b/UnitTests/CButtonArray/cbuttonarraytest.hxx index b8a9e15e5..1dc794a48 100644 --- a/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -75,11 +75,11 @@ # define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CCheckBox/ccheckboxtest.hxx b/UnitTests/CCheckBox/ccheckboxtest.hxx index 0397b37dd..58099acdf 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/UnitTests/CGlyphButton/cglyphbuttontest.hxx index b3e5bb656..2c21d4cb1 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -76,11 +76,11 @@ # define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CImage/cimagetest.hxx b/UnitTests/CImage/cimagetest.hxx index 9592f2936..5b5901bb1 100644 --- a/UnitTests/CImage/cimagetest.hxx +++ b/UnitTests/CImage/cimagetest.hxx @@ -71,11 +71,11 @@ # define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CKeypad/ckeypadtest.hxx b/UnitTests/CKeypad/ckeypadtest.hxx index d11c92375..12d7e18fa 100644 --- a/UnitTests/CKeypad/ckeypadtest.hxx +++ b/UnitTests/CKeypad/ckeypadtest.hxx @@ -72,11 +72,11 @@ # define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index 98c0a3bb3..80bf8fb71 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -75,11 +75,11 @@ # define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CListBox/clistboxtest.hxx b/UnitTests/CListBox/clistboxtest.hxx index a19a2fabc..dfe179503 100644 --- a/UnitTests/CListBox/clistboxtest.hxx +++ b/UnitTests/CListBox/clistboxtest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CProgressBar/cprogressbartest.hxx b/UnitTests/CProgressBar/cprogressbartest.hxx index a7a4238e7..2223d8081 100644 --- a/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/UnitTests/CProgressBar/cprogressbartest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CRadioButton/cradiobuttontest.hxx b/UnitTests/CRadioButton/cradiobuttontest.hxx index 540d5019b..3f81371db 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -70,11 +70,11 @@ # define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index 774225091..30f66ca45 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index 8b9fb1ee8..6323b0f26 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index 9709a2b7c..fd333af5c 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif diff --git a/UnitTests/CSliderVertical/csliderverticaltest.hxx b/UnitTests/CSliderVertical/csliderverticaltest.hxx index 3bb174ba0..6a893e395 100644 --- a/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -69,11 +69,11 @@ # define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, lib_rawprintf() instead +// If debug is enabled, use the debug function, syslog() instead // of printf() so that the output is synchronized. #ifdef CONFIG_DEBUG -# define message lib_lowprintf +# define message lowsyslog #else # define message printf #endif From 48224ae40d74a43fb204dd43307e4ae3ec2a58d3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 1 Feb 2013 14:53:38 +0000 Subject: [PATCH 107/390] NxWidgets updates from Petteri Aimonen; buildroot GDB build fix from Ken Bannister git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5592 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 11 ++ libnxwidgets/Makefile | 2 +- libnxwidgets/include/cgraphicsport.hxx | 7 +- libnxwidgets/include/cnxwidget.hxx | 2 +- libnxwidgets/include/ctabpanel.hxx | 108 ++++++++++++++++++++ libnxwidgets/src/cgraphicsport.cxx | 19 ++-- libnxwidgets/src/cnxwidget.cxx | 14 +++ libnxwidgets/src/ctabpanel.cxx | 133 +++++++++++++++++++++++++ 8 files changed, 282 insertions(+), 14 deletions(-) create mode 100644 libnxwidgets/include/ctabpanel.hxx create mode 100644 libnxwidgets/src/ctabpanel.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 744584ed4..be55a2e78 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -252,3 +252,14 @@ around this, I added several "enabling" settings to override the default setting. This is awkward and I preferred the configuration as it was before, but this avoids the mconf errors and warnings. +* UnitTests: Changed occurrences of lib_rawprintf() and lib_lowprintf() + to match recent changes to NuttX (will be in NuttX-6.25) +* CGraphicsPort::_drawText: Renamed from CGraphicsPort::drawText in order + to eliminate some naming collisions when overloaded in some configurations + (i.e., when both bool and nx_pixel_t are uint8_t). From Petteri Aimonen. +* CNxWidgets::drawContents: Change base drawContents from a do-nothing + function to a function that fills the widget with the background color. + This is useful when using CNxWidgets as a "panel" , i.e. a container + for other widgets. Subclasses will override drawContents and decide + themselves how to draw the background. +* CNxWidgets::CTabPanel: A new widget contributed by Petteri Aimonen. diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 0c7c922ea..84b377edd 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -63,7 +63,7 @@ CXXSRCS += cprogressbar.cxx cradiobutton.cxx cradiobuttongroup.cxx cscrollbarhor CXXSRCS += cscrollbarpanel.cxx cscrollbarvertical.cxx cscrollinglistbox.cxx CXXSRCS += cscrollingpanel.cxx cscrollingtextbox.cxx csliderhorizontal.cxx CXXSRCS += csliderhorizontalgrip.cxx cslidervertical.cxx csliderverticalgrip.cxx -CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx ctextbox.cxx +CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx ctabpanel.cxx ctextbox.cxx # Images CXXSRCS += glyph_nxlogo.cxx CXXSRCS += glyph_arrowdown.cxx glyph_checkboxon.cxx glyph_screendepthup.cxx diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index d3d9e6114..006a56d51 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -123,9 +123,10 @@ namespace NXWidgets * @param background Color to use for background if transparent is false. * @param transparent Whether to fill the background. */ - void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, - const CNxString &string, int startIndex, int length, - nxgl_mxpixel_t background, bool transparent); + + void _drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, + const CNxString &string, int startIndex, int length, + nxgl_mxpixel_t background, bool transparent); public: /** diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index dda8efc1d..32e3dfbc6 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -222,7 +222,7 @@ namespace NXWidgets * @see redraw(). */ - virtual inline void drawContents(CGraphicsPort* port) { } + virtual void drawContents(CGraphicsPort* port); /** * Draw the area of this widget that falls within the clipping region. diff --git a/libnxwidgets/include/ctabpanel.hxx b/libnxwidgets/include/ctabpanel.hxx new file mode 100644 index 000000000..aa6eb20f8 --- /dev/null +++ b/libnxwidgets/include/ctabpanel.hxx @@ -0,0 +1,108 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/ctabpanel.hxx + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Petteri Aimonen + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CTABPANEL_HXX +#define __INCLUDE_CTABPANEL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxwidget.hxx" +#include "cwidgetstyle.hxx" +#include "cnxstring.hxx" +#include "tnxarray.hxx" +#include "clatchbuttonarray.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Forward references + */ + + class CWidgetControl; + class CRect; + class CStickyButtonArray; + + /** + * Tab panel, with tabs at the top and a panel at the bottom. + */ + + class CTabPanel : public CNxWidget, public CWidgetEventHandler + { + protected: + TNxArray m_tabpages; + CLatchButtonArray *m_buttonbar; + + virtual void handleActionEvent(const CWidgetEventArgs &e); + + virtual void drawContents(CGraphicsPort* port) {} + virtual void drawBorder(CGraphicsPort* port) {} + + public: + CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_coord_t buttonHeight, + FAR const CWidgetStyle *style = (FAR const CWidgetStyle *)NULL + ); + + inline CNxWidget &page(uint8_t index) { return *m_tabpages.at(index); } + + void setPageName(uint8_t index, const CNxString &name); + + void showPage(uint8_t index); + }; +} + +#endif +#endif diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index 73f2352eb..f295483a9 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -604,7 +604,7 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string) { - drawText(pos, bound, font, string, 0, string.getLength()); + _drawText(pos, bound, font, string, 0, string.getLength(), 0, true); } /** @@ -632,7 +632,7 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, // Draw the string with this new color - drawText(pos, bound, font, string, startIndex, length); + _drawText(pos, bound, font, string, startIndex, length, 0, true); // Restore the font color @@ -654,7 +654,7 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string, int startIndex, int length) { - drawText(pos, bound, font, string, startIndex, length, 0, true); + _drawText(pos, bound, font, string, startIndex, length, 0, true); } /** @@ -680,7 +680,7 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, nxgl_mxpixel_t savedColor = font->getColor(); font->setColor(color); - drawText(pos, bound, font, string, startIndex, length, background, false); + _drawText(pos, bound, font, string, startIndex, length, background, false); font->setColor(savedColor); } @@ -697,11 +697,12 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, * @param background Color to use for background if transparent is false. * @param transparent Whether to fill the background. */ -void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, - CNxFont *font, const CNxString &string, - int startIndex, int length, - nxgl_mxpixel_t background, - bool transparent) + +void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, + CNxFont *font, const CNxString &string, + int startIndex, int length, + nxgl_mxpixel_t background, + bool transparent) { // Verify index and length diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index ab4a09b4e..15ed501e6 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -1443,6 +1443,20 @@ void CNxWidget::useWidgetStyle(const CWidgetStyle *style) m_style.font = style->font; } +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw(). + */ + +void CNxWidget::drawContents(CGraphicsPort* port) +{ + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), + getBackgroundColor()); +} + /** * Draw all visible regions of this widget's children. */ diff --git a/libnxwidgets/src/ctabpanel.cxx b/libnxwidgets/src/ctabpanel.cxx new file mode 100644 index 000000000..f1723fdba --- /dev/null +++ b/libnxwidgets/src/ctabpanel.cxx @@ -0,0 +1,133 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/ctabpanel.hxx + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Petteri Aimonen + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "ctabpanel.hxx" +#include "cgraphicsport.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CTabPanel Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +CTabPanel::CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + nxgl_coord_t buttonHeight, + FAR const CWidgetStyle *style + ): + CNxWidget(pWidgetControl, x, y, width, height, 0, style) +{ + m_buttonbar = new CLatchButtonArray(pWidgetControl, x, y, + numPages, 1, + width / numPages, + buttonHeight, + 0); + m_buttonbar->addWidgetEventHandler(this); + this->addWidget(m_buttonbar); + + for (int i = 0; i < numPages; i++) + { + CNxWidget *tabpage = new CNxWidget(pWidgetControl, x, y + buttonHeight, + width, height - buttonHeight, 0); + tabpage->setBackgroundColor(getBackgroundColor()); + tabpage->setBorderless(true); + m_tabpages.push_back(tabpage); + this->addWidget(tabpage); + } + + // Activate the first page + + showPage(0); +} + +void CTabPanel::setPageName(uint8_t index, const CNxString &name) +{ + m_buttonbar->setText(index, 0, name); +} + +void CTabPanel::showPage(uint8_t index) +{ + if (!m_buttonbar->isThisButtonStuckDown(index, 0)) + { + m_buttonbar->stickDown(index, 0); + } + + for (int i = 0; i < m_tabpages.size(); i++) + { + if (i == index) + { + m_tabpages.at(i)->enable(); + m_tabpages.at(i)->show(); + m_tabpages.at(i)->redraw(); + } + else + { + m_tabpages.at(i)->hide(); + m_tabpages.at(i)->disable(); + } + } +} + +void CTabPanel::handleActionEvent(const CWidgetEventArgs &e) +{ + if (e.getSource() == m_buttonbar) + { + int x = 0; + int y = 0; + + m_buttonbar->isAnyButtonStuckDown(x, y); + showPage(x); + } +} + + + From 76850b3fb604ce7ba0b70cc43acae66297f7b968 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 1 Feb 2013 15:32:39 +0000 Subject: [PATCH 108/390] Additional patches from Petteri Aimonen for FAT, STM32 SPI, and AT25 git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5593 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index be55a2e78..88e15d7db 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -263,3 +263,6 @@ for other widgets. Subclasses will override drawContents and decide themselves how to draw the background. * CNxWidgets::CTabPanel: A new widget contributed by Petteri Aimonen. + This widget provides a tab panel, which has a button bar at the top + and panels below it. Pressing a button will select the corresponding + panel. From 957149c24f77c4896183f5f6d7f2bda0f4c12122 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 1 Feb 2013 22:37:52 +0000 Subject: [PATCH 109/390] Prep for 6.25 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5594 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 +++- ReleaseNotes.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 88e15d7db..7e2acdea1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -219,7 +219,7 @@ * NxWidgets::CNxWidgets and NxWM::CStartWindow: Small changes to make sub- classing easier (from Petteri Aimonen). -1.5 2013-xx-xx Gregory Nutt +1.5 2013-02-01 Gregory Nutt * NxWidgets::CGraphicsPort::move(): Fix typo bug in bounding rectangle calculation (from Petteri Aimonen). @@ -266,3 +266,5 @@ This widget provides a tab panel, which has a button bar at the top and panels below it. Pressing a button will select the corresponding panel. + +1.6 2013-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index aaaefe6eb..431d2796c 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -144,3 +144,46 @@ Bugfixes (see the change log for details). Some of these are very important * NxWidgets:CText and NxWidgets:CNumericEdite: Fix some memory freeing bugs * NxWidgets::CScrollingPanel: It is borderless for now because there was no easy way to redraw only the required part of the border. + +NxWidgets-1.5 +============= + +The 6th release of the NxWidgets package was made on February 1, 2013. This +release depends on NuttX-6.25 or above and should not be used with older +NuttX releases. This release corresponds to SVN revision r5594. + +Note: Nearly all of the changes between 1.4 and 1.5 were the result of the +efforts of Petteri Aimonen. + +Additional new features and extended functionality in Version 1.5: + +* CNxWidgets::CTabPanel: A new widget contributed by Petteri Aimonen. + This widget provides a tab panel, which has a button bar at the top + and panels below it. Pressing a button will select the corresponding + panel. +* NxWidgets::CGraphicsPort: Many times we only want a constant background. + In that case the old code filled the background, read it back, rendered + the text and then wrote it back. When used with an LCD this causes + some screen flicker. Added a variant of drawText that takes background + color, so that the background and text can both be rendered at one go. +* NxWM::CScrollingPanel::scrollChildren(): Avoid unnecessary redraws in + CScrollingPanel +* Kconfig: Added several "enabling" settings that must be selected to + override the default setting. +* UnitTests: Changes for compatibility with NuttX-6.25 + +Bugfixes: + +* NxWidgets::CGraphicsPort::move(): Fix typo bug in bounding rectangle + calculation. +* NxWM::CCycleButton: Remove the separator from CCycleButton. It draws in + wrong place, and doesn't look very good in the correct place either. +* NxWidgets::CLabel: The label was drawn as a single rectangular region, + then a text was added to the on top of this. The result is that the + text would flicker when the CLabel was updated. With this change, the + two step update is replaced with a five step update: The background + is updated as four rectangulear regions (leaving the previous text in + place), then the new text is updated. This eliminates the flicker. +* CGraphicsPort::_drawText: Renamed from CGraphicsPort::drawText in order + to eliminate some naming collisions when overloaded in some configurations + (i.e., when both bool and nx_pixel_t are uint8_t). From c66f2100dbb930822738d1843de304a663a923d8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 1 Feb 2013 22:51:34 +0000 Subject: [PATCH 110/390] Last minute 6.25 change git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5595 42af7a65-404d-4744-a932-0658087f49c3 --- ReleaseNotes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 431d2796c..3b3a8531d 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -150,7 +150,7 @@ NxWidgets-1.5 The 6th release of the NxWidgets package was made on February 1, 2013. This release depends on NuttX-6.25 or above and should not be used with older -NuttX releases. This release corresponds to SVN revision r5594. +NuttX releases. This release corresponds to SVN revision r5595. Note: Nearly all of the changes between 1.4 and 1.5 were the result of the efforts of Petteri Aimonen. From 51d056fa130bad78b60ade70847289fda4f4e476 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 2 Feb 2013 19:32:46 +0000 Subject: [PATCH 111/390] All argv types should be char * const * not const char ** git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5599 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 3 +++ libnxwidgets/src/cnxserver.cxx | 2 +- nxwm/src/cnxconsole.cxx | 2 +- nxwm/src/cstartwindow.cxx | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7e2acdea1..7ebfc6e8a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -268,3 +268,6 @@ panel. 1.6 2013-xx-xx Gregory Nutt + +* Type of argv[] has changed from const char ** to char * const * + diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 4d5a6e681..15f9bce5a 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -216,7 +216,7 @@ bool CNxServer::connect(void) gvdbg("CNxServer::connect: Starting server task\n"); serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, - CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR const char **)0); + CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR char * const *)0); if (serverId < 0) { gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 41e153400..3a506cb4b 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -247,7 +247,7 @@ bool CNxConsole::run(void) sched_lock(); m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxconsole, - (FAR const char **)0); + (FAR char * const *)0); // Did we successfully start the NxConsole task? diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index cc8802b7c..bc7b747f8 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -182,7 +182,7 @@ bool CStartWindow::run(void) m_taskId = TASK_CREATE("StartWindow", CONFIG_NXWM_STARTWINDOW_PRIO, CONFIG_NXWM_STARTWINDOW_STACKSIZE, startWindow, - (FAR const char **)0); + (FAR char * const *)0); // Did we successfully start the NxConsole task? From 1e8e94837c14c99d36b37a1640434506dafcde2d Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 8 Feb 2013 15:28:07 +0000 Subject: [PATCH 112/390] Several patches from Petteri Aimonen git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5625 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 8 ++++++++ libnxwidgets/include/ccyclebutton.hxx | 2 +- libnxwidgets/include/cnxwidget.hxx | 7 +++++++ libnxwidgets/src/ccyclebutton.cxx | 4 +++- nxwm/include/ctaskbar.hxx | 16 ++++++++-------- tools/bitmap_converter.py | 2 +- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7ebfc6e8a..43347fcdb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -270,4 +270,12 @@ 1.6 2013-xx-xx Gregory Nutt * Type of argv[] has changed from const char ** to char * const * +* NXWidgets::CNxWidget: Add an inline function to get the current style. +* NxWM::CTaskBar: Make a some methods of CTaskbar virtual to allow + customizations. From Petteri Aimonen. +* NXWidgets::CCycleButton: Make CCycleButton change state in onPreRelease(). + This way the new value is already available when a listener gets the + action event. From Petteri Aimonen. +* NxWidgets/tools/bitmap_converter.py: Fix bitmap_converter.py so that + it works with indexed input images. diff --git a/libnxwidgets/include/ccyclebutton.hxx b/libnxwidgets/include/ccyclebutton.hxx index f7f965933..d8a32175e 100644 --- a/libnxwidgets/include/ccyclebutton.hxx +++ b/libnxwidgets/include/ccyclebutton.hxx @@ -152,7 +152,7 @@ namespace NXWidgets * @param y The y coordinate of the mouse. */ - virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); /** * Redraws the button. diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 32e3dfbc6..a6982660b 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -796,6 +796,13 @@ namespace NXWidgets return m_style.colors.selectedText; } + /** + * Get the style used by this widget + * + * @return Const pointer to CWidgetStyle stored inside this widget. + */ + inline const CWidgetStyle *getWidgetStyle() const { return &m_style; } + /** * Sets this widget's border state. * diff --git a/libnxwidgets/src/ccyclebutton.cxx b/libnxwidgets/src/ccyclebutton.cxx index 0fdbba73c..b4dff685b 100644 --- a/libnxwidgets/src/ccyclebutton.cxx +++ b/libnxwidgets/src/ccyclebutton.cxx @@ -424,7 +424,7 @@ void CCycleButton::drawOutline(CGraphicsPort *port) * @param y The y coordinate of the mouse. */ -void CCycleButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) +void CCycleButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { // Choose next option @@ -447,6 +447,8 @@ void CCycleButton::onRelease(nxgl_coord_t x, nxgl_coord_t y) } redraw(); + + CButton::onPreRelease(x, y); } /** diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 5aab9e6bf..229e78b22 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -83,9 +83,9 @@ namespace NxWM */ class CTaskbar : public NXWidgets::CNxServer, - private NXWidgets::CWidgetEventHandler + protected NXWidgets::CWidgetEventHandler { - private: + protected: /** * This structure represents an application and its associated icon image */ @@ -152,7 +152,7 @@ namespace NxWM * @return true on success */ - bool createTaskbarWindow(void); + virtual bool createTaskbarWindow(void); /** * Create the background window. @@ -160,7 +160,7 @@ namespace NxWM * @return true on success */ - bool createBackgroundWindow(void); + virtual bool createBackgroundWindow(void); /** * Create the background image. @@ -168,7 +168,7 @@ namespace NxWM * @return true on success */ - bool createBackgroundImage(void); + virtual bool createBackgroundImage(void); /** * (Re-)draw the task bar window. @@ -176,7 +176,7 @@ namespace NxWM * @return true on success */ - bool redrawTaskbarWindow(void); + virtual bool redrawTaskbarWindow(void); /** * Redraw the window at the top of the heirarchy. @@ -184,7 +184,7 @@ namespace NxWM * @return true on success */ - bool redrawTopApplication(void); + virtual bool redrawTopApplication(void); /** * Raise the top window to the top of the NXheirarchy. @@ -200,7 +200,7 @@ namespace NxWM * @return true on success */ - bool redrawBackgroundWindow(void); + virtual bool redrawBackgroundWindow(void); /** * Redraw the last application in the list of application maintained by diff --git a/tools/bitmap_converter.py b/tools/bitmap_converter.py index 2cb7e8869..1c5337741 100755 --- a/tools/bitmap_converter.py +++ b/tools/bitmap_converter.py @@ -121,7 +121,7 @@ if __name__ == '__main__': print "Usage: bitmap_converter.py source.png output.cxx" sys.exit(1) - img = Image.open(sys.argv[1]) + img = Image.open(sys.argv[1]).convert("RGB") outfile = open(sys.argv[2], 'w') palette = get_palette(img) From a96a12751aa7f22509a8ff0ab6d55056319e9758 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 15 Feb 2013 14:37:37 +0000 Subject: [PATCH 113/390] STM32 F4 patches from Petteri Aimonen (mostly USB) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5652 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ libnxwidgets/src/clabel.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 43347fcdb..dd3422dcc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -278,4 +278,6 @@ action event. From Petteri Aimonen. * NxWidgets/tools/bitmap_converter.py: Fix bitmap_converter.py so that it works with indexed input images. +* NxWidgets::CLabel: Fix backward conditional compilation in the + "flicker free" logic. diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx index be4fe902d..376d2ce8f 100644 --- a/libnxwidgets/src/clabel.cxx +++ b/libnxwidgets/src/clabel.cxx @@ -303,7 +303,7 @@ void CLabel::drawContents(CGraphicsPort *port) // Draw the background (excluding the border) -#ifdef CONFIG_NXWIDGETS_FLICKERFREE +#ifndef CONFIG_NXWIDGETS_FLICKERFREE port->drawFilledRect(rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight(), backColor); #endif From 804bd95e05a3eb9eb160c05fb1d2e1fbf88e282c Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 28 Feb 2013 18:48:11 +0000 Subject: [PATCH 114/390] NxWidgets/NxWM updates from Petteri Aimonen (Patches 0007-0013) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5689 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 48 +++++++- Kconfig | 24 ++++ libnxwidgets/include/cimage.hxx | 8 +- libnxwidgets/include/cwidgetcontrol.hxx | 71 ++++++++--- libnxwidgets/src/cimage.cxx | 27 +++-- libnxwidgets/src/cmultilinetextbox.cxx | 4 +- libnxwidgets/src/cnxtimer.cxx | 8 +- libnxwidgets/src/cwidgetcontrol.cxx | 46 +++++-- nxwm/include/cstartwindow.hxx | 1 - nxwm/include/cwindowmessenger.hxx | 25 ++-- nxwm/src/capplicationwindow.cxx | 22 +++- nxwm/src/cstartwindow.cxx | 153 +----------------------- nxwm/src/ctaskbar.cxx | 18 ++- nxwm/src/cwindowmessenger.cxx | 116 +++++++----------- 14 files changed, 286 insertions(+), 285 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index dd3422dcc..1d2abab4d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -280,4 +280,50 @@ it works with indexed input images. * NxWidgets::CLabel: Fix backward conditional compilation in the "flicker free" logic. - +* NxWidgets::CNxTimer: Previously repeated timers were re-enabled after + the timer action event. Consequently, if the action event handler tried + to stop the timer, the request would be ignored. Changes the order + so that the timer is re-enabled before the callback. There is still + no risk of re-entrancy, because everything executes on the USRWORK work + queue. From Petteri Aimonen. +* NxWidgets::CMultiLineTestBox: Fix text placement error. From Petteri + Aimonen. +* NxWidgets::CWidgetControl: Added another semaphore, boundssem, which + is set as soon as the screen bounds are known. This corrects two + problems: + 1) Due to the way nxgl_rectsize computes the size, it will never + be 0,0 like CWidgetControl expects. Therefore the size is considered + valid even though it has not been set yet. + 2) After the check is fixed to test for > 1, NxWM window creation will + hang. This is due to the fact that it uses the screen bounds for + determining window size. This was being blocked on geosem, which + is only posted after the size has been set. + From Petteri Aimonen. +* NxWidgets::CImage: Two enhancements: + 1) Allow changing the bitmap even after the control has been created. + 2) Allow giving 'null' to have the control draw no image at all. + From Petteri Aimonen. +* NxWM::CTaskBar: Allow windows with null icon. This makes sense for e.g. + full screen windows. From Petteri Aimonen. +* NxWM::CApplicationWindow: Add config options to override NxWM + stop/minimize icons. From Petteri Aimonen. +* NwWM::CStartWindow, NxWM::CWindowMessenger: Get rid of the start window + thread. Instead, handle all events through the USRWORK work queue. + For me, this was necessary because I would open some files in button + handlers and close them in NxTimer handlers. If these belonged to + different tasks, the close operation would fail. Further benefits: + + Gets rid of one task and message queue. + + Reduces the amount of code required + + Decouples CStartWindow from everything else - now it is just a window + with application icons, not an integral part of the event logic. + + All events come from the same thread, which reduces the possibility of + multithreading errors in user code. + + The user code can also send events to USRWORK, so that everything gets + serialized nicely without having to use so many mutexes. + Drawbacks: + - Currently the work state structure is malloc()ed, causing one allocation + and free per each input event. Could add a memory pool for these later, but + the speed difference doesn't seem noticeable. + - The work queue will add ~50 ms latency to input events. This is however + configurable, and the delay is anyway short enough that it is unnoticeable. + From Petteri Aimonen. diff --git a/Kconfig b/Kconfig index 656399199..6f5f3e924 100644 --- a/Kconfig +++ b/Kconfig @@ -463,6 +463,30 @@ config NXWM_BACKGROUND_IMAGE The name of the image to use in the background window. Default: NXWidgets::g_nuttxBitmap +comment "Application Window Configuration" + +config NXWM_CUSTOM_APPWINDOW_ICONS + bool "Custom Start/Stop Application Window Icons" + default n + ---help--- + Select to override the default Application Window Stop and Minimize Icons. + +if NXWM_CUSTOM_APPWINDOW_ICONS + +config NXWM_STOP_BITMAP + string "Stop Icon" + default "NxWM::g_stopBitmap" + ---help--- + The glyph to use as the Stop icon. Default: NxWM::g_stopBitmap + +config NXWM_MINIMIZE_BITMAP + string "Minimize Icon" + default "NxWM::g_minimizeBitmap" + ---help--- + The glyph to use as the Minimize icon. Default: NxWM::g_minimizeBitmap + +endif + comment "Start Window Configuration" comment "Horizontal and vertical spacing of icons in the task bar" diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 6093c5f33..438ea7267 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cimage.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -207,6 +207,12 @@ namespace NXWidgets inline FAR IBitmap *getBitmap() const { return m_bitmap; } + /** + * Set the bitmap that this image contains. + */ + + inline void setBitmap(FAR IBitmap *bitmap) { m_bitmap = bitmap; } + /** * Insert the dimensions that this widget wants to have into the rect * passed in as a parameter. All coordinates are relative to the diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index e709271a0..f0afe2c47 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cwidgetcontrol.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,11 +39,12 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include #include +#include #include #include @@ -203,6 +204,7 @@ namespace NXWidgets struct nxgl_rect_s m_bounds; /**< Size of the display */ #ifdef CONFIG_NX_MULTIUSER sem_t m_geoSem; /**< Posted when geometry is valid */ + sem_t m_boundsSem; /**< Posted when bounds are valid */ #endif CWindowEventHandlerList m_eventHandlers; /**< List of event handlers. */ @@ -228,7 +230,7 @@ namespace NXWidgets * @param startTime A time in the past from which to compute the elapsed time. * @return The elapsed time since startTime */ - + uint32_t elapsedTime(FAR const struct timespec *startTime); /** @@ -256,7 +258,7 @@ namespace NXWidgets /** * Delete any widgets in the deletion queue. */ - + void processDeleteQueue(void); /** @@ -324,6 +326,37 @@ namespace NXWidgets giveGeoSem(); } + /** + * Take the bounds semaphore (handling signal interruptions) + */ + +#ifdef CONFIG_NX_MULTIUSER + void takeBoundsSem(void); +#else + inline void takeBoundsSem(void) {} +#endif + + /** + * Give the bounds semaphore + */ + + inline void giveBoundsSem(void) + { +#ifdef CONFIG_NX_MULTIUSER + sem_post(&m_boundsSem); +#endif + } + + /** + * Wait for bounds data + */ + + inline void waitBoundsData(void) + { + takeBoundsSem(); + giveBoundsSem(); + } + /** * Clear all mouse events */ @@ -345,7 +378,7 @@ namespace NXWidgets /** * Destructor. */ - + virtual ~CWidgetControl(void); /** @@ -407,7 +440,7 @@ namespace NXWidgets * all widgets in the window. * @return True means some interesting event occurred */ - + bool pollEvents(CNxWidget *widget = (CNxWidget *)NULL); /** @@ -425,7 +458,7 @@ namespace NXWidgets * * @param widget The widget to be controlled. */ - + inline void addControlledWidget(CNxWidget* widget) { m_widgets.push_back(widget); @@ -438,7 +471,7 @@ namespace NXWidgets */ void removeControlledWidget(CNxWidget* widget); - + /** * Get the number of controlled widgets. * @@ -456,7 +489,7 @@ namespace NXWidgets * * @param widget The widget to add to the delete queue. */ - + void addToDeleteQueue(CNxWidget *widget); /** @@ -469,7 +502,7 @@ namespace NXWidgets void setClickedWidget(CNxWidget *widget); /** - * Get the clicked widget pointer. + * Get the clicked widget pointer. * * @return Pointer to the clicked widget. */ @@ -502,7 +535,7 @@ namespace NXWidgets } /** - * Get the focused widget pointer. + * Get the focused widget pointer. * * @return Pointer to the focused widget. */ @@ -513,7 +546,7 @@ namespace NXWidgets } /** - * Check for the occurrence of a double click. + * Check for the occurrence of a double click. * * @return Pointer to the clicked widget. */ @@ -582,7 +615,7 @@ namespace NXWidgets * @param pos The (x,y) position of the mouse. * @param buttons See NX_MOUSE_* definitions. */ - + void newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons); /** @@ -624,7 +657,7 @@ namespace NXWidgets * * @param cursorControl The cursor control code received. */ - + void newCursorControlEvent(ECursorControl cursorControl); /** @@ -639,21 +672,21 @@ namespace NXWidgets } /** - * Get the window bounding box in physical display coordinated. This - * method may need to wait until geometry data is available. + * Get the window bounding box in physical display coordinates. This + * method may need to wait until bounds data is available. * * @return This function returns the window handle. */ inline CRect getWindowBoundingBox(void) { - waitGeoData(); + waitBoundsData(); return CRect(&m_bounds); } inline void getWindowBoundingBox(FAR struct nxgl_rect_s *bounds) { - waitGeoData(); + waitBoundsData(); nxgl_rectcopy(bounds, &m_bounds); } @@ -759,7 +792,7 @@ namespace NXWidgets inline void removeWindowEventHandler(CWindowEventHandler *eventHandler) { - m_eventHandlers.removeWindowEventHandler(eventHandler); + m_eventHandlers.removeWindowEventHandler(eventHandler); } }; } diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 30bf7e78b..9b3137129 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cimage.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -88,7 +88,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Method Implementations ****************************************************************************/ @@ -163,6 +163,13 @@ void CImage::getPreferredDimensions(CRect &rect) const void CImage::drawContents(CGraphicsPort *port) { + if (!m_bitmap) + { + // No image to draw + + return; + } + // Get the the drawable region CRect rect; @@ -187,11 +194,11 @@ void CImage::drawContents(CGraphicsPort *port) m_bitmap->setSelected(isClicked() || m_highlighted); // This is the number of rows that we can draw at the top of the display - + nxgl_coord_t nTopRows = m_bitmap->getHeight() - m_origin.y; if (nTopRows > rect.getHeight()) { - nTopRows = rect.getHeight(); + nTopRows = rect.getHeight(); } else if (nTopRows < 0) { @@ -214,7 +221,7 @@ void CImage::drawContents(CGraphicsPort *port) // the display nxgl_coord_t nLeftPixels = m_bitmap->getWidth() - m_origin.x; - + // This is the number of rows that we have to pad on the right if the display // width is wider than the image width @@ -257,7 +264,7 @@ void CImage::drawContents(CGraphicsPort *port) // Replace any transparent pixels with the background color. // Then we can use the faster opaque drawBitmap() function. - + ptr = buffer; for (int i = 0; i < nLeftPixels; i++, ptr++) { @@ -337,12 +344,12 @@ void CImage::drawBorder(CGraphicsPort *port) { return; } - + // Work out which colors to use nxgl_coord_t color1; nxgl_coord_t color2; - + if (isClicked()) { // Bevelled into the screen @@ -357,7 +364,7 @@ void CImage::drawBorder(CGraphicsPort *port) color1 = getShineEdgeColor(); color2 = getShadowEdgeColor(); } - + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } @@ -389,7 +396,7 @@ void CImage::onClick(nxgl_coord_t x, nxgl_coord_t y) } /** - * Raises an action. + * Raises an action. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/src/cmultilinetextbox.cxx b/libnxwidgets/src/cmultilinetextbox.cxx index 94caac5fd..df060f037 100644 --- a/libnxwidgets/src/cmultilinetextbox.cxx +++ b/libnxwidgets/src/cmultilinetextbox.cxx @@ -1261,8 +1261,8 @@ void CMultiLineTextBox::drawRow(CGraphicsPort *port, int row) uint8_t rowLength = m_text->getLineTrimmedLength(row); struct nxgl_point_s pos; - pos.x = getRowX(row) + m_canvasX; - pos.y = getRowY(row) + m_canvasY; + pos.x = getRowX(row) + m_canvasX + rect.getX(); + pos.y = getRowY(row) + m_canvasY + rect.getY(); // Determine the background and text color diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index d663df036..d67cee6e8 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -193,16 +193,16 @@ void CNxTimer::workQueueCallback(FAR void *arg) This->m_isRunning = false; - // Raise the action event. - - This->m_widgetEventHandlers->raiseActionEvent(); - // Restart the timer if this is a repeating timer if (This->m_isRepeater) { This->start(); } + + // Raise the action event. + + This->m_widgetEventHandlers->raiseActionEvent(); } diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 644abd714..2cb1a930d 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cwidgetcontrol.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -117,6 +117,7 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) sem_init(&m_waitSem, 0, 0); #endif #ifdef CONFIG_NX_MULTIUSER + sem_init(&m_boundsSem, 0, 0); sem_init(&m_geoSem, 0, 0); #endif @@ -135,12 +136,11 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) copyWidgetStyle(&m_style, style); } } - /** * Destructor. */ - + CWidgetControl::~CWidgetControl(void) { // Notify any external waiters... this should not happen because it @@ -235,7 +235,7 @@ void CWidgetControl::postWindowEvent(void) * all widgets in the window. * @return True means some interesting event occurred */ - + bool CWidgetControl::pollEvents(CNxWidget *widget) { // Delete any queued widgets @@ -299,7 +299,7 @@ void CWidgetControl::removeControlledWidget(CNxWidget *widget) * * @param widget The widget to add to the delete queue. */ - + void CWidgetControl::addToDeleteQueue(CNxWidget *widget) { // Add the widget to the delete queue @@ -330,7 +330,7 @@ void CWidgetControl::setClickedWidget(CNxWidget *widget) m_clickedWidget->release(m_clickedWidget->getX() - 10, 0); } - + // Update the pointer m_clickedWidget = widget; @@ -394,18 +394,19 @@ void CWidgetControl::geometryEvent(NXHANDLE hWindow, if (!m_hWindow) { // Save one-time server specific information - + m_hWindow = hWindow; nxgl_rectcopy(&m_bounds, bounds); + giveBoundsSem(); } // In the normal start up sequence, the window is created with zero size // at position 0,0. The safe thing to do is to set the position (still // with size 0, then then set the size. Assuming that is what is being // done, we will not report that we have valid geometry until the size - // becomes nonzero. + // becomes nonzero (or actually over 1). - if (!m_haveGeometry && size->h > 0 && size->w > 0) + if (!m_haveGeometry && size->h > 1 && size->w > 1) { // Wake up any threads waiting for initial position information. // REVISIT: If the window is moved or repositioned, then the @@ -619,7 +620,7 @@ void CWidgetControl::newKeyboardEvent(uint8_t nCh, FAR const uint8_t *pStr) * * @param cursorControl The cursor control code received. */ - + void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl) { // Append the new cursor control @@ -688,7 +689,7 @@ void CWidgetControl::copyWidgetStyle(CWidgetStyle *dest, const CWidgetStyle *src * @param tp A time in the past from which to compute the elapsed time. * @return The elapsed time since tp */ - + uint32_t CWidgetControl::elapsedTime(FAR const struct timespec *startTime) { struct timespec endTime; @@ -701,7 +702,7 @@ uint32_t CWidgetControl::elapsedTime(FAR const struct timespec *startTime) uint32_t seconds = endTime.tv_sec - startTime->tv_sec; // Get the elapsed nanoseconds, borrowing from the seconds if necessary - + int32_t endNanoSeconds = endTime.tv_nsec; if (startTime->tv_nsec > endNanoSeconds) { @@ -767,7 +768,7 @@ void CWidgetControl::handleLeftClick(nxgl_coord_t x, nxgl_coord_t y, CNxWidget * /** * Delete any widgets in the deletion queue. */ - + void CWidgetControl::processDeleteQueue(void) { int i = 0; @@ -916,6 +917,25 @@ void CWidgetControl::takeGeoSem(void) } #endif +/** + * Take the bounds semaphore (handling signal interruptions) + */ + +#ifdef CONFIG_NX_MULTIUSER +void CWidgetControl::takeBoundsSem(void) +{ + // Take the bounds semaphore. Retry is an error occurs (only if + // the error is due to a signal interruption). + + int ret; + do + { + ret = sem_wait(&m_boundsSem); + } + while (ret < 0 && errno == EINTR); +} +#endif + /** * Clear all mouse events */ diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 52a67fbd4..250d5068c 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -119,7 +119,6 @@ namespace NxWM CApplicationWindow *m_window; /**< Reference to the application window */ TNxArray m_slots; /**< List of apps in the start window */ struct nxgl_size_s m_iconSize; /**< A box big enough to hold the largest icon */ - pid_t m_taskId; /**< ID of the start window task */ /** * This is the start window task. This function receives window events from diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index 11a48645b..a30010fd8 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/cwindowmessenger.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,12 +39,12 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include -#include +#include #include #include @@ -83,9 +83,20 @@ namespace NxWM public NXWidgets::CWidgetControl { private: - mqd_t m_mqd; /**< Message queue descriptor used to commincate with the - ** start window thread. */ - + /** Structure that stores data for the work queue callback. */ + + struct work_state_t + { + work_s work; + CWindowMessenger *windowMessenger; + void *instance; + }; + + /** Work queue callback functions */ + + static void inputWorkCallback(FAR void *arg); + static void destroyWorkCallback(FAR void *arg); + /** * Handle an NX window mouse input event. * @@ -109,7 +120,7 @@ namespace NxWM * * @param arg - User provided argument (see nx_block or nxtk_block) */ - + void handleBlockedEvent(FAR void *arg); public: diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index d2e044298..77d196d07 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/capplicationwindow.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,18 @@ * Pre-Processor Definitions ********************************************************************************************/ +#ifdef CONFIG_NXWM_STOP_BITMAP +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_STOP_BITMAP; +#else +# define CONFIG_NXWM_STOP_BITMAP g_stopBitmap +#endif + +#ifdef CONFIG_NXWM_MINIMIZE_BITMAP +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_MINIMIZE_BITMAP; +#else +# define CONFIG_NXWM_MINIMIZE_BITMAP g_minimizeBitmap +#endif + /******************************************************************************************** * CApplicationWindow Method Implementations ********************************************************************************************/ @@ -192,7 +204,7 @@ bool CApplicationWindow::open(void) { // Create STOP bitmap container - m_stopBitmap = new NXWidgets::CRlePaletteBitmap(&g_stopBitmap); + m_stopBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_STOP_BITMAP); if (!m_stopBitmap) { return false; @@ -244,7 +256,7 @@ bool CApplicationWindow::open(void) #ifndef CONFIG_NXWM_DISABLE_MINIMIZE // Create MINIMIZE application bitmap container - m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&g_minimizeBitmap); + m_minimizeBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MINIMIZE_BITMAP); if (!m_minimizeBitmap) { return false; @@ -375,7 +387,7 @@ void CApplicationWindow::redraw(void) m_minimizeImage->redraw(); m_minimizeImage->setRaisesEvents(true); } - + // And finally draw the window label m_windowLabel->enableDrawing(); @@ -406,7 +418,7 @@ void CApplicationWindow::hide(void) m_minimizeImage->disableDrawing(); m_minimizeImage->setRaisesEvents(false); } - + // Disable the window label m_windowLabel->disableDrawing(); diff --git a/nxwm/src/cstartwindow.cxx b/nxwm/src/cstartwindow.cxx index bc7b747f8..1b56094ec 100644 --- a/nxwm/src/cstartwindow.cxx +++ b/nxwm/src/cstartwindow.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/cstartwindow.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,8 +44,6 @@ #include #include -#include - #include "cwidgetcontrol.hxx" #include "nxwmconfig.hxx" @@ -66,7 +64,7 @@ */ FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME; - + /******************************************************************************************** * CStartWindow Method Implementations ********************************************************************************************/ @@ -89,10 +87,6 @@ CStartWindow::CStartWindow(CTaskbar *taskbar, CApplicationWindow *window) m_taskbar = taskbar; m_window = window; - // The start window task is not running - - m_taskId = -1; - // Add our personalized window label NXWidgets::CNxString myName = getName(); @@ -169,24 +163,7 @@ NXWidgets::CNxString CStartWindow::getName(void) bool CStartWindow::run(void) { - // Some sanity checking - - if (m_taskId >= 0) - { - // The start window task is already running??? - - return false; - } - - // Start the start window task - - m_taskId = TASK_CREATE("StartWindow", CONFIG_NXWM_STARTWINDOW_PRIO, - CONFIG_NXWM_STARTWINDOW_STACKSIZE, startWindow, - (FAR char * const *)0); - - // Did we successfully start the NxConsole task? - - return m_taskId >= 0; + return true; } /** @@ -195,21 +172,8 @@ bool CStartWindow::run(void) void CStartWindow::stop(void) { - // Delete the start window task --- what are we doing? This should never - // happen because the start window task is persistent! - - if (m_taskId >= 0) - { - // Call task_delete(), possibly stranding resources - - pid_t pid = m_taskId; - m_taskId = -1; - - // Then delete the NSH task - - task_delete(pid); - } } + /** * Destroy the application and free all of its resources. This method * will initiate blocking of messages from the NX server. The server @@ -532,7 +496,7 @@ void CStartWindow::getIconBounds(void) void CStartWindow::removeAllApplications(void) { - // Stop all applications and remove them from the start window. Clearly, there + // Stop all applications and remove them from the start window. Clearly, there // are some ordering issues here... On an orderly system shutdown, disconnection // should really occur priority to deleting instances @@ -543,7 +507,7 @@ void CStartWindow::removeAllApplications(void) IApplicationFactory *app = m_slots.at(0).app; // Now, delete the image and the application - + delete app; delete m_slots.at(0).image; @@ -596,108 +560,3 @@ void CStartWindow::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } -/** - * This is the start window task. This function receives window events from - * the NX listener threads indirectly through this sequence: - * - * 1. NX listener thread receives a windows event. This may be a - * positional change notification, a redraw request, or mouse or - * keyboard input. - * 2. The NX listener thread performs the callback by calling a - * NXWidgets::CCallback method associated with the window. - * 3. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process - * the event. - * 4. NXWidgets::CWidgetControl records the new state data and raises a - * window event. - * 5. NXWidgets::CWindowEventHandlerList will give the event to - * NxWM::CWindowMessenger. - * 6. NxWM::CWindowMessenger will send the a message on a well-known message - * queue. - * 7. This CStartWindow::startWindow task will receive and process that - * message. - */ - -int CStartWindow::startWindow(int argc, char *argv[]) -{ - /* Open a well-known message queue for reading */ - - struct mq_attr attr; - attr.mq_maxmsg = CONFIG_NXWM_STARTWINDOW_MXMSGS; - attr.mq_msgsize = sizeof(struct SStartWindowMessage); - attr.mq_flags = 0; - - mqd_t mqd = mq_open(g_startWindowMqName, O_RDONLY|O_CREAT, 0666, &attr); - if (mqd == (mqd_t)-1) - { - gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); - return EXIT_FAILURE; - } - - // Now loop forever, receiving and processing messages. Ultimately, all - // widget driven events (button presses, etc.) are driven by this logic - // on this thread. - - for (;;) - { - // Receive the next message - - struct SStartWindowMessage msg; - ssize_t nbytes = mq_receive(mqd, &msg, sizeof(struct SStartWindowMessage), 0); - if (nbytes < 0) - { - int errval = errno; - - // EINTR is not an error. The wait was interrupted by a signal and - // we just need to try reading again. - - if (errval != EINTR) - { - gdbg("ERROR: mq_receive failed: %d\n", errval); - } - else - { - gdbg("mq_receive interrupted by signal\n"); - } - - continue; - } - - gvdbg("Received msgid=%d nbytes=%d\n", msg.msgId, nbytes); - DEBUGASSERT(nbytes = sizeof(struct SStartWindowMessage) && msg.instance); - - // Dispatch the message to the appropriate CWidgetControl and to the - // appropriate CWidgetControl method - - switch (msg.msgId) - { - break; - - case MSGID_MOUSE_INPUT: // New mouse input is available - case MSGID_KEYBOARD_INPUT: // New keyboard input is available - { - // Handle all new window input events by calling the CWidgetControl::pollEvents() method - - NXWidgets::CWidgetControl *control = (NXWidgets::CWidgetControl *)msg.instance; - control->pollEvents(); - } - break; - - case MSGID_DESTROY_APP: // Destroy the application - { - // Handle all destroy application events - - gdbg("Deleting app=%p\n", msg.instance); - IApplication *app = (IApplication *)msg.instance; - delete app; - } - break; - - case MSGID_POSITIONAL_CHANGE: // Change in window positional data (not used) - case MSGID_REDRAW_REQUEST: // Request to redraw a portion of the window (not used) - default: - gdbg("ERROR: Unrecognized or unsupported msgId: %d\n", (int)msg.msgId); - break; - } - } -} - diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 031edbf3a..93c38ed98 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/ctaskbar.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -456,11 +456,21 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) NXWidgets::IBitmap *bitmap = app->getIcon(); - // Create a CImage instance to manage the applications icon + // Create a CImage instance to manage the applications icon. Assume the + // minimum size in case no bitmap is provided (bitmap == NULL) + + int w = 1; + int h = 1; + + if (bitmap) + { + w = bitmap->getWidth(); + h = bitmap->getHeight(); + } NXWidgets::CImage *image = - new NXWidgets::CImage(control, 0, 0, bitmap->getWidth(), - bitmap->getHeight(), bitmap, 0); + new NXWidgets::CImage(control, 0, 0, w, h, bitmap, 0); + if (!image) { return false; diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 032dd1bf2..114690838 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/cwindowmessenger.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -69,20 +69,6 @@ using namespace NxWM; CWindowMessenger::CWindowMessenger(FAR const NXWidgets::CWidgetStyle *style) : NXWidgets::CWidgetControl(style) { - // Open a message queue to communicate with the start window task. We need to create - // the message queue if it does not exist. - - struct mq_attr attr; - attr.mq_maxmsg = CONFIG_NXWM_STARTWINDOW_MXMSGS; - attr.mq_msgsize = sizeof(struct SStartWindowMessage); - attr.mq_flags = 0; - - m_mqd = mq_open(g_startWindowMqName, O_WRONLY|O_CREAT, 0666, &attr); - if (m_mqd == (mqd_t)-1) - { - gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); - } - // Add ourself to the list of window event handlers addWindowEventHandler(this); @@ -97,10 +83,6 @@ CWindowMessenger::~CWindowMessenger(void) // Remove ourself from the list of the window event handlers removeWindowEventHandler(this); - - // Close the message queue - - (void)mq_close(m_mqd); } /** @@ -120,8 +102,8 @@ void CWindowMessenger::handleMouseEvent(void) // 3. The NX server will determine which window gets the mouse input // and send a window event message to the NX listener thread. // 4. The NX listener thread receives a windows event. The NX listener thread - // which is part of CTaskBar and was created when NX server connection was - // established). This event may be a positional change notification, a + // is part of CTaskBar and was created when NX server connection was + // established. This event may be a positional change notification, a // redraw request, or mouse or keyboard input. In this case, mouse input. // 5. The NX listener thread handles the message by calling nx_eventhandler(). // nx_eventhandler() dispatches the message by calling a method in the @@ -133,20 +115,18 @@ void CWindowMessenger::handleMouseEvent(void) // window event. // 8. NXWidgets::CWindowEventHandlerList will give the event to this method // NxWM::CWindowMessenger. - // 9. This NxWM::CWindowMessenger method will send the a message on a well- - // known message queue. - // 10. This CStartWindow::startWindow task will receive and process that - // message by calling CWidgetControl::pollEvents() + // 9. This NxWM::CWindowMessenger method will schedule an entry on the work + // queue. + // 10. The work queue callback will finally call pollEvents() to execute whatever + // actions the input event should trigger. - struct SStartWindowMessage outmsg; - outmsg.msgId = MSGID_MOUSE_INPUT; - outmsg.instance = (FAR void *)static_cast(this); + work_state_t *state = new work_state_t; + state->windowMessenger = this; - int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), - CONFIG_NXWM_STARTWINDOW_MXMPRIO); + int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: mq_send failed: %d\n", errno); + gdbg("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -158,41 +138,13 @@ void CWindowMessenger::handleMouseEvent(void) #ifdef CONFIG_NX_KBD void CWindowMessenger::handleKeyboardEvent(void) { - // The logic path here is tortuous but flexible: - // - // 1. A listener thread receives keyboard input and injects that into NX - // via nx_kbdin. - // 2. In the multi-user mode, this will send a message to the NX server - // 3. The NX server will determine which window gets the keyboard input - // and send a window event message to the NX listener thread. - // 4. The NX listener thread receives a windows event. The NX listener thread - // which is part of CTaskBar and was created when NX server connection was - // established). This event may be a positional change notification, a - // redraw request, or mouse or keyboard input. In this case, keyboard input. - // 5. The NX listener thread handles the message by calling nx_eventhandler(). - // nx_eventhandler() dispatches the message by calling a method in the - // NXWidgets::CCallback instance associated with the window. - // NXWidgets::CCallback is a part of the CWidgetControl. - // 6. NXWidgets::CCallback calls into NXWidgets::CWidgetControl to process - // the event. - // 7. NXWidgets::CWidgetControl records the new state data and raises a - // window event. - // 8. NXWidgets::CWindowEventHandlerList will give the event to this method - // NxWM::CWindowMessenger. - // 9. This NxWM::CWindowMessenger method will send the a message on a well- - // known message queue. - // 10. This CStartWindow::startWindow task will receive and process that - // message by calling CWidgetControl::pollEvents() + work_state_t *state = new work_state_t; + state->windowMessenger = this; - struct SStartWindowMessage outmsg; - outmsg.msgId = MSGID_KEYBOARD_INPUT; - outmsg.instance = (FAR void *)static_cast(this); - - int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), - CONFIG_NXWM_STARTWINDOW_MXMPRIO); + int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: mq_send failed: %d\n", errno); + gdbg("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -213,18 +165,40 @@ void CWindowMessenger::handleKeyboardEvent(void) void CWindowMessenger::handleBlockedEvent(FAR void *arg) { - // Send a message to destroy the window isntance at a later time + // Send a message to destroy the window instance. - struct SStartWindowMessage outmsg; - outmsg.msgId = MSGID_DESTROY_APP; - outmsg.instance = arg; + work_state_t *state = new work_state_t; + state->windowMessenger = this; + state->instance = arg; - gdbg("Sending MSGID_DESTROY_APP with instance=%p\n", arg); - int ret = mq_send(m_mqd, &outmsg, sizeof(struct SStartWindowMessage), - CONFIG_NXWM_STARTWINDOW_MXMPRIO); + int ret = work_queue(USRWORK, &state->work, &destroyWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: mq_send failed: %d\n", errno); + gdbg("ERROR: work_queue failed: %d\n", ret); } } +/** Work queue callback functions */ + +void CWindowMessenger::inputWorkCallback(FAR void *arg) +{ + work_state_t *state = (work_state_t*)arg; + state->windowMessenger->pollEvents(); + delete state; +} + +void CWindowMessenger::destroyWorkCallback(FAR void *arg) +{ + work_state_t *state = (work_state_t*)arg; + + // First make sure any pending input events have been handled. + + state->windowMessenger->pollEvents(); + + // Then release the memory. + + gdbg("Deleting app=%p\n", state->instance); + IApplication *app = (IApplication *)state->instance; + delete app; + delete state; +} From b373cf0452fce9c564ceb52b47aa3be890d1f2c5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 15 Mar 2013 18:07:34 +0000 Subject: [PATCH 115/390] Prep for 6.26 release git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5745 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 4 ++- ReleaseNotes.txt | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1d2abab4d..f5a5947b3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -267,7 +267,7 @@ and panels below it. Pressing a button will select the corresponding panel. -1.6 2013-xx-xx Gregory Nutt +1.6 2013-03-15 Gregory Nutt * Type of argv[] has changed from const char ** to char * const * * NXWidgets::CNxWidget: Add an inline function to get the current style. @@ -327,3 +327,5 @@ - The work queue will add ~50 ms latency to input events. This is however configurable, and the delay is anyway short enough that it is unnoticeable. From Petteri Aimonen. + +1.7 2013-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 3b3a8531d..d573311f0 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -187,3 +187,75 @@ Bugfixes: * CGraphicsPort::_drawText: Renamed from CGraphicsPort::drawText in order to eliminate some naming collisions when overloaded in some configurations (i.e., when both bool and nx_pixel_t are uint8_t). + +NxWidgets-1.6 +============= + +The 7th release of the NxWidgets package was made on March 15, 2013. This +release depends on NuttX-6.26 or above and should not be used with older +NuttX releases. This release corresponds to SVN revision r5745. + +Note: All of the changes between 1.5 and 1.6 were the result of the +efforts of Petteri Aimonen. + +Additional new features and extended functionality in Version 1.6: + +* NXWidgets::CNxWidget: Add an inline function to get the current style. +* NXWidgets::CCycleButton: Make CCycleButton change state in onPreRelease(). + This way the new value is already available when a listener gets the + action event. +* NxWidgets::CImage: Two enhancements: + 1) Allow changing the bitmap even after the control has been created. + 2) Allow giving 'null' to have the control draw no image at all. + +* NxWM::CTaskBar: Make a some methods of CTaskbar virtual to allow + customizations. +* NxWM::CTaskBar: Allow windows with null icon. This makes sense for e.g. + full screen windows. +* NxWM::CApplicationWindow: Add config options to override NxWM + stop/minimize icons. +* NwWM::CStartWindow, NxWM::CWindowMessenger: Get rid of the start window + thread. Instead, handle all events through the USRWORK work queue. + For me, this was necessary because I would open some files in button + handlers and close them in NxTimer handlers. If these belonged to + different tasks, the close operation would fail. Further benefits: + + Gets rid of one task and message queue. + + Reduces the amount of code required + + Decouples CStartWindow from everything else - now it is just a window + with application icons, not an integral part of the event logic. + + All events come from the same thread, which reduces the possibility of + multithreading errors in user code. + + The user code can also send events to USRWORK, so that everything gets + serialized nicely without having to use so many mutexes. + Drawbacks: + - Currently the work state structure is malloc()ed, causing one allocation + and free per each input event. Could add a memory pool for these later, but + the speed difference doesn't seem noticeable. + - The work queue will add ~50 ms latency to input events. This is however + configurable, and the delay is anyway short enough that it is unnoticeable. + +Bugfixes: + +* NxWidgets::CWidgetControl: Added another semaphore, boundssem, which + is set as soon as the screen bounds are known. This corrects two + problems: + 1) Due to the way nxgl_rectsize computes the size, it will never + be 0,0 like CWidgetControl expects. Therefore the size is considered + valid even though it has not been set yet. + 2) After the check is fixed to test for > 1, NxWM window creation will + hang. This is due to the fact that it uses the screen bounds for + determining window size. This was being blocked on geosem, which + is only posted after the size has been set. +* NxWidgets::CNxTimer: Previously repeated timers were re-enabled after + the timer action event. Consequently, if the action event handler tried + to stop the timer, the request would be ignored. Changes the order + so that the timer is re-enabled before the callback. There is still + no risk of re-entrancy, because everything executes on the USRWORK work + queue. +* NxWidgets::CLabel: Fix backward conditional compilation in the "flicker + free" logic. +* NxWidgets::CMultiLineTestBox: Fix text placement error. From Petteri + Aimonen. + +* NxWidgets/tools/bitmap_converter.py: Fix bitmap_converter.py so that + it works with indexed input images. From 26e5eb41326c536ff4fe2d151badeaa0fe81a9fc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 4 Apr 2013 14:27:29 -0600 Subject: [PATCH 116/390] Clone svn:ignore directory atributed to .gitignore files --- UnitTests/CButton/.gitignore | 14 ++++++++++++++ UnitTests/CButtonArray/.gitignore | 14 ++++++++++++++ UnitTests/CCheckBox/.gitignore | 14 ++++++++++++++ UnitTests/CGlyphButton/.gitignore | 14 ++++++++++++++ UnitTests/CImage/.gitignore | 14 ++++++++++++++ UnitTests/CKeypad/.gitignore | 14 ++++++++++++++ UnitTests/CLabel/.gitignore | 14 ++++++++++++++ UnitTests/CLatchButton/.gitignore | 14 ++++++++++++++ UnitTests/CLatchButtonArray/.gitignore | 14 ++++++++++++++ UnitTests/CListBox/.gitignore | 14 ++++++++++++++ UnitTests/CProgressBar/.gitignore | 14 ++++++++++++++ UnitTests/CRadioButton/.gitignore | 14 ++++++++++++++ UnitTests/CScrollbarHorizontal/.gitignore | 14 ++++++++++++++ UnitTests/CScrollbarVertical/.gitignore | 14 ++++++++++++++ UnitTests/CSliderHorizonal/.gitignore | 14 ++++++++++++++ UnitTests/CSliderVertical/.gitignore | 14 ++++++++++++++ UnitTests/CTextBox/.gitignore | 14 ++++++++++++++ UnitTests/nxwm/.gitignore | 15 +++++++++++++++ nxwm/.gitignore | 2 ++ 19 files changed, 255 insertions(+) create mode 100644 UnitTests/CButton/.gitignore create mode 100644 UnitTests/CButtonArray/.gitignore create mode 100644 UnitTests/CCheckBox/.gitignore create mode 100644 UnitTests/CGlyphButton/.gitignore create mode 100644 UnitTests/CImage/.gitignore create mode 100644 UnitTests/CKeypad/.gitignore create mode 100644 UnitTests/CLabel/.gitignore create mode 100644 UnitTests/CLatchButton/.gitignore create mode 100644 UnitTests/CLatchButtonArray/.gitignore create mode 100644 UnitTests/CListBox/.gitignore create mode 100644 UnitTests/CProgressBar/.gitignore create mode 100644 UnitTests/CRadioButton/.gitignore create mode 100644 UnitTests/CScrollbarHorizontal/.gitignore create mode 100644 UnitTests/CScrollbarVertical/.gitignore create mode 100644 UnitTests/CSliderHorizonal/.gitignore create mode 100644 UnitTests/CSliderVertical/.gitignore create mode 100644 UnitTests/CTextBox/.gitignore create mode 100644 UnitTests/nxwm/.gitignore create mode 100644 nxwm/.gitignore diff --git a/UnitTests/CButton/.gitignore b/UnitTests/CButton/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CButton/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CButtonArray/.gitignore b/UnitTests/CButtonArray/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CButtonArray/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CCheckBox/.gitignore b/UnitTests/CCheckBox/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CCheckBox/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CGlyphButton/.gitignore b/UnitTests/CGlyphButton/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CGlyphButton/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CImage/.gitignore b/UnitTests/CImage/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CImage/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CKeypad/.gitignore b/UnitTests/CKeypad/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CKeypad/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CLabel/.gitignore b/UnitTests/CLabel/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CLabel/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CLatchButton/.gitignore b/UnitTests/CLatchButton/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CLatchButton/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CLatchButtonArray/.gitignore b/UnitTests/CLatchButtonArray/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CLatchButtonArray/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CListBox/.gitignore b/UnitTests/CListBox/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CListBox/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CProgressBar/.gitignore b/UnitTests/CProgressBar/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CProgressBar/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CRadioButton/.gitignore b/UnitTests/CRadioButton/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CRadioButton/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CScrollbarHorizontal/.gitignore b/UnitTests/CScrollbarHorizontal/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CScrollbarVertical/.gitignore b/UnitTests/CScrollbarVertical/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CScrollbarVertical/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CSliderHorizonal/.gitignore b/UnitTests/CSliderHorizonal/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CSliderHorizonal/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CSliderVertical/.gitignore b/UnitTests/CSliderVertical/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CSliderVertical/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/CTextBox/.gitignore b/UnitTests/CTextBox/.gitignore new file mode 100644 index 000000000..c63935dc8 --- /dev/null +++ b/UnitTests/CTextBox/.gitignore @@ -0,0 +1,14 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + diff --git a/UnitTests/nxwm/.gitignore b/UnitTests/nxwm/.gitignore new file mode 100644 index 000000000..83d78ed0d --- /dev/null +++ b/UnitTests/nxwm/.gitignore @@ -0,0 +1,15 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src + + + diff --git a/nxwm/.gitignore b/nxwm/.gitignore new file mode 100644 index 000000000..a3a70d2f3 --- /dev/null +++ b/nxwm/.gitignore @@ -0,0 +1,2 @@ +nxwm-export.zip + From d8e05678fe2099e4dd68391b9c5366693e50e8b3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 22 Apr 2013 08:01:43 -0600 Subject: [PATCH 117/390] Fixes to strchr, mkfats, and NxWidgets from Petteri Aimonen --- ChangeLog.txt | 15 +++++++++ Kconfig | 6 ++++ libnxwidgets/include/cglyphbutton.hxx | 17 +++++++--- libnxwidgets/include/cnxtimer.hxx | 16 ++++++--- libnxwidgets/include/cnxwidget.hxx | 6 ++-- libnxwidgets/include/cscrollbarpanel.hxx | 32 +++++++++--------- libnxwidgets/src/cglyphbutton.cxx | 32 ++++++++++++------ libnxwidgets/src/cscrollbarpanel.cxx | 42 ++++++++++++------------ nxwm/src/ctaskbar.cxx | 2 ++ tools/bitmap_converter.py | 2 +- 10 files changed, 110 insertions(+), 60 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f5a5947b3..d1746a064 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -329,3 +329,18 @@ From Petteri Aimonen. 1.7 2013-xx-xx Gregory Nutt + +* NxWidgets bitmap_converter.py: Fix bug when image width > 255. From + Petteri Aimonen (2013-4-22). +* NxWM::CScrollbarPanel: Fix spelling error in class name: CScollbarPanel + should be CScrollbarPanel. From Petteri Aimonen (2013-4-22). +* NxWidgets:: CGlyphButton: Generate action event, like CButton does. + From Petteri Aimonen (2013-4-22). +* NxWidgets:: CGlyphButton: Prevent drawing outside of the bitmap size. + From Petteri Aimonen (2013-4-22). +* NxWM::CTaskBar: Add option CONFIG_NXWM_TASKBAR_NO_BORDER to suppress + drawing of the border on the taskbar. From Petteri Aimonen (2013-4-22). +* NxWidgets::CNxTimer: Add function to check if CNxTimer is running. + From Petteri Aimonen (2013-4-22). +* NxWidgets::CNxWidgets: Allow overriding of the checkCollision() method. + From Petteri Aimonen (2013-4-22). diff --git a/Kconfig b/Kconfig index 6f5f3e924..efa56a06c 100644 --- a/Kconfig +++ b/Kconfig @@ -428,6 +428,12 @@ config NXWM_DISABLE_MINIMIZE windows. If the buttons are small, it's easy to hit minimize button accidentally when trying to close an application. +config NXWM_TASKBAR_NO_BORDER + bool "Suppress Taskbar border" + default n + ---help--- + Suppress drawing a the border around the taskbar. + comment "Tool Bar Configuration" config NXWM_CUSTOM_TOOLBAR_HEIGHT diff --git a/libnxwidgets/include/cglyphbutton.hxx b/libnxwidgets/include/cglyphbutton.hxx index aad348ca9..b4b1a5657 100644 --- a/libnxwidgets/include/cglyphbutton.hxx +++ b/libnxwidgets/include/cglyphbutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -156,7 +156,16 @@ namespace NXWidgets virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); /** - * Raises an action event and redraws the button. + * Raises an action event. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Raises a release event and redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/include/cnxtimer.hxx b/libnxwidgets/include/cnxtimer.hxx index d4715b378..ab3727de3 100644 --- a/libnxwidgets/include/cnxtimer.hxx +++ b/libnxwidgets/include/cnxtimer.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -102,7 +102,7 @@ namespace NXWidgets * Timer widget. It can drive time-based events, animations, etc. * * Using the timer is simple: - * - Create an instance of the CNxTimer and add it as a child to a widget. + * - Create an instance of the CNxTimer and add it as a child to a widget. * - Call the instance's "start()" method. * - Catch the timer's action event and call any code that should run. */ @@ -169,6 +169,12 @@ namespace NXWidgets void stop(void); + /** + * Returns true if the timer is currently running. + */ + + inline bool isRunning() const { return m_isRunning; } + /** * Set the timeout of this timer. This timeout value will not * take effect until start() or reset() is called. @@ -181,7 +187,7 @@ namespace NXWidgets { m_timeout = timeout; } - + /** * Return the timeout of this timer. * diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index a6982660b..f8c472e75 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -1215,7 +1215,7 @@ namespace NXWidgets * @return True if a collision occurred. */ - bool checkCollision(nxgl_coord_t x, nxgl_coord_t y) const; + virtual bool checkCollision(nxgl_coord_t x, nxgl_coord_t y) const; /** * Checks if the supplied rectangle definition collides with this widget. @@ -1227,8 +1227,8 @@ namespace NXWidgets * @return True if a collision occurred. */ - bool checkCollision(nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t width, nxgl_coord_t height) const; + virtual bool checkCollision(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height) const; /** * Checks if the supplied widget collides with this widget. diff --git a/libnxwidgets/include/cscrollbarpanel.hxx b/libnxwidgets/include/cscrollbarpanel.hxx index 08bdb721c..7f6bf1d32 100644 --- a/libnxwidgets/include/cscrollbarpanel.hxx +++ b/libnxwidgets/include/cscrollbarpanel.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -93,11 +93,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -105,8 +105,8 @@ namespace NXWidgets /** * Class containing a scrolling panel bordered by scrollbars. */ - class CScollbarPanel : public CNxWidget, public IScrollable, - public CWidgetEventHandler + class CScrollbarPanel : public CNxWidget, public IScrollable, + public CWidgetEventHandler { protected: CWidgetControl *m_widgetControl; /**< Widget control instance */ @@ -143,13 +143,13 @@ namespace NXWidgets * Destructor. */ - virtual ~CScollbarPanel(void) { } + virtual ~CScrollbarPanel(void) { } /** * Copy constructor is protected to prevent usage. */ - inline CScollbarPanel(const CScollbarPanel &scrollbarPanel) + inline CScrollbarPanel(const CScrollbarPanel &scrollbarPanel) : CNxWidget(scrollbarPanel) { } public: @@ -169,11 +169,11 @@ namespace NXWidgets * the style into its own internal style object. */ - CScollbarPanel(CWidgetControl *pWidgetControl, - nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t width, nxgl_coord_t height, - uint32_t flags, - CWidgetStyle *style = (CWidgetStyle *)NULL); + CScrollbarPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, + CWidgetStyle *style = (CWidgetStyle *)NULL); /** * Scroll the panel by the specified amounts. @@ -183,7 +183,7 @@ namespace NXWidgets */ virtual void scroll(int32_t dx, int32_t dy); - + /** * Reposition the panel's scrolling region to the specified coordinates. * @@ -216,7 +216,7 @@ namespace NXWidgets */ virtual void setCanvasWidth(const int32_t width); - + /** * Sets the height of the virtual canvas. * @@ -248,7 +248,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasX(void) const; - + /** * Gets the y coordinate of the virtual canvas. * @@ -264,7 +264,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasWidth(void) const; - + /** * Gets the height of the virtual canvas. * diff --git a/libnxwidgets/src/cglyphbutton.cxx b/libnxwidgets/src/cglyphbutton.cxx index f24b5c943..6a2e521ed 100644 --- a/libnxwidgets/src/cglyphbutton.cxx +++ b/libnxwidgets/src/cglyphbutton.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -193,16 +193,16 @@ void CGlyphButton::drawContents(CGraphicsPort *port) if (isEnabled()) { - port->drawBitmap(rect.getX(), rect.getY(), - rect.getWidth(), rect.getHeight(), - bitmap, m_bitmapX, m_bitmapY, + port->drawBitmap(rect.getX() + m_bitmapX, rect.getY() + m_bitmapY, + bitmap->width, bitmap->height, + bitmap, 0, 0, CONFIG_NXWIDGETS_TRANSPARENT_COLOR); } else { - port->drawBitmapGreyScale(rect.getX(), rect.getY(), - rect.getWidth(), rect.getHeight(), - bitmap, m_bitmapX, m_bitmapY); + port->drawBitmapGreyScale(rect.getX() + m_bitmapX, rect.getY() + m_bitmapY, + bitmap->width, bitmap->height, + bitmap, 0, 0); } } @@ -237,7 +237,7 @@ void CGlyphButton::drawOutline(CGraphicsPort *port) nxgl_coord_t color1; nxgl_coord_t color2; - + if (isClicked()) { // Bevelled into the screen @@ -252,7 +252,7 @@ void CGlyphButton::drawOutline(CGraphicsPort *port) color1 = getShineEdgeColor(); color2 = getShadowEdgeColor(); } - + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); @@ -272,7 +272,19 @@ void CGlyphButton::onClick(nxgl_coord_t x, nxgl_coord_t y) } /** - * Raises an action event and redraws the button. + * Raises an action event. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CGlyphButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + m_widgetEventHandlers->raiseActionEvent(); +} + +/** + * Raises a release event and redraws the button. * * @param x The x coordinate of the mouse. * @param y The y coordinate of the mouse. diff --git a/libnxwidgets/src/cscrollbarpanel.cxx b/libnxwidgets/src/cscrollbarpanel.cxx index f21cd7766..4202ab749 100644 --- a/libnxwidgets/src/cscrollbarpanel.cxx +++ b/libnxwidgets/src/cscrollbarpanel.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -104,10 +104,10 @@ using namespace NXWidgets; * the style into its own internal style object. */ -CScollbarPanel::CScollbarPanel(CWidgetControl *pWidgetControl, - nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t width, nxgl_coord_t height, - uint32_t flags, CWidgetStyle *style) +CScrollbarPanel::CScrollbarPanel(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + uint32_t flags, CWidgetStyle *style) : CNxWidget(pWidgetControl, x, y, width, height, flags, style) { m_scrollbarWidth = 10; @@ -136,7 +136,7 @@ CScollbarPanel::CScollbarPanel(CWidgetControl *pWidgetControl, * @param dy The vertical distance to scroll. */ -void CScollbarPanel::scroll(int32_t dx, int32_t dy) +void CScrollbarPanel::scroll(int32_t dx, int32_t dy) { m_panel->scroll(dx, dy); } @@ -148,7 +148,7 @@ void CScollbarPanel::scroll(int32_t dx, int32_t dy) * @param y The new y coordinate of the scrolling region. */ -void CScollbarPanel::jump(int32_t x, int32_t y) +void CScrollbarPanel::jump(int32_t x, int32_t y) { m_panel->jump(x, y); } @@ -159,7 +159,7 @@ void CScollbarPanel::jump(int32_t x, int32_t y) * @param allow True to allow horizontal scrolling; false to deny it. */ -void CScollbarPanel::setAllowsVerticalScroll(bool allow) +void CScrollbarPanel::setAllowsVerticalScroll(bool allow) { m_panel->setAllowsVerticalScroll(allow); @@ -182,7 +182,7 @@ void CScollbarPanel::setAllowsVerticalScroll(bool allow) * @param allow True to allow horizontal scrolling; false to deny it. */ -void CScollbarPanel::setAllowsHorizontalScroll(bool allow) +void CScrollbarPanel::setAllowsHorizontalScroll(bool allow) { m_panel->setAllowsHorizontalScroll(allow); @@ -205,7 +205,7 @@ void CScollbarPanel::setAllowsHorizontalScroll(bool allow) * @param width The width of the virtual canvas. */ -void CScollbarPanel::setCanvasWidth(const int32_t width) +void CScrollbarPanel::setCanvasWidth(const int32_t width) { m_panel->setCanvasWidth(width); m_scrollbarHorizontal->setMaximumValue(width); @@ -217,7 +217,7 @@ void CScollbarPanel::setCanvasWidth(const int32_t width) * @param height The height of the virtual canvas. */ -void CScollbarPanel::setCanvasHeight(const int32_t height) +void CScrollbarPanel::setCanvasHeight(const int32_t height) { m_panel->setCanvasHeight(height); m_scrollbarVertical->setMaximumValue(height); @@ -229,7 +229,7 @@ void CScollbarPanel::setCanvasHeight(const int32_t height) * @return True if vertical scrolling is allowed. */ -bool CScollbarPanel::allowsVerticalScroll(void) const +bool CScrollbarPanel::allowsVerticalScroll(void) const { return m_panel->allowsVerticalScroll(); } @@ -240,7 +240,7 @@ bool CScollbarPanel::allowsVerticalScroll(void) const * @return True if horizontal scrolling is allowed. */ -bool CScollbarPanel::allowsHorizontalScroll(void) const +bool CScrollbarPanel::allowsHorizontalScroll(void) const { return m_panel->allowsHorizontalScroll(); } @@ -251,7 +251,7 @@ bool CScollbarPanel::allowsHorizontalScroll(void) const * @return The x coordinate of the virtual canvas. */ -const int32_t CScollbarPanel::getCanvasX(void) const +const int32_t CScrollbarPanel::getCanvasX(void) const { return m_panel->getCanvasX(); } @@ -262,7 +262,7 @@ const int32_t CScollbarPanel::getCanvasX(void) const * @return The y coordinate of the virtual canvas. */ -const int32_t CScollbarPanel::getCanvasY(void) const +const int32_t CScrollbarPanel::getCanvasY(void) const { return m_panel->getCanvasY(); } @@ -273,7 +273,7 @@ const int32_t CScollbarPanel::getCanvasY(void) const * @return The width of the virtual canvas. */ -const int32_t CScollbarPanel::getCanvasWidth(void) const +const int32_t CScrollbarPanel::getCanvasWidth(void) const { return m_panel->getCanvasWidth(); } @@ -284,7 +284,7 @@ const int32_t CScollbarPanel::getCanvasWidth(void) const * @return The height of the virtual canvas. */ -const int32_t CScollbarPanel::getCanvasHeight(void) const +const int32_t CScrollbarPanel::getCanvasHeight(void) const { return m_panel->getCanvasHeight(); } @@ -295,7 +295,7 @@ const int32_t CScollbarPanel::getCanvasHeight(void) const * @param e The event data. */ -void CScollbarPanel::handleScrollEvent(const CWidgetEventArgs &e) +void CScrollbarPanel::handleScrollEvent(const CWidgetEventArgs &e) { if (e.getSource() != NULL) { @@ -323,7 +323,7 @@ void CScollbarPanel::handleScrollEvent(const CWidgetEventArgs &e) * @param e The event data. */ -void CScollbarPanel::handleValueChangeEvent(const CWidgetEventArgs &e) +void CScrollbarPanel::handleValueChangeEvent(const CWidgetEventArgs &e) { if (e.getSource() != NULL) { @@ -352,7 +352,7 @@ void CScollbarPanel::handleValueChangeEvent(const CWidgetEventArgs &e) * Creates the child widgets. */ -void CScollbarPanel::buildUI(void) +void CScrollbarPanel::buildUI(void) { CRect rect; getClientRect(rect); @@ -432,7 +432,7 @@ void CScollbarPanel::buildUI(void) * @see redraw() */ -void CScollbarPanel::drawContents(CGraphicsPort *port) +void CScrollbarPanel::drawContents(CGraphicsPort *port) { port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); } diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 93c38ed98..226ebe7bb 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -1112,11 +1112,13 @@ bool CTaskbar::redrawTaskbarWindow(void) port->drawFilledRect(0, 0, windowSize.w, windowSize.h, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR); +#ifndef CONFIG_NXWM_TASKBAR_NO_BORDER // Add a border to the task bar to delineate it from the background window port->drawBevelledRect(0, 0, windowSize.w, windowSize.h, CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR, CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR); +#endif // Begin adding icons in the upper left corner diff --git a/tools/bitmap_converter.py b/tools/bitmap_converter.py index 1c5337741..714be3ae6 100755 --- a/tools/bitmap_converter.py +++ b/tools/bitmap_converter.py @@ -64,7 +64,7 @@ def encode_row(img, palette, y): for x in range(0, img.size[0]): c = quantize(img.getpixel((x, y)), palette) - if c == color: + if c == color and repeats < 255: repeats += 1 else: if color is not None: From 9030c9556b9a4692a41847e743d7dab74a26c6c2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 28 Apr 2013 10:56:29 -0600 Subject: [PATCH 118/390] Prep for NuttX-6.27 release --- ChangeLog.txt | 4 +++- ReleaseNotes.txt | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d1746a064..be423b9dd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -328,7 +328,7 @@ configurable, and the delay is anyway short enough that it is unnoticeable. From Petteri Aimonen. -1.7 2013-xx-xx Gregory Nutt +1.7 2013-04-28 Gregory Nutt * NxWidgets bitmap_converter.py: Fix bug when image width > 255. From Petteri Aimonen (2013-4-22). @@ -344,3 +344,5 @@ From Petteri Aimonen (2013-4-22). * NxWidgets::CNxWidgets: Allow overriding of the checkCollision() method. From Petteri Aimonen (2013-4-22). + +1.8 2013-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index d573311f0..ca3608243 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -259,3 +259,28 @@ Bugfixes: * NxWidgets/tools/bitmap_converter.py: Fix bitmap_converter.py so that it works with indexed input images. + +NxWidgets-1.7 +============= + +The 8th release of the NxWidgets package was made on April 28, 2013. This +release depends on NuttX-6.26 or above and should not be used with older +NuttX releases. + +Note: All of the changes between 1.6 and 1.7 were the result of the +efforts of Petteri Aimonen. + +Additional new features and extended functionality in Version 1.7: + +* NxWidgets:: CGlyphButton: Generate action event, like CButton does. +* NxWM::CTaskBar: Add option CONFIG_NXWM_TASKBAR_NO_BORDER to suppress + drawing of the border on the taskbar. +* NxWidgets::CNxTimer: Add function to check if CNxTimer is running. +* NxWidgets::CNxWidgets: Allow overriding of the checkCollision() method. + +Bugfixes: + +* NxWidgets bitmap_converter.py: Fix bug when image width > 255 +* NxWM::CScrollbarPanel: Fix spelling error in class name: CScollbarPanel + should be CScrollbarPanel +* NxWidgets:: CGlyphButton: Prevent drawing outside of the bitmap size. From ee1ca5f971539498c4f3f9a82ffcf4d82397aa39 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 28 Apr 2013 12:00:34 -0600 Subject: [PATCH 119/390] Fix minor typos --- ReleaseNotes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index ca3608243..a856cad2c 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -272,7 +272,7 @@ efforts of Petteri Aimonen. Additional new features and extended functionality in Version 1.7: -* NxWidgets:: CGlyphButton: Generate action event, like CButton does. +* NxWidgets::CGlyphButton: Generate action event, like CButton does. * NxWM::CTaskBar: Add option CONFIG_NXWM_TASKBAR_NO_BORDER to suppress drawing of the border on the taskbar. * NxWidgets::CNxTimer: Add function to check if CNxTimer is running. @@ -283,4 +283,4 @@ Bugfixes: * NxWidgets bitmap_converter.py: Fix bug when image width > 255 * NxWM::CScrollbarPanel: Fix spelling error in class name: CScollbarPanel should be CScrollbarPanel -* NxWidgets:: CGlyphButton: Prevent drawing outside of the bitmap size. +* NxWidgets::CGlyphButton: Prevent drawing outside of the bitmap size. From 18737449ba8834472377f586246a154aecb3c17c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 May 2013 16:15:51 -0600 Subject: [PATCH 120/390] Add beginning a a media player window to NxWM from Ken Pettit. Still a work in progress --- ChangeLog.txt | 6 + Kconfig | 18 +- UnitTests/nxwm/nxwm_main.cxx | 45 ++++ nxwm/Makefile | 4 + nxwm/include/cmediaplayer.hxx | 286 +++++++++++++++++++++ nxwm/include/nxwmconfig.hxx | 23 ++ nxwm/include/nxwmglyphs.hxx | 1 + nxwm/src/cmediaplayer.cxx | 454 +++++++++++++++++++++++++++++++++ nxwm/src/glyph_mediaplayer.cxx | 305 ++++++++++++++++++++++ 9 files changed, 1139 insertions(+), 3 deletions(-) create mode 100644 nxwm/include/cmediaplayer.hxx create mode 100644 nxwm/src/cmediaplayer.cxx create mode 100644 nxwm/src/glyph_mediaplayer.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index be423b9dd..12e429f45 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -346,3 +346,9 @@ From Petteri Aimonen (2013-4-22). 1.8 2013-xx-xx Gregory Nutt + +* NxWM::CMediaPlayer: shell application for an MP3 Media Player with + Kconfig settings to enable it. I plan to write this app to help + develop and test the MP3 codec chip driver. It really doesn't do + anything yet except display a text box saying "Coming soon", and I + need to minimize the icon size a bit. From Ken Pettit (2013-5-11). diff --git a/Kconfig b/Kconfig index efa56a06c..1e4e10c66 100644 --- a/Kconfig +++ b/Kconfig @@ -470,7 +470,7 @@ config NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap comment "Application Window Configuration" - + config NXWM_CUSTOM_APPWINDOW_ICONS bool "Custom Start/Stop Application Window Icons" default n @@ -591,13 +591,13 @@ if NXWM_NXCONSOLE_CUSTOM_COLORS config NXWM_NXCONSOLE_WCOLOR hex "NxConsole Background Color" ---help--- - The color of the NxConsole window background. Default: + The color of the NxConsole window background. Default: RGB(192,192,192) config NXWM_NXCONSOLE_FONTCOLOR hex "NxConsole Font Color" ---help--- - The color of the fonts to use in the NxConsole window. + The color of the fonts to use in the NxConsole window. Default: RGB(0,0,0) endif @@ -840,4 +840,16 @@ config NXWM_HEXCALCULATOR_FONTID NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 endif +config NXWM_MEDIAPLAYER + bool "Enable Media Player" + default n + ---help--- + Enable support for the MP3 Media Player. This features requires + a board that includes an MP3 Codec chip, such as the Mikromedia + boards available from MikroElektronica, along with a NuttX port + with a device driver for the MP3 codec. + + NOTE: This application is currently under development and just + a shell of an app which will be developed soon. + endif diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index fa05d52e4..04ffb64ba 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -49,6 +49,10 @@ #include "cnxconsole.hxx" #include "chexcalculator.hxx" +#ifdef CONFIG_NXWM_MEDIAPLAYER +#include "cmediaplayer.hxx" +#endif + #ifdef CONFIG_NXWM_TOUCHSCREEN # include "ctouchscreen.hxx" # include "ccalibration.hxx" @@ -560,6 +564,37 @@ static bool createHexCalculator(void) return true; } +///////////////////////////////////////////////////////////////////////////// +// Name: createMediaPlayer +///////////////////////////////////////////////////////////////////////////// + +#ifdef CONFIG_NXWM_MEDIAPLAYER +static bool createMediaPlayer(void) +{ + // Add the hex calculator application to the start window + + printf("createHexCalculator: Creating the hex calculator application\n"); + NxWM::CMediaPlayerFactory *calculator = new NxWM::CMediaPlayerFactory(g_nxwmtest.taskbar); + if (!calculator) + { + printf("createMediaPlayer: ERROR: Failed to instantiate CMediaPlayerFactory\n"); + return false; + } + showTestCaseMemory("createMediaPlayer: After creating the media player application"); + + printf("createMediaPlayer: Adding the hex calculator application to the start window\n"); + if (!g_nxwmtest.startwindow->addApplication(calculator)) + { + printf("createMediaPlayer: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + delete calculator; + return false; + } + + showTestCaseMemory("createMediaPlayer: After adding the media player application"); + return true; +} +#endif + ///////////////////////////////////////////////////////////////////////////// // Public Functions ///////////////////////////////////////////////////////////////////////////// @@ -673,6 +708,16 @@ int nxwm_main(int argc, char *argv[]) testCleanUpAndExit(EXIT_FAILURE); } + // Create the media player application and add it to the start window + +#ifdef CONFIG_NXWM_MEDIAPLAYER + if (!createMediaPlayer()) + { + printf("nxwm_main: ERROR: Failed to create the media player application\n"); + testCleanUpAndExit(EXIT_FAILURE); + } +#endif + // Call CTaskBar::startWindowManager to start the display with applications in place. if (!startWindowManager()) diff --git a/nxwm/Makefile b/nxwm/Makefile index 0bea357b2..22653a524 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -75,6 +75,10 @@ CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx CXXSRCS += glyph_stop.cxx +ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) +CXXSRCS += glyph_mediaplayer.cxx cmediaplayer.cxx +endif + SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) AOBJS = $(ASRCS:.S=$(OBJEXT)) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx new file mode 100644 index 000000000..88143617e --- /dev/null +++ b/nxwm/include/cmediaplayer.hxx @@ -0,0 +1,286 @@ +/**************************************************************************** + * NxWidgets/nxwm/include/cmediaplayer.hxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CMEDIAPLAYER_HXX +#define __INCLUDE_CMEDIAPLAYER_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "cbuttonarray.hxx" +#include "clabel.hxx" +#include "cnxfont.hxx" + +#include "iapplication.hxx" +#include "capplicationwindow.hxx" +#include "ctaskbar.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +#define NXWM_MEDIAPLAYER_NROWS 6 +#define NXWM_MEDIAPLAYER_NCOLUMNS 6 + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NxWM +{ + /** + * This class implements the CMediaPlayer application. + */ + + class CMediaPlayer : public IApplication, + private IApplicationCallback, + private NXWidgets::CWidgetEventHandler + { + private: + /** + * The structure defines a pending operation. + */ + + struct SPendingOperation + { + int64_t value; /**< Accumulated value */ + uint8_t operation; /**< Identifies the operations */ + }; + + /** + * Media player state data. + */ + + /** + * Cached constructor parameters. + */ + + CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ + CApplicationWindow *m_window; /**< Reference to the application window */ + + /** + * Widgets + */ + + NXWidgets::CLabel *m_text; /**< Some text in the app for now */ + NXWidgets::CNxFont *m_font; /**< The font used in the media player */ + + /** + * Calculator geometry. This stuff does not really have to be retained + * in memory. If you are pinched for memory, get rid of these. + */ + + struct nxgl_size_s m_windowSize; /**< The size of the calculator window */ + struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */ + struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */ + + /** + * Select the geometry of the media player given the current window size. + * Only called as part of construction. + */ + + inline void setGeometry(void); + + /** + * Create the Media Player conrols. Only start as part of the applicaiton + * start method. + */ + + inline bool createPlayer(void); + + /** + * Called when the window minimize button is pressed. + */ + + void minimize(void); + + /** + * Called when the window minimize close is pressed. + */ + + void close(void); + + /** + * Handle a widget action event. For CImage, this is a button pre- + * release event. + * + * @param e The event data. + */ + + void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); + + public: + /** + * CMediaPlayer constructor + * + * @param window. The application window + * + * @param taskbar. A pointer to the parent task bar instance + * @param window. The window to be used by this application. + */ + + CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window); + + /** + * CMediaPlayer destructor + */ + + ~CMediaPlayer(void); + + /** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + + IApplicationWindow *getWindow(void) const; + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + + /** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + + NXWidgets::CNxString getName(void); + + /** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + + bool run(void); + + /** + * Stop the application. + */ + + void stop(void); + + /** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + + void destroy(void); + + /** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + + void hide(void); + + /** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + + void redraw(void); + + /** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + + bool isFullScreen(void) const; + }; + + class CMediaPlayerFactory : public IApplicationFactory + { + private: + CTaskbar *m_taskbar; /**< The taskbar */ + + public: + /** + * CMediaPlayerFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate calibration + */ + + CMediaPlayerFactory(CTaskbar *taskbar); + + /** + * CMediaPlayerFactory Destructor + */ + + inline ~CMediaPlayerFactory(void) { } + + /** + * Create a new instance of an CMediaPlayer (as IApplication). + */ + + IApplication *create(void); + + /** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + + NXWidgets::IBitmap *getIcon(void); + }; +} +#endif // __cplusplus + +#endif // __INCLUDE_CMEDIAPLAYER_HXX diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 0c43125bb..d57b58b59 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -533,6 +533,29 @@ # define CONFIG_NXWM_HEXCALCULATOR_FONTID CONFIG_NXWM_DEFAULT_FONTID #endif +/* Media Player application ***********************************************/ +/** + * + * CONFIG_NXWM_HEXCALCULATOR_BACKGROUNDCOLOR - The background color of the + * calculator display. Default: Same as CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR + * CONFIG_NXWM_HEXCALCULATOR_ICON - The ICON to use for the hex calculator + * application. Default: NxWM::g_calculatorBitmap + * CONFIG_NXWM_HEXCALCULATOR_FONTID - The font used with the calculator. + * Default: CONFIG_NXWM_DEFAULT_FONTID + */ + +#ifndef CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR +# define CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +#endif + +#ifndef CONFIG_NXWM_MEDIAPLAYER_ICON +# define CONFIG_NXWM_MEDIAPLAYER_ICON NxWM::g_mediaplayerBitmap +#endif + +#ifndef CONFIG_NXWM_MEDIAPLAYER_FONTID +# define CONFIG_NXWM_MEDIAPLAYER_FONTID CONFIG_NXWM_DEFAULT_FONTID +#endif + /**************************************************************************** * Global Function Prototypes ****************************************************************************/ diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 7db02fd17..74b527611 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -60,6 +60,7 @@ namespace NxWM extern const struct NXWidgets::SRlePaletteBitmap g_calculatorBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_calibrationBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mediaplayerBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx new file mode 100644 index 000000000..ffe237fc1 --- /dev/null +++ b/nxwm/src/cmediaplayer.cxx @@ -0,0 +1,454 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/cmediaplayer.cxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" +#include "cmediaplayer.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +/******************************************************************************************** + * Private Types + ********************************************************************************************/ + +/******************************************************************************************** + * Private Data + ********************************************************************************************/ + +/******************************************************************************************** + * Private Functions + ********************************************************************************************/ + +/******************************************************************************************** + * CMediaPlayer Method Implementations + ********************************************************************************************/ + +extern const struct NXWidgets::SRlePaletteBitmap CONFIG_NXWM_MEDIAPLAYER_ICON; + +using namespace NxWM; + +/** + * CMediaPlayer constructor + * + * @param window. The application window + */ + +CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) +{ + // Save the constructor data + + m_taskbar = taskbar; + m_window = window; + + // Nullify widgets that will be instantiated when the window is started + + m_text = (NXWidgets::CLabel *)0; + m_font = (NXWidgets::CNxFont *)0; + + // Add our personalized window label + + NXWidgets::CNxString myName = getName(); + window->setWindowLabel(myName); + + // Add our callbacks with the application window + + window->registerCallbacks(static_cast(this)); + + // Set the geometry of the media player + + setGeometry(); +} + +/** + * CMediaPlayer destructor + * + * @param window. The application window + */ + +CMediaPlayer::~CMediaPlayer(void) +{ + // Destroy widgets + + if (m_text) + { + delete m_text; + } + + if (m_font) + { + delete m_font; + } + + // Although we didn't create it, we are responsible for deleting the + // application window + + delete m_window; +} + +/** + * Each implementation of IApplication must provide a method to recover + * the contained CApplicationWindow instance. + */ + +IApplicationWindow *CMediaPlayer::getWindow(void) const +{ + return static_cast(m_window); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CMediaPlayer::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MEDIAPLAYER_ICON); + + return bitmap; +} + +/** + * Get the name string associated with the application + * + * @return A copy if CNxString that contains the name of the application. + */ + +NXWidgets::CNxString CMediaPlayer::getName(void) +{ + return NXWidgets::CNxString("Media Player"); +} + +/** + * Start the application (perhaps in the minimized state). + * + * @return True if the application was successfully started. + */ + +bool CMediaPlayer::run(void) +{ + // Create the widgets (if we have not already done so) + + if (!m_text) + { + // Create the widgets + + if (!createPlayer()) + { + gdbg("ERROR: Failed to create widgets\n"); + return false; + } + } + + return true; +} + +/** + * Stop the application. + */ + +void CMediaPlayer::stop(void) +{ + // Just disable further drawing + + m_text->disableDrawing(); +} + +/** + * Destroy the application and free all of its resources. This method + * will initiate blocking of messages from the NX server. The server + * will flush the window message queue and reply with the blocked + * message. When the block message is received by CWindowMessenger, + * it will send the destroy message to the start window task which + * will, finally, safely delete the application. + */ + +void CMediaPlayer::destroy(void) +{ + // Make sure that the widgets are stopped + + stop(); + + // Block any further window messages + + m_window->block(this); +} + +/** + * The application window is hidden (either it is minimized or it is + * maximized, but not at the top of the hierarchy + */ + +void CMediaPlayer::hide(void) +{ + // Disable drawing and events + + stop(); +} + +/** + * Redraw the entire window. The application has been maximized or + * otherwise moved to the top of the hierarchy. This method is call from + * CTaskbar when the application window must be displayed + */ + +void CMediaPlayer::redraw(void) +{ + char buffer[24]; + + snprintf(buffer, 24, "Comming soon!"); + + // setText will perform the redraw as well + + m_text->setText(buffer); + + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, + CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); + + // Enable and redraw widgets + + m_text->enableDrawing(); + m_text->redraw(); +} + +/** + * Report of this is a "normal" window or a full screen window. The + * primary purpose of this method is so that window manager will know + * whether or not it show draw the task bar. + * + * @return True if this is a full screen window. + */ + +bool CMediaPlayer::isFullScreen(void) const +{ + return m_window->isFullScreen(); +} + +/** + * Select the geometry of the calculator given the current window size. + */ + +void CMediaPlayer::setGeometry(void) +{ + // Recover the NXTK window instance contained in the application window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the window + + (void)window->getSize(&m_windowSize); + + // Get the size of the text box. Same width as the m_keypad + + m_textSize.w = m_windowSize.w - 10; + m_textSize.h = 36; + + // Now position the text box + + m_textPos.x = 5; + m_textPos.y = 5; +} + +/** + * Create the calculator widgets. Only start as part of the applicaiton + * start method. + */ + +bool CMediaPlayer::createPlayer(void) +{ + // Select a font for the calculator + + m_font = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_MEDIAPLAYER_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, + CONFIG_NXWM_TRANSPARENT_COLOR); + if (!m_font) + { + gdbg("ERROR failed to create font\n"); + return false; + } + + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Create a label to show some text. A simple label is used + // because the power of a text box is un-necessary in this application. + + m_text = new NXWidgets::CLabel(control, + m_textPos.x, m_textPos.y, + m_textSize.w, m_textSize.h, + "0"); + if (!m_text) + { + gdbg("ERROR: Failed to create CLabel\n"); + return false; + } + + // Align text on the left + + m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_RIGHT); + + // Disable drawing and events until we are asked to redraw the window + + m_text->disableDrawing(); + m_text->setRaisesEvents(false); + + // Select the font + + m_text->setFont(m_font); + return true; +} + +/** + * Called when the window minimize button is pressed. + */ + +void CMediaPlayer::minimize(void) +{ + m_taskbar->minimizeApplication(static_cast(this)); +} + +/** + * Called when the window close button is pressed. + */ + +void CMediaPlayer::close(void) +{ + m_taskbar->stopApplication(static_cast(this)); +} + +/** + * Handle a widget action event. For CButtonArray, this is a button pre- + * release event. + * + * @param e The event data. + */ + +void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) +{ + /* Nothing here yet! Comming soon! */ +} + +/** + * CMediaPlayerFactory Constructor + * + * @param taskbar. The taskbar instance used to terminate the console + */ + +CMediaPlayerFactory::CMediaPlayerFactory(CTaskbar *taskbar) +{ + m_taskbar = taskbar; +} + +/** + * Create a new instance of an CMediaPlayer (as IApplication). + */ + +IApplication *CMediaPlayerFactory::create(void) +{ + // Call CTaskBar::openFullScreenWindow to create a application window for + // the NxConsole application + + CApplicationWindow *window = m_taskbar->openApplicationWindow(); + if (!window) + { + gdbg("ERROR: Failed to create CApplicationWindow\n"); + return (IApplication *)0; + } + + // Open the window (it is hot in here) + + if (!window->open()) + { + gdbg("ERROR: Failed to open CApplicationWindow\n"); + delete window; + return (IApplication *)0; + } + + // Instantiate the application, providing the window to the application's + // constructor + + CMediaPlayer *mediaPlayer = new CMediaPlayer(m_taskbar, window); + if (!mediaPlayer) + { + gdbg("ERROR: Failed to instantiate CMediaPlayer\n"); + delete window; + return (IApplication *)0; + } + + return static_cast(mediaPlayer); +} + +/** + * Get the icon associated with the application + * + * @return An instance if IBitmap that may be used to rend the + * application's icon. This is an new IBitmap instance that must + * be deleted by the caller when it is no long needed. + */ + +NXWidgets::IBitmap *CMediaPlayerFactory::getIcon(void) +{ + NXWidgets::CRlePaletteBitmap *bitmap = + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MEDIAPLAYER_ICON); + + return bitmap; +} diff --git a/nxwm/src/glyph_mediaplayer.cxx b/nxwm/src/glyph_mediaplayer.cxx new file mode 100644 index 000000000..e258c2065 --- /dev/null +++ b/nxwm/src/glyph_mediaplayer.cxx @@ -0,0 +1,305 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_mediaplayer.cxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +/* Automatically NuttX bitmap file. */ +/* Generated from play_music.png by bitmap_converter.py. */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_WIDTH 24 +#define BITMAP_HEIGHT 24 +#define BITMAP_PALETTESIZE 255 + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] = +{ + MKRGB( 0, 0, 0), MKRGB(255,255,255), MKRGB(116,187,231), MKRGB(120,200,242), + MKRGB(114,186,226), MKRGB(111,182,229), MKRGB(106,181,227), MKRGB( 93,176,231), + MKRGB( 46,106,167), MKRGB( 27,106,185), MKRGB(123,203,244), MKRGB(122,203,244), + MKRGB(119,191,228), MKRGB( 6, 74,154), MKRGB(144,206,241), MKRGB(124,205,245), + MKRGB(143,204,235), MKRGB(121,202,243), MKRGB(134,198,239), MKRGB(135,197,233), + MKRGB(131,193,235), MKRGB(125,191,229), MKRGB(124,191,231), MKRGB(119,191,229), + MKRGB(122,189,231), MKRGB(114,189,225), MKRGB(116,188,227), MKRGB(113,184,229), + MKRGB(105,182,231), MKRGB( 98,181,233), MKRGB(100,180,231), MKRGB(113,176,219), + MKRGB( 91,175,231), MKRGB(102,174,217), MKRGB( 88,173,229), MKRGB( 85,172,229), + MKRGB( 83,171,229), MKRGB( 74,164,225), MKRGB( 67,161,225), MKRGB( 92,154,203), + MKRGB( 62,153,221), MKRGB( 58,152,219), MKRGB( 56,148,217), MKRGB( 58,146,215), + MKRGB( 54,139,207), MKRGB( 54,137,207), MKRGB( 52,135,203), MKRGB( 50,128,199), + MKRGB( 59,127,187), MKRGB( 41,114,189), MKRGB( 36,110,185), MKRGB( 37,101,169), + MKRGB( 29, 95,169), MKRGB( 32, 93,167), MKRGB( 30, 89,161), MKRGB( 21, 78,153), + MKRGB( 19, 77,151), MKRGB( 14, 70,145), MKRGB(130,209,246), MKRGB(130,208,246), + MKRGB(119,200,244), MKRGB(146,199,234), MKRGB(117,198,242), MKRGB(129,197,236), + MKRGB(107,192,238), MKRGB(123,191,232), MKRGB(102,189,234), MKRGB(117,187,230), + MKRGB(110,183,230), MKRGB(100,183,234), MKRGB(119,182,222), MKRGB(109,181,222), + MKRGB(103,180,226), MKRGB( 95,179,230), MKRGB(107,177,220), MKRGB( 95,176,230), + MKRGB( 79,170,226), MKRGB( 77,167,224), MKRGB( 79,162,220), MKRGB( 86,158,206), + MKRGB( 64,155,220), MKRGB( 59,154,220), MKRGB( 60,150,218), MKRGB( 84,147,200), + MKRGB( 55,141,210), MKRGB( 58,140,206), MKRGB( 49,127,198), MKRGB( 45,122,192), + MKRGB( 33,118,192), MKRGB( 25,104,184), MKRGB( 38,103,172), MKRGB( 28, 94,168), + MKRGB( 30, 93,168), MKRGB( 28, 90,162), MKRGB( 26, 87,160), MKRGB( 25, 85,160), + MKRGB( 25, 84,158), MKRGB( 20, 78,150), MKRGB( 19, 78,150), MKRGB( 18, 74,148), + MKRGB( 15, 71,146), MKRGB( 13, 69,144), MKRGB( 11, 67,142), MKRGB(254,255,255), + MKRGB(242,250,253), MKRGB(239,246,249), MKRGB(238,244,247), MKRGB(100,177,227), + MKRGB(222,231,241), MKRGB(220,230,241), MKRGB(213,227,237), MKRGB(171,216,243), + MKRGB(134,214,251), MKRGB(163,212,241), MKRGB(162,211,241), MKRGB(130,211,249), + MKRGB(128,210,249), MKRGB(128,208,247), MKRGB(125,208,247), MKRGB(123,205,247), + MKRGB(123,204,245), MKRGB(122,204,247), MKRGB(179,202,225), MKRGB(123,201,243), + MKRGB(119,201,245), MKRGB(119,200,243), MKRGB(116,200,241), MKRGB(172,197,223), + MKRGB(122,197,233), MKRGB(115,197,243), MKRGB(135,195,233), MKRGB(114,195,241), + MKRGB(108,195,241), MKRGB(122,194,237), MKRGB(110,194,237), MKRGB(126,193,231), + MKRGB(122,193,233), MKRGB(118,192,227), MKRGB(110,192,241), MKRGB(109,191,239), + MKRGB(104,189,239), MKRGB(118,188,229), MKRGB(102,188,235), MKRGB(149,186,219), + MKRGB(121,186,225), MKRGB( 99,184,237), MKRGB(143,183,217), MKRGB(106,183,231), + MKRGB(140,182,217), MKRGB(112,182,229), MKRGB(103,182,225), MKRGB( 95,182,235), + MKRGB(116,181,221), MKRGB( 94,181,235), MKRGB( 92,178,229), MKRGB(100,177,225), + MKRGB( 91,176,231), MKRGB( 84,175,231), MKRGB( 83,175,233), MKRGB( 97,174,225), + MKRGB( 92,174,227), MKRGB( 89,174,229), MKRGB( 89,173,227), MKRGB( 85,173,231), + MKRGB(100,171,221), MKRGB( 87,171,227), MKRGB( 86,171,221), MKRGB( 95,170,219), + MKRGB( 87,169,223), MKRGB( 86,169,223), MKRGB(101,168,213), MKRGB( 78,168,225), + MKRGB( 81,167,225), MKRGB( 79,167,227), MKRGB( 75,167,219), MKRGB( 75,166,223), + MKRGB( 82,165,223), MKRGB( 69,165,225), MKRGB( 90,164,217), MKRGB( 73,164,225), + MKRGB( 90,163,217), MKRGB( 75,163,223), MKRGB( 70,163,223), MKRGB( 75,162,221), + MKRGB( 68,161,221), MKRGB( 73,160,217), MKRGB( 72,159,219), MKRGB(114,158,201), + MKRGB( 90,157,209), MKRGB( 75,156,213), MKRGB( 69,156,217), MKRGB( 68,156,217), + MKRGB( 73,153,209), MKRGB( 63,153,217), MKRGB( 77,152,207), MKRGB( 81,149,205), + MKRGB(100,144,193), MKRGB( 65,142,205), MKRGB( 73,160,221), MKRGB( 68,133,191), + MKRGB( 61,126,185), MKRGB( 66,123,179), MKRGB( 38,117,191), MKRGB( 37,117,191), + MKRGB( 39,116,187), MKRGB( 30,116,191), MKRGB( 43,114,187), MKRGB( 31,114,189), + MKRGB( 29,112,187), MKRGB( 49,111,177), MKRGB( 49,110,177), MKRGB( 38,108,179), + MKRGB( 25,107,183), MKRGB( 29,106,185), MKRGB( 45,105,167), MKRGB( 26,105,185), + MKRGB( 24,103,183), MKRGB( 42,102,165), MKRGB( 22,102,183), MKRGB( 36,100,169), + MKRGB( 36, 99,169), MKRGB( 14, 85,165), MKRGB( 22, 80,153), MKRGB( 21, 80,153), + MKRGB( 2, 72,153), MKRGB(252,253,254), MKRGB(247,249,250), MKRGB(245,248,252), + MKRGB(237,244,248), MKRGB(215,228,240), MKRGB(213,227,238), MKRGB(123,204,246), + MKRGB(122,204,246), MKRGB(140,203,238), MKRGB(121,201,242), MKRGB(119,201,246), + MKRGB(121,200,242), MKRGB(170,198,224), MKRGB(171,197,222), MKRGB(114,196,242), + MKRGB(147,194,228), MKRGB(119,194,230), MKRGB(120,191,228), MKRGB(114,191,236), + MKRGB(119,190,234), MKRGB(118,190,228), MKRGB(119,189,228), MKRGB(118,189,228), + MKRGB(115,189,234), MKRGB(109,187,232), MKRGB(106,187,236), MKRGB(103,187,236), + MKRGB(146,186,218), MKRGB(117,185,230), MKRGB( 95,185,236), +}; + +static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] = +{ + MKRGB( 50, 50, 50), MKRGB(255,255,255), MKRGB(166,237,255), MKRGB(170,250,255), + MKRGB(164,236,255), MKRGB(161,232,255), MKRGB(156,231,255), MKRGB(143,226,255), + MKRGB( 96,156,217), MKRGB( 77,156,235), MKRGB(173,253,255), MKRGB(172,253,255), + MKRGB(169,241,255), MKRGB( 56,124,204), MKRGB(194,255,255), MKRGB(174,255,255), + MKRGB(193,254,255), MKRGB(171,252,255), MKRGB(184,248,255), MKRGB(185,247,255), + MKRGB(181,243,255), MKRGB(175,241,255), MKRGB(174,241,255), MKRGB(169,241,255), + MKRGB(172,239,255), MKRGB(164,239,255), MKRGB(166,238,255), MKRGB(163,234,255), + MKRGB(155,232,255), MKRGB(148,231,255), MKRGB(150,230,255), MKRGB(163,226,255), + MKRGB(141,225,255), MKRGB(152,224,255), MKRGB(138,223,255), MKRGB(135,222,255), + MKRGB(133,221,255), MKRGB(124,214,255), MKRGB(117,211,255), MKRGB(142,204,253), + MKRGB(112,203,255), MKRGB(108,202,255), MKRGB(106,198,255), MKRGB(108,196,255), + MKRGB(104,189,255), MKRGB(104,187,255), MKRGB(102,185,253), MKRGB(100,178,249), + MKRGB(109,177,237), MKRGB( 91,164,239), MKRGB( 86,160,235), MKRGB( 87,151,219), + MKRGB( 79,145,219), MKRGB( 82,143,217), MKRGB( 80,139,211), MKRGB( 71,128,203), + MKRGB( 69,127,201), MKRGB( 64,120,195), MKRGB(180,255,255), MKRGB(180,255,255), + MKRGB(169,250,255), MKRGB(196,249,255), MKRGB(167,248,255), MKRGB(179,247,255), + MKRGB(157,242,255), MKRGB(173,241,255), MKRGB(152,239,255), MKRGB(167,237,255), + MKRGB(160,233,255), MKRGB(150,233,255), MKRGB(169,232,255), MKRGB(159,231,255), + MKRGB(153,230,255), MKRGB(145,229,255), MKRGB(157,227,255), MKRGB(145,226,255), + MKRGB(129,220,255), MKRGB(127,217,255), MKRGB(129,212,255), MKRGB(136,208,255), + MKRGB(114,205,255), MKRGB(109,204,255), MKRGB(110,200,255), MKRGB(134,197,250), + MKRGB(105,191,255), MKRGB(108,190,255), MKRGB( 99,177,248), MKRGB( 95,172,242), + MKRGB( 83,168,242), MKRGB( 75,154,234), MKRGB( 88,153,222), MKRGB( 78,144,218), + MKRGB( 80,143,218), MKRGB( 78,140,212), MKRGB( 76,137,210), MKRGB( 75,135,210), + MKRGB( 75,134,208), MKRGB( 70,128,200), MKRGB( 69,128,200), MKRGB( 68,124,198), + MKRGB( 65,121,196), MKRGB( 63,119,194), MKRGB( 61,117,192), MKRGB(255,255,255), + MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(150,227,255), + MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(221,255,255), + MKRGB(184,255,255), MKRGB(213,255,255), MKRGB(212,255,255), MKRGB(180,255,255), + MKRGB(178,255,255), MKRGB(178,255,255), MKRGB(175,255,255), MKRGB(173,255,255), + MKRGB(173,254,255), MKRGB(172,254,255), MKRGB(229,252,255), MKRGB(173,251,255), + MKRGB(169,251,255), MKRGB(169,250,255), MKRGB(166,250,255), MKRGB(222,247,255), + MKRGB(172,247,255), MKRGB(165,247,255), MKRGB(185,245,255), MKRGB(164,245,255), + MKRGB(158,245,255), MKRGB(172,244,255), MKRGB(160,244,255), MKRGB(176,243,255), + MKRGB(172,243,255), MKRGB(168,242,255), MKRGB(160,242,255), MKRGB(159,241,255), + MKRGB(154,239,255), MKRGB(168,238,255), MKRGB(152,238,255), MKRGB(199,236,255), + MKRGB(171,236,255), MKRGB(149,234,255), MKRGB(193,233,255), MKRGB(156,233,255), + MKRGB(190,232,255), MKRGB(162,232,255), MKRGB(153,232,255), MKRGB(145,232,255), + MKRGB(166,231,255), MKRGB(144,231,255), MKRGB(142,228,255), MKRGB(150,227,255), + MKRGB(141,226,255), MKRGB(134,225,255), MKRGB(133,225,255), MKRGB(147,224,255), + MKRGB(142,224,255), MKRGB(139,224,255), MKRGB(139,223,255), MKRGB(135,223,255), + MKRGB(150,221,255), MKRGB(137,221,255), MKRGB(136,221,255), MKRGB(145,220,255), + MKRGB(137,219,255), MKRGB(136,219,255), MKRGB(151,218,255), MKRGB(128,218,255), + MKRGB(131,217,255), MKRGB(129,217,255), MKRGB(125,217,255), MKRGB(125,216,255), + MKRGB(132,215,255), MKRGB(119,215,255), MKRGB(140,214,255), MKRGB(123,214,255), + MKRGB(140,213,255), MKRGB(125,213,255), MKRGB(120,213,255), MKRGB(125,212,255), + MKRGB(118,211,255), MKRGB(123,210,255), MKRGB(122,209,255), MKRGB(164,208,251), + MKRGB(140,207,255), MKRGB(125,206,255), MKRGB(119,206,255), MKRGB(118,206,255), + MKRGB(123,203,255), MKRGB(113,203,255), MKRGB(127,202,255), MKRGB(131,199,255), + MKRGB(150,194,243), MKRGB(115,192,255), MKRGB(123,210,255), MKRGB(118,183,241), + MKRGB(111,176,235), MKRGB(116,173,229), MKRGB( 88,167,241), MKRGB( 87,167,241), + MKRGB( 89,166,237), MKRGB( 80,166,241), MKRGB( 93,164,237), MKRGB( 81,164,239), + MKRGB( 79,162,237), MKRGB( 99,161,227), MKRGB( 99,160,227), MKRGB( 88,158,229), + MKRGB( 75,157,233), MKRGB( 79,156,235), MKRGB( 95,155,217), MKRGB( 76,155,235), + MKRGB( 74,153,233), MKRGB( 92,152,215), MKRGB( 72,152,233), MKRGB( 86,150,219), + MKRGB( 86,149,219), MKRGB( 64,135,215), MKRGB( 72,130,203), MKRGB( 71,130,203), + MKRGB( 52,122,203), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), + MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(173,254,255), + MKRGB(172,254,255), MKRGB(190,253,255), MKRGB(171,251,255), MKRGB(169,251,255), + MKRGB(171,250,255), MKRGB(220,248,255), MKRGB(221,247,255), MKRGB(164,246,255), + MKRGB(197,244,255), MKRGB(169,244,255), MKRGB(170,241,255), MKRGB(164,241,255), + MKRGB(169,240,255), MKRGB(168,240,255), MKRGB(169,239,255), MKRGB(168,239,255), + MKRGB(165,239,255), MKRGB(159,237,255), MKRGB(156,237,255), MKRGB(153,237,255), + MKRGB(196,236,255), MKRGB(167,235,255), MKRGB(145,235,255), +}; + +static const NXWidgets::SRlePaletteBitmapEntry bitmap[] = +{ + { 7, 0}, { 1, 99}, { 1, 100}, { 1, 101}, { 1, 102}, { 2, 98}, + { 1, 102}, { 1, 101}, { 1, 100}, { 1, 99}, { 7, 0}, /* Row 0 */ + { 5, 0}, { 1, 56}, { 1, 57}, { 1, 93}, { 1, 48}, { 1, 79}, + { 1, 33}, { 2, 71}, { 1, 33}, { 1, 79}, { 1, 48}, { 1, 93}, + { 1, 57}, { 1, 56}, { 5, 0}, /* Row 1 */ + { 4, 0}, { 1, 97}, { 1, 223}, { 1, 83}, { 1, 74}, { 1, 25}, + { 1, 26}, { 4, 4}, { 1, 26}, { 1, 25}, { 1, 74}, { 1, 83}, + { 1, 222}, { 1, 97}, { 4, 0}, /* Row 2 */ + { 3, 0}, { 1, 55}, { 1, 220}, { 1, 170}, { 1, 137}, { 1, 245}, + { 1, 247}, { 2, 12}, { 1, 242}, { 1, 12}, { 2, 23}, { 1, 241}, + { 1, 128}, { 1, 74}, { 1, 170}, { 1, 219}, { 1, 55}, { 3, 0}, /* Row 3 */ + { 2, 0}, { 1, 96}, { 1, 51}, { 1, 152}, { 1, 135}, { 1, 21}, + { 1, 246}, { 1, 150}, { 1, 166}, { 2, 174}, { 1, 185}, { 1, 192}, + { 1, 195}, { 1, 199}, { 1, 209}, { 1, 196}, { 1, 201}, { 1, 144}, + { 1, 51}, { 1, 96}, { 2, 0}, /* Row 4 */ + { 1, 0}, { 1, 54}, { 1, 94}, { 1, 31}, { 1, 130}, { 1, 21}, + { 1, 155}, { 1, 78}, { 1, 176}, { 1, 180}, { 1, 79}, { 1, 83}, + { 1, 39}, { 1, 148}, { 1, 237}, { 1, 108}, { 2, 1}, { 1, 8}, + { 1, 233}, { 1, 31}, { 1, 94}, { 1, 54}, { 1, 0}, /* Row 5 */ + { 1, 0}, { 1, 95}, { 1, 39}, { 1, 16}, { 1, 141}, { 2, 168}, + { 1, 160}, { 1, 167}, { 1, 199}, { 1, 238}, { 7, 1}, { 1, 214}, + { 1, 136}, { 1, 16}, { 1, 39}, { 1, 95}, { 1, 0}, /* Row 6 */ + { 1, 53}, { 1, 90}, { 1, 61}, { 1, 27}, { 1, 159}, { 3, 107}, + { 1, 178}, { 1, 225}, { 2, 1}, { 1, 228}, { 1, 229}, { 1, 127}, + { 1, 187}, { 1, 209}, { 1, 1}, { 1, 8}, { 1, 30}, { 1, 27}, + { 1, 61}, { 1, 90}, { 1, 53}, /* Row 7 */ + { 1, 92}, { 1, 83}, { 1, 19}, { 1, 72}, { 4, 6}, { 1, 178}, + { 1, 227}, { 1, 106}, { 1, 122}, { 1, 212}, { 1, 50}, { 1, 188}, + { 1, 164}, { 1, 200}, { 1, 1}, { 1, 8}, { 1, 249}, { 1, 72}, + { 1, 19}, { 1, 83}, { 1, 92}, /* Row 8 */ + { 1, 52}, { 1, 70}, { 1, 68}, { 2, 5}, { 1, 149}, { 1, 27}, + { 1, 253}, { 1, 78}, { 1, 1}, { 1, 194}, { 1, 213}, { 1, 76}, + { 1, 172}, { 1, 165}, { 1, 147}, { 1, 199}, { 1, 1}, { 1, 8}, + { 1, 248}, { 1, 5}, { 1, 68}, { 1, 70}, { 1, 52}, /* Row 9 */ + { 1, 91}, { 1, 65}, { 2, 2}, { 2, 67}, { 1, 160}, { 1, 182}, + { 1, 205}, { 1, 1}, { 1, 89}, { 1, 193}, { 1, 182}, { 2, 184}, + { 1, 177}, { 1, 221}, { 1, 1}, { 1, 217}, { 1, 133}, { 2, 2}, + { 1, 65}, { 1, 91}, /* Row 10 */ + { 1, 211}, { 1, 63}, { 1, 24}, { 1, 22}, { 1, 68}, { 1, 179}, + { 1, 175}, { 1, 76}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 191}, + { 1, 171}, { 2, 77}, { 1, 36}, { 1, 221}, { 1, 1}, { 1, 224}, + { 1, 243}, { 1, 22}, { 1, 24}, { 1, 63}, { 1, 211}, /* Row 11 */ + { 1, 206}, { 1, 18}, { 1, 20}, { 1, 75}, { 1, 173}, { 2, 36}, + { 1, 163}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 186}, { 2, 36}, + { 2, 157}, { 1, 13}, { 1, 1}, { 1, 13}, { 1, 158}, { 1, 75}, + { 1, 20}, { 1, 18}, { 1, 206}, /* Row 12 */ + { 1, 50}, { 1, 14}, { 1, 30}, { 1, 35}, { 2, 34}, { 1, 161}, + { 1, 73}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 78}, { 1, 156}, + { 1, 34}, { 1, 204}, { 1, 224}, { 1, 148}, { 1, 1}, { 1, 13}, + { 1, 153}, { 1, 35}, { 1, 30}, { 1, 14}, { 1, 50}, /* Row 13 */ + { 1, 49}, { 1, 28}, { 1, 32}, { 2, 7}, { 1, 75}, { 1, 7}, + { 1, 181}, { 1, 208}, { 1, 1}, { 1, 215}, { 1, 176}, { 1, 151}, + { 1, 221}, { 1, 146}, { 3, 1}, { 1, 13}, { 1, 145}, { 1, 7}, + { 1, 32}, { 1, 28}, { 1, 49}, /* Row 14 */ + { 1, 87}, { 1, 78}, { 1, 69}, { 1, 29}, { 1, 69}, { 1, 36}, + { 1, 208}, { 1, 74}, { 1, 240}, { 1, 103}, { 1, 89}, { 1, 34}, + { 1, 209}, { 1, 143}, { 4, 1}, { 1, 13}, { 1, 140}, { 1, 29}, + { 1, 69}, { 1, 78}, { 1, 87}, /* Row 15 */ + { 1, 86}, { 1, 85}, { 1, 64}, { 1, 251}, { 1, 254}, { 1, 208}, + { 1, 104}, { 3, 1}, { 1, 216}, { 1, 156}, { 1, 210}, { 1, 252}, + { 3, 1}, { 1, 230}, { 1, 13}, { 1, 132}, { 1, 142}, { 1, 64}, + { 1, 85}, { 1, 86}, /* Row 16 */ + { 1, 0}, { 1, 47}, { 1, 73}, { 1, 129}, { 1, 203}, { 1, 111}, + { 4, 1}, { 1, 218}, { 1, 154}, { 1, 162}, { 1, 90}, { 1, 109}, + { 1, 226}, { 1, 110}, { 1, 102}, { 1, 189}, { 1, 138}, { 1, 139}, + { 1, 73}, { 1, 47}, { 1, 0}, /* Row 17 */ + { 1, 0}, { 1, 46}, { 1, 44}, { 1, 235}, { 1, 202}, { 1, 244}, + { 3, 1}, { 1, 105}, { 1, 216}, { 1, 250}, { 1, 124}, { 1, 197}, + { 1, 52}, { 1, 221}, { 1, 90}, { 1, 169}, { 1, 60}, { 1, 131}, + { 1, 239}, { 1, 44}, { 1, 46}, { 1, 0}, /* Row 18 */ + { 2, 0}, { 1, 45}, { 1, 186}, { 1, 116}, { 1, 208}, { 1, 113}, + { 1, 1}, { 1, 114}, { 1, 212}, { 1, 168}, { 1, 60}, { 1, 62}, + { 1, 60}, { 1, 121}, { 1, 119}, { 1, 232}, { 1, 125}, { 1, 62}, + { 1, 10}, { 1, 190}, { 1, 45}, { 2, 0}, /* Row 19 */ + { 3, 0}, { 1, 84}, { 1, 183}, { 1, 118}, { 1, 207}, { 1, 205}, + { 1, 207}, { 1, 231}, { 1, 10}, { 1, 234}, { 4, 3}, { 1, 236}, + { 1, 123}, { 1, 10}, { 1, 198}, { 1, 84}, { 3, 0}, /* Row 20 */ + { 4, 0}, { 1, 43}, { 1, 193}, { 1, 126}, { 1, 112}, { 1, 115}, + { 1, 15}, { 4, 11}, { 1, 120}, { 1, 15}, { 1, 117}, { 1, 134}, + { 1, 82}, { 1, 43}, { 4, 0}, /* Row 21 */ + { 5, 0}, { 1, 82}, { 1, 42}, { 1, 37}, { 1, 66}, { 1, 17}, + { 1, 58}, { 2, 59}, { 1, 58}, { 1, 17}, { 1, 66}, { 1, 37}, + { 1, 42}, { 1, 82}, { 5, 0}, /* Row 22 */ + { 7, 0}, { 1, 80}, { 1, 40}, { 1, 81}, { 1, 41}, { 2, 38}, + { 1, 41}, { 1, 81}, { 1, 40}, { 1, 80}, { 7, 0}, /* Row 23 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mediaplayerBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + BITMAP_WIDTH, + BITMAP_HEIGHT, + {palette, hilight_palette}, + bitmap +}; From 27689b5aa5bc8c0373a75c380f65ce856b69cbe6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 12 May 2013 07:47:16 -0600 Subject: [PATCH 121/390] Smalled CMediaPlayer image from Ken Pettit --- ChangeLog.txt | 2 + nxwm/src/glyph_mediaplayer.cxx | 283 ++++++++------------------------- tools/README.txt | 128 +++++++++------ tools/addobjs.sh | 4 +- 4 files changed, 150 insertions(+), 267 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 12e429f45..c72d20782 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -352,3 +352,5 @@ develop and test the MP3 codec chip driver. It really doesn't do anything yet except display a text box saying "Coming soon", and I need to minimize the icon size a bit. From Ken Pettit (2013-5-11). +* NxWidgets/nxwm/src/glyph_mediaplayer.cxx: Smaller version of the + media player glyph. From Ken Pettit (2013-5-12). diff --git a/nxwm/src/glyph_mediaplayer.cxx b/nxwm/src/glyph_mediaplayer.cxx index e258c2065..e7b55a74e 100644 --- a/nxwm/src/glyph_mediaplayer.cxx +++ b/nxwm/src/glyph_mediaplayer.cxx @@ -62,7 +62,7 @@ #define BITMAP_WIDTH 24 #define BITMAP_HEIGHT 24 -#define BITMAP_PALETTESIZE 255 +#define BITMAP_PALETTESIZE 9 using namespace NxWM; @@ -70,227 +70,82 @@ using namespace NxWM; static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] = { - MKRGB( 0, 0, 0), MKRGB(255,255,255), MKRGB(116,187,231), MKRGB(120,200,242), - MKRGB(114,186,226), MKRGB(111,182,229), MKRGB(106,181,227), MKRGB( 93,176,231), - MKRGB( 46,106,167), MKRGB( 27,106,185), MKRGB(123,203,244), MKRGB(122,203,244), - MKRGB(119,191,228), MKRGB( 6, 74,154), MKRGB(144,206,241), MKRGB(124,205,245), - MKRGB(143,204,235), MKRGB(121,202,243), MKRGB(134,198,239), MKRGB(135,197,233), - MKRGB(131,193,235), MKRGB(125,191,229), MKRGB(124,191,231), MKRGB(119,191,229), - MKRGB(122,189,231), MKRGB(114,189,225), MKRGB(116,188,227), MKRGB(113,184,229), - MKRGB(105,182,231), MKRGB( 98,181,233), MKRGB(100,180,231), MKRGB(113,176,219), - MKRGB( 91,175,231), MKRGB(102,174,217), MKRGB( 88,173,229), MKRGB( 85,172,229), - MKRGB( 83,171,229), MKRGB( 74,164,225), MKRGB( 67,161,225), MKRGB( 92,154,203), - MKRGB( 62,153,221), MKRGB( 58,152,219), MKRGB( 56,148,217), MKRGB( 58,146,215), - MKRGB( 54,139,207), MKRGB( 54,137,207), MKRGB( 52,135,203), MKRGB( 50,128,199), - MKRGB( 59,127,187), MKRGB( 41,114,189), MKRGB( 36,110,185), MKRGB( 37,101,169), - MKRGB( 29, 95,169), MKRGB( 32, 93,167), MKRGB( 30, 89,161), MKRGB( 21, 78,153), - MKRGB( 19, 77,151), MKRGB( 14, 70,145), MKRGB(130,209,246), MKRGB(130,208,246), - MKRGB(119,200,244), MKRGB(146,199,234), MKRGB(117,198,242), MKRGB(129,197,236), - MKRGB(107,192,238), MKRGB(123,191,232), MKRGB(102,189,234), MKRGB(117,187,230), - MKRGB(110,183,230), MKRGB(100,183,234), MKRGB(119,182,222), MKRGB(109,181,222), - MKRGB(103,180,226), MKRGB( 95,179,230), MKRGB(107,177,220), MKRGB( 95,176,230), - MKRGB( 79,170,226), MKRGB( 77,167,224), MKRGB( 79,162,220), MKRGB( 86,158,206), - MKRGB( 64,155,220), MKRGB( 59,154,220), MKRGB( 60,150,218), MKRGB( 84,147,200), - MKRGB( 55,141,210), MKRGB( 58,140,206), MKRGB( 49,127,198), MKRGB( 45,122,192), - MKRGB( 33,118,192), MKRGB( 25,104,184), MKRGB( 38,103,172), MKRGB( 28, 94,168), - MKRGB( 30, 93,168), MKRGB( 28, 90,162), MKRGB( 26, 87,160), MKRGB( 25, 85,160), - MKRGB( 25, 84,158), MKRGB( 20, 78,150), MKRGB( 19, 78,150), MKRGB( 18, 74,148), - MKRGB( 15, 71,146), MKRGB( 13, 69,144), MKRGB( 11, 67,142), MKRGB(254,255,255), - MKRGB(242,250,253), MKRGB(239,246,249), MKRGB(238,244,247), MKRGB(100,177,227), - MKRGB(222,231,241), MKRGB(220,230,241), MKRGB(213,227,237), MKRGB(171,216,243), - MKRGB(134,214,251), MKRGB(163,212,241), MKRGB(162,211,241), MKRGB(130,211,249), - MKRGB(128,210,249), MKRGB(128,208,247), MKRGB(125,208,247), MKRGB(123,205,247), - MKRGB(123,204,245), MKRGB(122,204,247), MKRGB(179,202,225), MKRGB(123,201,243), - MKRGB(119,201,245), MKRGB(119,200,243), MKRGB(116,200,241), MKRGB(172,197,223), - MKRGB(122,197,233), MKRGB(115,197,243), MKRGB(135,195,233), MKRGB(114,195,241), - MKRGB(108,195,241), MKRGB(122,194,237), MKRGB(110,194,237), MKRGB(126,193,231), - MKRGB(122,193,233), MKRGB(118,192,227), MKRGB(110,192,241), MKRGB(109,191,239), - MKRGB(104,189,239), MKRGB(118,188,229), MKRGB(102,188,235), MKRGB(149,186,219), - MKRGB(121,186,225), MKRGB( 99,184,237), MKRGB(143,183,217), MKRGB(106,183,231), - MKRGB(140,182,217), MKRGB(112,182,229), MKRGB(103,182,225), MKRGB( 95,182,235), - MKRGB(116,181,221), MKRGB( 94,181,235), MKRGB( 92,178,229), MKRGB(100,177,225), - MKRGB( 91,176,231), MKRGB( 84,175,231), MKRGB( 83,175,233), MKRGB( 97,174,225), - MKRGB( 92,174,227), MKRGB( 89,174,229), MKRGB( 89,173,227), MKRGB( 85,173,231), - MKRGB(100,171,221), MKRGB( 87,171,227), MKRGB( 86,171,221), MKRGB( 95,170,219), - MKRGB( 87,169,223), MKRGB( 86,169,223), MKRGB(101,168,213), MKRGB( 78,168,225), - MKRGB( 81,167,225), MKRGB( 79,167,227), MKRGB( 75,167,219), MKRGB( 75,166,223), - MKRGB( 82,165,223), MKRGB( 69,165,225), MKRGB( 90,164,217), MKRGB( 73,164,225), - MKRGB( 90,163,217), MKRGB( 75,163,223), MKRGB( 70,163,223), MKRGB( 75,162,221), - MKRGB( 68,161,221), MKRGB( 73,160,217), MKRGB( 72,159,219), MKRGB(114,158,201), - MKRGB( 90,157,209), MKRGB( 75,156,213), MKRGB( 69,156,217), MKRGB( 68,156,217), - MKRGB( 73,153,209), MKRGB( 63,153,217), MKRGB( 77,152,207), MKRGB( 81,149,205), - MKRGB(100,144,193), MKRGB( 65,142,205), MKRGB( 73,160,221), MKRGB( 68,133,191), - MKRGB( 61,126,185), MKRGB( 66,123,179), MKRGB( 38,117,191), MKRGB( 37,117,191), - MKRGB( 39,116,187), MKRGB( 30,116,191), MKRGB( 43,114,187), MKRGB( 31,114,189), - MKRGB( 29,112,187), MKRGB( 49,111,177), MKRGB( 49,110,177), MKRGB( 38,108,179), - MKRGB( 25,107,183), MKRGB( 29,106,185), MKRGB( 45,105,167), MKRGB( 26,105,185), - MKRGB( 24,103,183), MKRGB( 42,102,165), MKRGB( 22,102,183), MKRGB( 36,100,169), - MKRGB( 36, 99,169), MKRGB( 14, 85,165), MKRGB( 22, 80,153), MKRGB( 21, 80,153), - MKRGB( 2, 72,153), MKRGB(252,253,254), MKRGB(247,249,250), MKRGB(245,248,252), - MKRGB(237,244,248), MKRGB(215,228,240), MKRGB(213,227,238), MKRGB(123,204,246), - MKRGB(122,204,246), MKRGB(140,203,238), MKRGB(121,201,242), MKRGB(119,201,246), - MKRGB(121,200,242), MKRGB(170,198,224), MKRGB(171,197,222), MKRGB(114,196,242), - MKRGB(147,194,228), MKRGB(119,194,230), MKRGB(120,191,228), MKRGB(114,191,236), - MKRGB(119,190,234), MKRGB(118,190,228), MKRGB(119,189,228), MKRGB(118,189,228), - MKRGB(115,189,234), MKRGB(109,187,232), MKRGB(106,187,236), MKRGB(103,187,236), - MKRGB(146,186,218), MKRGB(117,185,230), MKRGB( 95,185,236), + MKRGB(248,252,251), MKRGB(120,198,241), MKRGB( 97,177,228), MKRGB( 31,104,177), + MKRGB( 73,153,213), MKRGB( 46,122,193), MKRGB(140,196,230), MKRGB( 9, 77,154), + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR }; static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] = { - MKRGB( 50, 50, 50), MKRGB(255,255,255), MKRGB(166,237,255), MKRGB(170,250,255), - MKRGB(164,236,255), MKRGB(161,232,255), MKRGB(156,231,255), MKRGB(143,226,255), - MKRGB( 96,156,217), MKRGB( 77,156,235), MKRGB(173,253,255), MKRGB(172,253,255), - MKRGB(169,241,255), MKRGB( 56,124,204), MKRGB(194,255,255), MKRGB(174,255,255), - MKRGB(193,254,255), MKRGB(171,252,255), MKRGB(184,248,255), MKRGB(185,247,255), - MKRGB(181,243,255), MKRGB(175,241,255), MKRGB(174,241,255), MKRGB(169,241,255), - MKRGB(172,239,255), MKRGB(164,239,255), MKRGB(166,238,255), MKRGB(163,234,255), - MKRGB(155,232,255), MKRGB(148,231,255), MKRGB(150,230,255), MKRGB(163,226,255), - MKRGB(141,225,255), MKRGB(152,224,255), MKRGB(138,223,255), MKRGB(135,222,255), - MKRGB(133,221,255), MKRGB(124,214,255), MKRGB(117,211,255), MKRGB(142,204,253), - MKRGB(112,203,255), MKRGB(108,202,255), MKRGB(106,198,255), MKRGB(108,196,255), - MKRGB(104,189,255), MKRGB(104,187,255), MKRGB(102,185,253), MKRGB(100,178,249), - MKRGB(109,177,237), MKRGB( 91,164,239), MKRGB( 86,160,235), MKRGB( 87,151,219), - MKRGB( 79,145,219), MKRGB( 82,143,217), MKRGB( 80,139,211), MKRGB( 71,128,203), - MKRGB( 69,127,201), MKRGB( 64,120,195), MKRGB(180,255,255), MKRGB(180,255,255), - MKRGB(169,250,255), MKRGB(196,249,255), MKRGB(167,248,255), MKRGB(179,247,255), - MKRGB(157,242,255), MKRGB(173,241,255), MKRGB(152,239,255), MKRGB(167,237,255), - MKRGB(160,233,255), MKRGB(150,233,255), MKRGB(169,232,255), MKRGB(159,231,255), - MKRGB(153,230,255), MKRGB(145,229,255), MKRGB(157,227,255), MKRGB(145,226,255), - MKRGB(129,220,255), MKRGB(127,217,255), MKRGB(129,212,255), MKRGB(136,208,255), - MKRGB(114,205,255), MKRGB(109,204,255), MKRGB(110,200,255), MKRGB(134,197,250), - MKRGB(105,191,255), MKRGB(108,190,255), MKRGB( 99,177,248), MKRGB( 95,172,242), - MKRGB( 83,168,242), MKRGB( 75,154,234), MKRGB( 88,153,222), MKRGB( 78,144,218), - MKRGB( 80,143,218), MKRGB( 78,140,212), MKRGB( 76,137,210), MKRGB( 75,135,210), - MKRGB( 75,134,208), MKRGB( 70,128,200), MKRGB( 69,128,200), MKRGB( 68,124,198), - MKRGB( 65,121,196), MKRGB( 63,119,194), MKRGB( 61,117,192), MKRGB(255,255,255), - MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(150,227,255), - MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(221,255,255), - MKRGB(184,255,255), MKRGB(213,255,255), MKRGB(212,255,255), MKRGB(180,255,255), - MKRGB(178,255,255), MKRGB(178,255,255), MKRGB(175,255,255), MKRGB(173,255,255), - MKRGB(173,254,255), MKRGB(172,254,255), MKRGB(229,252,255), MKRGB(173,251,255), - MKRGB(169,251,255), MKRGB(169,250,255), MKRGB(166,250,255), MKRGB(222,247,255), - MKRGB(172,247,255), MKRGB(165,247,255), MKRGB(185,245,255), MKRGB(164,245,255), - MKRGB(158,245,255), MKRGB(172,244,255), MKRGB(160,244,255), MKRGB(176,243,255), - MKRGB(172,243,255), MKRGB(168,242,255), MKRGB(160,242,255), MKRGB(159,241,255), - MKRGB(154,239,255), MKRGB(168,238,255), MKRGB(152,238,255), MKRGB(199,236,255), - MKRGB(171,236,255), MKRGB(149,234,255), MKRGB(193,233,255), MKRGB(156,233,255), - MKRGB(190,232,255), MKRGB(162,232,255), MKRGB(153,232,255), MKRGB(145,232,255), - MKRGB(166,231,255), MKRGB(144,231,255), MKRGB(142,228,255), MKRGB(150,227,255), - MKRGB(141,226,255), MKRGB(134,225,255), MKRGB(133,225,255), MKRGB(147,224,255), - MKRGB(142,224,255), MKRGB(139,224,255), MKRGB(139,223,255), MKRGB(135,223,255), - MKRGB(150,221,255), MKRGB(137,221,255), MKRGB(136,221,255), MKRGB(145,220,255), - MKRGB(137,219,255), MKRGB(136,219,255), MKRGB(151,218,255), MKRGB(128,218,255), - MKRGB(131,217,255), MKRGB(129,217,255), MKRGB(125,217,255), MKRGB(125,216,255), - MKRGB(132,215,255), MKRGB(119,215,255), MKRGB(140,214,255), MKRGB(123,214,255), - MKRGB(140,213,255), MKRGB(125,213,255), MKRGB(120,213,255), MKRGB(125,212,255), - MKRGB(118,211,255), MKRGB(123,210,255), MKRGB(122,209,255), MKRGB(164,208,251), - MKRGB(140,207,255), MKRGB(125,206,255), MKRGB(119,206,255), MKRGB(118,206,255), - MKRGB(123,203,255), MKRGB(113,203,255), MKRGB(127,202,255), MKRGB(131,199,255), - MKRGB(150,194,243), MKRGB(115,192,255), MKRGB(123,210,255), MKRGB(118,183,241), - MKRGB(111,176,235), MKRGB(116,173,229), MKRGB( 88,167,241), MKRGB( 87,167,241), - MKRGB( 89,166,237), MKRGB( 80,166,241), MKRGB( 93,164,237), MKRGB( 81,164,239), - MKRGB( 79,162,237), MKRGB( 99,161,227), MKRGB( 99,160,227), MKRGB( 88,158,229), - MKRGB( 75,157,233), MKRGB( 79,156,235), MKRGB( 95,155,217), MKRGB( 76,155,235), - MKRGB( 74,153,233), MKRGB( 92,152,215), MKRGB( 72,152,233), MKRGB( 86,150,219), - MKRGB( 86,149,219), MKRGB( 64,135,215), MKRGB( 72,130,203), MKRGB( 71,130,203), - MKRGB( 52,122,203), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), - MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(255,255,255), MKRGB(173,254,255), - MKRGB(172,254,255), MKRGB(190,253,255), MKRGB(171,251,255), MKRGB(169,251,255), - MKRGB(171,250,255), MKRGB(220,248,255), MKRGB(221,247,255), MKRGB(164,246,255), - MKRGB(197,244,255), MKRGB(169,244,255), MKRGB(170,241,255), MKRGB(164,241,255), - MKRGB(169,240,255), MKRGB(168,240,255), MKRGB(169,239,255), MKRGB(168,239,255), - MKRGB(165,239,255), MKRGB(159,237,255), MKRGB(156,237,255), MKRGB(153,237,255), - MKRGB(196,236,255), MKRGB(167,235,255), MKRGB(145,235,255), + MKRGB(255,255,255), MKRGB(170,248,255), MKRGB(147,227,255), MKRGB( 81,154,227), + MKRGB(123,203,255), MKRGB( 96,172,243), MKRGB(190,246,255), MKRGB( 59,127,204), + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR }; static const NXWidgets::SRlePaletteBitmapEntry bitmap[] = { - { 7, 0}, { 1, 99}, { 1, 100}, { 1, 101}, { 1, 102}, { 2, 98}, - { 1, 102}, { 1, 101}, { 1, 100}, { 1, 99}, { 7, 0}, /* Row 0 */ - { 5, 0}, { 1, 56}, { 1, 57}, { 1, 93}, { 1, 48}, { 1, 79}, - { 1, 33}, { 2, 71}, { 1, 33}, { 1, 79}, { 1, 48}, { 1, 93}, - { 1, 57}, { 1, 56}, { 5, 0}, /* Row 1 */ - { 4, 0}, { 1, 97}, { 1, 223}, { 1, 83}, { 1, 74}, { 1, 25}, - { 1, 26}, { 4, 4}, { 1, 26}, { 1, 25}, { 1, 74}, { 1, 83}, - { 1, 222}, { 1, 97}, { 4, 0}, /* Row 2 */ - { 3, 0}, { 1, 55}, { 1, 220}, { 1, 170}, { 1, 137}, { 1, 245}, - { 1, 247}, { 2, 12}, { 1, 242}, { 1, 12}, { 2, 23}, { 1, 241}, - { 1, 128}, { 1, 74}, { 1, 170}, { 1, 219}, { 1, 55}, { 3, 0}, /* Row 3 */ - { 2, 0}, { 1, 96}, { 1, 51}, { 1, 152}, { 1, 135}, { 1, 21}, - { 1, 246}, { 1, 150}, { 1, 166}, { 2, 174}, { 1, 185}, { 1, 192}, - { 1, 195}, { 1, 199}, { 1, 209}, { 1, 196}, { 1, 201}, { 1, 144}, - { 1, 51}, { 1, 96}, { 2, 0}, /* Row 4 */ - { 1, 0}, { 1, 54}, { 1, 94}, { 1, 31}, { 1, 130}, { 1, 21}, - { 1, 155}, { 1, 78}, { 1, 176}, { 1, 180}, { 1, 79}, { 1, 83}, - { 1, 39}, { 1, 148}, { 1, 237}, { 1, 108}, { 2, 1}, { 1, 8}, - { 1, 233}, { 1, 31}, { 1, 94}, { 1, 54}, { 1, 0}, /* Row 5 */ - { 1, 0}, { 1, 95}, { 1, 39}, { 1, 16}, { 1, 141}, { 2, 168}, - { 1, 160}, { 1, 167}, { 1, 199}, { 1, 238}, { 7, 1}, { 1, 214}, - { 1, 136}, { 1, 16}, { 1, 39}, { 1, 95}, { 1, 0}, /* Row 6 */ - { 1, 53}, { 1, 90}, { 1, 61}, { 1, 27}, { 1, 159}, { 3, 107}, - { 1, 178}, { 1, 225}, { 2, 1}, { 1, 228}, { 1, 229}, { 1, 127}, - { 1, 187}, { 1, 209}, { 1, 1}, { 1, 8}, { 1, 30}, { 1, 27}, - { 1, 61}, { 1, 90}, { 1, 53}, /* Row 7 */ - { 1, 92}, { 1, 83}, { 1, 19}, { 1, 72}, { 4, 6}, { 1, 178}, - { 1, 227}, { 1, 106}, { 1, 122}, { 1, 212}, { 1, 50}, { 1, 188}, - { 1, 164}, { 1, 200}, { 1, 1}, { 1, 8}, { 1, 249}, { 1, 72}, - { 1, 19}, { 1, 83}, { 1, 92}, /* Row 8 */ - { 1, 52}, { 1, 70}, { 1, 68}, { 2, 5}, { 1, 149}, { 1, 27}, - { 1, 253}, { 1, 78}, { 1, 1}, { 1, 194}, { 1, 213}, { 1, 76}, - { 1, 172}, { 1, 165}, { 1, 147}, { 1, 199}, { 1, 1}, { 1, 8}, - { 1, 248}, { 1, 5}, { 1, 68}, { 1, 70}, { 1, 52}, /* Row 9 */ - { 1, 91}, { 1, 65}, { 2, 2}, { 2, 67}, { 1, 160}, { 1, 182}, - { 1, 205}, { 1, 1}, { 1, 89}, { 1, 193}, { 1, 182}, { 2, 184}, - { 1, 177}, { 1, 221}, { 1, 1}, { 1, 217}, { 1, 133}, { 2, 2}, - { 1, 65}, { 1, 91}, /* Row 10 */ - { 1, 211}, { 1, 63}, { 1, 24}, { 1, 22}, { 1, 68}, { 1, 179}, - { 1, 175}, { 1, 76}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 191}, - { 1, 171}, { 2, 77}, { 1, 36}, { 1, 221}, { 1, 1}, { 1, 224}, - { 1, 243}, { 1, 22}, { 1, 24}, { 1, 63}, { 1, 211}, /* Row 11 */ - { 1, 206}, { 1, 18}, { 1, 20}, { 1, 75}, { 1, 173}, { 2, 36}, - { 1, 163}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 186}, { 2, 36}, - { 2, 157}, { 1, 13}, { 1, 1}, { 1, 13}, { 1, 158}, { 1, 75}, - { 1, 20}, { 1, 18}, { 1, 206}, /* Row 12 */ - { 1, 50}, { 1, 14}, { 1, 30}, { 1, 35}, { 2, 34}, { 1, 161}, - { 1, 73}, { 1, 88}, { 1, 1}, { 1, 9}, { 1, 78}, { 1, 156}, - { 1, 34}, { 1, 204}, { 1, 224}, { 1, 148}, { 1, 1}, { 1, 13}, - { 1, 153}, { 1, 35}, { 1, 30}, { 1, 14}, { 1, 50}, /* Row 13 */ - { 1, 49}, { 1, 28}, { 1, 32}, { 2, 7}, { 1, 75}, { 1, 7}, - { 1, 181}, { 1, 208}, { 1, 1}, { 1, 215}, { 1, 176}, { 1, 151}, - { 1, 221}, { 1, 146}, { 3, 1}, { 1, 13}, { 1, 145}, { 1, 7}, - { 1, 32}, { 1, 28}, { 1, 49}, /* Row 14 */ - { 1, 87}, { 1, 78}, { 1, 69}, { 1, 29}, { 1, 69}, { 1, 36}, - { 1, 208}, { 1, 74}, { 1, 240}, { 1, 103}, { 1, 89}, { 1, 34}, - { 1, 209}, { 1, 143}, { 4, 1}, { 1, 13}, { 1, 140}, { 1, 29}, - { 1, 69}, { 1, 78}, { 1, 87}, /* Row 15 */ - { 1, 86}, { 1, 85}, { 1, 64}, { 1, 251}, { 1, 254}, { 1, 208}, - { 1, 104}, { 3, 1}, { 1, 216}, { 1, 156}, { 1, 210}, { 1, 252}, - { 3, 1}, { 1, 230}, { 1, 13}, { 1, 132}, { 1, 142}, { 1, 64}, - { 1, 85}, { 1, 86}, /* Row 16 */ - { 1, 0}, { 1, 47}, { 1, 73}, { 1, 129}, { 1, 203}, { 1, 111}, - { 4, 1}, { 1, 218}, { 1, 154}, { 1, 162}, { 1, 90}, { 1, 109}, - { 1, 226}, { 1, 110}, { 1, 102}, { 1, 189}, { 1, 138}, { 1, 139}, - { 1, 73}, { 1, 47}, { 1, 0}, /* Row 17 */ - { 1, 0}, { 1, 46}, { 1, 44}, { 1, 235}, { 1, 202}, { 1, 244}, - { 3, 1}, { 1, 105}, { 1, 216}, { 1, 250}, { 1, 124}, { 1, 197}, - { 1, 52}, { 1, 221}, { 1, 90}, { 1, 169}, { 1, 60}, { 1, 131}, - { 1, 239}, { 1, 44}, { 1, 46}, { 1, 0}, /* Row 18 */ - { 2, 0}, { 1, 45}, { 1, 186}, { 1, 116}, { 1, 208}, { 1, 113}, - { 1, 1}, { 1, 114}, { 1, 212}, { 1, 168}, { 1, 60}, { 1, 62}, - { 1, 60}, { 1, 121}, { 1, 119}, { 1, 232}, { 1, 125}, { 1, 62}, - { 1, 10}, { 1, 190}, { 1, 45}, { 2, 0}, /* Row 19 */ - { 3, 0}, { 1, 84}, { 1, 183}, { 1, 118}, { 1, 207}, { 1, 205}, - { 1, 207}, { 1, 231}, { 1, 10}, { 1, 234}, { 4, 3}, { 1, 236}, - { 1, 123}, { 1, 10}, { 1, 198}, { 1, 84}, { 3, 0}, /* Row 20 */ - { 4, 0}, { 1, 43}, { 1, 193}, { 1, 126}, { 1, 112}, { 1, 115}, - { 1, 15}, { 4, 11}, { 1, 120}, { 1, 15}, { 1, 117}, { 1, 134}, - { 1, 82}, { 1, 43}, { 4, 0}, /* Row 21 */ - { 5, 0}, { 1, 82}, { 1, 42}, { 1, 37}, { 1, 66}, { 1, 17}, - { 1, 58}, { 2, 59}, { 1, 58}, { 1, 17}, { 1, 66}, { 1, 37}, - { 1, 42}, { 1, 82}, { 5, 0}, /* Row 22 */ - { 7, 0}, { 1, 80}, { 1, 40}, { 1, 81}, { 1, 41}, { 2, 38}, - { 1, 41}, { 1, 81}, { 1, 40}, { 1, 80}, { 7, 0}, /* Row 23 */ + { 8, 8}, { 8, 7}, { 8, 8}, /* Row 0 */ + { 6, 8}, { 1, 7}, { 1, 3}, { 1, 5}, { 2, 2}, { 2, 1}, + { 2, 2}, { 1, 5}, { 1, 3}, { 1, 7}, { 6, 8}, /* Row 1 */ + { 4, 8}, { 2, 7}, { 1, 4}, { 1, 2}, { 1, 6}, { 6, 1}, + { 1, 6}, { 1, 2}, { 1, 4}, { 2, 7}, { 4, 8}, /* Row 2 */ + { 3, 8}, { 1, 7}, { 1, 3}, { 1, 2}, { 1, 6}, { 2, 1}, + { 4, 6}, { 2, 1}, { 2, 6}, { 2, 2}, { 1, 3}, { 1, 7}, + { 3, 8}, /* Row 3 */ + { 2, 8}, { 1, 7}, { 1, 3}, { 1, 1}, { 2, 6}, { 3, 1}, + { 2, 2}, { 1, 4}, { 1, 3}, { 5, 5}, { 1, 1}, { 1, 3}, + { 1, 7}, { 2, 8}, /* Row 4 */ + { 2, 8}, { 1, 7}, { 1, 2}, { 1, 6}, { 4, 1}, { 1, 4}, + { 3, 5}, { 2, 6}, { 3, 0}, { 1, 3}, { 2, 2}, { 1, 7}, + { 2, 8}, /* Row 5 */ + { 1, 8}, { 1, 7}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, + { 1, 5}, { 1, 6}, { 7, 0}, { 1, 3}, { 1, 2}, { 1, 6}, + { 1, 4}, { 1, 7}, { 1, 8}, /* Row 6 */ + { 1, 8}, { 1, 3}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, + { 4, 0}, { 2, 6}, { 1, 3}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 2}, { 1, 1}, { 1, 6}, { 1, 3}, { 1, 8}, /* Row 7 */ + { 1, 3}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, + { 2, 0}, { 1, 6}, { 3, 3}, { 1, 4}, { 1, 5}, { 1, 0}, + { 1, 3}, { 1, 2}, { 1, 1}, { 1, 6}, { 1, 4}, { 1, 3}, /* Row 8 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 4}, + { 1, 3}, { 1, 4}, { 3, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 2}, { 3, 1}, { 1, 3}, /* Row 9 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 3}, { 1, 2}, + { 3, 1}, { 1, 3}, /* Row 10 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, + { 3, 1}, { 1, 3}, /* Row 11 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, + { 3, 1}, { 1, 5}, /* Row 12 */ + { 1, 3}, { 1, 6}, { 4, 1}, { 2, 2}, { 1, 5}, { 1, 0}, + { 1, 3}, { 1, 4}, { 2, 2}, { 1, 5}, { 1, 7}, { 1, 6}, + { 1, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 6}, { 1, 3}, /* Row 13 */ + { 1, 3}, { 5, 1}, { 1, 2}, { 2, 3}, { 1, 0}, { 1, 3}, + { 1, 4}, { 1, 2}, { 1, 7}, { 1, 6}, { 3, 0}, { 1, 7}, + { 1, 2}, { 2, 1}, { 1, 2}, { 1, 3}, /* Row 14 */ + { 1, 5}, { 1, 4}, { 3, 1}, { 1, 2}, { 1, 3}, { 1, 2}, + { 1, 6}, { 1, 0}, { 1, 3}, { 1, 2}, { 1, 5}, { 1, 6}, + { 4, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 5}, /* Row 15 */ + { 1, 8}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 3}, { 4, 0}, + { 1, 3}, { 1, 2}, { 1, 3}, { 1, 6}, { 3, 0}, { 1, 6}, + { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 8}, /* Row 16 */ + { 1, 8}, { 1, 5}, { 1, 2}, { 1, 1}, { 1, 5}, { 1, 6}, + { 4, 0}, { 1, 3}, { 2, 2}, { 1, 3}, { 1, 6}, { 1, 0}, + { 1, 6}, { 1, 7}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 5}, + { 1, 8}, /* Row 17 */ + { 2, 8}, { 1, 5}, { 1, 1}, { 1, 5}, { 1, 1}, { 4, 0}, + { 1, 3}, { 1, 2}, { 1, 1}, { 1, 4}, { 1, 3}, { 1, 7}, + { 1, 3}, { 1, 2}, { 3, 1}, { 1, 5}, { 2, 8}, /* Row 18 */ + { 2, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 6}, + { 1, 0}, { 1, 6}, { 1, 3}, { 1, 2}, { 9, 1}, { 1, 4}, + { 1, 5}, { 2, 8}, /* Row 19 */ + { 3, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 5}, + { 1, 3}, { 10, 1}, { 1, 4}, { 1, 5}, { 3, 8}, /* Row 20 */ + { 4, 8}, { 2, 4}, { 12, 1}, { 2, 4}, { 4, 8}, /* Row 21 */ + { 6, 8}, { 2, 4}, { 8, 1}, { 2, 4}, { 6, 8}, /* Row 22 */ + { 8, 8}, { 8, 4}, { 8, 8}, /* Row 23 */ }; const struct NXWidgets::SRlePaletteBitmap NxWM::g_mediaplayerBitmap = diff --git a/tools/README.txt b/tools/README.txt index 22b2bf2a9..b38a7892f 100755 --- a/tools/README.txt +++ b/tools/README.txt @@ -1,51 +1,77 @@ -NxWidgets/tools README File -=========================== - -addobjs.sh ----------- - - $0 will add all object (.o) files in directory to an archive. - - Usage: tools/addobjs.sh [OPTIONS] - - Where: - is the full, absolute path to the library to use - is full path to the directory containing the object files to be added - OPTIONS include: - -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-' - -w Use Windows style paths insted of POSIX paths - -d Enable script debug - -h Show this usage information - -bitmap_converter.py -------------------- - - This script converts from any image type supported by Python imaging library to - the RLE-encoded format used by NxWidgets. - -indent.sh ---------- - - This script uses the Linux 'indent' utility to re-format C source files - to match the coding style that I use. It differs from my coding style in that - - - I normally put the traiing */ of a multi-line comment on a separate line, - - I usually align things vertically (like '='in assignments. - -install.sh ----------- - - Install a unit test in the NuttX source tree" - - USAGE: tools/install.sh - - Where: - is the full, absolute path to the NuttX apps/ directory - is the name of a sub-directory in the UnitTests directory - -zipme.sh --------- - - Pack up the NxWidgets tarball for release. - - USAGE: tools/zipme.sh +NxWidgets/tools README File +=========================== + +addobjs.sh +---------- + + $0 will add all object (.o) files in directory to an archive. + + Usage: tools/addobjs.sh [OPTIONS] + + Where: + is the full, absolute path to the library to use + is full path to the directory containing the object files to be added + OPTIONS include: + -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-' + -w Use Windows style paths instead of POSIX paths + -d Enable script debug + -h Show this usage information + +bitmap_converter.py +------------------- + + This script converts from any image type supported by Python imaging library to + the RLE-encoded format used by NxWidgets. + + RLE (Run Length Length) is a very simply encoding that compress quite well + with certain kinds of images: Images that that have many pixels of the + same color adjacent on a row (like simple graphics). It does not work well + with photographic images. + + But even simple graphics may not encode compactly if, for example, they have + been resized. Resizing an image can create hundreds of unique colors that + may differ by only a bit or two in the RGB representation. This "color + smear" is the result of pixel interpolation (and might be eliminated if + your graphics software supports resizing via pixel replication instead of + interpolation). + + When a simple graphics image does not encode well, the symptom is that + the resulting RLE data structures are quite large. The pallette structure, + in particular, may have hundreds of colors in it. There is a way to fix + the graphic image in this case. Here is what I do (in fact, I do this + on all images prior to conversion just to be certain): + + - Open the original image in GIMP. + - Select the option to select the number of colors in the image. + - Pick the smallest number of colors that will represent the image + faithfully. For most simple graphic images this might be as few as 6 + or 8 colors. + - Save the image as PNG or other lossless format (NOT jpeg). + - Then generate the image. + +indent.sh +--------- + + This script uses the Linux 'indent' utility to re-format C source files + to match the coding style that I use. It differs from my coding style in that + + - I normally put the trailing */ of a multi-line comment on a separate line, + - I usually align things vertically (like '='in assignments. + +install.sh +---------- + + Install a unit test in the NuttX source tree" + + USAGE: tools/install.sh + + Where: + is the full, absolute path to the NuttX apps/ directory + is the name of a sub-directory in the UnitTests directory + +zipme.sh +-------- + + Pack up the NxWidgets tarball for release. + + USAGE: tools/zipme.sh diff --git a/tools/addobjs.sh b/tools/addobjs.sh index 5ccb289c5..b618efd34 100755 --- a/tools/addobjs.sh +++ b/tools/addobjs.sh @@ -66,7 +66,7 @@ while [ ! -z "$1" ]; do echo " is full path to the directory containing the object files to be added" echo "OPTIONS include:" echo " -p Prefix to use. For example, to use arm-elf-ar, add '-p arm-elf-'" - echo " -w Use Windows style paths insted of POSIX paths" + echo " -w Use Windows style paths instead of POSIX paths" echo " -d Enable script debug" echo " -h Show this usage information" exit 0 @@ -138,4 +138,4 @@ for obj in `ls "${objdir}"/*.o`; do echo " Object: ${obj}"; \ exit 1; \ } -done \ No newline at end of file +done From 9837ed01705ef9e9398500094dcbcf1755ae876e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 12 May 2013 11:47:09 -0600 Subject: [PATCH 122/390] Fixe a race confition in NxWM::CCalibration --- ChangeLog.txt | 4 ++++ nxwm/include/ccalibration.hxx | 33 ++++++++++++++++++++++++++++----- nxwm/src/ccalibration.cxx | 26 +++++++++++++++++--------- 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c72d20782..46eb06a08 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -354,3 +354,7 @@ need to minimize the icon size a bit. From Ken Pettit (2013-5-11). * NxWidgets/nxwm/src/glyph_mediaplayer.cxx: Smaller version of the media player glyph. From Ken Pettit (2013-5-12). +* NxWidgets/nxwm/include/ccalibration.hxx and src/ccalibration.cxx: + Fix a race condition that would cause the calibration screen + to fail to come up when its icon was touched (From Ken Pettit, + 2013-5-12). diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index a54a35bf7..f114a19a2 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/ccalibration.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -175,21 +175,44 @@ namespace NxWM /** * Return true if the calibration thread is running normally. There are - * lots of potential race conditions. Let's hope that things are running - * orderly and we that we do not have to concern ourself with them + * lots of potential race conditions. There are also two ambiguous + * states: + * + * 1) The thread may have been started but not yet running + * (CALTHREAD_STARTED), or the + * 2) The thread may been requested to terminate, but has not yet + * terminated (CALTHREAD_STOPREQUESTED) + * + * Both of those states will cause isRunning() to return false. * * @return True if the calibration thread is runnning normally. */ inline bool isRunning(void) const { - // What if the boundary states CALTHREAD_STARTED and CALTHREAD_STOPREQUESTED? - return (m_calthread == CALTHREAD_RUNNING || m_calthread == CALTHREAD_HIDE || m_calthread == CALTHREAD_SHOW); } + /** + * Return true if the calibration thread is has been started and has not + * yet terminated. There is a potential race condition here when the + * thread has been requested to terminate, but has not yet terminated + * (CALTHREAD_STOPREQUESTED). isStarted() will return false in that case. + * + * @return True if the calibration thread has been started and/or is + * running normally. + */ + + inline bool isStarted(void) const + { + return (m_calthread == CALTHREAD_STARTED || + m_calthread == CALTHREAD_RUNNING || + m_calthread == CALTHREAD_HIDE || + m_calthread == CALTHREAD_SHOW); + } + /** * The calibration thread. This is the entry point of a thread that provides the * calibration displays, waits for input, and collects calibration data. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 32aeb5ee6..04233d5ef 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/src/ccalibration.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -247,26 +247,34 @@ void CCalibration::hide(void) void CCalibration::redraw(void) { + uint8_t waitcount = 0; + gvdbg("Entry\n"); - // Is the calibration thread running? We might have to restart it if - // we have completed the calibration early but are being brought to - // top of the display again + // Is the calibration thread still running? We might have to restart + // it if we have completed the calibration early but are being brought + // to top of the display again - // Is the calibration thread running? - - if (!isRunning()) + if (!isStarted()) { gvdbg("Starting calibration: m_calthread=%d\n", (int)m_calthread); (void)startCalibration(CALTHREAD_SHOW); } + // Is the calibration thread running? If not, then wait until it is. + + while (!isRunning() && (++waitcount < 10)) + { + usleep(500); + } + // The calibration thread is running. Make sure that is is not // already processing a redraw - else if (m_calthread != CALTHREAD_SHOW) + if (m_calthread != CALTHREAD_SHOW) { - // Ask the calibration thread to restart the calibration and redraw the display + // Ask the calibration thread to restart the calibration and redraw + // the display m_calthread = CALTHREAD_SHOW; (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); From e067c9337adff607a48c24ea6a141b32d1ba7815 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 12 May 2013 14:31:41 -0600 Subject: [PATCH 123/390] Default NxWidgets and NxWM priorities should be 100 not 50 to be consistent with other default priorities --- ChangeLog.txt | 2 ++ Kconfig | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 46eb06a08..b6098a530 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -358,3 +358,5 @@ Fix a race condition that would cause the calibration screen to fail to come up when its icon was touched (From Ken Pettit, 2013-5-12). +* Kconfig: Default priorities for NxWidget and NxWM threads + should be 100, not 50, to be consistent with other default priorities. diff --git a/Kconfig b/Kconfig index 1e4e10c66..75b0bd8c4 100644 --- a/Kconfig +++ b/Kconfig @@ -40,10 +40,10 @@ config NXWIDGETS_VPLANE config NXWIDGETS_SERVERPRIO int "NX Server priority" - default 51 + default 110 ---help--- Priority of the NX server. This applies only if NX is configured in - multi-user mode (NX_MULTIUSER=y). Default: 51. + multi-user mode (NX_MULTIUSER=y). Default: 110. NOTE: Of the three priority definitions here, NXWIDGETS_SERVERPRIO should have the highest priority to avoid data overrun race conditions. @@ -58,18 +58,18 @@ config NXWIDGETS_SERVERSTACK config NXWIDGETS_CLIENTPRIO int "NX Client Priority" - default 50 + default 100 ---help--- The thread that calls CNxServer::connect() will be re-prioritized to this priority. This applies only if NX is configured in multi-user - mode (NX_MULTIUSER=y). Default: 50 + mode (NX_MULTIUSER=y). Default: 100 config NXWIDGETS_LISTENERPRIO int "NX Listener Priority" - default 50 + default 100 ---help--- Priority of the NX event listener thread. This applies only if NX - is configured in multi-user mode (NX_MULTIUSER=y). Default: 50 + is configured in multi-user mode (NX_MULTIUSER=y). Default: 100 config NXWIDGETS_LISTENERSTACK int "NX Listener Stack Size" @@ -544,9 +544,9 @@ config NXWM_STARTWINDOW_MXMPRIO config NXWM_STARTWINDOW_PRIO int "StartWindow Task Priority" - default 50 + default 100 ---help--- - Priority of the StartWindow task. Default: 50. + Priority of the StartWindow task. Default: 100. NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else there may be data overrun errors. Such errors would most likely appear @@ -563,9 +563,9 @@ comment "NxConsole Window Configuration" config NXWM_NXCONSOLE_PRIO int "NxConsole Task Priority" - default 50 + default 100 ---help--- - Priority of the NxConsole task. Default: 50. + Priority of the NxConsole task. Default: 100. NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else there may be data overrun errors. Such errors would most likely @@ -662,9 +662,9 @@ config NXWM_TOUCHSCREEN_SIGNO config NXWM_TOUCHSCREEN_LISTENERPRIO int "Touchscreen Listener Task Priority" - default 50 + default 100 ---help--- - Priority of the touchscreen listener thread. Default: 50 + Priority of the touchscreen listener thread. Default: 100 config NXWM_TOUCHSCREEN_LISTENERSTACK int "Touchscreen Listener Task Stack Size" @@ -704,9 +704,9 @@ config NXWM_KEYBOARD_BUFSIZE config NXWM_KEYBOARD_LISTENERPRIO int "Keyboard Listener Task Priority" - default 50 + default 100 ---help--- - Priority of the touchscreen listener thread. Default: 50 + Priority of the touchscreen listener thread. Default: 100 config NXWM_KEYBOARD_LISTENERSTACK int "Keyboard Listener Task Stack Size" @@ -779,9 +779,9 @@ config NXWM_CALIBRATION_SIGNO config NXWM_CALIBRATION_LISTENERPRIO int "Calibration Task Priority" - default 50 + default 100 ---help--- - Priority of the calibration listener thread. Default: 50 + Priority of the calibration listener thread. Default: 100 config NXWM_CALIBRATION_LISTENERSTACK int "Calibration Task Stack Size" From 4e5c8e97e8afc87a8e750f81783ef038ddd11ef7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 15 May 2013 16:45:57 -0600 Subject: [PATCH 124/390] Add NxWdigets::CGlyphSliderHorizontal and associated grip widgets. From Ken Pettit. --- ChangeLog.txt | 2 + UnitTests/nxwm/nxwm_main.cxx | 8 +- libnxwidgets/Makefile | 3 +- .../include/cglyphsliderhorizontal.hxx | 336 ++++++++++++ .../include/cglyphsliderhorizontalgrip.hxx | 206 +++++++ libnxwidgets/src/cglyphsliderhorizontal.cxx | 503 ++++++++++++++++++ .../src/cglyphsliderhorizontalgrip.cxx | 204 +++++++ nxwm/Makefile | 2 +- nxwm/include/cmediaplayer.hxx | 7 +- nxwm/include/nxwmconfig.hxx | 20 + nxwm/include/nxwmglyphs.hxx | 7 + nxwm/src/cmediaplayer.cxx | 59 ++ nxwm/src/glyph_mplayer_controls.cxx | 398 ++++++++++++++ 13 files changed, 1748 insertions(+), 7 deletions(-) create mode 100644 libnxwidgets/include/cglyphsliderhorizontal.hxx create mode 100644 libnxwidgets/include/cglyphsliderhorizontalgrip.hxx create mode 100644 libnxwidgets/src/cglyphsliderhorizontal.cxx create mode 100644 libnxwidgets/src/cglyphsliderhorizontalgrip.cxx create mode 100644 nxwm/src/glyph_mplayer_controls.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index b6098a530..6a9164bb6 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -360,3 +360,5 @@ 2013-5-12). * Kconfig: Default priorities for NxWidget and NxWM threads should be 100, not 50, to be consistent with other default priorities. +* NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: + New widgets added by Ken Pettit (2013-5-15). diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 04ffb64ba..26ab1b2d3 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -574,8 +574,8 @@ static bool createMediaPlayer(void) // Add the hex calculator application to the start window printf("createHexCalculator: Creating the hex calculator application\n"); - NxWM::CMediaPlayerFactory *calculator = new NxWM::CMediaPlayerFactory(g_nxwmtest.taskbar); - if (!calculator) + NxWM::CMediaPlayerFactory *mediaplayer = new NxWM::CMediaPlayerFactory(g_nxwmtest.taskbar); + if (!mediaplayer) { printf("createMediaPlayer: ERROR: Failed to instantiate CMediaPlayerFactory\n"); return false; @@ -583,10 +583,10 @@ static bool createMediaPlayer(void) showTestCaseMemory("createMediaPlayer: After creating the media player application"); printf("createMediaPlayer: Adding the hex calculator application to the start window\n"); - if (!g_nxwmtest.startwindow->addApplication(calculator)) + if (!g_nxwmtest.startwindow->addApplication(mediaplayer)) { printf("createMediaPlayer: ERROR: Failed to add CNxConsoleFactory to the start window\n"); - delete calculator; + delete mediaplayer; return false; } diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 84b377edd..4f6840aaa 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -56,7 +56,8 @@ CXXSRCS += cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx cwidgeteventhandler CXXSRCS += cwindoweventhandlerlist.cxx singletons.cxx # Widget APIs CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx -CXXSRCS += cglyphbutton.cxx cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx +CXXSRCS += cglyphbutton.cxx cglyphsliderhorizontal.cxx cglyphsliderhorizontalgrip.cxx +CXXSRCS += cimage.cxx ckeypad.cxx clabel.cxx clatchbutton.cxx CXXSRCS += clatchbuttonarray.cxx clistbox.cxx clistboxdataitem.cxx cmultilinetextbox.cxx CXXSRCS += cnumericedit.cxx CXXSRCS += cprogressbar.cxx cradiobutton.cxx cradiobuttongroup.cxx cscrollbarhorizontal.cxx diff --git a/libnxwidgets/include/cglyphsliderhorizontal.hxx b/libnxwidgets/include/cglyphsliderhorizontal.hxx new file mode 100644 index 000000000..0540708ea --- /dev/null +++ b/libnxwidgets/include/cglyphsliderhorizontal.hxx @@ -0,0 +1,336 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CGLYPHSLIDERHORIZONTAL_HXX +#define __INCLUDE_CGLYPHSLIDERHORIZONTAL_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "csliderhorizontal.hxx" +#include "cglyphsliderhorizontalgrip.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Widget providing a sliding "grip" that can be moved left and + * right in the "gutter". Essentially a scrollbar, but more + * generic. + */ + + class CGlyphSliderHorizontal : public ISlider, public CNxWidget, public CWidgetEventHandler + { + protected: + CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ + nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ + nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int32_t m_value; /**< Current value of the slider. */ + nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ + nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking + the gutter. */ + int32_t m_gutterWidth; /**< Width of the gutter, taking into account + any adjustments made to the width of the grip. */ + uint32_t m_contentSize; /**< Number of values in the min/max range. */ + nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */ + bool m_fill; /**< Set true if fill is active */ + uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */ + + /** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + + int32_t getPhysicalMaximumValueWithBitshift(void) const; + + /** + * Get the value represented by the top of the grip. + * return The value represented by the top of the grip. + */ + + const int32_t getGripValue(void) const; + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + public: + + /** + * Constructor. + * + * @param pWidgetControl The widget control instance for the window. + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + + CGlyphSliderHorizontal(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height, IBitmap *pGripBitmap, + nxwidget_pixel_t fillColor, bool fill = true); + + /** + * Destructor. + */ + + virtual inline ~CGlyphSliderHorizontal(void) { } + + /** + * Get the smallest value that the slider can represent. + * + * @return The smallest value. + */ + + inline const nxgl_coord_t getMinimumValue(void) const + { + return m_minimumValue; + } + + /** + * Get the largest value that the slider can represent. + * + * @return The largest value. + */ + + inline const nxgl_coord_t getMaximumValue(void) const + { + return m_maximumValue; + } + + /** + * Get the current value of the slider. + * + * return The current slider value. + */ + + inline const nxgl_coord_t getValue(void) const + { + return m_value >> 16; + } + + /** + * Get the value represented by the height of the grip. + * For sliders, this would typically be 1 (so each new + * grip position is worth 1). For scrollbars, this + * would be the height of the scrolling widget. + * + * @return The page size. + */ + + inline const nxgl_coord_t getPageSize(void) const + { + return m_pageSize; + } + + /** + * Set the smallest value that the slider can represent. + * + * @param value The smallest value. + */ + + inline void setMinimumValue(const nxgl_coord_t value) + { + m_minimumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + //resizeGrip(); + }; + + /** + * Set the largest value that the slider can represent. + * + * @param value The largest value. + */ + + inline void setMaximumValue(const nxgl_coord_t value) + { + m_maximumValue = value; + m_contentSize = m_maximumValue - m_minimumValue + 1; + //resizeGrip(); + }; + + /** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + + void setValue(const nxgl_coord_t value); + + /** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + + void setValueWithBitshift(const int32_t value); + + /** + * Set the page size represented by the grip. + * + * @param pageSize The page size. + * @see getPageSize(). + */ + + inline void setPageSize(const nxgl_coord_t pageSize) + { + m_pageSize = pageSize; + //resizeGrip(); + }; + + /** + * Set the thickness of the slider bar + * + * @param thickness The slider bar thickness in pixels + */ + + inline void setBarThickness(const nxgl_coord_t thickness) + { + m_barThickness = thickness; + redraw(); + }; + + /** + * Process events fired by the grip. + * + * @param e The event details. + */ + + virtual void handleDragEvent(const CWidgetEventArgs &e); + + /** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + + nxgl_coord_t getMinimumStep(void) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CGLYPHSLIDERHORIZONTAL_HXX + diff --git a/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx b/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx new file mode 100644 index 000000000..89e4fb3b9 --- /dev/null +++ b/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx @@ -0,0 +1,206 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx + * + * Copyright (C) 2012 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CGLYPHSLIDERHORIZONTALGRIP_HXX +#define __INCLUDE_CGLYPHSLIDERHORIZONTALGRIP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "csliderhorizontalgrip.hxx" +#include "cimage.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class IBitmap; + + /** + * Class representing the grip, or draggable button, with a horizontal + * slider. + */ + + class CGlyphSliderHorizontalGrip : public CImage + { + protected: + + /** + * The CImage to represent the grip. + */ + + //CImage* m_pImage; + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + //virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + //virtual void drawBorder(CGraphicsPort *port); + + /** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + + virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); + + /** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); + + /** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + + virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY); + + public: + + /** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + + CGlyphSliderHorizontalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + IBitmap *pGripBitmap); + + + /** + * Destructor. + */ + + virtual inline ~CGlyphSliderHorizontalGrip(void) { } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CGLYPHSLIDERHORIZONTALGRIP_HXX + diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx new file mode 100644 index 000000000..97d8d01ad --- /dev/null +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -0,0 +1,503 @@ + +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cglyphsliderhorizontal.cxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * Based on and copied from csliderhorizontal.cxx written by Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "cglyphsliderhorizontal.hxx" +#include "cglyphsliderhorizontalgrip.hxx" +#include "cimage.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the slider, relative to its parent. + * @param y The y coordinate of the slider, relative to its parent. + * @param width The width of the slider. + * @param height The height of the slider. + */ + +CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + IBitmap * pGripBitmap, + nxwidget_pixel_t fillColor, bool fill) +:CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +{ + m_minimumValue = 0; + m_maximumValue = 0; + m_contentSize = 0; + m_value = 0; + m_minimumGripWidth = 10; + m_pageSize = 1; + m_fillColor = fillColor; + m_fill = fill; + m_barThickness = 8; + + m_flags.permeable = false; + m_flags.borderless = false; + m_flags.doubleClickable = false; + + // Create grip + + CRect rect; + getClientRect(rect); + m_gutterWidth = rect.getWidth(); + + // Create grip + + m_grip = new CGlyphSliderHorizontalGrip(pWidgetControl, x, y, + width, height, pGripBitmap); + m_grip->setBorderless(true); + m_grip->addWidgetEventHandler(this); + addWidget(m_grip); +} + +/** + * Set the value that of the slider. This will reposition + * and redraw the grip. + * + * @param value The new value. + */ + +void CGlyphSliderHorizontal::setValue(const nxgl_coord_t value) +{ + setValueWithBitshift((int32_t) value << 16); +} + +/** + * Set the value that of the slider. This will reposition and redraw + * the grip. The supplied value should be bitshifted left 16 places. + * This ensures greater accuracy than the standard setValue() method if + * the slider is being used as a scrollbar. + * + * @param value The new value. + */ + +void CGlyphSliderHorizontal::setValueWithBitshift(const int32_t value) +{ + CRect rect; + getClientRect(rect); + + // Can the grip move? + + if ((rect.getWidth() > m_grip->getWidth()) && + (m_maximumValue != m_minimumValue)) + { + int32_t newValue = value; + int32_t maxValue = getPhysicalMaximumValueWithBitshift(); + + // Limit to max/min values + + if (newValue > maxValue) + { + newValue = maxValue; + } + + if (newValue >> 16 < m_minimumValue) + { + newValue = m_minimumValue << 16; + } + + uint32_t scrollRatio = newValue / m_contentSize; + int32_t newGripX = m_gutterWidth * scrollRatio; + newGripX += newGripX & 0x8000; + newGripX >>= 16; + newGripX += rect.getX(); + + m_grip->moveTo(newGripX, (rect.getHeight() - m_grip->getHeight()) >> 1); + + // Update stored value if necessary + + if (m_value != newValue) + { + m_value = newValue; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Process events fired by the grip. + * + * @param e The event details. + */ + +void CGlyphSliderHorizontal::handleDragEvent(const CWidgetEventArgs & e) +{ + // Handle grip events + + if ((e.getSource() == m_grip) && (e.getSource() != NULL)) + { + int32_t newValue = getGripValue() >> 16; + + // Grip has moved - compare values and raise event if the + // value has changed. Compare using integer values rather + // than fixed-point. + + if (m_value >> 16 != newValue) + { + m_value = newValue << 16; + m_widgetEventHandlers->raiseValueChangeEvent(); + } + } +} + +/** + * Get the smallest value that the slider can move through when + * dragged. + * + * @return The smallest value that the slider can move through when + * dragged. + */ + +nxgl_coord_t CGlyphSliderHorizontal::getMinimumStep(void) const +{ + // If the ratio of content to gutter is greater than or equal to one, + // the minimum step that the slider can represent will be that ratio. + + uint32_t gutterRatio = m_contentSize << 16 / m_gutterWidth; + gutterRatio += gutterRatio & 0x8000; + gutterRatio >>= 16; + + if (gutterRatio > 0) + { + return gutterRatio; + } + + return 1; +} + +/** + * Get the maximum possible value that the slider can represent. Useful when + * using the slider as a scrollbar, as the height of the grip prevents the full + * range of values being accessed (intentionally). + * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * calculations. + * + * @return The maximum possible value that the slider can represent. + */ + +int32_t CGlyphSliderHorizontal::getPhysicalMaximumValueWithBitshift(void) const +{ + uint32_t maxX = m_gutterWidth - m_grip->getWidth(); + uint32_t scrollRatio = (maxX << 16) / m_gutterWidth; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Get the value represented by the top of the grip. + * return The value represented by the top of the grip. + */ + +const int32_t CGlyphSliderHorizontal::getGripValue(void) const +{ + // Calculate the current value represented by the top of the grip + + CRect rect; + getClientRect(rect); + + uint32_t gripPos = ((m_grip->getX() - getX()) - rect.getX()); + uint32_t scrollRatio = (gripPos << 16) / m_gutterWidth; + int32_t value = (scrollRatio * m_contentSize); + + return value; +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CGlyphSliderHorizontal::drawContents(CGraphicsPort * port) +{ + int halfGripWidth = m_grip->getWidth() >> 1; + int halfBar = m_barThickness >> 1; + int halfHeight = getHeight() >> 1; + int width; + nxwidget_pixel_t color; + + // Fill in (erase) the region to the left and right of the fuel guage + + width = + m_grip->getX() > halfGripWidth ? halfGripWidth : m_grip->getX() - getX(); + port->drawFilledRect(getX(), getY(), width, getHeight(), + getBackgroundColor()); + + // Fill in (erase) the region above the "fuel gauge" + + port->drawFilledRect(getX(), getY(), getWidth(), halfHeight - halfBar, + getBackgroundColor()); + + // Fill in the bar area to the left of the grip + + if (m_fill) + color = m_fillColor; + else + color = getBackgroundColor(); + if (m_grip->getX() > halfGripWidth) + port->drawFilledRect(getX() + 1 + halfGripWidth, + getY() + halfHeight - halfBar + 1, + m_grip->getX() - halfGripWidth, m_barThickness - 2, + color); + + // Fill in bar the area to the right of the grip + + width = getWidth() - (m_grip->getX() - getX() + m_grip->getWidth()) - 1 - + halfGripWidth; + if (width > 0) + port->drawFilledRect(m_grip->getX() + m_grip->getWidth(), + getY() + halfHeight - halfBar + 1, width, + m_barThickness - 2, getBackgroundColor()); + + // Fill in (erase) the area to right of the bar + + width = m_grip->getX() - getX() + m_grip->getWidth() < + getWidth() - halfGripWidth ? halfGripWidth : getWidth() - (m_grip->getX() - + getX() + + halfGripWidth); + if (width > 0) + port->drawFilledRect(getX() + getWidth() - halfGripWidth, getY(), width, + getHeight(), getBackgroundColor()); + + // Fill in (erase) the region below the "fuel gauge" + + port->drawFilledRect(getX(), getY() + halfHeight + (m_barThickness - halfBar), + getWidth(), halfHeight - (m_barThickness - halfBar), + getBackgroundColor()); + + // Now redraw the grip + + m_grip->enableDrawing(); + m_grip->redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CGlyphSliderHorizontal::drawBorder(CGraphicsPort * port) +{ + // Stop drawing if the widget indicates it should not have an outline + + if (!isBorderless()) + { + int y1, y2; + int x = getX(); + int gripWidth = m_grip->getWidth(); + int halfGripWidth = gripWidth >> 1; + int gripX = m_grip->getX(); + int width; + nxwidget_pixel_t shine; + nxwidget_pixel_t shadow; + + y1 = getY() + (getHeight() >> 1) - (m_barThickness >> 1); + y2 = getY() + (getHeight() >> 1) + m_barThickness - + (m_barThickness >> 1) - 1; + + // To the Left of the grip. Only draw if the icon isn't covering the + // edge of the bar + + width = gripX - x - halfGripWidth; + if (width > 0) + { + // If we aren't filling, then don't draw a "raised" bar + + if (m_fill) + { + shine = getShineEdgeColor(); + shadow = getShadowEdgeColor(); + } + else + { + shadow = getShineEdgeColor(); + shine = getShadowEdgeColor(); + } + + port->drawHorizLine(x + halfGripWidth, y1, width, shine); + port->drawHorizLine(x + halfGripWidth, y2, width, shadow); + } + + // To the Right of the grip + // Only draw if the icon isn't covering the edge of the bar + + width = getWidth() - (gripX - x + gripWidth) - 1 - halfGripWidth; + if (width > 0) + { + + port->drawHorizLine(gripX + gripWidth, y1, + getWidth() - (gripX - x + gripWidth) - 1 - + halfGripWidth, getShadowEdgeColor()); + port->drawHorizLine(gripX + gripWidth, y2, + getWidth() - (gripX - x + gripWidth) - 1 - + halfGripWidth, getShineEdgeColor()); + } + + // Left edge + + if (gripX > x + halfGripWidth) + { + port->drawVertLine(x + halfGripWidth, y1, m_barThickness, + getShineEdgeColor()); + } + + // Right edge + + if (gripX + gripWidth < x + getWidth() - 1 - halfGripWidth) + { + port->drawVertLine(x + getWidth() - 1 - halfGripWidth, + y1, m_barThickness, getShadowEdgeColor()); + } + } +} + +/** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CGlyphSliderHorizontal::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ + // Remember current values + + int32_t oldValue = m_value; + bool events = raisesEvents(); + + // Disable event raising + + setRaisesEvents(false); + // resizeGrip(); + + // Set back to current value + + setValue(oldValue); + + // Reset event raising + + setRaisesEvents(events); +} + +/** + * Moves the grip towards the mouse. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CGlyphSliderHorizontal::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + // Which way should the grip move? + + if (x > m_grip->getX()) + { + // Move grip right + + setValueWithBitshift(m_value + (m_pageSize << 16)); + } + else + { + // Move grip left + + setValueWithBitshift(m_value - (m_pageSize << 16)); + } + redraw(); +} diff --git a/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx new file mode 100644 index 000000000..331ec8d8b --- /dev/null +++ b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx @@ -0,0 +1,204 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * Mostly copied from CSliderHorizontalGrip written by Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "cglyphsliderhorizontalgrip.hxx" +#include "ibitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the grip, relative to its parent. + * @param y The y coordinate of the grip, relative to its parent. + * @param width The width of the grip. + * @param height The height of the grip. + */ + +CGlyphSliderHorizontalGrip::CGlyphSliderHorizontalGrip(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + IBitmap *pGripBitmap) +: CImage(pWidgetControl, 0, (height>>1) - (pGripBitmap->getHeight() >> 1), + pGripBitmap->getWidth(), pGripBitmap->getHeight(), + pGripBitmap, 0) +{ + // Make the widget draggable + + setDraggable(true); +} + +/** + * Resize the slider to the new dimensions. + * + * @param width The new width. + * @param height The new height. + */ + +void CGlyphSliderHorizontalGrip::onResize(nxgl_coord_t width, nxgl_coord_t height) +{ +} + +/** + * Starts dragging the grip and redraws it. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + +void CGlyphSliderHorizontalGrip::onClick(nxgl_coord_t x, nxgl_coord_t y) +{ + startDragging(x, y); + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CGlyphSliderHorizontalGrip::onRelease(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Redraws the grip. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + +void CGlyphSliderHorizontalGrip::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) +{ + redraw(); +} + +/** + * Moves the grip to follow the mouse. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + * @param vX The horizontal distance of the drag. + * @param vY The vertical distance of the drag. + */ + +void CGlyphSliderHorizontalGrip::onDrag(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t vX, nxgl_coord_t vY) +{ + // Work out where we're moving to + + nxgl_coord_t destX = x - m_grabPointX - m_parent->getX(); + + // Do we need to move? + + if (destX != m_rect.getX()) + { + // Get parent rect + + CRect rect; + m_parent->getClientRect(rect); + + // Prevent grip from moving outside parent + + if (destX < rect.getX()) + { + destX = rect.getX(); + } + else + { + if (destX + getWidth() > rect.getWidth() + rect.getX()) + { + destX = (rect.getWidth() + rect.getX()) - getWidth() ; + } + } + + // Move to new location + + moveTo(destX, (rect.getHeight() - getHeight()) >> 1); + m_parent->redraw(); + } +} diff --git a/nxwm/Makefile b/nxwm/Makefile index 22653a524..f4d148316 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -76,7 +76,7 @@ CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx CXXSRCS += glyph_stop.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) -CXXSRCS += glyph_mediaplayer.cxx cmediaplayer.cxx +CXXSRCS += glyph_mediaplayer.cxx cmediaplayer.cxx glyph_mplayer_controls.cxx endif SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 88143617e..81656c761 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -46,9 +46,10 @@ #include #include -#include "cbuttonarray.hxx" +#include "cimage.hxx" #include "clabel.hxx" #include "cnxfont.hxx" +#include "cglyphsliderhorizontal.hxx" #include "iapplication.hxx" #include "capplicationwindow.hxx" @@ -105,6 +106,10 @@ namespace NxWM NXWidgets::CLabel *m_text; /**< Some text in the app for now */ NXWidgets::CNxFont *m_font; /**< The font used in the media player */ + NXWidgets::CImage *m_rew; /**< Rewind control */ + NXWidgets::CImage *m_playPause; /**< Play/Pause control */ + NXWidgets::CImage *m_fwd; /**< Forward control */ + NXWidgets::CGlyphSliderHorizontal *m_volume; /**< Volume control */ /** * Calculator geometry. This stuff does not really have to be retained diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index d57b58b59..ad8e0e97d 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -552,6 +552,26 @@ # define CONFIG_NXWM_MEDIAPLAYER_ICON NxWM::g_mediaplayerBitmap #endif +#ifndef CONFIG_NXWM_MPLAYER_FWD_ICON +# define CONFIG_NXWM_MPLAYER_FWD_ICON NxWM::g_mplayerFwdBitmap +#endif + +#ifndef CONFIG_NXWM_MPLAYER_PLAY_ICON +# define CONFIG_NXWM_MPLAYER_PLAY_ICON NxWM::g_mplayerPlayBitmap +#endif + +#ifndef CONFIG_NXWM_MPLAYER_PAUSE_ICON +# define CONFIG_NXWM_MPLAYER_PAUSE_ICON NxWM::g_mplayerPauseBitmap +#endif + +#ifndef CONFIG_NXWM_MPLAYER_REW_ICON +# define CONFIG_NXWM_MPLAYER_REW_ICON NxWM::g_mplayerRewBitmap +#endif + +#ifndef CONFIG_NXWM_MPLAYER_VOL_ICON +# define CONFIG_NXWM_MPLAYER_VOL_ICON NxWM::g_mplayerVolBitmap +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_FONTID # define CONFIG_NXWM_MEDIAPLAYER_FONTID CONFIG_NXWM_DEFAULT_FONTID #endif diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 74b527611..5bcd4fb83 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -60,7 +60,14 @@ namespace NxWM extern const struct NXWidgets::SRlePaletteBitmap g_calculatorBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_calibrationBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_cmdBitmap; +#ifdef CONFIG_NXWM_MEDIAPLAYER extern const struct NXWidgets::SRlePaletteBitmap g_mediaplayerBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mplayerFwdBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mplayerPlayBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mplayerPauseBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mplayerRewBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_mplayerVolBitmap; +#endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index ffe237fc1..795123cc3 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -267,6 +267,15 @@ void CMediaPlayer::redraw(void) m_text->enableDrawing(); m_text->redraw(); + + m_rew->enableDrawing(); + m_rew->redraw(); + m_playPause->enableDrawing(); + m_playPause->redraw(); + m_fwd->enableDrawing(); + m_fwd->redraw(); + m_volume->enableDrawing(); + m_volume->redraw(); } /** @@ -314,6 +323,8 @@ void CMediaPlayer::setGeometry(void) bool CMediaPlayer::createPlayer(void) { + int playControlX, playControlY; + // Select a font for the calculator m_font = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_MEDIAPLAYER_FONTID, @@ -354,6 +365,54 @@ bool CMediaPlayer::createPlayer(void) // Select the font m_text->setFont(m_font); + + // Create button for rewind + + playControlX = (m_windowSize.w >> 1) - 64; + playControlY = m_windowSize.h - 64; + + // Create the Rewind Image + + NXWidgets::CRlePaletteBitmap *pRewBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + m_rew = new NXWidgets::CImage(control, + playControlX, playControlY, + 32, 32, + pRewBitmap, 0); + m_rew->setBorderless(true); + + // Create the Play Image + + pRewBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); + m_playPause = new NXWidgets::CImage(control, + playControlX + 32 + 16, playControlY, + 32, 32, + pRewBitmap, 0); + m_playPause->setBorderless(true); + + // Create the Forward Image + + pRewBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); + m_fwd = new NXWidgets::CImage(control, + playControlX + 32*3, playControlY, + 32, 32, + pRewBitmap, 0); + m_fwd->setBorderless(true); + + // Create the Volume control + + pRewBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); + m_volume = new NXWidgets::CGlyphSliderHorizontal(control, + 10, m_windowSize.h - 30, + m_windowSize.w - 20, 26, + pRewBitmap, MKRGB( 63, 90,192)); + m_volume->setMinimumValue(0); + m_volume->setMaximumValue(100); + m_volume->setValue(15); + return true; } diff --git a/nxwm/src/glyph_mplayer_controls.cxx b/nxwm/src/glyph_mplayer_controls.cxx new file mode 100644 index 000000000..4f6a387c1 --- /dev/null +++ b/nxwm/src/glyph_mplayer_controls.cxx @@ -0,0 +1,398 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_mediaplayer.cxx + * + * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Author: Ken Pettit + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +/* Automatically NuttX bitmap file. */ +/* Generated from play_music.png by bitmap_converter.py. */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_WIDTH 32 +#define BITMAP_HEIGHT 32 +#define BITMAP_PALETTESIZE 8 + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 11, 24,108), MKRGB( 63, 90,192), MKRGB(121,136,250), + MKRGB(224,234,244), MKRGB( 69, 80,149), MKRGB(127,169,239), MKRGB(152,174,207), +}; + +static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 61, 74,158), MKRGB(113,140,242), MKRGB(171,186,255), + MKRGB(255,255,255), MKRGB(119,130,199), MKRGB(177,219,255), MKRGB(202,224,255), +}; + +/* Bitmap definition for the "Play" button */ + +static const NXWidgets::SRlePaletteBitmapEntry play_bitmap[] = +{ + { 32, 0}, /* Row 0 */ + { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ + { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ + { 8, 0}, { 3, 6}, { 9, 7}, { 3, 6}, { 1, 7}, { 8, 0}, /* Row 3 */ + { 7, 0}, { 7, 6}, { 4, 7}, { 7, 6}, { 7, 0}, /* Row 4 */ + { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ + { 5, 0}, { 6, 3}, { 9, 6}, { 7, 3}, { 5, 0}, /* Row 6 */ + { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ + { 3, 0}, { 3, 2}, { 5, 3}, { 1, 6}, { 13, 3}, { 4, 2}, + { 3, 0}, /* Row 9 */ + { 2, 0}, { 1, 5}, { 6, 2}, { 2, 3}, { 2, 4}, { 1, 6}, + { 9, 3}, { 6, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ + { 2, 0}, { 1, 5}, { 8, 2}, { 1, 7}, { 3, 4}, { 1, 6}, + { 2, 2}, { 1, 3}, { 10, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ + { 1, 0}, { 4, 5}, { 6, 2}, { 1, 7}, { 4, 4}, { 1, 7}, + { 1, 3}, { 8, 2}, { 4, 5}, { 2, 0}, /* Row 12 */ + { 1, 0}, { 7, 5}, { 3, 2}, { 1, 7}, { 6, 4}, { 1, 7}, + { 3, 2}, { 8, 5}, { 2, 0}, /* Row 13 */ + { 1, 0}, { 9, 5}, { 1, 2}, { 1, 7}, { 8, 4}, { 1, 7}, + { 8, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ + { 1, 0}, { 4, 1}, { 6, 5}, { 1, 7}, { 10, 4}, { 1, 7}, + { 3, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ + { 1, 0}, { 8, 1}, { 2, 5}, { 1, 7}, { 10, 4}, { 1, 7}, + { 7, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ + { 1, 0}, { 10, 1}, { 1, 7}, { 9, 4}, { 1, 5}, { 8, 1}, + { 1, 5}, { 1, 0}, /* Row 17 */ + { 1, 0}, { 10, 1}, { 1, 7}, { 7, 4}, { 1, 5}, { 10, 1}, + { 2, 0}, /* Row 18 */ + { 1, 0}, { 1, 5}, { 9, 1}, { 1, 7}, { 5, 4}, { 1, 7}, + { 12, 1}, { 2, 0}, /* Row 19 */ + { 2, 0}, { 9, 1}, { 1, 7}, { 4, 4}, { 1, 5}, { 13, 1}, + { 2, 0}, /* Row 20 */ + { 2, 0}, { 9, 1}, { 1, 7}, { 2, 4}, { 1, 7}, { 1, 2}, + { 13, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ + { 2, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 1, 4}, { 1, 5}, + { 6, 2}, { 9, 1}, { 3, 0}, /* Row 22 */ + { 3, 0}, { 7, 1}, { 1, 2}, { 1, 5}, { 10, 2}, { 6, 1}, + { 1, 5}, { 3, 0}, /* Row 23 */ + { 4, 0}, { 4, 1}, { 16, 2}, { 4, 1}, { 4, 0}, /* Row 24 */ + { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ + { 5, 0}, { 1, 5}, { 1, 1}, { 19, 2}, { 1, 5}, { 5, 0}, /* Row 26 */ + { 6, 0}, { 1, 5}, { 18, 2}, { 7, 0}, /* Row 27 */ + { 8, 0}, { 15, 2}, { 1, 5}, { 8, 0}, /* Row 28 */ + { 9, 0}, { 1, 5}, { 12, 2}, { 10, 0}, /* Row 29 */ + { 12, 0}, { 8, 2}, { 12, 0}, /* Row 30 */ + { 32, 0}, /* Row 31 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerPlayBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + BITMAP_WIDTH, + BITMAP_HEIGHT, + {palette, hilight_palette}, + play_bitmap +}; + +/* Bitmap definition for the "Pause" button */ + +static const NXWidgets::SRlePaletteBitmapEntry pause_bitmap[] = +{ + { 32, 0}, /* Row 0 */ + { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ + { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ + { 8, 0}, { 4, 6}, { 8, 7}, { 4, 6}, { 8, 0}, /* Row 3 */ + { 7, 0}, { 7, 6}, { 3, 7}, { 8, 6}, { 7, 0}, /* Row 4 */ + { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ + { 5, 0}, { 6, 3}, { 9, 6}, { 7, 3}, { 5, 0}, /* Row 6 */ + { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ + { 3, 0}, { 3, 2}, { 19, 3}, { 4, 2}, { 3, 0}, /* Row 9 */ + { 2, 0}, { 1, 5}, { 5, 2}, { 2, 3}, { 1, 6}, { 3, 4}, + { 3, 3}, { 1, 7}, { 2, 4}, { 1, 7}, { 2, 3}, { 6, 2}, + { 1, 5}, { 2, 0}, /* Row 10 */ + { 2, 0}, { 1, 5}, { 7, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 3}, { 4, 4}, { 1, 3}, { 7, 2}, { 1, 5}, + { 2, 0}, /* Row 11 */ + { 1, 0}, { 4, 5}, { 5, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 3}, { 4, 4}, { 1, 6}, { 4, 2}, { 4, 5}, + { 2, 0}, /* Row 12 */ + { 1, 0}, { 8, 5}, { 1, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 5}, { 4, 4}, { 1, 5}, { 1, 2}, { 7, 5}, + { 2, 0}, /* Row 13 */ + { 1, 0}, { 9, 5}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 2}, + { 1, 5}, { 4, 4}, { 8, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ + { 1, 0}, { 4, 1}, { 5, 5}, { 1, 7}, { 3, 4}, { 1, 7}, + { 2, 5}, { 4, 4}, { 5, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 2, 5}, + { 4, 4}, { 1, 5}, { 8, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 18 */ + { 1, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 19 */ + { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 20 */ + { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 2}, { 4, 4}, { 1, 5}, { 7, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ + { 2, 0}, { 1, 5}, { 7, 1}, { 1, 7}, { 3, 4}, { 1, 6}, + { 1, 1}, { 1, 2}, { 4, 4}, { 1, 2}, { 7, 1}, { 3, 0}, /* Row 22 */ + { 3, 0}, { 7, 1}, { 1, 2}, { 3, 6}, { 4, 2}, { 2, 6}, + { 2, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ + { 4, 0}, { 4, 1}, { 16, 2}, { 4, 1}, { 4, 0}, /* Row 24 */ + { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 1, 5}, { 5, 0}, /* Row 26 */ + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 4, 2}, { 7, 0}, /* Row 27 */ + { 8, 0}, { 3, 2}, { 4, 2}, { 2, 2}, { 4, 2}, { 2, 2}, + { 1, 5}, { 8, 0}, /* Row 28 */ + { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 3, 2}, { 10, 0}, /* Row 29 */ + { 12, 0}, { 8, 2}, { 12, 0}, /* Row 30 */ + { 32, 0}, /* Row 31 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerPauseBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + BITMAP_WIDTH, + BITMAP_HEIGHT, + {palette, hilight_palette}, + pause_bitmap +}; + +/* Bitmap definition for "Rewind" control */ + +static const NXWidgets::SRlePaletteBitmapEntry rew_bitmap[] = +{ + { 32, 0}, /* Row 0 */ +// { 14, 0}, { 3, 4}, { 1, 7}, { 14, 0}, /* Row 1 */ + { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ + { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ + { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, + { 3, 6}, { 1, 7}, { 8, 0}, /* Row 3 */ + { 7, 0}, { 7, 6}, { 3, 7}, { 8, 6}, { 7, 0}, /* Row 4 */ + { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ + { 5, 0}, { 6, 3}, { 9, 6}, { 7, 3}, { 5, 0}, /* Row 6 */ + { 4, 0}, { 23, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ + { 3, 0}, { 3, 2}, { 18, 3}, { 5, 2}, { 3, 0}, /* Row 9 */ + { 2, 0}, { 1, 5}, { 5, 2}, { 6, 3}, { 1, 6}, { 7, 3}, + { 2, 2}, { 2, 6}, { 3, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ + { 2, 0}, { 1, 5}, { 9, 2}, { 1, 6}, { 2, 4}, { 1, 3}, + { 1, 2}, { 2, 3}, { 3, 2}, { 1, 6}, { 2, 4}, { 1, 6}, + { 3, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ + { 1, 0}, { 2, 5}, { 7, 2}, { 1, 6}, { 4, 4}, { 1, 3}, + { 4, 2}, { 1, 3}, { 1, 7}, { 3, 4}, { 1, 7}, { 3, 2}, + { 1, 5}, { 2, 0}, /* Row 12 */ + { 1, 0}, { 5, 5}, { 2, 2}, { 1, 5}, { 1, 7}, { 5, 4}, + { 1, 5}, { 3, 2}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 2}, + { 3, 5}, { 2, 0}, /* Row 13 */ + { 1, 0}, { 6, 5}, { 1, 7}, { 7, 4}, { 1, 5}, { 1, 2}, + { 1, 7}, { 7, 4}, { 1, 7}, { 3, 5}, { 1, 1}, { 1, 5}, + { 1, 0}, /* Row 14 */ + { 1, 0}, { 4, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 7}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ + { 1, 0}, { 4, 1}, { 1, 5}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ + { 1, 0}, { 6, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, + { 1, 5}, { 7, 4}, { 1, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ + { 1, 0}, { 8, 1}, { 1, 7}, { 5, 4}, { 1, 5}, { 3, 1}, + { 1, 7}, { 5, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 18 */ + { 1, 0}, { 1, 5}, { 8, 1}, { 1, 5}, { 4, 4}, { 1, 5}, + { 4, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 19 */ + { 2, 0}, { 10, 1}, { 1, 7}, { 2, 4}, { 1, 2}, { 6, 1}, + { 1, 7}, { 2, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 20 */ + { 2, 0}, { 11, 1}, { 1, 5}, { 1, 4}, { 1, 2}, { 7, 1}, + { 1, 5}, { 1, 7}, { 1, 5}, { 3, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ + { 2, 0}, { 1, 5}, { 9, 1}, { 1, 2}, { 1, 1}, { 6, 2}, + { 9, 1}, { 3, 0}, /* Row 22 */ + { 3, 0}, { 7, 1}, { 12, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ + { 4, 0}, { 5, 1}, { 14, 2}, { 5, 1}, { 4, 0}, /* Row 24 */ + { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 1, 5}, { 5, 0}, /* Row 26 */ + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 4, 2}, { 7, 0}, /* Row 27 */ + { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, + { 1, 5}, { 8, 0}, /* Row 28 */ + { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, + { 10, 0}, /* Row 29 */ + { 12, 0}, { 3, 2}, { 2, 2}, { 3, 2}, { 12, 0}, /* Row 30 */ + { 32, 0}, /* Row 31 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerRewBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + BITMAP_WIDTH, + BITMAP_HEIGHT, + {palette, hilight_palette}, + rew_bitmap +}; + +/* Bitmap definition for "Forward" control */ + +static const NXWidgets::SRlePaletteBitmapEntry fwd_bitmap[] = +{ + { 32, 0}, /* Row 0 */ + { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ + { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ + { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, + { 3, 6}, { 1, 7}, { 8, 0}, /* Row 3 */ + { 7, 0}, { 7, 6}, { 3, 7}, { 8, 6}, { 7, 0}, /* Row 4 */ + { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ + { 5, 0}, { 6, 3}, { 10, 6}, { 6, 3}, { 5, 0}, /* Row 6 */ + { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ + { 3, 0}, { 3, 2}, { 19, 3}, { 4, 2}, { 3, 0}, /* Row 9 */ + { 2, 0}, { 1, 5}, { 3, 2}, { 2, 6}, { 2, 2}, { 7, 3}, + { 1, 6}, { 5, 3}, { 6, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ + { 2, 0}, { 1, 5}, { 3, 2}, { 1, 7}, { 2, 4}, { 1, 3}, + { 2, 2}, { 3, 3}, { 1, 2}, { 1, 6}, { 2, 4}, { 1, 6}, + { 9, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ + { 1, 0}, { 2, 5}, { 3, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 5, 2}, { 1, 6}, { 4, 4}, { 1, 5}, { 7, 2}, { 1, 5}, + { 2, 0}, /* Row 12 */ + { 1, 0}, { 4, 5}, { 1, 2}, { 1, 7}, { 5, 4}, { 1, 7}, + { 3, 2}, { 1, 6}, { 5, 4}, { 1, 7}, { 1, 5}, { 2, 2}, + { 4, 5}, { 2, 0}, /* Row 13 */ + { 1, 0}, { 1, 5}, { 1, 1}, { 2, 5}, { 1, 1}, { 1, 7}, + { 7, 4}, { 1, 7}, { 1, 2}, { 1, 5}, { 7, 4}, { 1, 7}, + { 4, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ + { 1, 0}, { 5, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 5}, { 3, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ + { 1, 0}, { 5, 1}, { 1, 7}, { 8, 4}, { 2, 7}, { 8, 4}, + { 1, 7}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ + { 1, 0}, { 5, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, + { 1, 5}, { 7, 4}, { 1, 5}, { 5, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ + { 1, 0}, { 5, 1}, { 1, 5}, { 5, 4}, { 1, 7}, { 3, 1}, + { 1, 5}, { 5, 4}, { 1, 7}, { 7, 1}, { 2, 0}, /* Row 18 */ + { 1, 0}, { 1, 5}, { 4, 1}, { 1, 5}, { 3, 4}, { 1, 7}, + { 1, 2}, { 4, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, + { 2, 0}, /* Row 19 */ + { 2, 0}, { 4, 1}, { 1, 5}, { 2, 4}, { 1, 5}, { 6, 1}, + { 1, 5}, { 2, 4}, { 1, 7}, { 10, 1}, { 2, 0}, /* Row 20 */ + { 2, 0}, { 4, 1}, { 2, 7}, { 8, 1}, { 1, 5}, { 1, 4}, + { 1, 2}, { 10, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ + { 2, 0}, { 1, 5}, { 9, 1}, { 6, 2}, { 1, 1}, { 1, 2}, + { 9, 1}, { 3, 0}, /* Row 22 */ + { 3, 0}, { 7, 1}, { 12, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ + { 4, 0}, { 5, 1}, { 14, 2}, { 5, 1}, { 4, 0}, /* Row 24 */ + { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 1, 5}, { 5, 0}, /* Row 26 */ + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 4, 2}, { 7, 0}, /* Row 27 */ + { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, + { 1, 5}, { 8, 0}, /* Row 28 */ + { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, + { 10, 0}, /* Row 29 */ + { 12, 0}, { 3, 2}, { 2, 2}, { 3, 2}, { 12, 0}, /* Row 30 */ + { 32, 0}, /* Row 31 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerFwdBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + BITMAP_WIDTH, + BITMAP_HEIGHT, + {palette, hilight_palette}, + fwd_bitmap +}; + +static const NXWidgets::SRlePaletteBitmapEntry vol_bitmap[] = +{ + { 22, 0}, /* Row 0 */ + { 9, 0}, { 5, 7}, { 8, 0}, /* Row 1 */ + { 6, 0}, { 2, 6}, { 6, 7}, { 2, 6}, { 1, 7}, { 5, 0}, /* Row 2 */ + { 4, 0}, { 2, 3}, { 9, 6}, { 3, 3}, { 4, 0}, /* Row 3 */ + { 3, 0}, { 5, 3}, { 6, 6}, { 5, 3}, { 3, 0}, /* Row 4 */ + { 3, 0}, { 16, 3}, { 3, 0}, /* Row 5 */ + { 2, 0}, { 2, 2}, { 13, 3}, { 3, 2}, { 2, 0}, /* Row 6 */ + { 1, 0}, { 1, 5}, { 4, 2}, { 10, 3}, { 4, 2}, { 1, 5}, + { 1, 0}, /* Row 7 */ + { 1, 0}, { 2, 5}, { 15, 2}, { 3, 5}, { 1, 0}, /* Row 8 */ + { 1, 0}, { 5, 5}, { 10, 2}, { 5, 5}, { 1, 0}, /* Row 9 */ + { 1, 0}, { 2, 1}, { 15, 5}, { 3, 1}, { 1, 0}, /* Row 10 */ + { 1, 0}, { 5, 1}, { 10, 5}, { 5, 1}, { 1, 0}, /* Row 11 */ + { 1, 0}, { 20, 1}, { 1, 0}, /* Row 12 */ + { 1, 0}, { 20, 1}, { 1, 0}, /* Row 13 */ + { 1, 0}, { 19, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ + { 1, 0}, { 1, 5}, { 7, 1}, { 1, 5}, { 4, 2}, { 6, 1}, + { 2, 0}, /* Row 15 */ + { 2, 0}, { 5, 1}, { 8, 2}, { 4, 1}, { 1, 5}, { 2, 0}, /* Row 16 */ + { 3, 0}, { 2, 1}, { 12, 2}, { 2, 1}, { 3, 0}, /* Row 17 */ + { 3, 0}, { 1, 5}, { 1, 1}, { 13, 2}, { 1, 5}, { 3, 0}, /* Row 18 */ + { 6, 0}, { 10, 2}, { 1, 5}, { 5, 0}, /* Row 19 */ + { 6, 0}, { 1, 5}, { 8, 2}, { 7, 0}, /* Row 20 */ + { 22, 0}, /* Row 21 */ +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerVolBitmap = +{ + CONFIG_NXWIDGETS_BPP, + CONFIG_NXWIDGETS_FMT, + BITMAP_PALETTESIZE, + 22, + 22, + {hilight_palette, hilight_palette}, + vol_bitmap +}; From 85f34cd314fc6f320d65699e2ff78e93bd2e963b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 May 2013 07:37:09 -0600 Subject: [PATCH 125/390] Minor updates to Kconfig and README files --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index 75b0bd8c4..a5d12f791 100644 --- a/Kconfig +++ b/Kconfig @@ -850,6 +850,6 @@ config NXWM_MEDIAPLAYER with a device driver for the MP3 codec. NOTE: This application is currently under development and just - a shell of an app which will be developed soon. + a shell of an app which will be developed soon. endif From d71736b2d5abcfb9c7199f9bca426d25d558020c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 May 2013 15:07:07 -0600 Subject: [PATCH 126/390] Add NxWidgets::CGlyphSliderHorizontal unit test; Fix NxWidgets::CGlyphSliderHorizontal drawing error. From Ken Pettit --- ChangeLog.txt | 4 + UnitTests/CGlyphSliderHorizontal/.gitignore | 12 + UnitTests/CGlyphSliderHorizontal/Makefile | 169 +++++++++++ .../cglyphsliderhorizontal_main.cxx | 230 +++++++++++++++ .../cglyphsliderhorizontaltest.cxx | 276 ++++++++++++++++++ .../cglyphsliderhorizontaltest.hxx | 137 +++++++++ libnxwidgets/src/cglyphsliderhorizontal.cxx | 2 +- 7 files changed, 829 insertions(+), 1 deletion(-) create mode 100644 UnitTests/CGlyphSliderHorizontal/.gitignore create mode 100644 UnitTests/CGlyphSliderHorizontal/Makefile create mode 100644 UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx create mode 100644 UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx create mode 100644 UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 6a9164bb6..dfd4c8c14 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -362,3 +362,7 @@ should be 100, not 50, to be consistent with other default priorities. * NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: New widgets added by Ken Pettit (2013-5-15). +* NxWidgets/UnitTests/CGlyphSliderHorizontal: Addes a unit test for the + NxWidgets::CGlyphSliderHorizontal class. From Ken Pettit (2013-5-17) . +* NxWidgets::CGlyphSliderHorizontal: Fix a drawing error. From Ken + Pettit (2013-5-17). diff --git a/UnitTests/CGlyphSliderHorizontal/.gitignore b/UnitTests/CGlyphSliderHorizontal/.gitignore new file mode 100644 index 000000000..22a689acd --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/.gitignore @@ -0,0 +1,12 @@ +Make.dep +.context +.depend +.built +*.swp +*.asm +*.rel +*.lst +*.sym +*.adb +*.lib +*.src diff --git a/UnitTests/CGlyphSliderHorizontal/Makefile b/UnitTests/CGlyphSliderHorizontal/Makefile new file mode 100644 index 000000000..5ab64b10d --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/Makefile @@ -0,0 +1,169 @@ +################################################################################# +# NxWidgets/UnitTests/CGlyphSliderHorizontal/Makefile +# +# Copyright (C) 2012-213 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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, NxWidgets, nor the names of its contributors +# me 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. +# +################################################################################# + +TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} + +-include $(TOPDIR)/Make.defs +include $(APPDIR)$(DELIM)Make.defs + +# Add the path to the NXWidget include directory to the CFLAGS + +NXWIDGETS_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)libnxwidgets" +NXWIDGETS_INC="$(NXWIDGETS_DIR)$(DELIM)include" +NXWIDGETS_LIB="$(NXWIDGETS_DIR)$(DELIM)libnxwidgets$(LIBEXT)" + +ifeq ($(WINTOOL),y) + CFLAGS += ${shell $(INCDIR) -w "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) -w "$(CXX)" "$(NXWIDGETS_INC)"} +else + CFLAGS += ${shell $(INCDIR) "$(CC)" "$(NXWIDGETS_INC)"} + CXXFLAGS += ${shell $(INCDIR) "$(CXX)" "$(NXWIDGETS_INC)"} +endif + +# Get the path to the archiver tool + +TESTTOOL_DIR="$(TESTDIR)$(DELIM)..$(DELIM)..$(DELIM)tools" +ARCHIVER=$(TESTTOOL_DIR)$(DELIM)addobjs.sh + +# Hello, World! C++ Example + +ASRCS = +CSRCS = +CXXSRCS = cglyphsliderhorizontal_main.cxx cglyphsliderhorizontaltest.cxx + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) +OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) + +POSIX_BIN = "$(APPDIR)$(DELIM)libapps$(LIBEXT)" +ifeq ($(WINTOOL),y) + BIN = "${shell cygpath -w $(POSIX_BIN)}" +else + BIN = $(POSIX_BIN) +endif + +ROOTDEPPATH = --dep-path . + +# helloxx built-in application info + +APPNAME = cglyphsliderhorizontal +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 2048 + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend context disclean chkcxx chklib + +# Object file creation targets + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(CXXOBJS): %$(OBJEXT): %.cxx + $(call COMPILEXX, $<, $@) + +# Verify that the NuttX configuration is setup to support C++ + +chkcxx: +ifneq ($(CONFIG_HAVE_CXX),y) + @echo "" + @echo "In order to use this example, you toolchain must support must" + @echo "" + @echo " (1) Explicitly select CONFIG_HAVE_CXX to build in C++ support" + @echo " (2) Define CXX, CXXFLAGS, and COMPILEXX in the Make.defs file" + @echo " of the configuration that you are using." + @echo "" + @exit 1 +endif + +# Verify that the NXWidget library has been built + +chklib: + $(Q) ( \ + if [ ! -e "$(NXWIDGETS_LIB)" ]; then \ + echo "$(NXWIDGETS_LIB) does not exist."; \ + echo "Please go to $(NXWIDGETS_DIR)"; \ + echo "and rebuild the library"; \ + exit 1; \ + fi; \ + ) + +# Library creation targets + +$(NXWIDGETS_LIB): # Just to keep make happy. chklib does the work. + +.built: chkcxx chklib $(OBJS) $(NXWIDGETS_LIB) + $(call ARCHIVE, $(BIN), $(OBJS)) +ifeq ($(WINTOOL),y) + $(Q) $(ARCHIVER) -w -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +else + $(Q) $(ARCHIVER) -p "$(CROSSDEV)" $(BIN) $(NXWIDGETS_DIR) +endif + $(Q) touch .built + +# Standard housekeeping targets + +.context: +ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) +endif + $(Q) touch $@ + +context: .context + +.depend: Makefile $(SRCS) + $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep + $(Q) touch $@ + +depend: .depend + +clean: + $(call DELFILE, .built) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx new file mode 100644 index 000000000..24450fcfd --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx @@ -0,0 +1,230 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx +// +// Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "cglyphsliderhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +#define MAX_SLIDER 50 + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static unsigned int g_mmInitial; +static unsigned int g_mmprevious; + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +// Suppress name-mangling + +extern "C" int cglyphsliderhorizontal_main(int argc, char *argv[]); + +///////////////////////////////////////////////////////////////////////////// +// Private Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: updateMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void updateMemoryUsage(unsigned int previous, + FAR const char *msg) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + /* Show the change from the previous time */ + + message("\n%s:\n", msg); + message(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + + /* Set up for the next test */ + + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Name: initMemoryUsage +///////////////////////////////////////////////////////////////////////////// + +static void initMemoryUsage(void) +{ + struct mallinfo mmcurrent; + + /* Get the current memory usage */ + +#ifdef CONFIG_CAN_PASS_STRUCTS + mmcurrent = mallinfo(); +#else + (void)mallinfo(&mmcurrent); +#endif + + g_mmInitial = mmcurrent.uordblks; + g_mmprevious = mmcurrent.uordblks; +} + +///////////////////////////////////////////////////////////////////////////// +// Public Functions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Name: nxheaders_main +///////////////////////////////////////////////////////////////////////////// + +int cglyphsliderhorizontal_main(int argc, char *argv[]) +{ + // Initialize memory monitor logic + + initMemoryUsage(); + + // Create an instance of the checkbox test + + message("csliderhorizontal_main: Create CGlyphSliderHorizontalTest instance\n"); + CGlyphSliderHorizontalTest *test = new CGlyphSliderHorizontalTest(); + updateMemoryUsage(g_mmprevious, "After creating CGlyphSliderHorizontalTest"); + + // Connect the NX server + + message("csliderhorizontal_main: Connect the CGlyphSliderHorizontalTest instance to the NX server\n"); + if (!test->connect()) + { + message("csliderhorizontal_main: Failed to connect the CGlyphSliderHorizontalTest instance to the NX server\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After connecting to the server"); + + // Create a window to draw into + + message("csliderhorizontal_main: Create a Window\n"); + if (!test->createWindow()) + { + message("csliderhorizontal_main: Failed to create a window\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a window"); + + // Create a slider + + message("csliderhorizontal_main: Create a Slider\n"); + CGlyphSliderHorizontal *slider = test->createSlider(); + if (!slider) + { + message("csliderhorizontal_main: Failed to create a slider\n"); + delete test; + return 1; + } + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a slider"); + + + // Set the slider minimum and maximum values + + slider->setMinimumValue(0); + slider->setMaximumValue(MAX_SLIDER); + slider->setValue(0); + message("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); + + // Show the initial state of the checkbox + + test->showSlider(slider); + + // Now move the slider up + + for (int i = 0; i <= MAX_SLIDER; i++) + { + slider->setValue(i); + test->showSlider(slider); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + usleep(1000 * 50); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider up"); + + // And move the slider down + + for (int i = MAX_SLIDER; i >= 0; i--) + { + slider->setValue(i); + test->showSlider(slider); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + usleep(1000 * 50); // The simulation needs this to let the X11 event loop run + } + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider down"); + sleep(1); + + // Clean up and exit + + message("csliderhorizontal_main: Clean-up and exit\n"); + delete slider; + updateMemoryUsage(g_mmprevious, "After deleting the slider"); + delete test; + updateMemoryUsage(g_mmprevious, "After deleting the test"); + updateMemoryUsage(g_mmInitial, "Final memory usage"); + return 0; +} diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx new file mode 100644 index 000000000..28f47af36 --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx @@ -0,0 +1,276 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx +// +// Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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. +// +////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "cbgwindow.hxx" +#include "cglyphsliderhorizontaltest.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Classes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Private Data +///////////////////////////////////////////////////////////////////////////// + +static const NXWidgets::nxwidget_pixel_t hilight_palette[8] = +{ + CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR, MKRGB( 61, 74,158), MKRGB(113,140,242), MKRGB(171,186,255), + MKRGB(255,255,255), MKRGB(119,130,199), MKRGB(177,219,255), MKRGB(202,224,255), +}; + +static const NXWidgets::SRlePaletteBitmapEntry vol_bitmap[] = +{ + { 22, 0}, /* Row 0 */ + { 9, 0}, { 5, 7}, { 8, 0}, /* Row 1 */ + { 6, 0}, { 2, 6}, { 6, 7}, { 2, 6}, { 1, 7}, { 5, 0}, /* Row 2 */ + { 4, 0}, { 2, 3}, { 9, 6}, { 3, 3}, { 4, 0}, /* Row 3 */ + { 3, 0}, { 5, 3}, { 6, 6}, { 5, 3}, { 3, 0}, /* Row 4 */ + { 3, 0}, { 16, 3}, { 3, 0}, /* Row 5 */ + { 2, 0}, { 2, 2}, { 13, 3}, { 3, 2}, { 2, 0}, /* Row 6 */ + { 1, 0}, { 1, 5}, { 4, 2}, { 10, 3}, { 4, 2}, { 1, 5}, + { 1, 0}, /* Row 7 */ + { 1, 0}, { 2, 5}, { 15, 2}, { 3, 5}, { 1, 0}, /* Row 8 */ + { 1, 0}, { 5, 5}, { 10, 2}, { 5, 5}, { 1, 0}, /* Row 9 */ + { 1, 0}, { 2, 1}, { 15, 5}, { 3, 1}, { 1, 0}, /* Row 10 */ + { 1, 0}, { 5, 1}, { 10, 5}, { 5, 1}, { 1, 0}, /* Row 11 */ + { 1, 0}, { 20, 1}, { 1, 0}, /* Row 12 */ + { 1, 0}, { 20, 1}, { 1, 0}, /* Row 13 */ + { 1, 0}, { 19, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ + { 1, 0}, { 1, 5}, { 7, 1}, { 1, 5}, { 4, 2}, { 6, 1}, + { 2, 0}, /* Row 15 */ + { 2, 0}, { 5, 1}, { 8, 2}, { 4, 1}, { 1, 5}, { 2, 0}, /* Row 16 */ + { 3, 0}, { 2, 1}, { 12, 2}, { 2, 1}, { 3, 0}, /* Row 17 */ + { 3, 0}, { 1, 5}, { 1, 1}, { 13, 2}, { 1, 5}, { 3, 0}, /* Row 18 */ + { 6, 0}, { 10, 2}, { 1, 5}, { 5, 0}, /* Row 19 */ + { 6, 0}, { 1, 5}, { 8, 2}, { 7, 0}, /* Row 20 */ + { 22, 0}, /* Row 21 */ +}; + +const struct NXWidgets::SRlePaletteBitmap g_mplayerVolBitmap = +{ + 16, + CONFIG_NXWIDGETS_FMT, + 8, + 22, + 22, + {hilight_palette, hilight_palette}, + vol_bitmap +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// CGlyphSliderHorizontalTest Method Implementations +///////////////////////////////////////////////////////////////////////////// + +// CGlyphSliderHorizontalTest Constructor + +CGlyphSliderHorizontalTest::CGlyphSliderHorizontalTest() +{ + // Initialize state data + + m_widgetControl = (CWidgetControl *)NULL; + m_bgWindow = (CBgWindow *)NULL; +} + +// CGlyphSliderHorizontalTest Descriptor + +CGlyphSliderHorizontalTest::~CGlyphSliderHorizontalTest(void) +{ + disconnect(); +} + +// Connect to the NX server + +bool CGlyphSliderHorizontalTest::connect(void) +{ + // Connect to the server + + bool nxConnected = CNxServer::connect(); + if (nxConnected) + { + // Set the background color + + if (!setBackgroundColor(CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR)) + { + message("CGlyphSliderHorizontalTest::connect: setBackgroundColor failed\n"); + } + } + + return nxConnected; +} + +// Disconnect from the NX server + +void CGlyphSliderHorizontalTest::disconnect(void) +{ + // Close the window + + if (m_bgWindow) + { + delete m_bgWindow; + m_bgWindow = (CBgWindow *)NULL; + } + + // Free the widget control instance + + if (m_widgetControl) + { + delete m_widgetControl; + m_widgetControl = (CWidgetControl *)NULL; + } + + // And disconnect from the server + + CNxServer::disconnect(); +} + +// Create the background window instance. This function illustrates +// the basic steps to instantiate any window: +// +// 1) Create a dumb CWigetControl instance +// 2) Pass the dumb CWidgetControl instance to the window constructor +// that inherits from INxWindow. This will "smarten" the CWidgetControl +// instance with some window knowlede +// 3) Call the open() method on the window to display the window. +// 4) After that, the fully smartened CWidgetControl instance can +// be used to generate additional widgets by passing it to the +// widget constructor + +bool CGlyphSliderHorizontalTest::createWindow(void) +{ + // Initialize the widget control using the default style + + m_widgetControl = new CWidgetControl((CWidgetStyle *)NULL); + + // Get an (uninitialized) instance of the background window as a class + // that derives from INxWindow. + + m_bgWindow = getBgWindow(m_widgetControl); + if (!m_bgWindow) + { + message("CGlyphSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + disconnect(); + return false; + } + + // Open (and initialize) the window + + bool success = m_bgWindow->open(); + if (!success) + { + message("CGlyphSliderHorizontalTest::createWindow: Failed to open background window\n"); + disconnect(); + return false; + } + + return true; +} + +// Create a slider in the center of the window + +CGlyphSliderHorizontal *CGlyphSliderHorizontalTest::createSlider(void) +{ + // Get the size of the display + + struct nxgl_size_s windowSize; + if (!m_bgWindow->getSize(&windowSize)) + { + printf("CGlyphSliderHorizontalTest::createSlider: Failed to get window size\n"); + disconnect(); + return false; + } + + // Put the slider in the center of the display + + nxgl_coord_t sliderWidth = windowSize.w >> 1; + nxgl_coord_t sliderX = windowSize.w >> 2; + + nxgl_coord_t sliderHeight = 26; + nxgl_coord_t sliderY = (windowSize.h - sliderHeight) >> 1; + + // Create the bitmap for the slider grip + + NXWidgets::CRlePaletteBitmap *pBitmap = new NXWidgets:: + CRlePaletteBitmap(&g_mplayerVolBitmap); + + // Create the slider + + CGlyphSliderHorizontal *slider = new CGlyphSliderHorizontal(m_widgetControl, + sliderX, sliderY, + sliderWidth, sliderHeight, + pBitmap, MKRGB(63, 90, 192)); + if (!slider) + { + printf("CGlyphSliderHorizontalTest::createSlider: Failed to create CGlyphSliderHorizontal\n"); + disconnect(); + } + return slider; +} + +// (Re-)draw the slider. + +void CGlyphSliderHorizontalTest::showSlider(CGlyphSliderHorizontal *slider) +{ + slider->enable(); // Un-necessary, the widget is enabled by default + slider->enableDrawing(); + slider->redraw(); +} diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx new file mode 100644 index 000000000..3311abe50 --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx @@ -0,0 +1,137 @@ +///////////////////////////////////////////////////////////////////////////// +// NxWidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx +// +// Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +// Author: Gregory Nutt +// +// 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, NxWidgets, nor the names of its contributors +// me 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 __UNITTESTS_CGLYPHSLIDERHORIZONTAL_CGLYPHSLIDERHORIZONTALTEST_HXX +#define __UNITTESTS_CGLYPHSLIDERHORIZONTAL_CGLYPHSLIDERHORIZONTALTEST_HXX + +///////////////////////////////////////////////////////////////////////////// +// Included Files +///////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include + +#include + +#include "nxconfig.hxx" +#include "cwidgetcontrol.hxx" +#include "ccallback.hxx" +#include "cbgwindow.hxx" +#include "cnxserver.hxx" +#include "cglyphsliderhorizontal.hxx" + +///////////////////////////////////////////////////////////////////////////// +// Definitions +///////////////////////////////////////////////////////////////////////////// +// Configuration //////////////////////////////////////////////////////////// + +#ifndef CONFIG_HAVE_CXX +# error "CONFIG_HAVE_CXX must be defined" +#endif + +#ifndef CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR +# define CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR +#endif + +// If debug is enabled, use the debug function, syslog() instead +// of printf() so that the output is synchronized. + +#ifdef CONFIG_DEBUG +# define message lowsyslog +#else +# define message printf +#endif + +///////////////////////////////////////////////////////////////////////////// +// Public Classes +///////////////////////////////////////////////////////////////////////////// + +using namespace NXWidgets; + +class CGlyphSliderHorizontalTest : public CNxServer +{ +private: + CWidgetControl *m_widgetControl; // The controlling widget for the window + CBgWindow *m_bgWindow; // Background window instance + +public: + // Constructor/destructors + + CGlyphSliderHorizontalTest(void); + ~CGlyphSliderHorizontalTest(void); + + // Initializer/unitializer. These methods encapsulate the basic steps for + // starting and stopping the NX server + + bool connect(void); + void disconnect(void); + + // Create a window. This method provides the general operations for + // creating a window that you can draw within. + // + // Those general operations are: + // 1) Create a dumb CWigetControl instance + // 2) Pass the dumb CWidgetControl instance to the window constructor + // that inherits from INxWindow. This will "smarten" the CWidgetControl + // instance with some window knowlede + // 3) Call the open() method on the window to display the window. + // 4) After that, the fully smartened CWidgetControl instance can + // be used to generate additional widgets by passing it to the + // widget constructor + + bool createWindow(void); + + // Create a slider in the center of the window + + CGlyphSliderHorizontal *createSlider(void); + + // (Re-)draw the slider. + + void showSlider(CGlyphSliderHorizontal *slider); +}; + +///////////////////////////////////////////////////////////////////////////// +// Public Data +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Public Function Prototypes +///////////////////////////////////////////////////////////////////////////// + +#endif // __UNITTESTS_CGLYPHSLIDERHORIZONTAL_CGLYPHSLIDERHORIZONTALTEST_HXX diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index 97d8d01ad..93984e1bc 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -331,7 +331,7 @@ void CGlyphSliderHorizontal::drawContents(CGraphicsPort * port) if (m_grip->getX() > halfGripWidth) port->drawFilledRect(getX() + 1 + halfGripWidth, getY() + halfHeight - halfBar + 1, - m_grip->getX() - halfGripWidth, m_barThickness - 2, + m_grip->getX() - getX() - halfGripWidth, m_barThickness - 2, color); // Fill in bar the area to the right of the grip From 4d79d88e76171a1872f3029e632098b4a15c5592 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 May 2013 14:45:31 -0600 Subject: [PATCH 127/390] Upate .gitignore files. Add .dSYM. Make sure / is present where needed. Add some missing .gitignore files --- UnitTests/CButton/.gitignore | 26 +++++++++----------- UnitTests/CButtonArray/.gitignore | 26 +++++++++----------- UnitTests/CCheckBox/.gitignore | 26 +++++++++----------- UnitTests/CGlyphButton/.gitignore | 26 +++++++++----------- UnitTests/CGlyphSliderHorizontal/.gitignore | 24 +++++++++--------- UnitTests/CImage/.gitignore | 26 +++++++++----------- UnitTests/CKeypad/.gitignore | 26 +++++++++----------- UnitTests/CLabel/.gitignore | 26 +++++++++----------- UnitTests/CLatchButton/.gitignore | 26 +++++++++----------- UnitTests/CLatchButtonArray/.gitignore | 26 +++++++++----------- UnitTests/CListBox/.gitignore | 26 +++++++++----------- UnitTests/CProgressBar/.gitignore | 26 +++++++++----------- UnitTests/CRadioButton/.gitignore | 26 +++++++++----------- UnitTests/CScrollbarHorizontal/.gitignore | 26 +++++++++----------- UnitTests/CScrollbarVertical/.gitignore | 26 +++++++++----------- UnitTests/CSliderHorizonal/.gitignore | 26 +++++++++----------- UnitTests/CSliderVertical/.gitignore | 26 +++++++++----------- UnitTests/CTextBox/.gitignore | 26 +++++++++----------- UnitTests/nxwm/.gitignore | 27 +++++++++------------ nxwm/.gitignore | 2 +- 20 files changed, 229 insertions(+), 266 deletions(-) diff --git a/UnitTests/CButton/.gitignore b/UnitTests/CButton/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CButton/.gitignore +++ b/UnitTests/CButton/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CButtonArray/.gitignore b/UnitTests/CButtonArray/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CButtonArray/.gitignore +++ b/UnitTests/CButtonArray/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CCheckBox/.gitignore b/UnitTests/CCheckBox/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CCheckBox/.gitignore +++ b/UnitTests/CCheckBox/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CGlyphButton/.gitignore b/UnitTests/CGlyphButton/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CGlyphButton/.gitignore +++ b/UnitTests/CGlyphButton/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CGlyphSliderHorizontal/.gitignore b/UnitTests/CGlyphSliderHorizontal/.gitignore index 22a689acd..bcc71b2ea 100644 --- a/UnitTests/CGlyphSliderHorizontal/.gitignore +++ b/UnitTests/CGlyphSliderHorizontal/.gitignore @@ -1,12 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CImage/.gitignore b/UnitTests/CImage/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CImage/.gitignore +++ b/UnitTests/CImage/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CKeypad/.gitignore b/UnitTests/CKeypad/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CKeypad/.gitignore +++ b/UnitTests/CKeypad/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CLabel/.gitignore b/UnitTests/CLabel/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CLabel/.gitignore +++ b/UnitTests/CLabel/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CLatchButton/.gitignore b/UnitTests/CLatchButton/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CLatchButton/.gitignore +++ b/UnitTests/CLatchButton/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CLatchButtonArray/.gitignore b/UnitTests/CLatchButtonArray/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CLatchButtonArray/.gitignore +++ b/UnitTests/CLatchButtonArray/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CListBox/.gitignore b/UnitTests/CListBox/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CListBox/.gitignore +++ b/UnitTests/CListBox/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CProgressBar/.gitignore b/UnitTests/CProgressBar/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CProgressBar/.gitignore +++ b/UnitTests/CProgressBar/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CRadioButton/.gitignore b/UnitTests/CRadioButton/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CRadioButton/.gitignore +++ b/UnitTests/CRadioButton/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CScrollbarHorizontal/.gitignore b/UnitTests/CScrollbarHorizontal/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CScrollbarHorizontal/.gitignore +++ b/UnitTests/CScrollbarHorizontal/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CScrollbarVertical/.gitignore b/UnitTests/CScrollbarVertical/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CScrollbarVertical/.gitignore +++ b/UnitTests/CScrollbarVertical/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CSliderHorizonal/.gitignore b/UnitTests/CSliderHorizonal/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CSliderHorizonal/.gitignore +++ b/UnitTests/CSliderHorizonal/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CSliderVertical/.gitignore b/UnitTests/CSliderVertical/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CSliderVertical/.gitignore +++ b/UnitTests/CSliderVertical/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/CTextBox/.gitignore b/UnitTests/CTextBox/.gitignore index c63935dc8..bcc71b2ea 100644 --- a/UnitTests/CTextBox/.gitignore +++ b/UnitTests/CTextBox/.gitignore @@ -1,14 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/UnitTests/nxwm/.gitignore b/UnitTests/nxwm/.gitignore index 83d78ed0d..bcc71b2ea 100644 --- a/UnitTests/nxwm/.gitignore +++ b/UnitTests/nxwm/.gitignore @@ -1,15 +1,12 @@ -Make.dep -.context -.depend -.built -*.swp -*.asm -*.rel -*.lst -*.sym -*.adb -*.lib -*.src - - - +/Make.dep +/.context +/.depend +/.built +/*.asm +/*.rel +/*.lst +/*.sym +/*.adb +/*.lib +/*.src +/*.dSYM diff --git a/nxwm/.gitignore b/nxwm/.gitignore index a3a70d2f3..72d6fc847 100644 --- a/nxwm/.gitignore +++ b/nxwm/.gitignore @@ -1,2 +1,2 @@ -nxwm-export.zip +/nxwm-export.zip From 90d063e9dcf6f8f2ddbfbecaaf87a621320e6b24 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 May 2013 15:02:04 -0600 Subject: [PATCH 128/390] .dSYM only needs to be in the same .gitignore files as .exe --- UnitTests/CButton/.gitignore | 1 - UnitTests/CButtonArray/.gitignore | 1 - UnitTests/CCheckBox/.gitignore | 1 - UnitTests/CGlyphButton/.gitignore | 1 - UnitTests/CGlyphSliderHorizontal/.gitignore | 1 - UnitTests/CImage/.gitignore | 1 - UnitTests/CKeypad/.gitignore | 1 - UnitTests/CLabel/.gitignore | 1 - UnitTests/CLatchButton/.gitignore | 1 - UnitTests/CLatchButtonArray/.gitignore | 1 - UnitTests/CListBox/.gitignore | 1 - UnitTests/CProgressBar/.gitignore | 1 - UnitTests/CRadioButton/.gitignore | 1 - UnitTests/CScrollbarHorizontal/.gitignore | 1 - UnitTests/CScrollbarVertical/.gitignore | 1 - UnitTests/CSliderHorizonal/.gitignore | 1 - UnitTests/CSliderVertical/.gitignore | 1 - UnitTests/CTextBox/.gitignore | 1 - UnitTests/nxwm/.gitignore | 1 - 19 files changed, 19 deletions(-) diff --git a/UnitTests/CButton/.gitignore b/UnitTests/CButton/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CButton/.gitignore +++ b/UnitTests/CButton/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CButtonArray/.gitignore b/UnitTests/CButtonArray/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CButtonArray/.gitignore +++ b/UnitTests/CButtonArray/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CCheckBox/.gitignore b/UnitTests/CCheckBox/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CCheckBox/.gitignore +++ b/UnitTests/CCheckBox/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CGlyphButton/.gitignore b/UnitTests/CGlyphButton/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CGlyphButton/.gitignore +++ b/UnitTests/CGlyphButton/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CGlyphSliderHorizontal/.gitignore b/UnitTests/CGlyphSliderHorizontal/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CGlyphSliderHorizontal/.gitignore +++ b/UnitTests/CGlyphSliderHorizontal/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CImage/.gitignore b/UnitTests/CImage/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CImage/.gitignore +++ b/UnitTests/CImage/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CKeypad/.gitignore b/UnitTests/CKeypad/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CKeypad/.gitignore +++ b/UnitTests/CKeypad/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CLabel/.gitignore b/UnitTests/CLabel/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CLabel/.gitignore +++ b/UnitTests/CLabel/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CLatchButton/.gitignore b/UnitTests/CLatchButton/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CLatchButton/.gitignore +++ b/UnitTests/CLatchButton/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CLatchButtonArray/.gitignore b/UnitTests/CLatchButtonArray/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CLatchButtonArray/.gitignore +++ b/UnitTests/CLatchButtonArray/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CListBox/.gitignore b/UnitTests/CListBox/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CListBox/.gitignore +++ b/UnitTests/CListBox/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CProgressBar/.gitignore b/UnitTests/CProgressBar/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CProgressBar/.gitignore +++ b/UnitTests/CProgressBar/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CRadioButton/.gitignore b/UnitTests/CRadioButton/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CRadioButton/.gitignore +++ b/UnitTests/CRadioButton/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CScrollbarHorizontal/.gitignore b/UnitTests/CScrollbarHorizontal/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CScrollbarHorizontal/.gitignore +++ b/UnitTests/CScrollbarHorizontal/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CScrollbarVertical/.gitignore b/UnitTests/CScrollbarVertical/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CScrollbarVertical/.gitignore +++ b/UnitTests/CScrollbarVertical/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CSliderHorizonal/.gitignore b/UnitTests/CSliderHorizonal/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CSliderHorizonal/.gitignore +++ b/UnitTests/CSliderHorizonal/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CSliderVertical/.gitignore b/UnitTests/CSliderVertical/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CSliderVertical/.gitignore +++ b/UnitTests/CSliderVertical/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/CTextBox/.gitignore b/UnitTests/CTextBox/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/CTextBox/.gitignore +++ b/UnitTests/CTextBox/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM diff --git a/UnitTests/nxwm/.gitignore b/UnitTests/nxwm/.gitignore index bcc71b2ea..105259c49 100644 --- a/UnitTests/nxwm/.gitignore +++ b/UnitTests/nxwm/.gitignore @@ -9,4 +9,3 @@ /*.adb /*.lib /*.src -/*.dSYM From d69d3cd0809f5a05128ee438e595d73851906ed1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 May 2013 16:49:20 -0600 Subject: [PATCH 129/390] Fix that way that NxWight UnitTests are reigistered as NSH builtin apps --- ChangeLog.txt | 3 +++ UnitTests/CButton/.gitignore | 1 - UnitTests/CButton/Makefile | 16 ++++++++++------ UnitTests/CButtonArray/.gitignore | 1 - UnitTests/CButtonArray/Makefile | 16 ++++++++++------ UnitTests/CCheckBox/.gitignore | 1 - UnitTests/CCheckBox/Makefile | 16 ++++++++++------ UnitTests/CGlyphButton/.gitignore | 1 - UnitTests/CGlyphButton/Makefile | 16 ++++++++++------ UnitTests/CGlyphSliderHorizontal/.gitignore | 1 - UnitTests/CGlyphSliderHorizontal/Makefile | 16 ++++++++++------ UnitTests/CImage/.gitignore | 1 - UnitTests/CImage/Makefile | 16 ++++++++++------ UnitTests/CKeypad/.gitignore | 1 - UnitTests/CKeypad/Makefile | 16 ++++++++++------ UnitTests/CLabel/.gitignore | 1 - UnitTests/CLabel/Makefile | 16 ++++++++++------ UnitTests/CLatchButton/.gitignore | 1 - UnitTests/CLatchButton/Makefile | 16 ++++++++++------ UnitTests/CLatchButtonArray/.gitignore | 1 - UnitTests/CLatchButtonArray/Makefile | 16 ++++++++++------ UnitTests/CListBox/.gitignore | 1 - UnitTests/CListBox/Makefile | 16 ++++++++++------ UnitTests/CProgressBar/.gitignore | 1 - UnitTests/CProgressBar/Makefile | 16 ++++++++++------ UnitTests/CRadioButton/.gitignore | 1 - UnitTests/CRadioButton/Makefile | 16 ++++++++++------ UnitTests/CScrollbarHorizontal/.gitignore | 1 - UnitTests/CScrollbarHorizontal/Makefile | 16 ++++++++++------ UnitTests/CScrollbarVertical/.gitignore | 1 - UnitTests/CScrollbarVertical/Makefile | 16 ++++++++++------ UnitTests/CSliderHorizonal/.gitignore | 1 - UnitTests/CSliderHorizonal/Makefile | 16 ++++++++++------ UnitTests/CSliderVertical/.gitignore | 1 - UnitTests/CSliderVertical/Makefile | 16 ++++++++++------ UnitTests/CTextBox/.gitignore | 1 - UnitTests/CTextBox/Makefile | 16 ++++++++++------ UnitTests/nxwm/.gitignore | 1 - UnitTests/nxwm/Makefile | 17 +++++++++++------ 39 files changed, 194 insertions(+), 133 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index dfd4c8c14..0737e5ca3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -366,3 +366,6 @@ NxWidgets::CGlyphSliderHorizontal class. From Ken Pettit (2013-5-17) . * NxWidgets::CGlyphSliderHorizontal: Fix a drawing error. From Ken Pettit (2013-5-17). +* UnitTests/*/Makefile and .gitignore: Update the way that NSH + the Unit Tests are registered as built-in NSH applications (2013-5-30). + diff --git a/UnitTests/CButton/.gitignore b/UnitTests/CButton/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CButton/.gitignore +++ b/UnitTests/CButton/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index ea7b5cf25..1547c705e 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/Unitests/CButton/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CButtonArray/.gitignore b/UnitTests/CButtonArray/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CButtonArray/.gitignore +++ b/UnitTests/CButtonArray/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 6bb490e34..535ceb948 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CButtonArray/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CCheckBox/.gitignore b/UnitTests/CCheckBox/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CCheckBox/.gitignore +++ b/UnitTests/CCheckBox/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index bd8293983..e2f6a051a 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CCheckBox/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CGlyphButton/.gitignore b/UnitTests/CGlyphButton/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CGlyphButton/.gitignore +++ b/UnitTests/CGlyphButton/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index b69382133..f0ebfa8b6 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CGlyphButton/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CGlyphSliderHorizontal/.gitignore b/UnitTests/CGlyphSliderHorizontal/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CGlyphSliderHorizontal/.gitignore +++ b/UnitTests/CGlyphSliderHorizontal/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CGlyphSliderHorizontal/Makefile b/UnitTests/CGlyphSliderHorizontal/Makefile index 5ab64b10d..96d825953 100644 --- a/UnitTests/CGlyphSliderHorizontal/Makefile +++ b/UnitTests/CGlyphSliderHorizontal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CGlyphSliderHorizontal/Makefile # -# Copyright (C) 2012-213 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CImage/.gitignore b/UnitTests/CImage/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CImage/.gitignore +++ b/UnitTests/CImage/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 08e22772f..f6416372f 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CImage/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CKeypad/.gitignore b/UnitTests/CKeypad/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CKeypad/.gitignore +++ b/UnitTests/CKeypad/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 0bbf837d8..ea5b0fb15 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CKeyPad/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CLabel/.gitignore b/UnitTests/CLabel/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CLabel/.gitignore +++ b/UnitTests/CLabel/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 4cd3d05d8..906e4754d 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLabel/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CLatchButton/.gitignore b/UnitTests/CLatchButton/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CLatchButton/.gitignore +++ b/UnitTests/CLatchButton/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 92909ab62..131a96f7a 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLatchButton/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CLatchButtonArray/.gitignore b/UnitTests/CLatchButtonArray/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CLatchButtonArray/.gitignore +++ b/UnitTests/CLatchButtonArray/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 412174ea2..c712142e3 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLatchButtonArray/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CListBox/.gitignore b/UnitTests/CListBox/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CListBox/.gitignore +++ b/UnitTests/CListBox/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 58d313b4f..5647002d6 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CListBox/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CProgressBar/.gitignore b/UnitTests/CProgressBar/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CProgressBar/.gitignore +++ b/UnitTests/CProgressBar/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index c57b0cf6e..90e09db72 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CProgressBar/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CRadioButton/.gitignore b/UnitTests/CRadioButton/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CRadioButton/.gitignore +++ b/UnitTests/CRadioButton/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 1278c8f53..c64cf008c 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CRadioButton/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CScrollbarHorizontal/.gitignore b/UnitTests/CScrollbarHorizontal/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CScrollbarHorizontal/.gitignore +++ b/UnitTests/CScrollbarHorizontal/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index c1edc8936..cf7bf3724 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CScrollbarHorizontal/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CScrollbarVertical/.gitignore b/UnitTests/CScrollbarVertical/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CScrollbarVertical/.gitignore +++ b/UnitTests/CScrollbarVertical/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index e3367e167..39a5d8528 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CScrollbarVertical/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CSliderHorizonal/.gitignore b/UnitTests/CSliderHorizonal/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CSliderHorizonal/.gitignore +++ b/UnitTests/CSliderHorizonal/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index c739fef96..d824ffe93 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CSliderHorizontal/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CSliderVertical/.gitignore b/UnitTests/CSliderVertical/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CSliderVertical/.gitignore +++ b/UnitTests/CSliderVertical/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 82f9c6fc6..a0b33a3ac 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CSliderVertical/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/CTextBox/.gitignore b/UnitTests/CTextBox/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/CTextBox/.gitignore +++ b/UnitTests/CTextBox/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index ddd16e95a..94cddcc9f 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CTextBox/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -142,15 +142,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -159,6 +162,7 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) diff --git a/UnitTests/nxwm/.gitignore b/UnitTests/nxwm/.gitignore index 105259c49..b14460823 100644 --- a/UnitTests/nxwm/.gitignore +++ b/UnitTests/nxwm/.gitignore @@ -1,5 +1,4 @@ /Make.dep -/.context /.depend /.built /*.asm diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 76007da1c..1fa22348e 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/Unitests/nxwm/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -172,15 +172,18 @@ else endif $(Q) touch .built -# Standard housekeeping targets +# Register NSH built-in application -.context: ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) +$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) -endif - $(Q) touch $@ -context: .context +context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +else +context: +endif + +# Standard housekeeping targets .depend: Makefile $(SRCS) $(Q) $(MKDEP) $(ROOTDEPPATH) $(CXX) -- $(CXXFLAGS) -- $(SRCS) >Make.dep @@ -189,10 +192,12 @@ context: .context depend: .depend clean: + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, .built) $(call CLEAN) distclean: clean + $(call DELFILE, $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat) $(call DELFILE, Make.dep) $(call DELFILE, .depend) From 1e7b43629a78d781967f1072f4e8b202f1d3ccc3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 4 Jun 2013 07:54:26 -0600 Subject: [PATCH 130/390] NxWidgets::CImage: Allow NULL bitmaps. From Petteri Aimonen --- ChangeLog.txt | 45 ++++++++++++++++++++----------------- libnxwidgets/src/cimage.cxx | 34 ++++++++++++++++++---------- 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0737e5ca3..f83364b9a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -347,25 +347,28 @@ 1.8 2013-xx-xx Gregory Nutt -* NxWM::CMediaPlayer: shell application for an MP3 Media Player with - Kconfig settings to enable it. I plan to write this app to help - develop and test the MP3 codec chip driver. It really doesn't do - anything yet except display a text box saying "Coming soon", and I - need to minimize the icon size a bit. From Ken Pettit (2013-5-11). -* NxWidgets/nxwm/src/glyph_mediaplayer.cxx: Smaller version of the - media player glyph. From Ken Pettit (2013-5-12). -* NxWidgets/nxwm/include/ccalibration.hxx and src/ccalibration.cxx: - Fix a race condition that would cause the calibration screen - to fail to come up when its icon was touched (From Ken Pettit, - 2013-5-12). -* Kconfig: Default priorities for NxWidget and NxWM threads - should be 100, not 50, to be consistent with other default priorities. -* NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: - New widgets added by Ken Pettit (2013-5-15). -* NxWidgets/UnitTests/CGlyphSliderHorizontal: Addes a unit test for the - NxWidgets::CGlyphSliderHorizontal class. From Ken Pettit (2013-5-17) . -* NxWidgets::CGlyphSliderHorizontal: Fix a drawing error. From Ken - Pettit (2013-5-17). -* UnitTests/*/Makefile and .gitignore: Update the way that NSH - the Unit Tests are registered as built-in NSH applications (2013-5-30). +* NxWM::CMediaPlayer: shell application for an MP3 Media Player with + Kconfig settings to enable it. I plan to write this app to help + develop and test the MP3 codec chip driver. It really doesn't do + anything yet except display a text box saying "Coming soon", and I + need to minimize the icon size a bit. From Ken Pettit (2013-5-11). +* NxWidgets/nxwm/src/glyph_mediaplayer.cxx: Smaller version of the + media player glyph. From Ken Pettit (2013-5-12). +* NxWidgets/nxwm/include/ccalibration.hxx and src/ccalibration.cxx: + Fix a race condition that would cause the calibration screen + to fail to come up when its icon was touched (From Ken Pettit, + 2013-5-12). +* Kconfig: Default priorities for NxWidget and NxWM threads + should be 100, not 50, to be consistent with other default priorities. +* NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: + New widgets added by Ken Pettit (2013-5-15). +* NxWidgets/UnitTests/CGlyphSliderHorizontal: Addes a unit test for the + NxWidgets::CGlyphSliderHorizontal class. From Ken Pettit (2013-5-17) . +* NxWidgets::CGlyphSliderHorizontal: Fix a drawing error. From Ken + Pettit (2013-5-17). +* UnitTests/*/Makefile and .gitignore: Update the way that NSH + the Unit Tests are registered as built-in NSH applications (2013-5-30). +* NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection + to prevent dereferencing the NULL pointer. From Petteri Aimonen + (2013-6-3). diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 9b3137129..b9b93ebb6 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -138,19 +138,29 @@ CImage::CImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, void CImage::getPreferredDimensions(CRect &rect) const { - nxgl_coord_t width = m_bitmap->getWidth(); - nxgl_coord_t height = m_bitmap->getHeight(); - - if (!m_flags.borderless) + if (!m_bitmap) { - width += (m_borderSize.left + m_borderSize.right); - height += (m_borderSize.top + m_borderSize.bottom); + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(0); + rect.setHeight(0); } + else + { + nxgl_coord_t width = m_bitmap->getWidth(); + nxgl_coord_t height = m_bitmap->getHeight(); - rect.setX(m_rect.getX()); - rect.setY(m_rect.getY()); - rect.setWidth(width); - rect.setHeight(height); + if (!m_flags.borderless) + { + width += (m_borderSize.left + m_borderSize.right); + height += (m_borderSize.top + m_borderSize.bottom); + } + + rect.setX(m_rect.getX()); + rect.setY(m_rect.getY()); + rect.setWidth(width); + rect.setHeight(height); + } } /** @@ -440,7 +450,7 @@ void CImage::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) void CImage::setImageLeft(nxgl_coord_t column) { - if (column > 0 && column <= m_bitmap->getWidth()) + if (m_bitmap && column > 0 && column <= m_bitmap->getWidth()) { m_origin.x = column; } @@ -455,7 +465,7 @@ void CImage::setImageLeft(nxgl_coord_t column) void CImage::setImageTop(nxgl_coord_t row) { - if (row > 0 && row <= m_bitmap->getHeight()) + if (m_bitmap && row > 0 && row <= m_bitmap->getHeight()) { m_origin.x = row; } From a6a07f3e45c7280ad37066cf0c9af6dd700aded0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 4 Jun 2013 08:02:06 -0600 Subject: [PATCH 131/390] Change auto-increment timing in NxWidgets::CNumericEdit. From Petteri Aimonen --- ChangeLog.txt | 5 ++++- libnxwidgets/src/cnumericedit.cxx | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f83364b9a..93112b7a0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -370,5 +370,8 @@ the Unit Tests are registered as built-in NSH applications (2013-5-30). * NxWidgets::CImage: Allow a NULL pointer for a bitmap. Add protection to prevent dereferencing the NULL pointer. From Petteri Aimonen - (2013-6-3). + (2013-6-4). +* NxWidgets::CNumericEdit: Delay before auto-incrementing now varies: + A longer delay is required to start auto-incrementing and speed increases + while pressed. From Petteri Aimonen (2013-6-4). diff --git a/libnxwidgets/src/cnumericedit.cxx b/libnxwidgets/src/cnumericedit.cxx index 993e86fb8..4a1f6a0e2 100644 --- a/libnxwidgets/src/cnumericedit.cxx +++ b/libnxwidgets/src/cnumericedit.cxx @@ -216,15 +216,23 @@ void CNumericEdit::handleActionEvent(const CWidgetEventArgs &e) { m_timercount++; - int increment = m_increment; + // Increment the value at increasing speed. + // Ignore the first 3 timer ticks so that single clicks + // only increment by one. + + int increment = 0; if (m_timercount > 50) { increment = m_increment * 100; } - else if (m_timercount > 10) + else if (m_timercount > 20) { increment = m_increment * 10; } + else if (m_timercount > 3) + { + increment = m_increment; + } if (m_button_minus->isClicked()) { From 981a0b1a78c6593be4a001f78a1bb43ebb7a0bc0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 4 Jun 2013 08:11:45 -0600 Subject: [PATCH 132/390] NxWM::CTaskbar: Add a method to redraw the task bar and the top application. From Petteri Aimonen --- ChangeLog.txt | 4 ++++ libnxwidgets/src/cnumericedit.cxx | 2 +- nxwm/include/ctaskbar.hxx | 24 ++++++++++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 93112b7a0..95a899011 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -374,4 +374,8 @@ * NxWidgets::CNumericEdit: Delay before auto-incrementing now varies: A longer delay is required to start auto-incrementing and speed increases while pressed. From Petteri Aimonen (2013-6-4). +* NxWM::CTaskbar: Add a method to redraw the taskbar and the current + application. This should only be necessary if the display loses + state due to e.g. powerdown or other manual intervention. From + Petteri Aimonen (2013-6-4). diff --git a/libnxwidgets/src/cnumericedit.cxx b/libnxwidgets/src/cnumericedit.cxx index 4a1f6a0e2..5030e782b 100644 --- a/libnxwidgets/src/cnumericedit.cxx +++ b/libnxwidgets/src/cnumericedit.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cnumericedit.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * Petteri Aimonen * diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 229e78b22..84c7b28f4 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/cnxtaskbar.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ namespace NxWM /** * This structure represents an application and its associated icon image */ - + struct STaskbarSlot { IApplication *app; /**< A reference to the icon */ @@ -108,7 +108,7 @@ namespace NxWM bool m_started; /**< True if window manager has been started */ /** - * Create a raw window. + * Create a raw window. * * 1) Create a dumb NXWidgets::CWidgetControl instance (See not). * 2) Pass the dumb NXWidgets::CWindowMessenger instance to the window constructor @@ -134,7 +134,7 @@ namespace NxWM * * @return A partially initialized application window instance. */ - + NXWidgets::CNxTkWindow *openFramedWindow(void); /** @@ -155,7 +155,7 @@ namespace NxWM virtual bool createTaskbarWindow(void); /** - * Create the background window. + * Create the background window. * * @return true on success */ @@ -163,7 +163,7 @@ namespace NxWM virtual bool createBackgroundWindow(void); /** - * Create the background image. + * Create the background image. * * @return true on success */ @@ -247,7 +247,7 @@ namespace NxWM /** * Connect to the server */ - + bool connect(void); /** @@ -409,7 +409,15 @@ namespace NxWM */ void getDisplaySize(FAR struct nxgl_size_s &size); - + + /** + * Force a redraw of the taskbar and current application. + * This should only be necessary if the display loses state due to e.g. powerdown + * or other manual intervention. + */ + + inline void redraw() { redrawTopApplication(); } + /** * Simulate a mouse click or release on the icon at index. This method * is only available during automated testing of NxWM. From c62e1b5cc4ac4f8f0be408a6d79906e1239c90df Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Jun 2013 14:30:00 -0600 Subject: [PATCH 133/390] Prep for 6.28 release --- ChangeLog.txt | 5 +++-- ReleaseNotes.txt | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 95a899011..5bcdc106f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -345,7 +345,7 @@ * NxWidgets::CNxWidgets: Allow overriding of the checkCollision() method. From Petteri Aimonen (2013-4-22). -1.8 2013-xx-xx Gregory Nutt +1.8 2013-06-14 Gregory Nutt * NxWM::CMediaPlayer: shell application for an MP3 Media Player with Kconfig settings to enable it. I plan to write this app to help @@ -362,7 +362,7 @@ should be 100, not 50, to be consistent with other default priorities. * NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: New widgets added by Ken Pettit (2013-5-15). -* NxWidgets/UnitTests/CGlyphSliderHorizontal: Addes a unit test for the +* NxWidgets/UnitTests/CGlyphSliderHorizontal: Adds a unit test for the NxWidgets::CGlyphSliderHorizontal class. From Ken Pettit (2013-5-17) . * NxWidgets::CGlyphSliderHorizontal: Fix a drawing error. From Ken Pettit (2013-5-17). @@ -379,3 +379,4 @@ state due to e.g. powerdown or other manual intervention. From Petteri Aimonen (2013-6-4). +1.9 2013-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index a856cad2c..7d7c2fb08 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -169,7 +169,7 @@ Additional new features and extended functionality in Version 1.5: * NxWM::CScrollingPanel::scrollChildren(): Avoid unnecessary redraws in CScrollingPanel * Kconfig: Added several "enabling" settings that must be selected to - override the default setting. + override the default setting. * UnitTests: Changes for compatibility with NuttX-6.25 Bugfixes: @@ -284,3 +284,38 @@ Bugfixes: * NxWM::CScrollbarPanel: Fix spelling error in class name: CScollbarPanel should be CScrollbarPanel * NxWidgets::CGlyphButton: Prevent drawing outside of the bitmap size. + +NxWidgets-1.8 +============= + +The 9th release of the NxWidgets package was made on June 14, 2013. This +release depends on NuttX-6.26 or above and should not be used with older +NuttX releases. + +Note: Most of the changes between 1.7 and 1.8 were the result of the +efforts of Ken Pettit and Petteri Aimonen. + +Additional new features and extended functionality in Version 1.8: + +* NxWM::CMediaPlayer: Shell application for an MP3 Media Player (from Ken + Pettit). +* NxWidgets::CGlyphSliderHorizontal and NxWidgets::CGlyphSliderHorizontalGrip: + New widgets added by Ken Pettit. Includes a Unit Test. +* NxWidgets::CImage: Allow a NULL pointer for a bitmap (from Petteri + Aimonen). +* NxWidgets::CNumericEdit: Delay before auto-incrementing now varies: A + longer delay is required to start auto-incrementing and speed increases + while pressed (from Petteri Aimonen). +* NxWM::CTaskbar: Add a method to redraw the taskbar and the current + application. This should only be necessary if the display loses state due + to e.g. powerdown or other manual intervention (from Petteri Aimonen). + +Bugfixes: + +* NxWM::CCalibration: Fix a race condition that would cause the calibration + screen to fail to come up when its icon was touched (from Ken Pettit). +* Default priorities for NxWidget and NxWM threads should be 100, not 50, to + be consistent with other default priorities. +* NxWidgets::CGlyphSliderHorizontal: Fix a drawing error (from Ken Pettit). +* Update the way that NSH the Unit Tests are registered as built-in NSH + applications. From 1393518ba76c0b689e2c74dee7e5ccc36df3a111 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Oct 2013 14:52:17 -0600 Subject: [PATCH 134/390] NxWM::CCalibration: Add an option to provide some instructions in the center of the calibration screen --- ChangeLog.txt | 5 + Kconfig | 40 +++++++ libnxwidgets/include/clabel.hxx | 12 +- libnxwidgets/include/cnxstring.hxx | 4 +- libnxwidgets/src/clabel.cxx | 12 +- nxwm/include/ccalibration.hxx | 8 +- nxwm/include/nxwmconfig.hxx | 25 +++- nxwm/src/ccalibration.cxx | 184 +++++++++++++++++++++++++---- 8 files changed, 250 insertions(+), 40 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5bcdc106f..28c35a9ab 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -380,3 +380,8 @@ Petteri Aimonen (2013-6-4). 1.9 2013-xx-xx Gregory Nutt + +* NxWM::CCalibration.cxx/hxx: If CONFIG_NXWM_CALIBRATION_MESSAGES is + defined then CCalibration will provide some instructions in the center + of the display (2013-10-14). + diff --git a/Kconfig b/Kconfig index a5d12f791..f2f50ac6f 100644 --- a/Kconfig +++ b/Kconfig @@ -718,6 +718,17 @@ endif comment "Calibration display settings" +config NXWM_CALIBRATION_MARGIN + int "Calibration Margin" + default 40 + ---help--- + The Calbration display consists of a target press offset from the edges + of the display by this number of pixels (in the horizontal direction) + or rows (in the vertical). The closer that you can comfortabley + position the press positions to the edge, the more accurate will be the + linear interpolation (provide that the hardware provides equally good + measurements near the edges). + config NXWM_CALIBRATION_CUSTOM_COLORS bool "Custom Calibration Colors" default n @@ -754,6 +765,35 @@ config NXWM_CALIBRATION_TOUCHEDCOLOR the touch is recorder. Default: RGB(255, 255, 96) (very light yellow) endif +config NXWM_CALIBRATION_MESSAGES + bool "Add Instructions in Center" + default n + ---help--- + By default, the calibration screen is clear excecpt for the + calibratino touchpoints. If this options are enabled, then + instructions when to touch and when to release the touch will + be added in the center of the display, + +if NXWM_CALIBRATION_MESSAGES + +config NXWM_CALIBRATION_CUSTOM_FONTID + bool "Use a Custom Font in Calibration Display" + default n + ---help--- + Set to override the system default font id (NXFONT_DEFAULT). + +if NXWM_CALIBRATION_CUSTOM_FONTID + +config NXWM_CALIBRATION_FONTID + int "Calibration Font ID" + default 0 + ---help--- + Use this default NxWidgets font ID instead of the system font ID + (NXFONT_DEFAULT). Default: 0 + +endif +endif + config NXWM_CUSTOM_CALIBRATION_ICON bool "Custom Calibration Icon" default n diff --git a/libnxwidgets/include/clabel.hxx b/libnxwidgets/include/clabel.hxx index 62ed1cda7..ccadb55ee 100644 --- a/libnxwidgets/include/clabel.hxx +++ b/libnxwidgets/include/clabel.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,11 +88,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -150,7 +150,7 @@ namespace NXWidgets * * @see redraw() */ - + virtual void drawContents(CGraphicsPort *port); /** @@ -240,7 +240,7 @@ namespace NXWidgets */ virtual void setTextAlignmentVert(TextAlignmentVert alignment); - + /** * Set the horizontal alignment of text within the label. * @@ -262,7 +262,7 @@ namespace NXWidgets { return m_vAlignment; } - + /** * Returns the string shown in the label. * diff --git a/libnxwidgets/include/cnxstring.hxx b/libnxwidgets/include/cnxstring.hxx index 91bd253c7..247919116 100644 --- a/libnxwidgets/include/cnxstring.hxx +++ b/libnxwidgets/include/cnxstring.hxx @@ -74,7 +74,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -122,7 +122,7 @@ namespace NXWidgets { private: friend class CStringIterator; - + int m_stringLength; /**< Number of characters in the string */ int m_allocatedSize; /**< Number of bytes allocated for this string */ int m_growAmount; /**< Number of chars that the string grows by diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx index 376d2ce8f..319b707b6 100644 --- a/libnxwidgets/src/clabel.cxx +++ b/libnxwidgets/src/clabel.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -119,7 +119,7 @@ CLabel::CLabel(CWidgetControl *pWidgetControl, m_vAlignment = TEXT_ALIGNMENT_VERT_CENTER; // The border thickness is 1 pixel - + m_borderSize.top = 1; m_borderSize.right = 1; m_borderSize.bottom = 1; @@ -272,7 +272,7 @@ void CLabel::setFont(CNxFont *font) * * @see redraw() */ - + void CLabel::drawContents(CGraphicsPort *port) { // Get the drawing area (excluding the border) @@ -318,7 +318,7 @@ void CLabel::drawContents(CGraphicsPort *port) CNxFont* font = getFont(); int height = font->getHeight(); int width = font->getStringWidth(m_text); - + // Draw the background (excluding the border and the text area) port->drawFilledRect(rect.getX(), rect.getY(), @@ -393,7 +393,7 @@ void CLabel::calculateTextPositionVertical(void) case TEXT_ALIGNMENT_VERT_TOP: m_align.y = 0; break; - + case TEXT_ALIGNMENT_VERT_BOTTOM: m_align.y = height - getFont()->getHeight(); break; @@ -409,7 +409,7 @@ void CLabel::calculateTextPositionHorizontal(void) { CRect rect; getClientRect(rect); - + nxgl_coord_t width = rect.getWidth(); switch (m_hAlignment) diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index f114a19a2..376462ca8 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ - + #ifndef __INCLUDE_CCALIBRATION_HXX #define __INCLUDE_CCALIBRATION_HXX @@ -48,6 +48,8 @@ #include "cnxstring.hxx" #include "cwidgeteventhandler.hxx" #include "cwidgetcontrol.hxx" +#include "clabel.hxx" +#include "cnxfont.hxx" #include "ctaskbar.hxx" #include "iapplication.hxx" @@ -146,6 +148,10 @@ namespace NxWM CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */ CFullScreenWindow *m_window; /**< The window for the calibration display */ CTouchscreen *m_touchscreen; /**< The touchscreen device */ +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + NXWidgets::CLabel *m_text; /**< Calibration message */ + NXWidgets::CNxFont *m_font; /**< The font used in the message */ +#endif pthread_t m_thread; /**< The calibration thread ID */ struct SCalibScreenInfo m_screenInfo; /**< Describes the current calibration display */ struct nxgl_point_s m_touchPos; /**< This is the last touch position */ diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index ad8e0e97d..65384341b 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -116,7 +116,7 @@ * * CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default: * MKRGB(148,189,215) - * CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR - Select background color. + * CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR - Select background color. * Default: MKRGB(206,227,241) * CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR - Color of the bright edge of a border. * Default: MKRGB(255,255,255) @@ -265,7 +265,7 @@ * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 4 rows * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue - * Used to communicated from CWindowMessenger to the start window thread. + * Used to communicated from CWindowMessenger to the start window thread. * Default: "/dev/nxwm" * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue * before blocking. Defualt 32 @@ -465,8 +465,10 @@ * CONFIG_NXWM_CALIBRATION_CIRCLECOLOR - The color of the circle in the * touchscreen calibration display. Default: MKRGB(255, 255, 255) (white) * CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR - The color of the circle in the - * touchscreen calibration display after the touch is recorder. Default: + * touchscreen calibration display after the touch is recorder. Default: * MKRGB(255, 255, 96) (very light yellow) + * CONFIG_NXWM_CALIBRATION_FONTID - Use this default NxWidgets font ID + * instead of the system font ID (NXFONT_DEFAULT). * CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen * calibration application. Default: NxWM::g_calibrationBitmap * CONFIG_NXWM_CALIBRATION_SIGNO - The realtime signal used to wake up the @@ -475,6 +477,13 @@ * thread. Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Calibration listener thread stack * size. Default 2048 + * CONFIG_NXWM_CALIBRATION_MARGIN + * The Calbration display consists of a target press offset from the edges + * of the display by this number of pixels (in the horizontal direction) + * or rows (in the vertical). The closer that you can comfortabley + * position the press positions to the edge, the more accurate will be the + * linear interpolation (provide that the hardware provides equally good + * measurements near the edges). */ #ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR @@ -493,6 +502,10 @@ # define CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR MKRGB(255, 255, 96) #endif +#ifndef CONFIG_NXWM_CALIBRATION_FONTID +# define CONFIG_NXWM_CALIBRATION_FONTID NXFONT_DEFAULT +#endif + #ifndef CONFIG_NXWM_CALIBRATION_ICON # define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap #endif @@ -509,6 +522,10 @@ # define CONFIG_NXWM_CALIBRATION_LISTENERSTACK 2048 #endif +#ifndef CONFIG_NXWM_CALIBRATION_MARGIN +# define CONFIG_NXWM_CALIBRATION_MARGIN 40 +#endif + /* Hexcalculator applications ***********************************************/ /** * Calibration display settings: diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 04233d5ef..d30ab690e 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -64,20 +64,30 @@ * Positional/size data for the calibration lines and circles */ -#define CALIBRATION_LEFTX 40 -#define CALIBRATION_RIGHTX (windowSize.w - 41) -#define CALIBRATION_TOPY 40 -#define CALIBRATION_BOTTOMY (windowSize.h - 41) +#define CALIBRATION_LEFTX CONFIG_NXWM_CALIBRATION_MARGIN +#define CALIBRATION_RIGHTX (windowSize.w - CONFIG_NXWM_CALIBRATION_MARGIN + 1) +#define CALIBRATION_TOPY CONFIG_NXWM_CALIBRATION_MARGIN +#define CALIBRATION_BOTTOMY (windowSize.h - CONFIG_NXWM_CALIBRATION_MARGIN + 1) #define CALIBRATION_CIRCLE_RADIUS 16 #define CALIBRATION_LINE_THICKNESS 2 /**************************************************************************** - * CCalibration Implementation Classes + * Private Data ****************************************************************************/ using namespace NxWM; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES +static const char g_touchmsg[] = "Touch"; +static const char g_againmsg[] = "Again"; +static const char g_okmsg[] = "OK"; +#endif + +/**************************************************************************** + * CCalibration Implementation Classes + ****************************************************************************/ + /** * CCalibration Constructor * @@ -99,6 +109,14 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window, m_calthread = CALTHREAD_NOTRUNNING; m_calphase = CALPHASE_NOT_STARTED; m_touched = false; + + // Nullify widgets that will be instantiated when the calibration thread + // is started + +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text = (NXWidgets::CLabel *)0; + m_font = (NXWidgets::CNxFont *)0; +#endif } /** @@ -180,7 +198,7 @@ void CCalibration::stop(void) if (m_thread != 0) { - // Is the calibration thread running? + // Is the calibration thread running? if (isRunning()) { @@ -191,10 +209,15 @@ void CCalibration::stop(void) m_calthread = CALTHREAD_STOPREQUESTED; // Try to wake up the calibration thread so that it will see our - // terminatin request + // termination request - gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); + gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); + + // Wait for the calibration thread to exit + + FAR pthread_addr_t value; + (void)pthread_join(m_thread, &value); } } } @@ -328,6 +351,9 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) if (!m_touched) { m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_okmsg); +#endif showCalibration(); m_touched = true; } @@ -361,8 +387,11 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) else { // No... restore the un-highlighted circle - + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(""); +#endif showCalibration(); } } @@ -415,10 +444,6 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) return false; } - // Detach from the pthread so that we do not have any memory leaks - - (void)pthread_detach(m_thread); - gvdbg("Calibration thread m_calthread=%d\n", (int)m_calthread); return true; } @@ -436,12 +461,87 @@ FAR void *CCalibration::calibration(FAR void *arg) CCalibration *This = (CCalibration *)arg; bool stalled = true; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + // Create widgets that will be used in the calibration display + // Select a font for the calculator + + This->m_font = new NXWidgets:: + CNxFont((nx_fontid_e)CONFIG_NXWM_CALIBRATION_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); + if (!This->m_font) + { + gdbg("ERROR failed to create font\n"); + return false; + } + + // Recover the window instance contained in the application window + + NXWidgets::INxWindow *window = This->m_window->getWindow(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + gdbg("ERROR: Failed to get window size\n"); + delete This->m_font; + This->m_font = (NXWidgets::CNxFont *)0; + return false; + } + + // How big can the label be? + + struct nxgl_size_s labelSize; + labelSize.w = (windowSize.w - 2*CONFIG_NXWM_CALIBRATION_MARGIN - 20); + labelSize.h = This->m_font->getHeight() + 2*4; + + // Where should the label be? + + struct nxgl_point_s labelPos; + labelPos.x = ((windowSize.w - labelSize.w) / 2); + labelPos.y = ((windowSize.h - labelSize.h) / 2); + + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = This->m_window->getWidgetControl(); + + // Create a label to show the calibration message. + + This->m_text = new NXWidgets:: + CLabel(control, labelPos.x, labelPos.y, labelSize.w, labelSize.h, ""); + + if (!This->m_text) + { + gdbg("ERROR: Failed to create CLabel\n"); + delete This->m_font; + This->m_font = (NXWidgets::CNxFont *)0; + return false; + } + + // No border + + This->m_text->setBorderless(true); + + // Center text + + This->m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_CENTER); + + // Disable drawing and events until we are asked to redraw the window + + This->m_text->disableDrawing(); + This->m_text->setRaisesEvents(false); + + // Select the font + + This->m_text->setFont(This->m_font); +#endif + // The calibration thread is now running This->m_calthread = CALTHREAD_RUNNING; This->m_calphase = CALPHASE_NOT_STARTED; gvdbg("Started: m_calthread=%d\n", (int)This->m_calthread); - + // Loop until calibration completes or we have been requested to terminate while (This->m_calthread != CALTHREAD_STOPREQUESTED && @@ -468,7 +568,7 @@ FAR void *CCalibration::calibration(FAR void *arg) } // The calibration thread will stall if has been asked to hide the - // display. While stalled, we will just sleep for a bit abd test + // display. While stalled, we will just sleep for a bit and test // the state again. If we are re-awakened by a redraw(), then we // will be given a signal which will wake us up immediately. // @@ -494,14 +594,33 @@ FAR void *CCalibration::calibration(FAR void *arg) if (This->m_calthread == CALTHREAD_RUNNING) { This->touchscreenInput(sample); - } + } } } + // Hide the message + +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + This->m_text->setText(""); + This->m_text->enableDrawing(); + This->m_text->redraw(); + This->m_text->disableDrawing(); +#endif + // Perform the final steps of calibration This->finishCalibration(); + // Destroy widgets + +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + delete This->m_text; + This->m_text = (NXWidgets::CLabel *)0; + + delete This->m_font; + This->m_font = (NXWidgets::CNxFont *)0; +#endif + gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread); return (FAR void *)0; } @@ -552,6 +671,9 @@ void CCalibration::stateMachine(void) m_screenInfo.pos.y = CALIBRATION_TOPY; m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_touchmsg); +#endif showCalibration(); // Then set up the current state @@ -568,7 +690,7 @@ void CCalibration::stateMachine(void) m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x; m_calibData[CALIB_UPPER_LEFT_INDEX].y = m_touchPos.y; - // Clear the previous screen by re-drawing it using the backgro9und + // Clear the previous screen by re-drawing it using the background // color. That is much faster than clearing the whole display m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; @@ -581,6 +703,9 @@ void CCalibration::stateMachine(void) m_screenInfo.pos.y = CALIBRATION_TOPY; m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_touchmsg); +#endif showCalibration(); // Then set up the current state @@ -610,6 +735,9 @@ void CCalibration::stateMachine(void) m_screenInfo.pos.y = CALIBRATION_BOTTOMY; m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_touchmsg); +#endif showCalibration(); // Then set up the current state @@ -639,6 +767,9 @@ void CCalibration::stateMachine(void) m_screenInfo.pos.y = CALIBRATION_BOTTOMY; m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_touchmsg); +#endif showCalibration(); // Then set up the current state @@ -660,6 +791,9 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->setText(g_touchmsg); +#endif showCalibration(); // Inform any waiter that calibration is complete @@ -711,14 +845,22 @@ void CCalibration::showCalibration(void) m_screenInfo.circleFillColor); /* Draw horizontal line */ - + port->drawFilledRect(0, m_screenInfo.pos.y, windowSize.w, CALIBRATION_LINE_THICKNESS, m_screenInfo.lineColor); /* Draw vertical line */ - + port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h, m_screenInfo.lineColor); + + /* Show the touchscreen message */ + +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + m_text->enableDrawing(); + m_text->redraw(); + m_text->disableDrawing(); +#endif } /** @@ -733,7 +875,7 @@ void CCalibration::finishCalibration(void) if (m_calphase == CALPHASE_COMPLETE) { // Yes... Get the final Calibration data - + struct SCalibrationData caldata; if (createCalibrationData(caldata)) { @@ -773,7 +915,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gdbg("NXWidgets::INxWindow::getSize failed\n"); + gdbg("NXWidgets::INxWindow::getSize failed\n"); return false; } From 31456e2e6a818c84e877c587cabd3249a447b8e4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Oct 2013 18:35:23 -0600 Subject: [PATCH 135/390] NxWM::CCalibration: Add logic to collect and average samples, optionally discarding the most extreem values --- ChangeLog.txt | 3 + Kconfig | 32 ++- nxwm/include/ccalibration.hxx | 31 +++ nxwm/include/nxwmconfig.hxx | 30 +++ nxwm/src/ccalibration.cxx | 375 ++++++++++++++++++++++++++-------- 5 files changed, 386 insertions(+), 85 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 28c35a9ab..9f7c6a90e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -384,4 +384,7 @@ * NxWM::CCalibration.cxx/hxx: If CONFIG_NXWM_CALIBRATION_MESSAGES is defined then CCalibration will provide some instructions in the center of the display (2013-10-14). +* NxWM::CCalibration.cxx/hxx: Add options to collect and average + multiple samples at each location. Also logic to discard the most + extreme samples before averaging (2013-10-14). diff --git a/Kconfig b/Kconfig index f2f50ac6f..e1ca03169 100644 --- a/Kconfig +++ b/Kconfig @@ -791,8 +791,36 @@ config NXWM_CALIBRATION_FONTID Use this default NxWidgets font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif -endif +endif # NXWM_CALIBRATION_CUSTOM_FONTID + +config NXWM_CALIBRATION_AVERAGE + bool "Average Samples" + default n + ---help--- + Collect multiple samples at each calibration position and use the + average of the samples. NOTE that is option is not available if we are + not providing instructions on the display. That is because it would + be impossible to know what to do if we are collecting multiple samples + at each position. + +if NXWM_CALIBRATION_AVERAGE + +config NXWM_CALIBRATION_NSAMPLES + int "Number of Samples in Average" + default 4 + range 2 255 + ---help--- + This is the number of samples to use in the average. + +config NXWM_CALIBRATION_DISCARD_MINMAX + bool "Discard minimum and maximum values" + default n + ---help--- + Discard the largest and smallest values before averaging. This + setting is ignored if NXWM_CALIBRATION_NSAMPLES < 3. + +endif # NXWM_CALIBRATION_AVERAGE +endif # NXWM_CALIBRATION_MESSAGES config NXWM_CUSTOM_CALIBRATION_ICON bool "Custom Calibration Icon" diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 376462ca8..30a48f7eb 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -160,6 +160,10 @@ namespace NxWM bool m_stop; /**< True: We have been asked to stop the calibration */ bool m_touched; /**< True: The screen is touched */ uint8_t m_touchId; /**< The ID of the touch */ +#if CONFIG_NXWM_CALIBRATION_AVERAGE + uint8_t m_nsamples; /**< Number of samples collected so far at this position */ + struct nxgl_point_s m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES]; +#endif struct nxgl_point_s m_calibData[CALIB_DATA_POINTS]; /** @@ -170,6 +174,22 @@ namespace NxWM void touchscreenInput(struct touch_sample_s &sample); +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES + /** + * Create widgets need by the calibration thread. + * + * @return True if the widgets were successfully created. + */ + + bool createWidgets(void); + + /** + * Destroy widgets created for the calibration thread. + */ + + void destroyWidgets(void); +#endif + /** * Start the calibration thread. * @@ -229,6 +249,17 @@ namespace NxWM static FAR void *calibration(FAR void *arg); + /** + * Accumulate and average touch sample data + * + * @param average. When the averaged data is available, return it here + * @return True: Average data is available; False: Need to collect more samples + */ + +#if CONFIG_NXWM_CALIBRATION_AVERAGE + bool averageSamples(struct nxgl_point_s &average); +#endif + /** * This is the calibration state machine. It is called initially and then * as new touchscreen data is received. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 65384341b..6e540fefc 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -526,6 +526,36 @@ # define CONFIG_NXWM_CALIBRATION_MARGIN 40 #endif +// Calibration sample averaging + +#ifndef CONFIG_NXWM_CALIBRATION_AVERAGE +# undef CONFIG_NXWM_CALIBRATION_AVERAGE +# undef CONFIG_NXWM_CALIBRATION_NSAMPLES +# define CONFIG_NXWM_CALIBRATION_NSAMPLES 1 +# undef CONFIG_NXWM_CALIBRATION_DISCARD_MINMAX +#endif + +#if !defined(CONFIG_NXWM_CALIBRATION_NSAMPLES) || CONFIG_NXWM_CALIBRATION_NSAMPLES < 2 +# undef CONFIG_NXWM_CALIBRATION_AVERAGE +# undef CONFIG_NXWM_CALIBRATION_NSAMPLES +# define CONFIG_NXWM_CALIBRATION_NSAMPLES 1 +# undef CONFIG_NXWM_CALIBRATION_DISCARD_MINMAX +#endif + +#if CONFIG_NXWM_CALIBRATION_NSAMPLES < 3 +# undef CONFIG_NXWM_CALIBRATION_DISCARD_MINMAX +#endif + +#if CONFIG_NXWM_CALIBRATION_NSAMPLES > 255 +# define CONFIG_NXWM_CALIBRATION_NSAMPLES 255 +#endif + +#ifdef CONFIG_NXWM_CALIBRATION_DISCARD_MINMAX +# define NXWM_CALIBRATION_NAVERAGE (CONFIG_NXWM_CALIBRATION_NSAMPLES - 2) +#else +# define NXWM_CALIBRATION_NAVERAGE CONFIG_NXWM_CALIBRATION_NSAMPLES +#endif + /* Hexcalculator applications ***********************************************/ /** * Calibration display settings: diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index d30ab690e..416f15883 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -79,9 +80,9 @@ using namespace NxWM; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES -static const char g_touchmsg[] = "Touch"; -static const char g_againmsg[] = "Again"; -static const char g_okmsg[] = "OK"; +static const char g_touchMsg[] = "Touch"; +static const char g_againMsg[] = "Again"; +static const char g_okMsg[] = "OK"; #endif /**************************************************************************** @@ -352,7 +353,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) { m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_okmsg); + m_text->setText(g_okMsg); #endif showCalibration(); m_touched = true; @@ -402,6 +403,113 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) } } +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES +/** + * Create widgets need by the calibration thread. + * + * @return True if the widgets were successfully created. + */ + +bool CCalibration::createWidgets(void) +{ + // Select a font for the calculator + + m_font = new NXWidgets:: + CNxFont((nx_fontid_e)CONFIG_NXWM_CALIBRATION_FONTID, + CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); + if (!m_font) + { + gdbg("ERROR failed to create font\n"); + return false; + } + + // Recover the window instance contained in the application window + + NXWidgets::INxWindow *window = m_window->getWindow(); + + // Get the size of the window + + struct nxgl_size_s windowSize; + if (!window->getSize(&windowSize)) + { + gdbg("ERROR: Failed to get window size\n"); + delete m_font; + m_font = (NXWidgets::CNxFont *)0; + return false; + } + + // How big is the biggest string we might display? + + nxgl_coord_t maxStringWidth = m_font->getStringWidth(g_touchMsg); + nxgl_coord_t altStringWidth = m_font->getStringWidth(g_againMsg); + + if (altStringWidth > maxStringWidth) + { + maxStringWidth = altStringWidth; + } + + // How big can the label be? + + struct nxgl_size_s labelSize; + labelSize.w = maxStringWidth + 2*4; + labelSize.h = m_font->getHeight() + 2*4; + + // Where should the label be? + + struct nxgl_point_s labelPos; + labelPos.x = ((windowSize.w - labelSize.w) / 2); + labelPos.y = ((windowSize.h - labelSize.h) / 2); + + // Get the widget control associated with the application window + + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Create a label to show the calibration message. + + m_text = new NXWidgets:: + CLabel(control, labelPos.x, labelPos.y, labelSize.w, labelSize.h, ""); + + if (!m_text) + { + gdbg("ERROR: Failed to create CLabel\n"); + delete m_font; + m_font = (NXWidgets::CNxFont *)0; + return false; + } + + // No border + + m_text->setBorderless(true); + + // Center text + + m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_CENTER); + + // Disable drawing and events until we are asked to redraw the window + + m_text->disableDrawing(); + m_text->setRaisesEvents(false); + + // Select the font + + m_text->setFont(m_font); + return true; +} + +/** + * Destroy widgets created for the calibration thread. + */ + +void CCalibration::destroyWidgets(void) +{ + delete m_text; + m_text = (NXWidgets::CLabel *)0; + + delete m_font; + m_font = (NXWidgets::CNxFont *)0; +} +#endif + /** * Start the calibration thread. * @@ -463,77 +571,16 @@ FAR void *CCalibration::calibration(FAR void *arg) #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES // Create widgets that will be used in the calibration display - // Select a font for the calculator - This->m_font = new NXWidgets:: - CNxFont((nx_fontid_e)CONFIG_NXWM_CALIBRATION_FONTID, - CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); - if (!This->m_font) + if (!This->createWidgets()) { - gdbg("ERROR failed to create font\n"); + gdbg("ERROR failed to create widgets\n"); return false; } - // Recover the window instance contained in the application window + // No samples have yet been collected - NXWidgets::INxWindow *window = This->m_window->getWindow(); - - // Get the size of the window - - struct nxgl_size_s windowSize; - if (!window->getSize(&windowSize)) - { - gdbg("ERROR: Failed to get window size\n"); - delete This->m_font; - This->m_font = (NXWidgets::CNxFont *)0; - return false; - } - - // How big can the label be? - - struct nxgl_size_s labelSize; - labelSize.w = (windowSize.w - 2*CONFIG_NXWM_CALIBRATION_MARGIN - 20); - labelSize.h = This->m_font->getHeight() + 2*4; - - // Where should the label be? - - struct nxgl_point_s labelPos; - labelPos.x = ((windowSize.w - labelSize.w) / 2); - labelPos.y = ((windowSize.h - labelSize.h) / 2); - - // Get the widget control associated with the application window - - NXWidgets::CWidgetControl *control = This->m_window->getWidgetControl(); - - // Create a label to show the calibration message. - - This->m_text = new NXWidgets:: - CLabel(control, labelPos.x, labelPos.y, labelSize.w, labelSize.h, ""); - - if (!This->m_text) - { - gdbg("ERROR: Failed to create CLabel\n"); - delete This->m_font; - This->m_font = (NXWidgets::CNxFont *)0; - return false; - } - - // No border - - This->m_text->setBorderless(true); - - // Center text - - This->m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_CENTER); - - // Disable drawing and events until we are asked to redraw the window - - This->m_text->disableDrawing(); - This->m_text->setRaisesEvents(false); - - // Select the font - - This->m_text->setFont(This->m_font); + This->m_nsamples = 0; #endif // The calibration thread is now running @@ -611,20 +658,125 @@ FAR void *CCalibration::calibration(FAR void *arg) This->finishCalibration(); +#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES // Destroy widgets -#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - delete This->m_text; - This->m_text = (NXWidgets::CLabel *)0; - - delete This->m_font; - This->m_font = (NXWidgets::CNxFont *)0; + This->destroyWidgets(); #endif gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread); return (FAR void *)0; } +/** + * Accumulate and average touch sample data + * + * @param average. When the averaged data is available, return it here + * @return True: Average data is available; False: Need to collect more samples + */ + +#if CONFIG_NXWM_CALIBRATION_AVERAGE +bool CCalibration::averageSamples(struct nxgl_point_s &average) +{ + // Have we started collecting sample data? */ + + // Save the sample data + + gvdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); + + m_sampleData[m_nsamples].x = m_touchPos.x; + m_sampleData[m_nsamples].y = m_touchPos.y; + m_nsamples++; + + // Have all of the samples been collected? + + if (m_nsamples < CONFIG_NXWM_CALIBRATION_NSAMPLES) + { + // Not yet... return false + + return false; + } + + // Yes.. we have all of the samples +#ifdef CONFIG_NXWM_CALIBRATION_NSAMPLES + // Discard the smallest X and Y values + + int xValue = INT_MAX; + int xIndex = -1; + + int yValue = INT_MAX; + int yIndex = -1; + + for (int i = 0; i < CONFIG_NXWM_CALIBRATION_NSAMPLES; i++) + { + if ((int)m_sampleData[i].x < xValue) + { + xValue = (int)m_sampleData[i].x; + xIndex = i; + } + + if ((int)m_sampleData[i].y < yValue) + { + yValue = (int)m_sampleData[i].y; + yIndex = i; + } + } + + m_sampleData[xIndex].x = m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES-1].x; + m_sampleData[yIndex].y = m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES-1].y; + + // Discard the largest X and Y values + + xValue = -1; + xIndex = -1; + + yValue = -1; + yIndex = -1; + + for (int i = 0; i < CONFIG_NXWM_CALIBRATION_NSAMPLES-1; i++) + { + if ((int)m_sampleData[i].x > xValue) + { + xValue = (int)m_sampleData[i].x; + xIndex = i; + } + + if ((int)m_sampleData[i].y > yValue) + { + yValue = (int)m_sampleData[i].y; + yIndex = i; + } + } + + m_sampleData[xIndex].x = m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES-2].x; + m_sampleData[yIndex].y = m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES-2].y; +#endif + +#if NXWM_CALIBRATION_NAVERAGE > 1 + // Calculate the average of the remaining values + + long xaccum = 0; + long yaccum = 0; + + for (int i = 0; i < NXWM_CALIBRATION_NAVERAGE; i++) + { + xaccum += m_sampleData[i].x; + yaccum += m_sampleData[i].y; + } + + average.x = xaccum / NXWM_CALIBRATION_NAVERAGE; + average.y = yaccum / NXWM_CALIBRATION_NAVERAGE; +#else + average.x = m_sampleData[0].x; + average.y = m_sampleData[0].y; +#endif + + gvdbg("Average: Touch x: %d y: %d\n", average.x, average.y); + m_nsamples = 0; + return true; +} +#endif + /** * This is the calibration state machine. It is called initially and then * as new touchscreen data is received. @@ -634,6 +786,43 @@ void CCalibration::stateMachine(void) { gvdbg("Old m_calphase=%d\n", m_calphase); +#if CONFIG_NXWM_CALIBRATION_AVERAGE + // Are we collecting samples? + + struct nxgl_point_s average; + + switch (m_calphase) + { + case CALPHASE_UPPER_LEFT: + case CALPHASE_UPPER_RIGHT: + case CALPHASE_LOWER_RIGHT: + case CALPHASE_LOWER_LEFT: + { + // Yes... Have all of the samples been collected? + + if (!averageSamples(average)) + { + // Not yet... Show the calibration screen again with the circle + // in the normal color and an instruction to touch the circle again. + + m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; + m_text->setText(g_againMsg); + showCalibration(); + + // And wait for the next touch + + return; + } + } + break; + + // No... we are not collecting data now + + default: + break; + } +#endif + // Recover the window instance contained in the full screen window NXWidgets::INxWindow *window = m_window->getWindow(); @@ -672,7 +861,7 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_touchmsg); + m_text->setText(g_touchMsg); #endif showCalibration(); @@ -687,8 +876,13 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_UPPER_LEFT state. // Save the touch data and set up the next calibration display +#if CONFIG_NXWM_CALIBRATION_AVERAGE + m_calibData[CALIB_UPPER_LEFT_INDEX].x = average.x; + m_calibData[CALIB_UPPER_LEFT_INDEX].y = average.y; +#else m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x; m_calibData[CALIB_UPPER_LEFT_INDEX].y = m_touchPos.y; +#endif // Clear the previous screen by re-drawing it using the background // color. That is much faster than clearing the whole display @@ -704,7 +898,7 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_touchmsg); + m_text->setText(g_touchMsg); #endif showCalibration(); @@ -719,8 +913,13 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_UPPER_RIGHT state. // Save the touch data and set up the next calibration display +#if CONFIG_NXWM_CALIBRATION_AVERAGE + m_calibData[CALIB_UPPER_RIGHT_INDEX].x = average.x; + m_calibData[CALIB_UPPER_RIGHT_INDEX].y = average.y; +#else m_calibData[CALIB_UPPER_RIGHT_INDEX].x = m_touchPos.x; m_calibData[CALIB_UPPER_RIGHT_INDEX].y = m_touchPos.y; +#endif // Clear the previous screen by re-drawing it using the backgro9und // color. That is much faster than clearing the whole display @@ -736,7 +935,7 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_touchmsg); + m_text->setText(g_touchMsg); #endif showCalibration(); @@ -751,8 +950,13 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_LOWER_RIGHT state. // Save the touch data and set up the next calibration display +#if CONFIG_NXWM_CALIBRATION_AVERAGE + m_calibData[CALIB_LOWER_RIGHT_INDEX].x = average.x; + m_calibData[CALIB_LOWER_RIGHT_INDEX].y = average.y; +#else m_calibData[CALIB_LOWER_RIGHT_INDEX].x = m_touchPos.x; m_calibData[CALIB_LOWER_RIGHT_INDEX].y = m_touchPos.y; +#endif // Clear the previous screen by re-drawing it using the backgro9und // color. That is much faster than clearing the whole display @@ -768,7 +972,7 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_touchmsg); + m_text->setText(g_touchMsg); #endif showCalibration(); @@ -783,8 +987,13 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_LOWER_LEFT state. // Save the touch data and set up the next calibration display +#if CONFIG_NXWM_CALIBRATION_AVERAGE + m_calibData[CALIB_LOWER_LEFT_INDEX].x = average.x; + m_calibData[CALIB_LOWER_LEFT_INDEX].y = average.y; +#else m_calibData[CALIB_LOWER_LEFT_INDEX].x = m_touchPos.x; m_calibData[CALIB_LOWER_LEFT_INDEX].y = m_touchPos.y; +#endif // Clear the previous screen by re-drawing it using the backgro9und // color. That is much faster than clearing the whole display @@ -792,7 +1001,7 @@ void CCalibration::stateMachine(void) m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES - m_text->setText(g_touchmsg); + m_text->setText(g_touchMsg); #endif showCalibration(); @@ -844,17 +1053,17 @@ void CCalibration::showCalibration(void) port->drawFilledCircle(&m_screenInfo.pos, CALIBRATION_CIRCLE_RADIUS, m_screenInfo.circleFillColor); - /* Draw horizontal line */ + // Draw horizontal line port->drawFilledRect(0, m_screenInfo.pos.y, windowSize.w, CALIBRATION_LINE_THICKNESS, m_screenInfo.lineColor); - /* Draw vertical line */ + // Draw vertical line port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h, m_screenInfo.lineColor); - /* Show the touchscreen message */ + // Show the touchscreen message #ifdef CONFIG_NXWM_CALIBRATION_MESSAGES m_text->enableDrawing(); From 341458e123e71f4885927f5feaf4728e68ffba1a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Oct 2013 11:09:20 -0600 Subject: [PATCH 136/390] NxWidgets::CScaledImage: New class that wraps any class that provides IBitMap and adds image scaling --- ChangeLog.txt | 3 + libnxwidgets/Makefile | 4 +- libnxwidgets/include/cbitmap.hxx | 2 +- libnxwidgets/include/crlepalettebitmap.hxx | 2 +- libnxwidgets/include/cscaledbitmap.hxx | 209 ++++++++ libnxwidgets/include/ibitmap.hxx | 15 +- libnxwidgets/src/cbitmap.cxx | 4 +- libnxwidgets/src/crlepalettebitmap.cxx | 2 +- libnxwidgets/src/cscaledbitmap.cxx | 583 +++++++++++++++++++++ 9 files changed, 810 insertions(+), 14 deletions(-) create mode 100644 libnxwidgets/include/cscaledbitmap.hxx create mode 100644 libnxwidgets/src/cscaledbitmap.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 9f7c6a90e..3fb1e5398 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -387,4 +387,7 @@ * NxWM::CCalibration.cxx/hxx: Add options to collect and average multiple samples at each location. Also logic to discard the most extreme samples before averaging (2013-10-14). +* NxWidgets::CScaledImage: This new class is a wrapper for an class + the exports IBitMap. It will perform scaling via bi-linear interpolation + so that images can be scaled to any size desired (2013-10-15). diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 4f6840aaa..cf219cc7e 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/libnxwidgets/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -52,7 +52,7 @@ CXXSRCS = cbitmap.cxx cbgwindow.cxx ccallback.cxx cgraphicsport.cxx CXXSRCS += clistdata.cxx clistdataitem.cxx cnxfont.cxx CXXSRCS += cnxserver.cxx cnxstring.cxx cnxtimer.cxx cnxwidget.cxx cnxwindow.cxx CXXSRCS += cnxtkwindow.cxx cnxtoolbar.cxx crect.cxx crlepalettebitmap.cxx -CXXSRCS += cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx cwidgeteventhandlerlist.cxx +CXXSRCS += cscaledbitmap.cxx cstringiterator.cxx ctext.cxx cwidgetcontrol.cxx cwidgeteventhandlerlist.cxx CXXSRCS += cwindoweventhandlerlist.cxx singletons.cxx # Widget APIs CXXSRCS += cbutton.cxx cbuttonarray.cxx ccheckbox.cxx ccyclebutton.cxx diff --git a/libnxwidgets/include/cbitmap.hxx b/libnxwidgets/include/cbitmap.hxx index 4828ca9cc..0fd133303 100644 --- a/libnxwidgets/include/cbitmap.hxx +++ b/libnxwidgets/include/cbitmap.hxx @@ -179,7 +179,7 @@ namespace NXWidgets * @return The bitmap's width. */ - const nxgl_coord_t getStride(void) const; + const size_t getStride(void) const; /** * Use the colors associated with a selected image. diff --git a/libnxwidgets/include/crlepalettebitmap.hxx b/libnxwidgets/include/crlepalettebitmap.hxx index dd869c476..1235c80fb 100644 --- a/libnxwidgets/include/crlepalettebitmap.hxx +++ b/libnxwidgets/include/crlepalettebitmap.hxx @@ -235,7 +235,7 @@ namespace NXWidgets * @return The bitmap's width. */ - const nxgl_coord_t getStride(void) const; + const size_t getStride(void) const; /** * Use the colors associated with a selected image. diff --git a/libnxwidgets/include/cscaledbitmap.hxx b/libnxwidgets/include/cscaledbitmap.hxx new file mode 100644 index 000000000..4c5d8f729 --- /dev/null +++ b/libnxwidgets/include/cscaledbitmap.hxx @@ -0,0 +1,209 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cscaledbitmap.hxx + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CSCALEDBITMAP_HXX +#define __INCLUDE_CSCALEDBITMAP_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include + +#include +#include + +#include "nxconfig.hxx" +#include "ibitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class for scaling layer for any bitmap that inherits from IBitMap + */ + + class CScaledBitmap : public IBitmap + { + protected: + FAR IBitmap *m_bitmap; /**< The bitmap that is being scaled */ + struct nxgl_size_s m_size; /**< Scaled size of the image */ + FAR uint8_t *m_rowCache[2]; /**< Two cached rows of the image */ + unsigned int m_row; /**< Row number of the first cached row */ + b16_t m_xScale; /**< X scale factor */ + b16_t m_yScale; /**< Y scale factor */ + + /** + * Read two rows into the row cache + * + * @param row - The row number of the first row to cache + */ + + bool cacheRows(unsigned int row); + + /** + * Given an two RGB colors and a fractional value, return the scaled + * value between the two colors. + * + * @param incolor1 - The first color to be used + * @param incolor2 - The second color to be used + * @param fraction - The fractional value + * @param outcolor - The returned, scaled color + */ + + bool scaleColor(FAR const struct rgbcolor_s &incolor1, + FAR const struct rgbcolor_s &incolor2, + b16_t fraction, FAR struct rgbcolor_s &outcolor); + + /** + * Given an image row and a non-integer column offset, return the + * interpolated RGB color value corresponding to that position + * + * @param row - The pointer to the row in the row cache to use + * @param column - The non-integer column offset + * @param outcolor - The returned, interpolated color + * + */ + + bool rowColor(FAR uint8_t *row, b16_t column, + FAR struct rgbcolor_s &outcolor); + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CScaledBitmap(const CScaledBitmap &bitmap) { } + + public: + + /** + * Constructor. + * + * @param bitmap The bitmap structure being scaled. + * @newSize The new, scaled size of the image + */ + + CScaledBitmap(IBitmap *bitmap, struct nxgl_size_s &newSize); + + /** + * Destructor. + */ + + ~CScaledBitmap(void); + + /** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + + const uint8_t getColorFormat(void) const; + + /** + * Get the bitmap's color format. + * + * @return The bitmap's pixel depth. + */ + + const uint8_t getBitsPerPixel(void) const; + + /** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's width (in pixels/columns). + */ + + const nxgl_coord_t getWidth(void) const; + + /** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height (in rows). + */ + + inline const nxgl_coord_t getHeight(void) const; + + /** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width (in bytes). + */ + + const size_t getStride(void) const; + + /** + * Use the colors associated with a selected image. + * + * @param selected. true: Use colors for a selected widget, + * false: Use normal (default) colors. + */ + + inline void setSelected(bool selected) {} + + /** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + + bool getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + FAR void *data); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSCALEDBITMAP_HXX diff --git a/libnxwidgets/include/ibitmap.hxx b/libnxwidgets/include/ibitmap.hxx index 923df407a..c4e235dc5 100644 --- a/libnxwidgets/include/ibitmap.hxx +++ b/libnxwidgets/include/ibitmap.hxx @@ -73,9 +73,10 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include +#include #include #include @@ -84,11 +85,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -114,7 +115,7 @@ namespace NXWidgets /** * Get the bitmap's color format. * - * @return The bitmap's width. + * @return The bitmap's color format. */ virtual const uint8_t getColorFormat(void) const = 0; @@ -130,7 +131,7 @@ namespace NXWidgets /** * Get the bitmap's width (in pixels/columns). * - * @return The bitmap's pixel depth. + * @return The bitmap's width (in pixels/columns). */ virtual const nxgl_coord_t getWidth(void) const = 0; @@ -138,7 +139,7 @@ namespace NXWidgets /** * Get the bitmap's height (in rows). * - * @return The bitmap's height. + * @return The bitmap's height (in rows). */ virtual const nxgl_coord_t getHeight(void) const = 0; @@ -149,7 +150,7 @@ namespace NXWidgets * @return The bitmap's width. */ - virtual const nxgl_coord_t getStride(void) const = 0; + virtual const size_t getStride(void) const = 0; /** * Use the colors associated with a selected image. diff --git a/libnxwidgets/src/cbitmap.cxx b/libnxwidgets/src/cbitmap.cxx index c9c974814..c0cf71ea4 100644 --- a/libnxwidgets/src/cbitmap.cxx +++ b/libnxwidgets/src/cbitmap.cxx @@ -149,7 +149,7 @@ const nxgl_coord_t CBitmap::getHeight(void) const * @return The bitmap's width. */ -const nxgl_coord_t CBitmap::getStride(void) const +const size_t CBitmap::getStride(void) const { return m_bitmap->stride; } @@ -172,7 +172,7 @@ bool CBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, { // Check ranges. Casts to unsigned int are ugly but permit one-sided comparisons - if (((unsigned int)x < (unsigned int)width) && + if (((unsigned int)x < (unsigned int)m_bitmap->width) && ((unsigned int)(x + width) <= (unsigned int)m_bitmap->width) && ((unsigned int)y < (unsigned int)m_bitmap->height)) { diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 99f7fdbba..241736add 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -155,7 +155,7 @@ const nxgl_coord_t CRlePaletteBitmap::getHeight(void) const * @return The bitmap's width. */ -const nxgl_coord_t CRlePaletteBitmap::getStride(void) const +const size_t CRlePaletteBitmap::getStride(void) const { // This only works if the bpp is an even multiple of 8-bit bytes diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx new file mode 100644 index 000000000..6fe211ca4 --- /dev/null +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -0,0 +1,583 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cscaledbitmap.hxx + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cscaledbitmap.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param bitmap The bitmap structure being scaled. + * @newSize The new, scaled size of the image + */ + +CScaledBitmap::CScaledBitmap(IBitmap *bitmap, struct nxgl_size_s &newSize) +: m_bitmap(bitmap), m_size(newSize) +{ + // xScale will be used to convert a request X position to an X position + // in the contained bitmap: + // + // xImage = xRequested * oldWidth / newWidth + // = xRequested * xScale + + m_xScale = itob16((uint32_t)m_bitmap->getWidth()) / newSize.w; + + // Similarly, yScale will be used to convert a request Y position to a Y + // positionin the contained bitmap: + // + // yImage = yRequested * oldHeight / newHeight + // = yRequested * yScale + + m_xScale = itob16((uint32_t)m_bitmap->getHeight()) / newSize.h; + + // Allocate and initialize the row cache + + size_t stride = bitmap->getStride(); + m_rowCache[0] = new uint8_t(stride); + m_rowCache[1] = new uint8_t(stride); + + // Read the first two rows into the cache + + cacheRows(0); +} + +/** + * Destructor. + */ + +CScaledBitmap::~CScaledBitmap(void) +{ + if (m_rowCache[0]) + { + delete m_rowCache[0]; + } + + if (m_rowCache[1]) + { + delete m_rowCache[1]; + } +} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's width. + */ + +const uint8_t CScaledBitmap::getColorFormat(void) const +{ + return m_bitmap->getColorFormat(); +} + +/** + * Get the bitmap's color format. + * + * @return The bitmap's color format. + */ + +const uint8_t CScaledBitmap::getBitsPerPixel(void) const +{ + return m_bitmap->getBitsPerPixel(); +} + +/** + * Get the bitmap's width (in pixels/columns). + * + * @return The bitmap's pixel depth. + */ + +const nxgl_coord_t CScaledBitmap::getWidth(void) const +{ + return m_size.w; +} + +/** + * Get the bitmap's height (in rows). + * + * @return The bitmap's height (in rows). + */ + +const nxgl_coord_t CScaledBitmap::getHeight(void) const +{ + return m_size.h; +} + +/** + * Get the bitmap's width (in bytes). + * + * @return The bitmap's width (in bytes). + */ + +const size_t CScaledBitmap::getStride(void) const +{ + return (m_bitmap->getBitsPerPixel() * m_size.w + 7) / 8; +} + +/** + * Get one row from the bit map image. + * + * @param x The offset into the row to get + * @param y The row number to get + * @param width The number of pixels to get from the row + * @param data The memory location provided by the caller + * in which to return the data. This should be at least + * (getWidth()*getBitsPerPixl() + 7)/8 bytes in length + * and properly aligned for the pixel color format. + * @param True if the run was returned successfully. + */ + +bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, FAR void *data) +{ +#if CONFIG_NXWIDGETS_FMT == FB_FMT_RGB8_332 || CONFIG_NXWIDGETS_FMT == FB_FMT_RGB24 + FAR uint8_t *dest = (FAR uint8_t *)data; +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB16_565 + FAR uint16_t *dest = (FAR uint16_t *)data; +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB32 + FAR uint32_t *dest = (FAR uint32_t *)data; +#else +# error Unsupported, invalid, or undefined color format +#endif + + // Check ranges. Casts to unsigned int are ugly but permit one-sided comparisons + + if (((unsigned int)x >= (unsigned int)m_size.w) && + ((unsigned int)(x + width) > (unsigned int)m_size.w) && + ((unsigned int)y <= (unsigned int)m_size.h)) + { + return false; + } + + // Get the row number in the unscaled image corresponding to the + // requested y position. This must be either the exact row or the + // closest row just before the requested position + + b16_t row16 = y * m_yScale; + nxgl_coord_t row = b16toi(row16); + + // Get that row and the one after it into the row cache. We know that + // the pixel value that we want is one between the two rows. This + // may seem wasteful to read two entire rows. However, in normal usage + // we will be traversal each image from top-left to bottom-right in + // order. In that case, the caching is most efficient. + + if (!cacheRows(row)) + { + return false; + } + + // Now scale and copy the data from the cached row data + + for (int i = 0; i < width; i++, x++) + { + // Get the column number in the unscaled row corresponding to the + // requested x position. This must be either the exact column or the + // closest column just before the requested position + + b16_t column = x * m_xScale; + + // Get the color at the position on the first row + + struct rgbcolor_s color1; + if (!rowColor(m_rowCache[0], column, color1)) + { + gdbg("ERROR rowColor failed for the first row\n"); + return false; + } + + // Get the color at the position on the first row + + struct rgbcolor_s color2; + if (!rowColor(m_rowCache[1], column, color2)) + { + gdbg("ERROR rowColor failed for the second row\n"); + return false; + } + + // Check for transparent colors + + bool transparent1; + bool transparent2; + +#if CONFIG_NXWIDGETS_FMT == FB_FMT_RGB8_332 + uint8_t color = RGBTO8(color1.r, color1.g, color1.b); + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = RGBTO8(color2.r, color2.g, color2.b); + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB16_565 + uint16_t color = RGBTO16(color1.r, color1.g, color1.b); + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = RGBTO16(color2.r, color2.g, color2.b); + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB24 || CONFIG_NXWIDGETS_FMT == FB_FMT_RGB32 + uint32_t color = RGBTO24(color1.r, color1.g, color1.b); + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = RGBTO24(color2.r, color2.g, color2.b); + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#else +# error Unsupported, invalid, or undefined color format +#endif + + // Is one of the colors transparent? + + struct rgbcolor_s scaledColor; + b16_t fraction b16frac(row16); + + if (transparent1 || transparent2) + { + // Yes.. don't interpolate within transparent regions or + // between transparent and opaque regions. + + // Get the color closest to the requested position + + if (fraction < b16HALF) + { + scaledColor.r = color1.r; + scaledColor.g = color1.g; + scaledColor.b = color1.b; + } + else + { + scaledColor.r = color2.r; + scaledColor.g = color2.g; + scaledColor.b = color2.b; + } + } + else + { + // No.. both colors are opaque + + if (!scaleColor(color1, color2, fraction, scaledColor)) + { + return false; + } + } + + // Write the interpolated data to the user buffer + +#if CONFIG_NXWIDGETS_FMT == FB_FMT_RGB8_332 + color = RGBTO8(scaledColor.r, scaledColor.g, scaledColor.b); + *dest++ = color; + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB16_565 + color = RGBTO16(scaledColor.r, scaledColor.g, scaledColor.b); + *dest++ = color; + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB24 + *dest++ = color2.b; + *dest++ = color2.r; + *dest++ = color2.g; + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB32 + color = RGBTO24(scaledColor.r, scaledColor.g, scaledColor.b); + *dest++ = color; + +#else +# error Unsupported, invalid, or undefined color format +#endif + } + + return true; +} + +/** + * Read two rows into the row cache + * + * @param row - The row number of the first row to cache + */ + +bool CScaledBitmap::cacheRows(unsigned int row) +{ + nxgl_coord_t bitmapWidth = m_bitmap->getWidth(); + nxgl_coord_t bitmapHeight = m_bitmap->getHeight(); + + // A common case is to advance by one row. In this case, we only + // need to read one row + + if (row == m_row + 1) + { + // Swap rows + + FAR uint8_t *saveRow = m_rowCache[0]; + m_rowCache[0] = m_rowCache[1]; + m_rowCache[1] = saveRow; + + // Save number of the first row that we have in the cache + + m_row = row; + + // Now read the new row into the second row cache buffer + + if (++row >= (unsigned int)bitmapHeight) + { + row = bitmapHeight - 1; + } + + if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[1])) + { + gdbg("Failed to read bitmap row %d\n", row); + return false; + } + } + + // Do we need to read two new rows? Or do we already have the + // request row in the cache? + + else if (row != m_row) + { + // Read the first row into the cache + + if (row >= (unsigned int)bitmapHeight) + { + row = bitmapHeight - 1; + } + + if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[0])) + { + gdbg("Failed to read bitmap row %d\n", row); + return false; + } + + // Save number of the first row that we have in the cache + + m_row = row; + + // Read the next row into the cache + + if (++row >= (unsigned int)bitmapHeight) + { + row = bitmapHeight - 1; + } + + if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[1])) + { + gdbg("Failed to read bitmap row %d\n", row); + return false; + } + } + + return true; +} + +/** + * Given an two RGB colors and a fractional value, return the scaled + * value between the two colors. + * + * @param incolor1 - The first color to be used + * @param incolor2 - The second color to be used + * @param fraction - The fractional value + * @param outcolor - The returned, scaled color + */ + +bool CScaledBitmap::scaleColor(FAR const struct rgbcolor_s &incolor1, + FAR const struct rgbcolor_s &incolor2, + b16_t fraction, FAR struct rgbcolor_s &outcolor) +{ + unsigned int red; + unsigned int green; + unsigned int blue; + b16_t remainder = b16ONE - fraction; + + red = (unsigned int)incolor1.r * fraction + + (unsigned int)incolor2.r * remainder; + green = (unsigned int)incolor1.g * fraction + + (unsigned int)incolor2.g * remainder; + blue = (unsigned int)incolor1.b * fraction + + (unsigned int)incolor2.b * remainder; + + outcolor.r = red < 256 ? red : 255; + outcolor.g = green < 256 ? green : 255; + outcolor.b = blue < 256 ? blue : 255; + return true; +} + +/** + * Given an image row and a non-integer column offset, return the + * interpolated RGB color value corresponding to that position + * + * @param row - The pointer to the row in the row cache to use + * @param column - The non-integer column offset + * @param outcolor - The returned, interpolated color + * + */ + +bool CScaledBitmap::rowColor(FAR uint8_t *row, b16_t column, + FAR struct rgbcolor_s &outcolor) +{ + // This is the col at or just before the pixel of interest + + nxgl_coord_t col1 = b16toi(column); + nxgl_coord_t col2 = col1 + 1; + + nxgl_coord_t bitmapWidth = m_bitmap->getWidth(); + if (col2 >= bitmapWidth) + { + col2 = bitmapWidth - 1; + } + + b16_t fraction = b16frac(column); + + struct rgbcolor_s color1; + struct rgbcolor_s color2; + + bool transparent1; + bool transparent2; + +#if CONFIG_NXWIDGETS_FMT == FB_FMT_RGB8_332 + uint8_t color = row[col1]; + color1.r = RBG8RED(color); + color1.g = RBG8GREEN(color); + color1.b = RBG8BLUE(color); + + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = row[col2]; + color2.r = RBG8RED(color); + color2.g = RBG8GREEN(color); + color2.b = RBG8BLUE(color); + + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB16_565 + FAR uint16_t *row16 = (FAR uint16_t*)row; + uint16_t color = row16[col1]; + color1.r = RBG16RED(color); + color1.g = RBG16GREEN(color); + color1.b = RBG16BLUE(color); + + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = row16[col2]; + color2.r = RBG16RED(color); + color2.g = RBG16GREEN(color); + color2.b = RBG16BLUE(color); + + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB24 + unsigned int ndx = 3*col1; + color1.r = row[ndx+2]; + color1.g = row[ndx+1]; + color1.b = row[ndx]; + + uint32_t color = RGBTO24(color1.r, color1.g, color1.b); + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + ndx = 3*col2; + color2.r = row[ndx+2]; + color2.g = row[ndx+1]; + color2.b = row[ndx]; + + color = RGBTO24(color2.r, color2.g, color2.b); + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB32 + FAR uint32_t *row32 = (FAR uint32_t*)row; + uint32_t color = row32[col1]; + color1.r = RBG24RED(color); + color1.g = RBG24GREEN(color); + color1.b = RBG24BLUE(color); + + transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + + color = row32[col2]; + color2.r = RBG24RED(color); + color2.g = RBG24GREEN(color); + color2.b = RBG24BLUE(color); + + transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); + +#else +# error Unsupported, invalid, or undefined color format +#endif + + // Is one of the colors transparent? + + if (transparent1 || transparent2) + { + // Yes.. don't interpolate within transparent regions or + // between transparent and opaque regions. + + // Return the color closest to the requested position + + if (fraction < b16HALF) + { + outcolor.r = color1.r; + outcolor.g = color1.b; + outcolor.g = color1.g; + } + else + { + outcolor.r = color2.r; + outcolor.g = color2.b; + outcolor.g = color2.g; + } + + return true; + } + else + { + // No.. both colors are opaque + + return scaleColor(color1, color2, fraction, outcolor); + } +} From d9d02140d89cabef9ec2773909725f50dcd07e7d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Oct 2013 14:29:06 -0600 Subject: [PATCH 137/390] Use NxWidgets::CScaledBitmap to scale icons in the NxWM taskbar --- ChangeLog.txt | 2 + Kconfig | 22 +++++++++ libnxwidgets/include/cscaledbitmap.hxx | 4 +- libnxwidgets/src/crlepalettebitmap.cxx | 2 +- libnxwidgets/src/cscaledbitmap.cxx | 62 +++++++++++++++++--------- nxwm/include/ctaskbar.hxx | 4 +- nxwm/include/nxwmconfig.hxx | 24 +++++++++- nxwm/src/ctaskbar.cxx | 38 +++++++++++++++- 8 files changed, 129 insertions(+), 29 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3fb1e5398..996ed236c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -390,4 +390,6 @@ * NxWidgets::CScaledImage: This new class is a wrapper for an class the exports IBitMap. It will perform scaling via bi-linear interpolation so that images can be scaled to any size desired (2013-10-15). +* NxWM::CTaskbar:: Can now be configured to scale taskbasr icons using + NxWidgets::CScaledImage (2013-10-15) diff --git a/Kconfig b/Kconfig index e1ca03169..2de112c3f 100644 --- a/Kconfig +++ b/Kconfig @@ -420,6 +420,28 @@ config NXWM_TASKBAR_WIDTH Task bar thickness (either vertical or horizontal). Default: 25 + 2*2 endif +config NXWM_TASKBAR_ICONSCALE + bool "Scale Icons" + default n + ---help--- + Enable scaling of icons in the task bar + +if NXWM_TASKBAR_ICONSCALE + +config NXWM_TASKBAR_ICONWIDTH + int "Icon Width (pixels)" + default 50 + ---help--- + Scaled width of each taskbar ICON in pixels. + +config NXWM_TASKBAR_ICONHEIGHT + int "Icon Height (rows)" + default 42 + ---help--- + Scaled height of each taskbar ICON in pixels. + +endif #NXWM_TASKBAR_ICONSCALE + config NXWM_DISABLE_MINIMIZE bool "Disable Minimize Button" default n diff --git a/libnxwidgets/include/cscaledbitmap.hxx b/libnxwidgets/include/cscaledbitmap.hxx index 4c5d8f729..3c0594a1d 100644 --- a/libnxwidgets/include/cscaledbitmap.hxx +++ b/libnxwidgets/include/cscaledbitmap.hxx @@ -75,7 +75,7 @@ namespace NXWidgets FAR IBitmap *m_bitmap; /**< The bitmap that is being scaled */ struct nxgl_size_s m_size; /**< Scaled size of the image */ FAR uint8_t *m_rowCache[2]; /**< Two cached rows of the image */ - unsigned int m_row; /**< Row number of the first cached row */ + int m_row; /**< Row number of the first cached row */ b16_t m_xScale; /**< X scale factor */ b16_t m_yScale; /**< Y scale factor */ @@ -167,7 +167,7 @@ namespace NXWidgets * @return The bitmap's height (in rows). */ - inline const nxgl_coord_t getHeight(void) const; + const nxgl_coord_t getHeight(void) const; /** * Get the bitmap's width (in bytes). diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 241736add..1fb2518a5 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -192,7 +192,7 @@ bool CRlePaletteBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t widt { // Check ranges. Casts to unsigned int are ugly but permit one-sided comparisons - if (((unsigned int)x < (unsigned int)width) && + if (((unsigned int)x < (unsigned int)m_bitmap->width) && ((unsigned int)(x + width) <= (unsigned int)m_bitmap->width)) { // Seek to the requested row diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index 6fe211ca4..e274bbb0a 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -81,16 +81,17 @@ CScaledBitmap::CScaledBitmap(IBitmap *bitmap, struct nxgl_size_s &newSize) // yImage = yRequested * oldHeight / newHeight // = yRequested * yScale - m_xScale = itob16((uint32_t)m_bitmap->getHeight()) / newSize.h; + m_yScale = itob16((uint32_t)m_bitmap->getHeight()) / newSize.h; // Allocate and initialize the row cache size_t stride = bitmap->getStride(); - m_rowCache[0] = new uint8_t(stride); - m_rowCache[1] = new uint8_t(stride); + m_rowCache[0] = new uint8_t[stride]; + m_rowCache[1] = new uint8_t[stride]; // Read the first two rows into the cache + m_row = m_bitmap->getWidth(); // Set to an impossible value cacheRows(0); } @@ -100,6 +101,8 @@ CScaledBitmap::CScaledBitmap(IBitmap *bitmap, struct nxgl_size_s &newSize) CScaledBitmap::~CScaledBitmap(void) { + // Delete the allocated row cache memory + if (m_rowCache[0]) { delete m_rowCache[0]; @@ -108,6 +111,13 @@ CScaledBitmap::~CScaledBitmap(void) if (m_rowCache[1]) { delete m_rowCache[1]; + } + + // We are also responsible for deleting the contained IBitmap + + if (m_bitmap) + { + delete m_bitmap; } } @@ -372,7 +382,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) row = bitmapHeight - 1; } - if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[1])) + if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { gdbg("Failed to read bitmap row %d\n", row); return false; @@ -391,7 +401,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) row = bitmapHeight - 1; } - if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[0])) + if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[0])) { gdbg("Failed to read bitmap row %d\n", row); return false; @@ -408,7 +418,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) row = bitmapHeight - 1; } - if (!m_bitmap->getRun(0, row, bitmapWidth, &m_rowCache[1])) + if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { gdbg("Failed to read bitmap row %d\n", row); return false; @@ -432,21 +442,33 @@ bool CScaledBitmap::scaleColor(FAR const struct rgbcolor_s &incolor1, FAR const struct rgbcolor_s &incolor2, b16_t fraction, FAR struct rgbcolor_s &outcolor) { - unsigned int red; - unsigned int green; - unsigned int blue; - b16_t remainder = b16ONE - fraction; - - red = (unsigned int)incolor1.r * fraction + - (unsigned int)incolor2.r * remainder; - green = (unsigned int)incolor1.g * fraction + - (unsigned int)incolor2.g * remainder; - blue = (unsigned int)incolor1.b * fraction + - (unsigned int)incolor2.b * remainder; + uint8_t component; + b16_t red; + b16_t green; + b16_t blue; - outcolor.r = red < 256 ? red : 255; - outcolor.g = green < 256 ? green : 255; - outcolor.b = blue < 256 ? blue : 255; + // A fraction of < 0.5 would mean to use use mostly color1; a fraction + // greater than 0.5 would men to use mostly color2 + + b16_t remainder = b16ONE - fraction; + + // Interpolate each color value (converting to b15) + + red = (b16_t)incolor1.r * remainder + (b16_t)incolor2.r * fraction; + green = (b16_t)incolor1.g * remainder + (b16_t)incolor2.g * fraction; + blue = (b16_t)incolor1.b * remainder + (b16_t)incolor2.b * fraction; + + // Return the integer, interpolated values, clipping to the range of + // uint8_t + + component = b16toi(red); + outcolor.r = component < 256 ? component : 255; + + component = b16toi(green); + outcolor.g = component < 256 ? component : 255; + + component = b16toi(blue); + outcolor.b = component < 256 ? component : 255; return true; } diff --git a/nxwm/include/ctaskbar.hxx b/nxwm/include/ctaskbar.hxx index 84c7b28f4..cbd35b52f 100644 --- a/nxwm/include/ctaskbar.hxx +++ b/nxwm/include/ctaskbar.hxx @@ -92,8 +92,8 @@ namespace NxWM struct STaskbarSlot { - IApplication *app; /**< A reference to the icon */ - NXWidgets::CImage *image; /**< The icon image that goes with the application */ + IApplication *app; /**< A reference to the application */ + NXWidgets::CImage *image; /**< The icon image for the application */ }; /** diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 6e540fefc..7715224e2 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -223,6 +223,24 @@ # define CONFIG_NXWM_TASKBAR_TOP 1 #endif +// Taskbar ICON scaling + +#ifdef CONFIG_NXWM_TASKBAR_ICONSCALE +# ifndef CONFIG_NXWM_TASKBAR_ICONWIDTH +# error Scaling requires CONFIG_NXWM_TASKBAR_ICONWIDTH +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 50 +# endif +# ifndef CONFIG_NXWM_TASKBAR_ICONHEIGHT +# error Scaling requires CONFIG_NXWM_TASKBAR_ICONHEIGHT +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 42 +# endif +#else +# undef CONFIG_NXWM_TASKBAR_ICONWIDTH +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 25 // Used below +# undef CONFIG_NXWM_TASKBAR_ICONHEIGHT +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 21 // Used below (NOT) +#endif + /** * At present, all icons are 25 pixels in "width" and, hence require a * task bar of at least that size. @@ -230,9 +248,11 @@ #ifndef CONFIG_NXWM_TASKBAR_WIDTH # if defined(CONFIG_NXWM_TASKBAR_TOP) || defined(CONFIG_NXWM_TASKBAR_BOTTOM) -# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*CONFIG_NXWM_TASKBAR_HSPACING) +# define CONFIG_NXWM_TASKBAR_WIDTH \ + (CONFIG_NXWM_TASKBAR_ICONWIDTH+2*CONFIG_NXWM_TASKBAR_HSPACING) # else -# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*CONFIG_NXWM_TASKBAR_VSPACING) +# define CONFIG_NXWM_TASKBAR_WIDTH \ + (CONFIG_NXWM_TASKBAR_ICONWIDTH+2*CONFIG_NXWM_TASKBAR_VSPACING) # endif #endif diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 226ebe7bb..3a5e44aec 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -46,6 +46,7 @@ #include "crect.hxx" #include "cwidgetcontrol.hxx" #include "cnxtkwindow.hxx" +#include "cscaledbitmap.hxx" #include "cwindowmessenger.hxx" #include "ctaskbar.hxx" @@ -456,12 +457,43 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) NXWidgets::IBitmap *bitmap = app->getIcon(); +#ifdef CONFIG_NXWM_TASKBAR_ICONSCALE + // Create a CScaledBitmap to scale the bitmap icon + + NXWidgets::CScaledBitmap *scaler = (NXWidgets::CScaledBitmap *)0; + if (bitmap) + { + // Create a CScaledBitmap to scale the bitmap icon + + struct nxgl_size_s iconSize; + iconSize.w = CONFIG_NXWM_TASKBAR_ICONWIDTH; + iconSize.h = CONFIG_NXWM_TASKBAR_ICONHEIGHT; + + scaler = new NXWidgets::CScaledBitmap(bitmap, iconSize); + if (!scaler) + { + return false; + } + } +#endif + // Create a CImage instance to manage the applications icon. Assume the // minimum size in case no bitmap is provided (bitmap == NULL) int w = 1; int h = 1; +#ifdef CONFIG_NXWM_TASKBAR_ICONSCALE + if (scaler) + { + w = scaler->getWidth(); + h = scaler->getHeight(); + } + + NXWidgets::CImage *image = + new NXWidgets::CImage(control, 0, 0, w, h, scaler, 0); + +#else if (bitmap) { w = bitmap->getWidth(); @@ -471,6 +503,8 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) NXWidgets::CImage *image = new NXWidgets::CImage(control, 0, 0, w, h, bitmap, 0); +#endif + if (!image) { return false; @@ -490,8 +524,8 @@ bool CTaskbar::startApplication(IApplication *app, bool minimized) // the task bar struct STaskbarSlot slot; - slot.app = app; - slot.image = image; + slot.app = app; + slot.image = image; m_slots.push_back(slot); // Initialize the application states From 4f24c6953807664f06fd5ac0759b864f9cb91b9e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Oct 2013 16:08:06 -0600 Subject: [PATCH 138/390] Add a 320x320 NuttX logo image --- ChangeLog.txt | 3 + UnitTests/CImage/cimage_main.cxx | 2 +- libnxwidgets/Makefile | 2 +- libnxwidgets/include/ctext.hxx | 6 + libnxwidgets/include/glyphs.hxx | 263 +- libnxwidgets/src/cscaledbitmap.cxx | 8 + libnxwidgets/src/glyph_nxlogo160x160.cxx | 3453 ++++++++++++++++++++++ libnxwidgets/src/glyph_nxlogo320x320.cxx | 1043 +++++++ 8 files changed, 4647 insertions(+), 133 deletions(-) create mode 100644 libnxwidgets/src/glyph_nxlogo160x160.cxx create mode 100644 libnxwidgets/src/glyph_nxlogo320x320.cxx diff --git a/ChangeLog.txt b/ChangeLog.txt index 996ed236c..acaa08e50 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -392,4 +392,7 @@ so that images can be scaled to any size desired (2013-10-15). * NxWM::CTaskbar:: Can now be configured to scale taskbasr icons using NxWidgets::CScaledImage (2013-10-15) +* NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 + NuttX logo image. The older, smaller NuttX logo was renamed from + nxlogo to nxlogo160x160 in all places (2015-10-15). diff --git a/UnitTests/CImage/cimage_main.cxx b/UnitTests/CImage/cimage_main.cxx index bca730202..74bfd767f 100644 --- a/UnitTests/CImage/cimage_main.cxx +++ b/UnitTests/CImage/cimage_main.cxx @@ -185,7 +185,7 @@ int cimage_main(int argc, char *argv[]) // Create an instance of the NuttX logo - CRlePaletteBitmap *nuttxBitmap = new CRlePaletteBitmap(&g_nuttxBitmap); + CRlePaletteBitmap *nuttxBitmap = new CRlePaletteBitmap(&g_nuttxBitmap160x160); updateMemoryUsage(&g_mmprevious, "After creating the bitmap"); // Create a CImage instance diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index cf219cc7e..5ef061339 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -66,7 +66,7 @@ CXXSRCS += cscrollingpanel.cxx cscrollingtextbox.cxx csliderhorizontal.cxx CXXSRCS += csliderhorizontalgrip.cxx cslidervertical.cxx csliderverticalgrip.cxx CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx ctabpanel.cxx ctextbox.cxx # Images -CXXSRCS += glyph_nxlogo.cxx +CXXSRCS += glyph_nxlogo160x160.cxx glyph_nxlogo320x320.cxx CXXSRCS += glyph_arrowdown.cxx glyph_checkboxon.cxx glyph_screendepthup.cxx CXXSRCS += glyph_arrowleft.cxx glyph_control.cxx glyph_screenflipdown.cxx CXXSRCS += glyph_arrowright.cxx glyph_cycle.cxx glyph_screenflipup.cxx diff --git a/libnxwidgets/include/ctext.hxx b/libnxwidgets/include/ctext.hxx index 8f8ee5783..a58d32eeb 100644 --- a/libnxwidgets/include/ctext.hxx +++ b/libnxwidgets/include/ctext.hxx @@ -146,6 +146,12 @@ namespace NXWidgets CText(CNxFont *font, const CNxString &text, nxgl_coord_t width); + /** + * Destructor. + */ + + virtual ~CText(void) {} + /** * Set the text in the string. * diff --git a/libnxwidgets/include/glyphs.hxx b/libnxwidgets/include/glyphs.hxx index afd6cc7a0..230db8ff6 100644 --- a/libnxwidgets/include/glyphs.hxx +++ b/libnxwidgets/include/glyphs.hxx @@ -1,131 +1,132 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/glyphs.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_GLYPHS_HXX -#define __INCLUDE_GLYPHS_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Bitmap Glyph References - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - struct SBitmap; - - // Global RLE Paletted Bitmaps - - extern const struct SRlePaletteBitmap g_nuttxBitmap; - - // Global Simple Bitmaps - - extern const struct SBitmap g_screenDepthUp; - extern const struct SBitmap g_screenDepthDown; - extern const struct SBitmap g_windowClose; - extern const struct SBitmap g_windowDepthUp; - extern const struct SBitmap g_windowDepthDown; - extern const struct SBitmap g_radioButtonOn; - extern const struct SBitmap g_radioButtonOff; - extern const struct SBitmap g_radioButtonMu; - extern const struct SBitmap g_checkBoxOff; - extern const struct SBitmap g_checkBoxOn; - extern const struct SBitmap g_checkBoxMu; - extern const struct SBitmap g_screenFlipUp; - extern const struct SBitmap g_screenFlipDown; - extern const struct SBitmap g_arrowUp; - extern const struct SBitmap g_arrowDown; - extern const struct SBitmap g_arrowLeft; - extern const struct SBitmap g_arrowRight; - extern const struct SBitmap g_cycle; - extern const struct SBitmap g_backspace; - extern const struct SBitmap g_return; - extern const struct SBitmap g_shift; - extern const struct SBitmap g_capslock; - extern const struct SBitmap g_control; -} - -#endif // __cplusplus - -#endif // __INCLUDE_GLYPHS_HXX +/**************************************************************************** + * NxWidgets/libnxwidgets/include/glyphs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_GLYPHS_HXX +#define __INCLUDE_GLYPHS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Bitmap Glyph References + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + struct SBitmap; + + // Global RLE Paletted Bitmaps + + extern const struct SRlePaletteBitmap g_nuttxBitmap160x160; + extern const struct SRlePaletteBitmap g_nuttxBitmap320x320; + + // Global Simple Bitmaps + + extern const struct SBitmap g_screenDepthUp; + extern const struct SBitmap g_screenDepthDown; + extern const struct SBitmap g_windowClose; + extern const struct SBitmap g_windowDepthUp; + extern const struct SBitmap g_windowDepthDown; + extern const struct SBitmap g_radioButtonOn; + extern const struct SBitmap g_radioButtonOff; + extern const struct SBitmap g_radioButtonMu; + extern const struct SBitmap g_checkBoxOff; + extern const struct SBitmap g_checkBoxOn; + extern const struct SBitmap g_checkBoxMu; + extern const struct SBitmap g_screenFlipUp; + extern const struct SBitmap g_screenFlipDown; + extern const struct SBitmap g_arrowUp; + extern const struct SBitmap g_arrowDown; + extern const struct SBitmap g_arrowLeft; + extern const struct SBitmap g_arrowRight; + extern const struct SBitmap g_cycle; + extern const struct SBitmap g_backspace; + extern const struct SBitmap g_return; + extern const struct SBitmap g_shift; + extern const struct SBitmap g_capslock; + extern const struct SBitmap g_control; +} + +#endif // __cplusplus + +#endif // __INCLUDE_GLYPHS_HXX diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index e274bbb0a..1ebf60324 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -179,6 +179,11 @@ const size_t CScaledBitmap::getStride(void) const /** * Get one row from the bit map image. * + * REVISIT: This algorithm is really intended to expand images. Hence, + * for example, interpolation is between row and row+1 and column and + * column+1 in the original, unscaled image. You would the interpolation + * differently if you really wanted to sub-sample well. + * * @param x The offset into the row to get * @param y The row number to get * @param width The number of pixels to get from the row @@ -580,6 +585,9 @@ bool CScaledBitmap::rowColor(FAR uint8_t *row, b16_t column, // between transparent and opaque regions. // Return the color closest to the requested position + // + // A fraction of < 0.5 would mean to use use mostly color1; a fraction + // greater than 0.5 would men to use mostly color2 if (fraction < b16HALF) { diff --git a/libnxwidgets/src/glyph_nxlogo160x160.cxx b/libnxwidgets/src/glyph_nxlogo160x160.cxx new file mode 100644 index 000000000..bd6d280b9 --- /dev/null +++ b/libnxwidgets/src/glyph_nxlogo160x160.cxx @@ -0,0 +1,3453 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_nxlogo160x160.cxx + * + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# define BITMAP_NLUTCODES 164 /* Number of unique RGB colors in the image */ + +static const uint32_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x000000, 0x102028, 0x5898e0, 0x3c30e4, 0x3c34e4, 0x0c0828, 0x382ce4, 0x3c34e8, /* Codes 0-7 */ + 0x3834d4, 0x241c74, 0x2c2490, 0x343c8c, 0x5ca0ec, 0x4454d0, 0x2c288c, 0x5ca0e8, /* Codes 8-15 */ + 0x3830d4, 0x687078, 0xd0e4f0, 0x3428e4, 0x24282c, 0xcce4f0, 0x848cec, 0xdcf4f4, /* Codes 16-23 */ + 0xd8ecf0, 0x2c24e0, 0xa8b8c4, 0xb4c4f0, 0x5854e4, 0xd8f0f0, 0xd8f0f4, 0x484890, /* Codes 24-31 */ + 0x2c287c, 0x28287c, 0x282478, 0x342cb4, 0xcce0f0, 0xd8e8f4, 0xa8bcc8, 0x587c98, /* Codes 32-39 */ + 0x5c98bc, 0x2c4c60, 0xe0f8fc, 0x1c1478, 0x2c2884, 0x302894, 0xfcfcfc, 0xd4e8f4, /* Codes 40-47 */ + 0x5090b8, 0x101c20, 0xd8ecf8, 0x5c94bc, 0x8c90ec, 0x7c84bc, 0xc8e0f0, 0x98c0d8, /* Codes 48-55 */ + 0xe8f0f8, 0x94bcd8, 0x3830e4, 0xb0bcec, 0xf4f8fc, 0xe4f0f8, 0x3c34ec, 0x142028, /* Codes 56-63 */ + 0x5894bc, 0x5078ac, 0x5084b4, 0x282080, 0x3428b4, 0xd0e4f4, 0x70a4c8, 0x3c34d8, /* Codes 64-71 */ + 0x7880b0, 0x5490b8, 0x5484b4, 0x281c78, 0x5ca4ec, 0xdcf4fc, 0x181078, 0x2c2880, /* Codes 72-79 */ + 0x382cd0, 0x342cb8, 0x1c1888, 0x888cf0, 0xc4e0f0, 0x98c4dc, 0x180c74, 0x5080b0, /* Codes 80-87 */ + 0x282480, 0x04000c, 0x282474, 0x4038f4, 0x3024ec, 0x302c9c, 0x7c84b4, 0x0c1c28, /* Codes 88-95 */ + 0x5090e0, 0x3020e4, 0xd8f0f8, 0x7478b4, 0x100870, 0x08006c, 0x24188c, 0x201c7c, /* Codes 96-103 */ + 0x2c2090, 0x5098d0, 0xd4e4f0, 0x589cd0, 0x3840e0, 0x4048e4, 0xc4dcf0, 0xdcf4f8, /* Codes 104-111 */ + 0x3024e8, 0x342cac, 0x4878b8, 0x4048e0, 0x8084e8, 0x2c248c, 0x3430bc, 0x241c70, /* Codes 112-119 */ + 0x141074, 0x3428e0, 0x342cec, 0x2c24b4, 0x201c78, 0x3028d0, 0x241c8c, 0x7078b4, /* Codes 120-127 */ + 0x040028, 0xd4e8f0, 0x4c7cd4, 0x282078, 0x5484b0, 0x20285c, 0x20187c, 0x4c7cb0, /* Codes 128-135 */ + 0x3830d0, 0x4034f0, 0x2820c8, 0xdcf0f4, 0x34408c, 0x98d4ec, 0x2c1ce0, 0x5080ac, /* Codes 136-143 */ + 0x3c30e8, 0x7078a8, 0x04001c, 0x2c3034, 0x305064, 0x2c4458, 0x74a8c8, 0xf8f8fc, /* Codes 144-151 */ + 0xdcecf8, 0xb0c0dc, 0xa0b0bc, 0xb4d4e4, 0x707880, 0x7c98a8, 0xdcf4f0, 0x2820ac, /* Codes 152-159 */ + 0x201874, 0x302898, 0x3844ac, 0x507ce0, /* Codes 160-163 */ +}; + +/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# define BITMAP_NLUTCODES 141 /* Number of unique RGB colors in the image */ + +static const uint16_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x0000, 0x1105, 0x5cdc, 0x399c, 0x41bc, 0x0845, 0x397c, 0x39bc, 0x41bd, 0x39ba, /* Codes 0-9 */ + 0x28ee, 0x3132, 0x31f2, 0x5d1d, 0x42ba, 0x3152, 0x399a, 0x6b8f, 0xd73e, 0x315c, /* Codes 10-19 */ + 0x2945, 0x8c7d, 0xe7be, 0xdf7e, 0x313c, 0xadd9, 0xb63e, 0x5abd, 0xdf9e, 0xdf9f, /* Codes 20-29 */ + 0x4a52, 0x2950, 0x292f, 0x3176, 0xcf1e, 0xdf5f, 0xadf9, 0x5bf3, 0x5cd8, 0x326c, /* Codes 30-39 */ + 0xe7df, 0x18af, 0x3153, 0xdf5e, 0xffff, 0x5497, 0x10e4, 0xdf7f, 0x5cb8, 0x8c9d, /* Codes 40-49 */ + 0x8437, 0x9e1b, 0xef9f, 0x9dfb, 0xb5fe, 0xffdf, 0x41be, 0x53d6, 0x5436, 0x2910, /* Codes 50-59 */ + 0x3156, 0x7539, 0x39bb, 0x7c16, 0x95fb, 0x28ef, 0x653d, 0xe7bf, 0x188f, 0x397a, /* Codes 60-69 */ + 0x3977, 0x20d1, 0x8c7e, 0xe79f, 0x9e3b, 0x186e, 0x5416, 0x2930, 0x0801, 0x41de, /* Codes 70-79 */ + 0x313d, 0x3173, 0x7c36, 0x08e5, 0x549c, 0xd75f, 0x311c, 0x73d6, 0x3150, 0x315d, /* Codes 80-89 */ + 0x104e, 0x080e, 0x20f0, 0x2912, 0x54da, 0xdf3e, 0x5cfa, 0x3a1c, 0x425c, 0xcefe, /* Codes 90-99 */ + 0x4bd7, 0x843d, 0x2932, 0x3997, 0xf7df, 0x397d, 0x2936, 0x20ef, 0x315a, 0x20f1, /* Codes 100-109 */ + 0x0005, 0xd75e, 0x53fa, 0x290f, 0x214b, 0x20cf, 0x4bf6, 0x2919, 0x3212, 0x9ebd, /* Codes 110-119 */ + 0x28fc, 0x5415, 0x399d, 0x73d5, 0x0804, 0x3187, 0x328d, 0x2a2b, 0x7559, 0xe77f, /* Codes 120-129 */ + 0xb61c, 0x3186, 0xa598, 0xbebd, 0x73d0, 0x84d5, 0x5cb7, 0x2916, 0x20ce, 0x3a35, /* Codes 130-139 */ + 0x53fc /* Codes 140-140 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these p;ointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE +# define BITMAP_NLUTCODES 116 /* Number of unique greyscale levels in the image */ + +/* 8-bit Greyscale */ + +static const uint8_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x00, 0x19, 0x8b, 0x46, 0x4a, 0x0b, 0x8d, 0x41, 0x44, 0x27, 0x32, 0x92, 0x59, 0x34, 0x6d, 0xdb, /* Codes 0-15 */ + 0x3f, 0x26, 0x91, 0xec, 0xe5, 0x39, 0xb4, 0xc0, 0x62, 0xe6, 0x4c, 0x2f, 0x2e, 0x3c, 0xda, 0xe4, /* Codes 16-31 */ + 0x72, 0x86, 0xed, 0x1d, 0x35, 0xe2, 0xfc, 0xe3, 0x7d, 0x16, 0x97, 0x87, 0xee, 0xb2, 0x42, 0xbc, /* Codes 32-47 */ + 0xf6, 0x4b, 0x1c, 0x70, 0x90, 0x77, 0x2c, 0xdf, 0x96, 0x29, 0x45, 0x7f, 0x81, 0xb1, 0x28, 0xea, /* Codes 48-63 */ + 0x40, 0x3d, 0x23, 0x95, 0xe9, 0xd6, 0xb7, 0x2d, 0x02, 0x3a, 0x85, 0x17, 0x82, 0xe7, 0x7b, 0x33, /* Codes 64-79 */ + 0x0e, 0x25, 0x84, 0xe0, 0x8c, 0x4d, 0x56, 0x1e, 0x3b, 0x6e, 0x31, 0x3e, 0xf3, 0x1a, 0x20, 0x04, /* Codes 80-95 */ + 0xe1, 0x74, 0x2a, 0x79, 0x21, 0x71, 0xc4, 0x76, 0x48, 0x98, 0xf7, 0x94, 0xe8, 0xbe, 0xac, 0xc9, /* Codes 96-111 */ + 0x75, 0x8e, 0x49, 0x7a /* Codes 112-115 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ +# define BITMAP_NLUTCODES 27 /* Number of unique RGB colors in the image */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x00, 0x25, 0x77, 0x4b, 0x01, 0x47, 0x26, 0x4a, 0x4f, 0x72, 0xdf, 0x93, 0xff, 0x27, 0xbb, 0xdb, /* Codes 0-15 */ + 0x6f, 0x29, 0x53, 0x97, 0x73, 0x22, 0x05, 0x02, 0x57, 0xbf, 0x4e /* Codes 16-26 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 2, 7}, { 3, 4}, { 1, 5}, /* Row 1 */ + { 75, 0}, + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ + { 1, 7}, { 3, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 12}, /* Row 3 */ + { 1, 13}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 4 */ + { 1, 6}, { 1, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 5 */ + { 1, 6}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 6 */ + { 1, 6}, { 5, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 7 */ + { 1, 6}, { 7, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 8 */ + { 1, 6}, { 9, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 9 */ + { 1, 6}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 10 */ + { 1, 6}, { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 11 */ + { 1, 6}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 12 */ + { 1, 6}, { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 13 */ + { 1, 6}, { 19, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 14 */ + { 1, 6}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 15 */ + { 1, 6}, { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 16 */ + { 1, 6}, { 25, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 17 */ + { 1, 6}, { 27, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 18 */ + { 1, 6}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 26, 0}, + { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 19 */ + { 1, 6}, { 10, 4}, { 5, 19}, { 16, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, + { 1, 5}, { 23, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, + { 1, 20}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 20 */ + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 3, 24}, { 1, 23}, { 1, 22}, + { 1, 25}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 22, 0}, + { 11, 18}, { 1, 20}, { 22, 0}, + { 23, 0}, { 1, 17}, { 5, 18}, { 1, 26}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ + { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, + { 1, 21}, { 5, 18}, { 1, 21}, { 1, 23}, { 1, 28}, { 15, 4}, { 1, 16}, { 1, 14}, + { 1, 7}, { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 1, 21}, { 11, 18}, { 1, 20}, + { 21, 0}, + { 21, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, { 1, 20}, /* Row 22 */ + { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 29}, { 1, 28}, + { 4, 7}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 19, 0}, + { 14, 18}, { 21, 0}, + { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, /* Row 23 */ + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 10, 4}, { 1, 22}, { 1, 21}, { 10, 18}, + { 1, 30}, { 1, 31}, { 1, 32}, { 1, 33}, { 1, 34}, { 1, 35}, { 1, 7}, { 10, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, + { 4, 18}, { 1, 36}, { 2, 37}, { 1, 36}, { 4, 18}, { 1, 21}, { 1, 17}, { 20, 0}, + { 20, 0}, { 1, 38}, { 1, 21}, { 11, 18}, { 1, 39}, { 4, 40}, { 1, 41}, { 13, 0}, /* Row 24 */ + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 3, 36}, { 5, 18}, { 1, 42}, { 1, 43}, + { 3, 44}, { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, + { 1, 5}, { 16, 0}, { 5, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 47}, + { 1, 48}, { 1, 49}, { 18, 0}, + { 19, 0}, { 1, 17}, { 1, 21}, { 12, 18}, { 1, 50}, { 1, 48}, { 3, 40}, { 1, 51}, /* Row 25 */ + { 1, 40}, { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 11, 4}, { 1, 52}, { 1, 21}, { 3, 18}, { 1, 37}, { 3, 46}, + { 1, 37}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 45}, { 1, 7}, { 10, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, + { 3, 18}, { 1, 54}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, { 1, 40}, + { 1, 49}, { 17, 0}, + { 19, 0}, { 5, 18}, { 1, 54}, { 2, 56}, { 1, 37}, { 5, 18}, { 1, 21}, { 1, 57}, /* Row 26 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 11, 4}, { 1, 58}, { 1, 59}, { 3, 18}, + { 1, 21}, { 1, 60}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, + { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, + { 13, 0}, { 5, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 2, 40}, + { 1, 49}, { 16, 0}, + { 18, 0}, { 1, 17}, { 1, 21}, { 3, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 5, 18}, /* Row 27 */ + { 1, 50}, { 1, 48}, { 5, 40}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 24}, { 3, 18}, + { 1, 37}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, + { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 3, 40}, + { 16, 0}, + { 18, 0}, { 4, 18}, { 1, 54}, { 5, 46}, { 1, 60}, { 1, 36}, { 4, 18}, { 1, 21}, /* Row 28 */ + { 1, 57}, { 4, 40}, { 1, 51}, { 1, 41}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, + { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 24}, + { 3, 18}, { 1, 61}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, + { 1, 34}, { 1, 62}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, + { 10, 0}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, + { 2, 40}, { 1, 51}, { 1, 41}, { 15, 0}, + { 18, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 29 */ + { 5, 40}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 4, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 30 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, + { 1, 62}, { 12, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, + { 1, 63}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 31 */ + { 5, 40}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 9, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 5, 40}, { 1, 41}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 32 */ + { 4, 40}, { 1, 51}, { 1, 41}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 9, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 6, 40}, { 1, 63}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 33 */ + { 3, 40}, { 1, 64}, { 1, 65}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 34 */ + { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 68}, { 1, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 69}, { 1, 70}, { 5, 40}, { 1, 51}, { 1, 41}, + { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 35 */ + { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 34}, { 1, 71}, { 1, 11}, { 1, 15}, + { 1, 6}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 16}, { 1, 14}, + { 1, 7}, { 3, 4}, { 1, 72}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 50}, { 1, 73}, { 6, 40}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 36 */ + { 1, 74}, { 1, 67}, { 3, 44}, { 1, 75}, { 1, 76}, { 1, 6}, { 21, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 1, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 5, 18}, { 1, 77}, { 1, 78}, /* Row 37 */ + { 4, 44}, { 1, 79}, { 1, 80}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 38 */ + { 5, 44}, { 1, 81}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 12, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, + { 1, 16}, { 1, 82}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 39 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 13, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, + { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 40 */ + { 5, 44}, { 1, 35}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 13, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 41 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 42 */ + { 5, 44}, { 1, 35}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 14, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 43 */ + { 4, 44}, { 1, 34}, { 1, 62}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 61}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 15, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 44 */ + { 5, 44}, { 1, 35}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, + { 1, 84}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, + { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 61}, { 6, 46}, { 1, 56}, { 5, 18}, /* Row 45 */ + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 18, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 84}, { 7, 46}, { 1, 54}, { 4, 18}, /* Row 46 */ + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 4, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, + { 1, 41}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 56}, { 6, 46}, { 1, 56}, /* Row 47 */ + { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 17, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 9, 4}, { 1, 22}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, + { 6, 40}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 54}, /* Row 48 */ + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, + { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 85}, + { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 6, 46}, /* Row 49 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, /* Row 50 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, { 1, 41}, + { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 56}, { 6, 46}, /* Row 51 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, /* Row 52 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 4, 44}, { 1, 67}, { 1, 87}, { 1, 41}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 56}, { 6, 46}, /* Row 53 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 88}, { 1, 89}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, /* Row 54 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 90}, { 1, 62}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 56}, { 6, 46}, /* Row 55 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 33}, { 1, 91}, { 2, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, /* Row 56 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 92}, { 1, 23}, + { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 93}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 56}, { 6, 46}, /* Row 57 */ + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 12, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 94}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, /* Row 58 */ + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 2, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 95}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 6, 18}, { 1, 56}, /* Row 59 */ + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 53}, + { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, + { 5, 44}, { 1, 34}, { 1, 62}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, + { 1, 5}, { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 96}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 60 */ + { 6, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 2, 18}, { 1, 21}, { 1, 47}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 5, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 97}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 61 */ + { 1, 36}, { 7, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 53}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 6, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, /* Row 62 */ + { 8, 46}, { 1, 36}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 35}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, { 1, 42}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 101}, { 1, 42}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 8, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 102}, { 1, 98}, { 2, 18}, /* Row 63 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, + { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 98}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 105}, { 1, 106}, /* Row 64 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 35}, { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 2, 18}, { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 9, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, + { 6, 44}, { 1, 35}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 108}, /* Row 65 */ + { 1, 29}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, + { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, + { 4, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 66 */ + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, + { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 7, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 14, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 67 */ + { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, + { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 5, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, + { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 68 */ + { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 2, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 5, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 69 */ + { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 6, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 18, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 70 */ + { 4, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 6, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 3, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 3, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 20, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 71 */ + { 5, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 2, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 34}, { 1, 62}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 72 */ + { 6, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 4, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 1, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, + { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 73 */ + { 7, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 4, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 110}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, + { 24, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 74 */ + { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, + { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 4, 4}, { 1, 19}, + { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 43}, { 1, 111}, { 3, 18}, { 1, 54}, { 15, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 26, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 75 */ + { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 4, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 56}, { 13, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, + { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 10, 4}, /* Row 76 */ + { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 112}, { 1, 23}, { 3, 18}, { 1, 54}, { 13, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, { 1, 5}, { 1, 0}, + { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 11, 4}, { 1, 19}, /* Row 77 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 2, 4}, { 1, 19}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 56}, { 11, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 16}, + { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, + { 1, 3}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 12, 4}, { 1, 19}, { 1, 24}, /* Row 78 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 54}, { 11, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 32, 4}, { 1, 16}, { 1, 14}, { 1, 7}, + { 2, 4}, + { 1, 4}, { 1, 113}, { 1, 114}, { 1, 115}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 79 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, + { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 56}, { 9, 46}, { 1, 61}, { 4, 18}, + { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 33, 4}, { 1, 16}, { 1, 14}, + { 1, 62}, { 1, 4}, + { 1, 4}, { 1, 7}, { 1, 117}, { 1, 8}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 80 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 54}, { 9, 46}, { 1, 37}, { 3, 18}, + { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 35, 4}, { 1, 118}, { 1, 119}, { 1, 7}, + { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 81 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 19}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 60}, { 1, 21}, + { 3, 18}, { 1, 98}, { 1, 120}, { 5, 44}, { 1, 33}, { 1, 62}, { 34, 4}, { 1, 8}, + { 1, 11}, { 1, 76}, { 1, 3}, + { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 82 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 121}, { 1, 24}, { 2, 18}, + { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 33}, { 1, 62}, { 33, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, { 1, 19}, { 1, 24}, /* Row 83 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 1, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 122}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 32, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 19}, /* Row 84 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 123}, { 1, 24}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 1, 0}, + { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, /* Row 85 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 124}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 35}, { 29, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 19}, /* Row 86 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 3, 0}, + { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 6, 4}, { 1, 19}, /* Row 87 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 35}, { 26, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 19}, /* Row 88 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 24, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, + { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 4, 4}, { 1, 19}, /* Row 89 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 23, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 19}, /* Row 90 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 2, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 1, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 2, 4}, { 1, 19}, /* Row 91 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, + { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 2, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 20, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, + { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 19}, /* Row 92 */ + { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, + { 5, 44}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 103}, { 1, 98}, + { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, + { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 18, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 121}, { 1, 24}, /* Row 93 */ + { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, + { 1, 33}, { 1, 7}, { 6, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, + { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, + { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 54}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 125}, { 1, 24}, { 2, 18}, /* Row 94 */ + { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, + { 1, 7}, { 7, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, + { 4, 18}, { 1, 21}, { 1, 53}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, + { 1, 54}, { 8, 46}, { 1, 54}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, + { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 126}, { 1, 98}, { 2, 18}, { 1, 36}, /* Row 95 */ + { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, + { 7, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, + { 1, 42}, { 1, 100}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, + { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, + { 6, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 14, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 96 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, + { 1, 99}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, + { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 7, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, + { 1, 62}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 97 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 47}, + { 1, 21}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, + { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 47}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 98 */ + { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 8, 18}, { 1, 36}, + { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 127}, { 1, 42}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, + { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 99 */ + { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 25}, + { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 8, 18}, { 1, 36}, { 7, 46}, + { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 1, 53}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 128}, { 1, 129}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, /* Row 100 */ + { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 22}, { 1, 21}, + { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, + { 7, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, + { 1, 43}, { 1, 42}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 101 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 53}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 102 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 43}, { 1, 42}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 34}, { 1, 62}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 103 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 53}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 35}, { 2, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 104 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 43}, { 1, 42}, + { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, + { 1, 34}, { 1, 62}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 105 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 94}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, + { 1, 93}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 106 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 92}, + { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, + { 5, 44}, { 1, 88}, { 1, 130}, { 1, 6}, { 1, 4}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 107 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 1, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 5, 44}, { 1, 131}, { 1, 7}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 108 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 1, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 4, 44}, { 1, 67}, { 1, 132}, { 1, 133}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 109 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 3, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 110 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 3, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, + { 1, 41}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 111 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 112 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, + { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 5, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, + { 1, 21}, { 1, 85}, { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 113 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, + { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, + { 1, 48}, { 6, 40}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 114 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 54}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 8, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, + { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 5, 40}, { 1, 51}, { 1, 41}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 115 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, + { 6, 46}, { 1, 56}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 56}, + { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 22}, { 1, 21}, + { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, + { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 134}, /* Row 116 */ + { 5, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, + { 7, 46}, { 1, 84}, { 7, 46}, { 1, 84}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 3, 18}, + { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, + { 1, 41}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 135}, /* Row 117 */ + { 1, 67}, { 4, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 25}, { 1, 23}, { 4, 18}, + { 1, 56}, { 6, 46}, { 1, 61}, { 7, 46}, { 1, 61}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 2, 18}, + { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 118 */ + { 1, 66}, { 1, 67}, { 3, 44}, { 1, 79}, { 1, 136}, { 19, 4}, { 1, 22}, { 1, 21}, + { 3, 18}, { 1, 54}, { 22, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 34}, { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, + { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 119 */ + { 1, 64}, { 1, 66}, { 1, 67}, { 2, 44}, { 1, 79}, { 1, 45}, { 1, 16}, { 18, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 20, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, + { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 120 */ + { 1, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 33}, { 1, 137}, { 1, 14}, + { 1, 16}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 20, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 13, 4}, { 1, 138}, + { 1, 139}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 121 */ + { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 33}, { 2, 7}, { 1, 14}, { 1, 16}, + { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 18, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 8}, { 1, 140}, { 1, 141}, + { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, + { 6, 40}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 122 */ + { 3, 40}, { 1, 64}, { 1, 66}, { 1, 131}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 14}, + { 1, 16}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 18, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 142}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 123 */ + { 4, 40}, { 1, 64}, { 1, 143}, { 1, 144}, { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, + { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 16, 46}, { 1, 56}, { 4, 18}, + { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 145}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, + { 1, 50}, { 1, 48}, { 6, 40}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 124 */ + { 5, 40}, { 1, 64}, { 1, 146}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 16, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 1, 147}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 125 */ + { 6, 40}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 126 */ + { 6, 40}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 127 */ + { 6, 40}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 128 */ + { 6, 40}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 129 */ + { 6, 40}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 130 */ + { 6, 40}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, + { 3, 18}, { 1, 21}, { 1, 55}, { 5, 40}, { 1, 51}, { 1, 148}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 131 */ + { 6, 40}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, + { 1, 56}, { 4, 18}, { 1, 57}, { 6, 40}, { 1, 149}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 132 */ + { 6, 40}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, + { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, + { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, + { 4, 18}, { 1, 57}, { 7, 40}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 133 */ + { 6, 40}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, + { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 6, 46}, + { 1, 56}, { 3, 18}, { 1, 69}, { 1, 150}, { 6, 40}, { 1, 51}, { 1, 148}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 134 */ + { 6, 40}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, + { 1, 22}, { 1, 21}, { 3, 18}, { 1, 36}, { 1, 151}, { 4, 46}, { 1, 151}, { 1, 36}, + { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 56}, + { 5, 46}, { 1, 54}, { 3, 18}, { 1, 50}, { 1, 73}, { 7, 40}, { 1, 41}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 135 */ + { 6, 40}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, + { 1, 25}, { 1, 23}, { 4, 18}, { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 36}, + { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 6, 4}, { 1, 8}, { 1, 11}, + { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, { 2, 18}, + { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, + { 8, 40}, { 1, 41}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 136 */ + { 6, 40}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, + { 1, 22}, { 1, 21}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 21}, { 1, 53}, { 6, 44}, + { 1, 34}, { 1, 62}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 50}, { 1, 48}, { 8, 40}, + { 1, 63}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 137 */ + { 6, 40}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, + { 1, 25}, { 1, 23}, { 12, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, { 1, 17}, + { 1, 21}, { 9, 18}, { 1, 47}, { 1, 70}, { 9, 40}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 138 */ + { 6, 40}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, + { 1, 22}, { 1, 21}, { 10, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, + { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 9, 18}, { 1, 47}, { 1, 70}, { 8, 40}, { 1, 51}, { 1, 41}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 69}, { 2, 47}, { 1, 152}, { 1, 73}, /* Row 139 */ + { 6, 40}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, + { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 21}, { 1, 153}, { 1, 103}, { 6, 44}, + { 1, 35}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 23, 0}, { 1, 147}, { 1, 154}, { 1, 18}, { 1, 21}, { 2, 18}, { 1, 21}, { 1, 47}, + { 1, 155}, { 1, 150}, { 10, 40}, { 15, 0}, + { 25, 0}, { 5, 48}, { 4, 73}, { 7, 40}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 7}, /* Row 140 */ + { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 1, 21}, { 4, 18}, + { 1, 21}, { 1, 42}, { 1, 53}, { 1, 103}, { 6, 44}, { 1, 34}, { 1, 62}, { 3, 4}, + { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 156}, + { 1, 17}, { 1, 157}, { 1, 55}, { 1, 48}, { 1, 64}, { 9, 40}, { 1, 51}, { 1, 41}, + { 15, 0}, + { 25, 0}, { 16, 40}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 141 */ + { 9, 4}, { 1, 25}, { 1, 22}, { 1, 158}, { 2, 98}, { 1, 77}, { 1, 53}, { 1, 43}, + { 7, 44}, { 1, 33}, { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, + { 1, 4}, { 1, 5}, { 30, 0}, { 1, 63}, { 11, 40}, { 1, 51}, { 1, 40}, { 16, 0}, + { 25, 0}, { 16, 40}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 142 */ + { 10, 4}, { 1, 19}, { 1, 159}, { 1, 160}, { 1, 103}, { 7, 44}, { 1, 79}, { 1, 161}, + { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, + { 32, 0}, { 1, 41}, { 1, 51}, { 8, 40}, { 1, 51}, { 1, 40}, { 17, 0}, + { 25, 0}, { 16, 40}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 143 */ + { 11, 4}, { 1, 62}, { 1, 35}, { 1, 34}, { 5, 33}, { 1, 161}, { 1, 136}, { 1, 7}, + { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 34, 0}, + { 8, 40}, { 1, 51}, { 1, 40}, { 18, 0}, + { 25, 0}, { 16, 40}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 144 */ + { 12, 4}, { 7, 7}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, + { 1, 5}, { 35, 0}, { 1, 49}, { 7, 40}, { 1, 41}, { 19, 0}, + { 25, 0}, { 16, 40}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 145 */ + { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 64, 0}, + { 25, 0}, { 16, 40}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 146 */ + { 19, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 17, 4}, { 1, 8}, /* Row 147 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, { 1, 8}, /* Row 148 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, { 1, 8}, /* Row 149 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 8}, /* Row 150 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 8}, /* Row 151 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 8}, /* Row 152 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 8}, /* Row 153 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 8}, /* Row 154 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 8}, /* Row 155 */ + { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 118}, { 1, 11}, { 1, 15}, /* Row 156 */ + { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 162}, { 1, 15}, { 1, 6}, { 1, 4}, /* Row 157 */ + { 1, 5}, { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 163}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ + }; + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 2, 8}, { 3, 4}, { 1, 5}, /* Row 1 */ + { 75, 0}, + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 10}, { 1, 11}, /* Row 2 */ + { 1, 8}, { 3, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 3 */ + { 1, 14}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 4 */ + { 1, 6}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 5 */ + { 1, 6}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 6 */ + { 1, 6}, { 4, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 7 */ + { 1, 6}, { 6, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 8 */ + { 1, 6}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 9 */ + { 1, 6}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 10 */ + { 1, 6}, { 12, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 11 */ + { 1, 6}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 12 */ + { 1, 6}, { 16, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 13 */ + { 1, 6}, { 18, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 14 */ + { 1, 6}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 15 */ + { 1, 6}, { 22, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 16 */ + { 1, 6}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 17 */ + { 1, 6}, { 26, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 18 */ + { 1, 6}, { 28, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 26, 0}, { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 19 */ + { 1, 6}, { 10, 4}, { 5, 19}, { 15, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 3, 4}, { 1, 5}, { 23, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 20 */ + { 1, 6}, { 9, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 3, 23}, { 1, 22}, { 1, 21}, + { 1, 24}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 22, 0}, { 11, 18}, { 1, 20}, { 22, 0}, + { 23, 0}, { 1, 17}, { 5, 18}, { 1, 25}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, + { 7, 18}, { 1, 22}, { 1, 27}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 12, 18}, { 1, 20}, { 21, 0}, + { 21, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 22 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, + { 9, 18}, { 1, 28}, { 1, 27}, { 4, 8}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 19, 0}, { 14, 18}, { 21, 0}, + { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, /* Row 23 */ + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, { 1, 21}, { 11, 18}, { 1, 29}, + { 1, 30}, { 2, 31}, { 1, 32}, { 1, 33}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 5, 18}, { 1, 34}, + { 2, 35}, { 1, 34}, { 5, 18}, { 1, 17}, { 20, 0}, + { 20, 0}, { 1, 36}, { 12, 18}, { 1, 37}, { 4, 38}, { 1, 39}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 3, 34}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, + { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, + { 1, 5}, { 16, 0}, { 5, 18}, { 1, 43}, { 4, 44}, { 1, 43}, { 4, 18}, { 1, 35}, + { 1, 45}, { 1, 46}, { 18, 0}, + { 19, 0}, { 1, 17}, { 13, 18}, { 1, 47}, { 1, 45}, { 3, 38}, { 1, 48}, { 1, 38}, /* Row 25 */ + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 11, 4}, { 1, 49}, { 4, 18}, { 1, 35}, { 3, 44}, { 1, 43}, { 5, 18}, + { 1, 50}, { 4, 31}, { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, + { 1, 8}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 4, 18}, { 1, 34}, { 6, 44}, + { 1, 34}, { 4, 18}, { 1, 51}, { 1, 38}, { 1, 46}, { 17, 0}, + { 19, 0}, { 5, 18}, { 1, 34}, { 2, 52}, { 1, 35}, { 6, 18}, { 1, 53}, { 4, 38}, /* Row 26 */ + { 1, 48}, { 1, 39}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 11, 4}, { 1, 3}, { 1, 54}, { 4, 18}, { 1, 55}, + { 4, 44}, { 1, 43}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 42}, { 1, 8}, + { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 13, 0}, + { 5, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 2, 38}, { 1, 46}, + { 16, 0}, + { 18, 0}, { 1, 17}, { 4, 18}, { 1, 43}, { 4, 44}, { 1, 35}, { 5, 18}, { 1, 47}, /* Row 27 */ + { 1, 45}, { 5, 38}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 23}, { 3, 18}, { 1, 35}, + { 6, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 3, 38}, { 16, 0}, + { 18, 0}, { 4, 18}, { 1, 34}, { 5, 44}, { 1, 55}, { 1, 34}, { 5, 18}, { 1, 53}, /* Row 28 */ + { 4, 38}, { 1, 48}, { 1, 39}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 23}, { 3, 18}, + { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, + { 1, 56}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, + { 10, 0}, { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 51}, { 2, 38}, + { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 29 */ + { 5, 38}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 4, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 30 */ + { 1, 48}, { 1, 39}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 8, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 1}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 31 */ + { 5, 38}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 5, 38}, { 1, 39}, + { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 32 */ + { 1, 48}, { 1, 39}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 1}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 33 */ + { 3, 38}, { 1, 48}, { 1, 57}, { 1, 13}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 2, 38}, /* Row 34 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 1, 60}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 61}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 35 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 1, 32}, { 1, 62}, { 1, 12}, { 1, 13}, + { 1, 6}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 11, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 3, 4}, { 1, 63}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 5, 18}, { 1, 64}, { 1, 58}, /* Row 36 */ + { 1, 59}, { 3, 31}, { 1, 65}, { 1, 66}, { 1, 6}, { 21, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, + { 1, 32}, { 1, 56}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 1, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 5, 18}, { 1, 67}, { 1, 68}, /* Row 37 */ + { 5, 31}, { 1, 69}, { 22, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 38 */ + { 1, 70}, { 1, 7}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 7}, { 1, 16}, { 1, 71}, { 1, 67}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 39 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, + { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 40 */ + { 1, 33}, { 1, 7}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 13, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 41 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 42 */ + { 1, 33}, { 1, 7}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 14, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, + { 5, 38}, { 1, 48}, { 1, 39}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 43 */ + { 4, 31}, { 1, 32}, { 1, 56}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 73}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, + { 1, 7}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 44 */ + { 1, 33}, { 1, 7}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, + { 1, 56}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 73}, { 6, 44}, { 1, 52}, { 5, 18}, /* Row 45 */ + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 18, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 46 */ + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 2, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 52}, { 6, 44}, { 1, 52}, /* Row 47 */ + { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, + { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 2, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 48 */ + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, + { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, + { 1, 48}, { 1, 39}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 6, 44}, /* Row 49 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 16, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, + { 1, 58}, { 1, 48}, { 4, 38}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, /* Row 50 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 1, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 6, 44}, /* Row 51 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, /* Row 52 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 4, 31}, { 1, 59}, { 1, 76}, { 1, 39}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 6, 44}, /* Row 53 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 14, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, + { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 5, 31}, { 1, 77}, { 1, 78}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, /* Row 54 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 6, 44}, /* Row 55 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, + { 1, 79}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, /* Row 56 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 80}, { 1, 22}, + { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 81}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 6, 44}, /* Row 57 */ + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 82}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, + { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, /* Row 58 */ + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 2, 7}, + { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 83}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 6, 18}, { 1, 52}, /* Row 59 */ + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 3, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 84}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 60 */ + { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, + { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 86}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 61 */ + { 1, 34}, { 7, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 1, 88}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, /* Row 62 */ + { 8, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 91}, { 1, 40}, { 4, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 71}, { 1, 29}, { 2, 18}, /* Row 63 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 29}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, + { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 5}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 94}, { 1, 95}, /* Row 64 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, + { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, + { 9, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 97}, /* Row 65 */ + { 1, 28}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, + { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 66 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 67 */ + { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 19}, + { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 2, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, + { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 68 */ + { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 5, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 15, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 69 */ + { 3, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 6, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 17, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 70 */ + { 4, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 18, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 71 */ + { 5, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 2, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 1, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, + { 1, 56}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, + { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 72 */ + { 6, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, + { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 1, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 21, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 73 */ + { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 4, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 99}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 23, 4}, + { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 74 */ + { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, + { 1, 41}, { 1, 67}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, + { 2, 4}, { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 75 */ + { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, + { 1, 29}, { 1, 92}, { 4, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, { 1, 52}, { 13, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 26, 4}, { 1, 7}, { 1, 16}, + { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 10, 4}, /* Row 76 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, + { 1, 22}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, + { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 5}, { 1, 0}, + { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 11, 4}, { 1, 19}, /* Row 77 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 5, 31}, { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 19}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 21}, { 4, 18}, { 1, 52}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 29, 4}, { 1, 7}, { 1, 16}, { 1, 15}, + { 1, 8}, { 2, 4}, { 1, 5}, + { 1, 3}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 78 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, + { 1, 33}, { 1, 7}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 30, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, + { 1, 4}, { 1, 33}, { 1, 100}, { 1, 98}, { 13, 4}, { 1, 19}, { 1, 23}, { 2, 18}, /* Row 79 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, + { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, + { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, + { 1, 101}, { 4, 18}, { 1, 52}, { 9, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 5, 31}, { 1, 32}, { 1, 56}, { 32, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 56}, + { 1, 7}, + { 1, 4}, { 1, 8}, { 1, 102}, { 1, 9}, { 1, 7}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 80 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 5, 31}, { 1, 33}, { 1, 7}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, { 1, 101}, + { 4, 18}, { 1, 34}, { 9, 44}, { 1, 35}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, + { 1, 7}, { 33, 4}, { 1, 7}, { 1, 103}, { 1, 10}, { 1, 8}, + { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, { 1, 19}, { 1, 23}, /* Row 81 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, + { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 19}, { 1, 23}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 104}, { 4, 18}, { 1, 29}, + { 1, 68}, { 6, 31}, { 1, 56}, { 33, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 66}, + { 1, 3}, + { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, /* Row 82 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 1, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, + { 1, 50}, { 5, 31}, { 1, 33}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 21}, { 4, 18}, + { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 56}, { 32, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, { 1, 19}, /* Row 83 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 6, 31}, { 1, 8}, { 1, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 105}, { 1, 23}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 80}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 30, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 8, 4}, /* Row 84 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 106}, { 1, 23}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, + { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 29, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 1, 0}, + { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 85 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 107}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, + { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 6, 4}, /* Row 86 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 4, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 26, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 3, 0}, + { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 87 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 4, 4}, /* Row 88 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 3, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 23, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 5, 0}, + { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 89 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 21, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 2, 4}, /* Row 90 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 5, 18}, { 1, 50}, { 2, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, + { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 91 */ + { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 1, 31}, { 1, 92}, { 1, 29}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, + { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 2, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, + { 18, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 8, 0}, + { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 19}, /* Row 92 */ + { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, + { 6, 31}, { 1, 8}, { 6, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 50}, { 1, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, + { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 5, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 19}, { 1, 23}, /* Row 93 */ + { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, + { 1, 8}, { 6, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 5, 18}, { 1, 40}, { 1, 41}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 108}, { 1, 23}, { 2, 18}, /* Row 94 */ + { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, + { 7, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, + { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 14, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 11, 0}, + { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 109}, { 1, 29}, { 2, 18}, { 1, 34}, /* Row 95 */ + { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 7, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, + { 1, 90}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, + { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 6, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, + { 1, 7}, { 12, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 96 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 87}, { 1, 29}, { 2, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 50}, { 4, 18}, + { 1, 34}, { 8, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 97 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 24}, + { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 85}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 4, 18}, + { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 98 */ + { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 21}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, + { 1, 87}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 5, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 99 */ + { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 24}, { 1, 22}, + { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 1, 50}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 110}, { 1, 111}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, /* Row 100 */ + { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, + { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, + { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 41}, { 1, 40}, { 3, 18}, + { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, + { 5, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 101 */ + { 6, 31}, { 1, 8}, { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 50}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, + { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, + { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 102 */ + { 6, 31}, { 1, 8}, { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 3, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 103 */ + { 6, 31}, { 1, 8}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 50}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 2, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 104 */ + { 6, 31}, { 1, 8}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 5, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 105 */ + { 6, 31}, { 1, 8}, { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 82}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 81}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 106 */ + { 6, 31}, { 1, 8}, { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 80}, { 1, 22}, { 3, 18}, { 1, 52}, + { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 77}, { 1, 112}, { 1, 6}, + { 1, 4}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 107 */ + { 6, 31}, { 1, 8}, { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 4}, { 1, 21}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, + { 1, 113}, { 1, 8}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 108 */ + { 6, 31}, { 1, 8}, { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 4, 31}, { 1, 59}, + { 1, 58}, { 1, 114}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 109 */ + { 6, 31}, { 1, 8}, { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 2, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, + { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 25, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 110 */ + { 6, 31}, { 1, 8}, { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 59}, + { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 111 */ + { 6, 31}, { 1, 8}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, + { 1, 58}, { 1, 48}, { 4, 38}, { 24, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 112 */ + { 6, 31}, { 1, 8}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 8, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 24}, { 1, 22}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, + { 1, 48}, { 1, 39}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 113 */ + { 6, 31}, { 1, 8}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, + { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, + { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, + { 6, 38}, { 23, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 114 */ + { 6, 31}, { 1, 8}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 2, 34}, + { 7, 44}, { 2, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 115 */ + { 6, 31}, { 1, 8}, { 17, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, + { 1, 52}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 22, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 115}, /* Row 116 */ + { 6, 31}, { 1, 8}, { 18, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, + { 7, 44}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 116}, /* Row 117 */ + { 1, 59}, { 5, 31}, { 1, 8}, { 18, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, + { 6, 44}, { 1, 73}, { 7, 44}, { 1, 73}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 118 */ + { 1, 58}, { 1, 59}, { 4, 31}, { 1, 16}, { 1, 7}, { 18, 4}, { 1, 21}, { 4, 18}, + { 1, 34}, { 22, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, + { 11, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, + { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 119 */ + { 1, 48}, { 1, 58}, { 1, 59}, { 3, 31}, { 1, 42}, { 1, 16}, { 1, 7}, { 17, 4}, + { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 20, 44}, { 1, 52}, { 4, 18}, { 1, 40}, + { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 21}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 120 */ + { 1, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 2, 31}, { 1, 56}, { 1, 15}, { 1, 16}, + { 1, 7}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 20, 44}, { 1, 34}, { 4, 18}, + { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 12, 4}, { 1, 7}, { 1, 117}, { 1, 73}, + { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, + { 1, 39}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 121 */ + { 2, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 2, 8}, { 1, 15}, { 1, 16}, + { 1, 7}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 18, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, + { 1, 9}, { 1, 118}, { 1, 119}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, + { 1, 47}, { 1, 45}, { 6, 38}, { 19, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 122 */ + { 3, 38}, { 1, 48}, { 1, 58}, { 1, 113}, { 1, 8}, { 1, 4}, { 1, 8}, { 1, 15}, + { 1, 16}, { 1, 7}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 18, 44}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 120}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 123 */ + { 4, 38}, { 1, 48}, { 1, 121}, { 1, 122}, { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, + { 1, 7}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 16, 44}, { 1, 52}, + { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 123}, { 3, 18}, { 1, 34}, + { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 18, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 124 */ + { 5, 38}, { 1, 48}, { 1, 124}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 1, 125}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 125 */ + { 6, 38}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 126 */ + { 6, 38}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 127 */ + { 6, 38}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 128 */ + { 6, 38}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 129 */ + { 6, 38}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 130 */ + { 6, 38}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, + { 4, 18}, { 1, 51}, { 5, 38}, { 1, 48}, { 1, 126}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 131 */ + { 6, 38}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 127}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 132 */ + { 6, 38}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, + { 6, 31}, { 1, 32}, { 1, 56}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, + { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, + { 4, 18}, { 1, 53}, { 7, 38}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 133 */ + { 6, 38}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, + { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 3, 18}, + { 1, 34}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 128}, { 6, 38}, { 1, 48}, { 1, 126}, + { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 134 */ + { 6, 38}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 1, 55}, { 4, 44}, { 1, 55}, { 1, 34}, + { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 52}, + { 5, 44}, { 1, 34}, { 3, 18}, { 1, 47}, { 1, 45}, { 7, 38}, { 1, 39}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 135 */ + { 6, 38}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, + { 1, 34}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, + { 1, 17}, { 3, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, { 1, 34}, { 4, 18}, + { 1, 53}, { 8, 38}, { 1, 39}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 136 */ + { 6, 38}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 9, 4}, { 1, 21}, { 6, 18}, { 2, 34}, { 6, 18}, { 1, 50}, { 6, 31}, { 1, 32}, + { 1, 56}, { 4, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 19, 0}, { 5, 18}, { 2, 34}, { 5, 18}, { 1, 47}, { 1, 45}, { 8, 38}, + { 1, 1}, { 13, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 137 */ + { 6, 38}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 8, 4}, { 1, 24}, { 1, 22}, { 12, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, + { 1, 7}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 20, 0}, { 1, 17}, { 10, 18}, { 1, 35}, { 1, 61}, { 9, 38}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 138 */ + { 6, 38}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 8, 4}, { 1, 21}, { 12, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, + { 9, 18}, { 1, 35}, { 1, 61}, { 8, 38}, { 1, 48}, { 1, 39}, { 14, 0}, + { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 18}, { 2, 35}, { 1, 129}, { 1, 45}, /* Row 139 */ + { 6, 38}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, + { 7, 4}, { 1, 19}, { 1, 26}, { 10, 18}, { 1, 130}, { 1, 107}, { 6, 31}, { 1, 33}, + { 1, 7}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 23, 0}, { 1, 131}, { 1, 132}, { 5, 18}, { 1, 35}, { 1, 133}, { 1, 128}, + { 10, 38}, { 15, 0}, + { 25, 0}, { 9, 45}, { 7, 38}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, /* Row 140 */ + { 1, 16}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 6, 18}, { 1, 40}, + { 1, 50}, { 1, 107}, { 6, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, { 1, 9}, + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 134}, { 1, 17}, + { 1, 135}, { 1, 51}, { 1, 45}, { 1, 136}, { 9, 38}, { 1, 48}, { 1, 39}, { 15, 0}, + { 25, 0}, { 16, 38}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 141 */ + { 1, 7}, { 8, 4}, { 1, 24}, { 1, 21}, { 1, 22}, { 2, 29}, { 1, 67}, { 1, 50}, + { 1, 41}, { 8, 31}, { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 1}, { 11, 38}, { 1, 48}, + { 1, 38}, { 16, 0}, + { 25, 0}, { 16, 38}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 142 */ + { 1, 7}, { 9, 4}, { 1, 89}, { 1, 137}, { 1, 138}, { 1, 92}, { 8, 31}, { 1, 42}, + { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, + { 1, 4}, { 1, 5}, { 32, 0}, { 1, 39}, { 1, 48}, { 8, 38}, { 1, 48}, { 1, 38}, + { 17, 0}, + { 25, 0}, { 16, 38}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 143 */ + { 1, 7}, { 9, 4}, { 1, 7}, { 1, 56}, { 1, 33}, { 1, 32}, { 5, 31}, { 1, 42}, + { 1, 16}, { 1, 8}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, + { 1, 4}, { 1, 5}, { 34, 0}, { 8, 38}, { 1, 48}, { 1, 38}, { 18, 0}, + { 25, 0}, { 16, 38}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 144 */ + { 1, 7}, { 10, 4}, { 1, 7}, { 7, 8}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, + { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 35, 0}, { 1, 46}, { 7, 38}, { 1, 39}, + { 19, 0}, + { 25, 0}, { 16, 38}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 145 */ + { 1, 7}, { 19, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 64, 0}, + { 25, 0}, { 16, 38}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 146 */ + { 1, 7}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, + { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 15, 4}, /* Row 147 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 13, 4}, /* Row 148 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, /* Row 149 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, /* Row 150 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 151 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 152 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 153 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 154 */ + { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 9}, /* Row 155 */ + { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 103}, { 1, 12}, { 1, 13}, /* Row 156 */ + { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 139}, { 1, 13}, { 1, 6}, { 1, 4}, /* Row 157 */ + { 1, 5}, { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 140}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ +}; + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + + { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 5, 4}, { 1, 5}, { 75, 0}, /* Row 1 */ + { 74, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ + { 4, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 3 */ + { 1, 12}, { 1, 13}, { 4, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 4 */ + { 1, 7}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 5 */ + { 1, 7}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 6 */ + { 1, 7}, { 4, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 7 */ + { 1, 7}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 8 */ + { 1, 7}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 9 */ + { 1, 7}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 10 */ + { 1, 7}, { 12, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 11 */ + { 1, 7}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 12 */ + { 1, 7}, { 16, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 13 */ + { 1, 7}, { 18, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 14 */ + { 1, 7}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 15 */ + { 1, 7}, { 22, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 16 */ + { 1, 7}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 17 */ + { 1, 7}, { 26, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 18 */ + { 1, 7}, { 28, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 26, 0}, + { 1, 14}, { 5, 15}, { 1, 14}, { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 19 */ + { 1, 7}, { 10, 4}, { 5, 16}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, + { 1, 5}, { 23, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 20 */ + { 1, 7}, { 9, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 3, 20}, { 1, 19}, { 1, 18}, + { 1, 21}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 22, 0}, + { 11, 15}, { 1, 17}, { 22, 0}, + { 23, 0}, { 1, 14}, { 5, 15}, { 1, 22}, { 25, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 21 */ + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, + { 7, 15}, { 1, 19}, { 1, 24}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, + { 1, 5}, { 20, 0}, { 1, 14}, { 12, 15}, { 1, 17}, { 21, 0}, + { 21, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 22, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 22 */ + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, + { 9, 15}, { 1, 20}, { 1, 24}, { 4, 4}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 19, 0}, { 14, 15}, { 21, 0}, + { 21, 0}, { 11, 15}, { 1, 17}, { 20, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, /* Row 23 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, { 1, 18}, { 11, 15}, { 1, 25}, + { 1, 26}, { 2, 27}, { 1, 28}, { 1, 29}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, + { 4, 4}, { 1, 5}, { 17, 0}, { 1, 14}, { 5, 15}, { 1, 30}, { 2, 31}, { 1, 30}, + { 5, 15}, { 1, 14}, { 20, 0}, + { 20, 0}, { 1, 22}, { 12, 15}, { 1, 32}, { 4, 33}, { 1, 7}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 3, 30}, { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, + { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 16, 0}, + { 5, 15}, { 1, 37}, { 4, 38}, { 1, 37}, { 4, 15}, { 1, 39}, { 1, 40}, { 1, 41}, + { 18, 0}, + { 19, 0}, { 1, 14}, { 13, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 11, 0}, { 1, 1}, /* Row 25 */ + { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, + { 1, 42}, { 4, 15}, { 1, 31}, { 3, 38}, { 1, 37}, { 5, 15}, { 1, 43}, { 4, 27}, + { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 14, 0}, + { 1, 14}, { 4, 15}, { 1, 30}, { 6, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 1, 33}, + { 1, 41}, { 17, 0}, + { 19, 0}, { 5, 15}, { 1, 30}, { 1, 44}, { 1, 34}, { 1, 31}, { 6, 15}, { 1, 45}, /* Row 26 */ + { 5, 33}, { 1, 7}, { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, { 1, 46}, { 1, 47}, { 4, 15}, { 1, 48}, + { 4, 38}, { 1, 37}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 36}, { 10, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 13, 0}, { 5, 15}, { 1, 34}, + { 6, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 2, 33}, { 1, 41}, { 16, 0}, + { 18, 0}, { 1, 14}, { 4, 15}, { 1, 37}, { 4, 38}, { 1, 31}, { 5, 15}, { 1, 31}, /* Row 27 */ + { 1, 40}, { 5, 33}, { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 12, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 31}, + { 6, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 3, 33}, { 16, 0}, + { 18, 0}, { 4, 15}, { 1, 30}, { 5, 38}, { 1, 48}, { 1, 30}, { 5, 15}, { 1, 45}, /* Row 28 */ + { 5, 33}, { 1, 7}, { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 13, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 19}, + { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, + { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 10, 0}, { 5, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 3, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 29 */ + { 5, 33}, { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 14, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 4, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 30 */ + { 1, 7}, { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 15, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 11, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 7, 0}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 5, 33}, { 1, 50}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 31 */ + { 5, 33}, { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 1, 7}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 32 */ + { 1, 7}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 4, 0}, { 5, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 50}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 33 */ + { 4, 33}, { 1, 51}, { 1, 52}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 3, 33}, /* Row 34 */ + { 1, 53}, { 1, 54}, { 1, 21}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 5}, { 1, 0}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 3, 15}, { 1, 55}, { 1, 56}, { 6, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 35 */ + { 1, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 1, 28}, { 1, 58}, { 1, 7}, { 1, 11}, + { 1, 7}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 11, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 4, 4}, { 1, 59}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 31}, { 1, 60}, { 6, 33}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 5, 15}, { 1, 61}, { 1, 53}, /* Row 36 */ + { 1, 57}, { 3, 27}, { 1, 62}, { 1, 56}, { 1, 7}, { 21, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, + { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 2, 4}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, + { 1, 7}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 5, 15}, { 1, 63}, { 1, 35}, /* Row 37 */ + { 5, 27}, { 1, 64}, { 22, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 3}, + { 1, 8}, { 1, 13}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 38 */ + { 1, 65}, { 1, 3}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 3}, { 1, 8}, { 1, 66}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 39 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, + { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, + { 6, 33}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 40 */ + { 1, 29}, { 1, 3}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 13, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 41 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, + { 6, 33}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 42 */ + { 1, 29}, { 1, 3}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 14, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 43 */ + { 4, 27}, { 1, 28}, { 1, 49}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 68}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, + { 1, 3}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 44 */ + { 1, 29}, { 1, 3}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, + { 1, 49}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 68}, { 6, 38}, { 1, 34}, { 5, 15}, /* Row 45 */ + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 18, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 69}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 46 */ + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 34}, { 6, 38}, { 1, 34}, /* Row 47 */ + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 17, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, + { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 2, 30}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 48 */ + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, + { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 6, 38}, /* Row 49 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 16, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, + { 1, 53}, { 5, 33}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, /* Row 50 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 1, 27}, { 1, 57}, { 1, 53}, { 3, 33}, { 1, 7}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 6, 38}, /* Row 51 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 2, 27}, { 1, 57}, { 1, 53}, { 2, 33}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, /* Row 52 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 4, 27}, { 1, 57}, { 1, 53}, { 1, 7}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 6, 38}, /* Row 53 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 14, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 71}, { 1, 72}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, /* Row 54 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 28}, { 1, 49}, { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 6, 38}, /* Row 55 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, + { 1, 49}, { 1, 3}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, /* Row 56 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 73}, { 1, 19}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 36}, + { 1, 13}, { 3, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 6, 38}, /* Row 57 */ + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 74}, { 4, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, + { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, /* Row 58 */ + { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 2, 3}, + { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 19, 0}, + { 17, 0}, { 1, 75}, { 1, 55}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 6, 15}, /* Row 59 */ + { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, + { 1, 49}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 3, 27}, { 1, 43}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 76}, { 1, 37}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 60 */ + { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, + { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 3, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 6}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 61 */ + { 1, 30}, { 7, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 1, 79}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 62 */ + { 8, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 80}, { 1, 34}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 9}, { 1, 77}, { 2, 15}, /* Row 63 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 37}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 68}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 82}, { 1, 83}, /* Row 64 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, + { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 9, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, + { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 85}, /* Row 65 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, + { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 66 */ + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 5, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 67 */ + { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 16}, + { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 2, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, + { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 68 */ + { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 15, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 69 */ + { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 6, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, + { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 70 */ + { 4, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 18, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 71 */ + { 5, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 1, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, + { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 72 */ + { 6, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, + { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 1, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 21, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 73 */ + { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 4, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 69}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, + { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 74 */ + { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, + { 1, 87}, { 1, 34}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, + { 1, 5}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 75 */ + { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 34}, { 13, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, { 1, 8}, + { 1, 13}, { 3, 4}, { 1, 5}, { 2, 0}, + { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 10, 4}, /* Row 76 */ + { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, + { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, + { 1, 19}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, + { 1, 0}, + { 1, 2}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 11, 4}, { 1, 16}, /* Row 77 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 5, 27}, { 1, 87}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 16}, { 1, 20}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 1, 4}, { 1, 18}, { 4, 15}, { 1, 34}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, { 1, 8}, { 1, 13}, + { 3, 4}, { 1, 5}, + { 1, 3}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 12, 4}, { 1, 16}, { 1, 20}, /* Row 78 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 3}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, { 1, 19}, + { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, + { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, + { 1, 4}, { 1, 88}, { 1, 89}, { 1, 86}, { 13, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 79 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, + { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, + { 4, 15}, { 1, 34}, { 9, 38}, { 1, 19}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 28}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 1, 49}, { 1, 3}, + { 2, 4}, { 1, 90}, { 1, 8}, { 1, 3}, { 12, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 80 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 3}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, { 4, 15}, { 1, 69}, + { 9, 38}, { 1, 31}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 33, 4}, + { 1, 3}, { 1, 91}, { 1, 81}, { 1, 4}, + { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 81 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, + { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 92}, { 4, 15}, { 1, 68}, { 1, 93}, + { 6, 27}, { 1, 49}, { 33, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 56}, { 1, 8}, + { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 82 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, + { 1, 29}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, /* Row 83 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 2, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, + { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 7}, { 1, 20}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, { 1, 16}, /* Row 84 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 3, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 5, 27}, { 1, 10}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 30}, { 12, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 1, 0}, + { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, /* Row 85 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 3, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 81}, { 1, 77}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 87}, { 1, 34}, + { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 2, 0}, + { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 6, 4}, { 1, 16}, /* Row 86 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 4, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 4, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 14, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 3, 0}, + { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 16}, /* Row 87 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 4, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, + { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 4, 0}, + { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 4, 4}, { 1, 16}, /* Row 88 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 5, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 16, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, + { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 16}, /* Row 89 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 5, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 21, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 6, 0}, + { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 2, 4}, { 1, 16}, /* Row 90 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 6, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 43}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, + { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, + { 1, 28}, { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 7, 0}, + { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 16}, /* Row 91 */ + { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, + { 6, 27}, { 6, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 34}, { 1, 35}, { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, + { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 18, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, + { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 16}, { 1, 20}, /* Row 92 */ + { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, + { 7, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, + { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, + { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, + { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 9, 0}, + { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 93 */ + { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 7, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, + { 1, 35}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 10, 0}, + { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 94 */ + { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 1, 81}, { 1, 25}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, + { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, + { 12, 0}, { 1, 5}, { 4, 4}, { 1, 57}, { 1, 77}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 95 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 41}, { 1, 25}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 35}, + { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 6, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 12, 0}, + { 13, 0}, { 1, 5}, { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 96 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 78}, { 1, 77}, { 2, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, + { 8, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 13, 0}, + { 14, 0}, { 1, 5}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 97 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 21}, { 1, 19}, + { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 37}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 4, 15}, { 1, 34}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, + { 15, 0}, { 1, 5}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 98 */ + { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 77}, { 1, 78}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 78}, + { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 15, 0}, + { 16, 0}, { 1, 5}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 99 */ + { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 21}, { 1, 19}, { 4, 15}, + { 1, 34}, { 6, 38}, { 1, 34}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 37}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 94}, + { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, + { 17, 0}, { 1, 95}, { 1, 96}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, /* Row 100 */ + { 1, 25}, { 1, 81}, { 6, 27}, { 11, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, + { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 8, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, + { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 101 */ + { 6, 27}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, + { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 102 */ + { 6, 27}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 3, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 103 */ + { 6, 27}, { 12, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 2, 3}, { 1, 8}, + { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 104 */ + { 6, 27}, { 13, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 5, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, + { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 1, 8}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 105 */ + { 6, 27}, { 13, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 5, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 74}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 36}, { 1, 7}, { 1, 11}, + { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 106 */ + { 6, 27}, { 14, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 73}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, + { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 54}, { 1, 97}, { 1, 7}, { 1, 4}, + { 1, 5}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 107 */ + { 6, 27}, { 14, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 4}, { 1, 18}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 98}, + { 1, 4}, { 1, 5}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 108 */ + { 6, 27}, { 15, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 4, 27}, { 1, 57}, { 1, 99}, + { 1, 9}, { 25, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 109 */ + { 6, 27}, { 15, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, + { 1, 57}, { 1, 53}, { 2, 33}, { 25, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 110 */ + { 6, 27}, { 16, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 57}, { 1, 53}, + { 3, 33}, { 1, 7}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 111 */ + { 6, 27}, { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, { 1, 53}, + { 5, 33}, { 24, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 112 */ + { 6, 27}, { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 21}, { 1, 19}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 113 */ + { 6, 27}, { 17, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 1, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 18}, + { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, + { 23, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 114 */ + { 6, 27}, { 18, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, + { 2, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 7, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 115 */ + { 6, 27}, { 18, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, + { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 22, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 100}, /* Row 116 */ + { 6, 27}, { 19, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 69}, { 7, 38}, + { 1, 69}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 9, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 101}, /* Row 117 */ + { 1, 57}, { 5, 27}, { 19, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, + { 1, 68}, { 7, 38}, { 1, 68}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, + { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 3, 15}, { 1, 30}, { 7, 38}, + { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 118 */ + { 1, 53}, { 1, 57}, { 4, 27}, { 1, 8}, { 1, 3}, { 18, 4}, { 1, 18}, { 4, 15}, + { 1, 30}, { 22, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 11, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 119 */ + { 1, 33}, { 1, 53}, { 1, 57}, { 3, 27}, { 1, 36}, { 1, 8}, { 1, 3}, { 17, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 20, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 18}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 120 */ + { 2, 33}, { 1, 53}, { 1, 57}, { 2, 27}, { 1, 49}, { 1, 13}, { 1, 8}, { 1, 3}, + { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 20, 38}, { 1, 30}, { 4, 15}, { 1, 43}, + { 6, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, { 1, 79}, { 1, 63}, { 3, 15}, + { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 121 */ + { 3, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 2, 4}, { 1, 13}, { 1, 8}, { 1, 3}, + { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 18, 38}, { 1, 34}, { 4, 15}, + { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, { 1, 8}, + { 1, 7}, { 1, 102}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, + { 1, 40}, { 6, 33}, { 19, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 122 */ + { 4, 33}, { 1, 53}, { 1, 62}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 16, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 18, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 79}, + { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, + { 1, 7}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 123 */ + { 5, 33}, { 1, 103}, { 1, 3}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 16, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 53}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, + { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 18, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 124 */ + { 6, 33}, { 1, 95}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 18}, + { 4, 15}, { 1, 30}, { 16, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, + { 1, 49}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 1, 27}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, + { 6, 33}, { 1, 7}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 125 */ + { 6, 33}, { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 126 */ + { 6, 33}, { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 4, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 127 */ + { 6, 33}, { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 16, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 128 */ + { 6, 33}, { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 7, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 45}, { 6, 33}, { 1, 7}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 129 */ + { 6, 33}, { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 130 */ + { 6, 33}, { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 10, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, + { 1, 22}, { 6, 33}, { 1, 104}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 131 */ + { 6, 33}, { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 65}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 132 */ + { 6, 33}, { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, + { 1, 28}, { 1, 49}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 13, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, + { 1, 45}, { 7, 33}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 133 */ + { 6, 33}, { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, + { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 14}, { 3, 15}, { 1, 30}, + { 6, 38}, { 1, 44}, { 3, 15}, { 1, 55}, { 1, 105}, { 7, 33}, { 1, 104}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 134 */ + { 6, 33}, { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, + { 1, 18}, { 4, 15}, { 1, 30}, { 1, 106}, { 4, 38}, { 1, 106}, { 1, 30}, { 4, 15}, + { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 15}, { 1, 34}, { 5, 38}, + { 1, 30}, { 3, 15}, { 1, 31}, { 1, 60}, { 7, 33}, { 1, 7}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 135 */ + { 6, 33}, { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, + { 1, 21}, { 1, 19}, { 4, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, + { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 14}, + { 3, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, { 4, 15}, { 1, 45}, + { 8, 33}, { 1, 7}, { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 136 */ + { 6, 33}, { 12, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, + { 1, 18}, { 6, 15}, { 2, 30}, { 6, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, + { 4, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 19, 0}, { 5, 15}, { 2, 30}, { 5, 15}, { 1, 31}, { 1, 40}, { 8, 33}, { 1, 50}, + { 13, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 137 */ + { 6, 33}, { 13, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, + { 1, 21}, { 1, 19}, { 12, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, + { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 20, 0}, { 1, 14}, { 10, 15}, { 1, 39}, { 1, 107}, { 9, 33}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 138 */ + { 6, 33}, { 14, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, + { 1, 18}, { 12, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, { 9, 15}, + { 1, 39}, { 1, 107}, { 9, 33}, { 1, 7}, { 14, 0}, + { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 55}, { 2, 96}, { 1, 108}, { 1, 60}, /* Row 139 */ + { 6, 33}, { 15, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, + { 1, 16}, { 1, 23}, { 10, 15}, { 1, 109}, { 1, 81}, { 6, 27}, { 1, 29}, { 1, 3}, + { 2, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 23, 0}, { 1, 28}, { 1, 110}, { 5, 15}, { 1, 39}, { 1, 111}, { 1, 105}, { 10, 33}, + { 15, 0}, + { 25, 0}, { 1, 59}, { 4, 40}, { 4, 60}, { 7, 33}, { 16, 0}, { 1, 5}, { 4, 4}, /* Row 140 */ + { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 6, 15}, + { 1, 34}, { 1, 43}, { 1, 81}, { 6, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 112}, + { 1, 14}, { 1, 113}, { 1, 22}, { 1, 40}, { 1, 76}, { 10, 33}, { 1, 7}, { 15, 0}, + { 25, 0}, { 16, 33}, { 17, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 141 */ + { 8, 4}, { 1, 21}, { 1, 18}, { 1, 19}, { 1, 77}, { 1, 25}, { 1, 34}, { 1, 43}, + { 1, 35}, { 8, 27}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 50}, { 13, 33}, { 16, 0}, + { 25, 0}, { 16, 33}, { 18, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 142 */ + { 9, 4}, { 1, 16}, { 1, 10}, { 1, 66}, { 1, 81}, { 8, 27}, { 1, 36}, { 1, 8}, + { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, + { 1, 5}, { 32, 0}, { 1, 7}, { 11, 33}, { 17, 0}, + { 25, 0}, { 16, 33}, { 19, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 143 */ + { 9, 4}, { 1, 3}, { 1, 49}, { 1, 29}, { 1, 28}, { 5, 27}, { 1, 36}, { 1, 8}, + { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 34, 0}, { 10, 33}, { 18, 0}, + { 25, 0}, { 16, 33}, { 20, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 144 */ + { 10, 4}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, + { 1, 4}, { 1, 5}, { 35, 0}, { 1, 41}, { 7, 33}, { 1, 7}, { 19, 0}, + { 25, 0}, { 16, 33}, { 21, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 145 */ + { 19, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 64, 0}, + { 25, 0}, { 16, 33}, { 22, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 146 */ + { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, + { 65, 0}, + { 64, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 3}, /* Row 147 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 66, 0}, + { 65, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, { 1, 3}, /* Row 148 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 67, 0}, + { 66, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 3}, /* Row 149 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 68, 0}, + { 67, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 3}, /* Row 150 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 69, 0}, + { 68, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 3}, /* Row 151 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 70, 0}, + { 69, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 3}, /* Row 152 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 71, 0}, + { 70, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 3}, /* Row 153 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 72, 0}, + { 71, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 154 */ + { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 73, 0}, + { 72, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 8}, { 1, 7}, /* Row 155 */ + { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 74, 0}, + { 73, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 91}, { 1, 7}, { 1, 11}, { 1, 7}, /* Row 156 */ + { 1, 4}, { 1, 5}, { 75, 0}, + { 74, 0}, { 1, 5}, { 4, 4}, { 1, 114}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 157 */ + { 76, 0}, + { 75, 0}, { 1, 5}, { 2, 4}, { 1, 8}, { 1, 115}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + { 76, 0}, { 1, 1}, { 1, 2}, { 5, 3}, { 1, 4}, { 76, 0}, /* Row 0 */ + { 75, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 6, 3}, { 1, 4}, { 75, 0}, /* Row 1 */ + { 74, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 2, 6}, { 4, 3}, { 1, 4}, /* Row 2 */ + { 74, 0}, + { 73, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 8}, /* Row 3 */ + { 1, 6}, { 4, 3}, { 1, 4}, { 73, 0}, + { 72, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 4 */ + { 2, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 72, 0}, + { 71, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 5 */ + { 4, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 71, 0}, + { 70, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 6 */ + { 6, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 70, 0}, + { 69, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 7 */ + { 8, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 69, 0}, + { 68, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 8 */ + { 10, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 68, 0}, + { 67, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 9 */ + { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 67, 0}, + { 66, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 10 */ + { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 66, 0}, + { 65, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 11 */ + { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 65, 0}, + { 64, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 12 */ + { 18, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 64, 0}, + { 63, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 13 */ + { 20, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 63, 0}, + { 62, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 14 */ + { 22, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 62, 0}, + { 61, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 15 */ + { 24, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 61, 0}, + { 60, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 16 */ + { 26, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 60, 0}, + { 59, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 17 */ + { 28, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 59, 0}, + { 58, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 18 */ + { 30, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 26, 0}, { 1, 9}, { 5, 10}, { 1, 9}, + { 25, 0}, + { 57, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 19 */ + { 10, 3}, { 5, 5}, { 17, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 23, 0}, { 1, 1}, + { 9, 10}, { 1, 1}, { 23, 0}, + { 56, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 20 */ + { 9, 3}, { 1, 5}, { 1, 11}, { 5, 12}, { 1, 11}, { 1, 13}, { 16, 3}, { 1, 6}, + { 4, 3}, { 1, 4}, { 22, 0}, { 11, 10}, { 1, 1}, { 22, 0}, + { 23, 0}, { 1, 9}, { 5, 10}, { 1, 14}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 21 */ + { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 7, 10}, + { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 20, 0}, { 1, 9}, + { 12, 10}, { 1, 1}, { 21, 0}, + { 21, 0}, { 1, 1}, { 9, 10}, { 1, 1}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 22 */ + { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 9, 10}, + { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 19, 0}, { 14, 10}, + { 21, 0}, + { 21, 0}, { 11, 10}, { 1, 1}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, /* Row 23 */ + { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 11}, { 11, 10}, { 1, 12}, { 1, 7}, + { 3, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 17, 0}, { 1, 9}, + { 6, 10}, { 2, 12}, { 6, 10}, { 1, 9}, { 20, 0}, + { 20, 0}, { 1, 14}, { 12, 10}, { 1, 9}, { 4, 2}, { 1, 17}, { 13, 0}, { 1, 1}, /* Row 24 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 13}, + { 1, 12}, { 12, 10}, { 1, 12}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, + { 16, 0}, { 5, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 1, 1}, { 18, 0}, + { 19, 0}, { 1, 9}, { 13, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 11, 0}, { 1, 1}, /* Row 25 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, { 1, 19}, + { 4, 10}, { 5, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, + { 1, 4}, { 14, 0}, { 1, 9}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 14}, { 1, 2}, + { 1, 1}, { 17, 0}, + { 19, 0}, { 6, 10}, { 3, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 9, 0}, /* Row 26 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, + { 1, 5}, { 1, 14}, { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 12, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 13, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 14}, + { 2, 2}, { 1, 1}, { 16, 0}, + { 18, 0}, { 1, 9}, { 4, 10}, { 6, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, /* Row 27 */ + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 1, 11}, { 5, 6}, + { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 11, 0}, { 1, 9}, { 5, 10}, + { 8, 12}, { 4, 10}, { 1, 14}, { 3, 2}, { 16, 0}, + { 18, 0}, { 5, 10}, { 6, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 6, 0}, /* Row 28 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 13, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 13, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 10, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 3, 2}, { 1, 17}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 5, 0}, /* Row 29 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 14, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 13, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 8, 0}, { 1, 9}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 3, 0}, /* Row 30 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 15, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 7, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 5, 2}, { 1, 1}, { 14, 0}, + { 18, 0}, { 4, 10}, { 9, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 2, 0}, /* Row 31 */ + { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 16, 3}, + { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 5, 0}, { 1, 9}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 9, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 1, 1}, /* Row 32 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 17, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 10, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 15, 3}, { 1, 6}, + { 4, 3}, { 1, 4}, { 4, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, + { 1, 1}, { 14, 0}, + { 18, 0}, { 4, 10}, { 10, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 1, 18}, /* Row 33 */ + { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 18, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, + { 1, 6}, { 4, 3}, { 1, 4}, { 2, 0}, { 1, 9}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 10, 12}, { 6, 10}, { 1, 14}, { 3, 2}, { 1, 20}, { 1, 6}, /* Row 34 */ + { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 19, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 11, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, { 1, 6}, { 4, 3}, + { 1, 4}, { 1, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 1, 17}, + { 15, 0}, + { 18, 0}, { 4, 10}, { 11, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 1, 2}, { 1, 20}, /* Row 35 */ + { 3, 6}, { 1, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 20, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 11, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 16, 3}, { 1, 6}, + { 4, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 16, 0}, + { 18, 0}, { 4, 10}, { 11, 12}, { 6, 10}, { 1, 14}, { 1, 20}, { 5, 6}, { 1, 2}, /* Row 36 */ + { 1, 5}, { 21, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 17, 3}, { 1, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 22, 3}, /* Row 37 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, + { 17, 3}, { 1, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, + { 1, 18}, { 6, 2}, { 17, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 22, 3}, /* Row 38 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 13, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 18, 3}, + { 1, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 17, 0}, + { 18, 0}, { 4, 10}, { 13, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 22, 3}, { 1, 5}, /* Row 39 */ + { 1, 12}, { 3, 10}, { 13, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 17, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, + { 18, 0}, { 4, 10}, { 13, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 21, 3}, /* Row 40 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, + { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 18, 0}, + { 18, 0}, { 4, 10}, { 14, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 21, 3}, { 1, 5}, /* Row 41 */ + { 1, 12}, { 3, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, + { 18, 0}, { 4, 10}, { 14, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 20, 3}, /* Row 42 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 15, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, + { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 19, 0}, + { 18, 0}, { 4, 10}, { 15, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 20, 3}, { 1, 5}, /* Row 43 */ + { 1, 12}, { 3, 10}, { 15, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 13, 3}, + { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 20, 0}, + { 18, 0}, { 4, 10}, { 15, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 19, 3}, /* Row 44 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 20, 0}, + { 18, 0}, { 4, 10}, { 16, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 19, 3}, { 1, 5}, /* Row 45 */ + { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, + { 1, 5}, { 11, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 46 */ + { 1, 5}, { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 47 */ + { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 48 */ + { 1, 5}, { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 49 */ + { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 50 */ + { 1, 5}, { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 51 */ + { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 52 */ + { 1, 5}, { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 5, 6}, { 1, 20}, { 1, 17}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 53 */ + { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 54 */ + { 1, 5}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 7, 6}, { 1, 3}, { 1, 4}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 55 */ + { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 3, 3}, { 1, 4}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 56 */ + { 1, 5}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 6, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 8, 6}, { 3, 3}, { 1, 4}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 57 */ + { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, + { 1, 11}, { 5, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 2, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 58 */ + { 1, 5}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 3, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 19, 0}, + { 17, 0}, { 1, 22}, { 1, 12}, { 3, 10}, { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, /* Row 59 */ + { 1, 12}, { 6, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, + { 8, 12}, { 5, 10}, { 1, 11}, { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 5, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 18, 0}, + { 16, 0}, { 1, 1}, { 1, 18}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, { 7, 12}, /* Row 60 */ + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 3, 6}, + { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 6, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 17, 0}, + { 15, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, /* Row 61 */ + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 1, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 8, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 16, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 2, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 9, 10}, /* Row 62 */ + { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 10, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 23}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 9, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 15, 0}, + { 13, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 12}, { 3, 10}, /* Row 63 */ + { 8, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, + { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, + { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 11, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 14, 0}, + { 12, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 24}, { 1, 12}, /* Row 64 */ + { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, + { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 13, 0}, + { 11, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 65 */ + { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, + { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 9, 10}, + { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 12, 0}, + { 10, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 66 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 8, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 15, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 11, 0}, + { 9, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 2, 3}, /* Row 67 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 10, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 3, 3}, /* Row 68 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 18, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 9, 0}, + { 7, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 4, 3}, /* Row 69 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 7, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 20, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 8, 0}, + { 6, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 5, 3}, /* Row 70 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 6, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 21, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 7, 0}, + { 5, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 6, 3}, /* Row 71 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 23, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 6, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 7, 3}, /* Row 72 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, + { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 24, 3}, + { 1, 6}, { 3, 3}, { 1, 4}, { 5, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 8, 3}, /* Row 73 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 5, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 4, 10}, { 8, 12}, + { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 26, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 9, 3}, /* Row 74 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, + { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 4, 3}, { 1, 5}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, + { 15, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 27, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 3, 0}, + { 1, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 10, 3}, /* Row 75 */ + { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 15, 12}, + { 4, 10}, { 1, 12}, { 7, 6}, { 29, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 2, 0}, + { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 11, 3}, { 1, 5}, /* Row 76 */ + { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 5, 10}, + { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 5}, { 1, 12}, + { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, + { 13, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 30, 3}, { 1, 6}, { 3, 3}, + { 1, 4}, { 1, 0}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 12, 3}, { 1, 5}, { 1, 12}, /* Row 77 */ + { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 12}, { 6, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 4, 10}, { 13, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 32, 3}, { 1, 6}, { 3, 3}, { 1, 4}, + { 2, 3}, { 1, 6}, { 1, 2}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 78 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 1, 5}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 11, 12}, { 5, 10}, + { 1, 11}, { 6, 6}, { 1, 5}, { 33, 3}, { 1, 6}, { 3, 3}, + { 1, 3}, { 1, 5}, { 1, 18}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 79 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 6, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 4, 10}, { 11, 12}, { 4, 10}, { 1, 12}, + { 7, 6}, { 35, 3}, { 1, 6}, { 2, 3}, + { 2, 3}, { 1, 6}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 80 */ + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 1, 5}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 4, 10}, { 1, 11}, + { 6, 6}, { 1, 5}, { 35, 3}, { 1, 5}, { 1, 6}, { 1, 3}, + { 3, 3}, { 1, 6}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 81 */ + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 6, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 6, 6}, { 36, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 82 */ + { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 5, 6}, { 2, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, + { 1, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 35, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 83 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, + { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, { 1, 12}, + { 6, 6}, { 1, 5}, { 33, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, + { 1, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 84 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 32, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 0}, + { 2, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 85 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 30, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 2, 0}, + { 3, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 8, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 86 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 6, 6}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 29, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 3, 0}, + { 4, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 87 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 27, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, + { 5, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 6, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 88 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 5, 6}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 26, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 5, 0}, + { 6, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 89 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 1, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 24, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 6, 0}, + { 7, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 4, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 90 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 4, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 23, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, + { 8, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 91 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 3, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 21, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 8, 0}, + { 9, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 92 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 11}, { 5, 10}, { 7, 12}, + { 6, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, + { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 20, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 9, 0}, + { 10, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 93 */ + { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 13}, { 1, 12}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, + { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 5, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 6, 6}, { 1, 5}, { 18, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 10, 0}, + { 11, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 94 */ + { 3, 10}, { 1, 12}, { 7, 6}, { 8, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, + { 1, 11}, { 1, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, + { 1, 11}, { 5, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 11, 0}, + { 12, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 95 */ + { 1, 12}, { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 1, 21}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, + { 1, 12}, { 4, 10}, { 9, 12}, { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 12, 0}, + { 13, 0}, { 1, 4}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 96 */ + { 1, 12}, { 7, 6}, { 9, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, + { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, { 5, 10}, + { 8, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 14, 3}, { 1, 7}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, + { 14, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 97 */ + { 1, 12}, { 7, 6}, { 9, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, + { 1, 12}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, + { 9, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 14, 0}, + { 15, 0}, { 1, 4}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 98 */ + { 1, 12}, { 7, 6}, { 10, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 10, 10}, { 7, 12}, + { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 1, 12}, + { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 11, 3}, { 1, 7}, { 1, 2}, + { 1, 5}, { 1, 3}, { 1, 4}, { 15, 0}, + { 16, 0}, { 1, 4}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, /* Row 99 */ + { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 7, 12}, + { 4, 10}, { 1, 12}, { 4, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 1, 6}, { 1, 11}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 9, 3}, { 1, 7}, + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, + { 17, 0}, { 1, 4}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, /* Row 100 */ + { 11, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 9, 10}, { 7, 12}, { 9, 10}, { 8, 12}, + { 5, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 11, 3}, { 1, 13}, /* Row 101 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 11}, /* Row 102 */ + { 5, 10}, { 7, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 4, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 5, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 13}, /* Row 103 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, + { 1, 5}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 11}, /* Row 104 */ + { 5, 10}, { 7, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 6, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 2, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 13}, /* Row 105 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 11}, /* Row 106 */ + { 5, 10}, { 7, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, + { 1, 18}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 13}, /* Row 107 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 3}, { 1, 4}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 11}, /* Row 108 */ + { 5, 10}, { 7, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 5, 6}, { 1, 20}, { 1, 1}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 13}, /* Row 109 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 25, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 11}, /* Row 110 */ + { 5, 10}, { 7, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 13}, /* Row 111 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 24, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 11}, /* Row 112 */ + { 5, 10}, { 7, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 13}, /* Row 113 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 23, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 11}, /* Row 114 */ + { 5, 10}, { 7, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 13}, /* Row 115 */ + { 1, 12}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 9, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 19, 3}, { 1, 11}, /* Row 116 */ + { 5, 10}, { 7, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 18}, { 6, 6}, { 19, 3}, /* Row 117 */ + { 1, 13}, { 1, 12}, { 4, 10}, { 24, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 1, 5}, + { 11, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, + { 21, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 2}, { 1, 20}, { 5, 6}, /* Row 118 */ + { 20, 3}, { 1, 11}, { 5, 10}, { 22, 12}, { 5, 10}, { 1, 11}, { 7, 6}, { 12, 3}, + { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, + { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 2}, { 1, 20}, { 5, 6}, /* Row 119 */ + { 19, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 22, 12}, { 4, 10}, { 1, 12}, { 7, 6}, + { 1, 5}, { 13, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 20, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 2}, { 1, 20}, { 3, 6}, /* Row 120 */ + { 1, 3}, { 1, 6}, { 19, 3}, { 1, 11}, { 5, 10}, { 20, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, + { 6, 2}, { 1, 17}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 2}, { 1, 20}, { 2, 6}, /* Row 121 */ + { 2, 3}, { 1, 6}, { 18, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 20, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 14, 3}, { 1, 7}, { 1, 25}, { 4, 10}, { 8, 12}, + { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 2}, { 1, 20}, { 1, 6}, /* Row 122 */ + { 3, 3}, { 1, 6}, { 18, 3}, { 1, 11}, { 5, 10}, { 18, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 14, 3}, { 1, 7}, { 1, 2}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, + { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 2}, { 1, 20}, { 4, 3}, /* Row 123 */ + { 1, 6}, { 17, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 18, 12}, { 4, 10}, { 1, 12}, + { 7, 6}, { 1, 5}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 20}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 4, 3}, /* Row 124 */ + { 1, 6}, { 17, 3}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 7, 6}, + { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 17}, { 4, 10}, + { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 1, 4}, /* Row 125 */ + { 4, 3}, { 1, 6}, { 16, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 2, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 17, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 2, 0}, { 1, 4}, /* Row 126 */ + { 4, 3}, { 1, 6}, { 16, 3}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 3, 0}, { 1, 4}, /* Row 127 */ + { 4, 3}, { 1, 6}, { 15, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 5, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 16, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 4, 0}, { 1, 4}, /* Row 128 */ + { 4, 3}, { 1, 6}, { 15, 3}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 5, 0}, { 1, 4}, /* Row 129 */ + { 4, 3}, { 1, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 8, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, + { 6, 2}, { 15, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 6, 0}, { 1, 4}, /* Row 130 */ + { 4, 3}, { 1, 6}, { 14, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 10, 0}, + { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 26}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 7, 0}, { 1, 4}, /* Row 131 */ + { 4, 3}, { 1, 6}, { 13, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 11, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 6, 2}, + { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 8, 0}, { 1, 4}, /* Row 132 */ + { 4, 3}, { 1, 6}, { 13, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, + { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 7, 2}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 9, 0}, { 1, 4}, /* Row 133 */ + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 14, 0}, { 1, 9}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 19}, + { 7, 2}, { 1, 26}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 10, 0}, { 1, 4}, /* Row 134 */ + { 4, 3}, { 1, 6}, { 12, 3}, { 1, 11}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 11}, + { 7, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, + { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 8, 2}, { 1, 17}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 11, 0}, { 1, 4}, /* Row 135 */ + { 4, 3}, { 1, 6}, { 11, 3}, { 1, 13}, { 1, 12}, { 5, 10}, { 4, 12}, { 5, 10}, + { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, + { 1, 4}, { 17, 0}, { 1, 9}, { 4, 10}, { 4, 12}, { 5, 10}, { 1, 14}, { 8, 2}, + { 1, 17}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 12, 0}, { 1, 4}, /* Row 136 */ + { 4, 3}, { 1, 6}, { 11, 3}, { 1, 11}, { 14, 10}, { 1, 11}, { 7, 6}, { 7, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, { 12, 10}, { 1, 12}, + { 1, 18}, { 8, 2}, { 1, 1}, { 13, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 13, 0}, { 1, 4}, /* Row 137 */ + { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 12, 10}, { 1, 12}, { 7, 6}, + { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, + { 1, 9}, { 10, 10}, { 1, 12}, { 10, 2}, { 14, 0}, + { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 14, 0}, { 1, 4}, /* Row 138 */ + { 4, 3}, { 1, 6}, { 10, 3}, { 1, 11}, { 12, 10}, { 1, 11}, { 7, 6}, { 6, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, { 9, 10}, { 1, 12}, + { 10, 2}, { 1, 17}, { 14, 0}, + { 18, 0}, { 4, 10}, { 12, 12}, { 7, 2}, { 15, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 139 */ + { 9, 3}, { 1, 5}, { 1, 15}, { 10, 10}, { 1, 15}, { 7, 6}, { 1, 5}, { 5, 3}, + { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, { 1, 17}, { 1, 14}, + { 5, 10}, { 1, 12}, { 1, 10}, { 1, 19}, { 10, 2}, { 15, 0}, + { 25, 0}, { 1, 20}, { 4, 18}, { 11, 2}, { 16, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 140 */ + { 9, 3}, { 1, 5}, { 1, 11}, { 1, 12}, { 6, 10}, { 1, 12}, { 1, 11}, { 8, 6}, + { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 27, 0}, { 2, 9}, + { 1, 19}, { 1, 14}, { 1, 18}, { 11, 2}, { 1, 17}, { 15, 0}, + { 25, 0}, { 16, 2}, { 17, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, /* Row 141 */ + { 1, 11}, { 4, 12}, { 1, 11}, { 9, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, + { 1, 3}, { 1, 4}, { 30, 0}, { 1, 1}, { 13, 2}, { 16, 0}, + { 25, 0}, { 16, 2}, { 18, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, /* Row 142 */ + { 1, 13}, { 11, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, + { 32, 0}, { 1, 17}, { 11, 2}, { 17, 0}, + { 25, 0}, { 16, 2}, { 19, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 5}, /* Row 143 */ + { 7, 6}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 34, 0}, + { 10, 2}, { 18, 0}, + { 25, 0}, { 16, 2}, { 20, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 25, 3}, { 1, 7}, /* Row 144 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 35, 0}, { 1, 1}, { 7, 2}, { 1, 17}, + { 19, 0}, + { 25, 0}, { 16, 2}, { 21, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 23, 3}, { 1, 7}, /* Row 145 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 64, 0}, + { 25, 0}, { 16, 2}, { 22, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 21, 3}, { 1, 7}, /* Row 146 */ + { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 65, 0}, + { 64, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 19, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 147 */ + { 1, 3}, { 1, 4}, { 66, 0}, + { 65, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 148 */ + { 1, 3}, { 1, 4}, { 67, 0}, + { 66, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 149 */ + { 1, 3}, { 1, 4}, { 68, 0}, + { 67, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 150 */ + { 1, 3}, { 1, 4}, { 69, 0}, + { 68, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 151 */ + { 1, 3}, { 1, 4}, { 70, 0}, + { 69, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 152 */ + { 1, 3}, { 1, 4}, { 71, 0}, + { 70, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 153 */ + { 1, 3}, { 1, 4}, { 72, 0}, + { 71, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 154 */ + { 1, 3}, { 1, 4}, { 73, 0}, + { 72, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 155 */ + { 1, 3}, { 1, 4}, { 74, 0}, + { 73, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 5}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 156 */ + { 1, 3}, { 1, 4}, { 75, 0}, + { 74, 0}, { 1, 4}, { 5, 3}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 76, 0}, /* Row 157 */ + { 75, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 20}, { 1, 5}, { 1, 3}, { 1, 4}, /* Row 158 */ + { 77, 0}, + { 76, 0}, { 1, 4}, { 4, 3}, { 1, 4}, { 78, 0} /* Row 159 */ +}; + +# endif +#else +# warning "Other pixel depths not yet supported" +#endif + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap160x160 = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + 160, // width - Width in pixels + 160, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nuttxLut, // Index 0: Unselected LUT + g_nuttxLut, // Index 1: Selected LUT + }, + g_nuttxRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/libnxwidgets/src/glyph_nxlogo320x320.cxx b/libnxwidgets/src/glyph_nxlogo320x320.cxx new file mode 100644 index 000000000..174c69355 --- /dev/null +++ b/libnxwidgets/src/glyph_nxlogo320x320.cxx @@ -0,0 +1,1043 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "nxconfig.hxx" +#include "crlepalettebitmap.hxx" +#include "glyphs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +#define BITMAP_NROWS 320 +#define BITMAP_NCOLUMNS 320 +#define BITMAP_NLUTCODES 7 + +/**************************************************************************** + * Private Bitmap Data + ****************************************************************************/ + +using namespace NXWidgets; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 + +static const uint32_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x000000, 0x60b0e0, 0x3c34e4, 0x2c2884, 0xd0e4f0, 0xfcfcfc, 0x5c98bc /* Codes 0-6 */ +}; + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 + +static const uint16_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x0000, 0x659c, 0x41bd, 0x3151, 0xd73e, 0xffff, 0x64d8 /* Codes 0-6 */ +}; + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +static const uint8_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x02, 0x9f, 0x4c, 0x35, 0xe1, 0xfe, 0x8c /* Codes 0-6 */ +}; + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +static const nxgl_mxpixel_t g_nuttxLut[BITMAP_NLUTCODES] = +{ + 0x00, 0x7b, 0x4b, 0x26, 0xff, 0xff, 0x77 /* Codes 0-6 */ +}; + +# endif +#else +# error "Unsupport pixel format" +#endif + +static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = +{ + {154, 0}, { 2, 1}, { 10, 2}, {154, 0}, /* Row 0 */ + {153, 0}, { 2, 1}, { 12, 2}, {153, 0}, /* Row 1 */ + {152, 0}, { 2, 1}, { 14, 2}, {152, 0}, /* Row 2 */ + {151, 0}, { 2, 1}, { 16, 2}, {151, 0}, /* Row 3 */ + {150, 0}, { 2, 1}, { 6, 2}, { 3, 3}, { 9, 2}, {150, 0}, /* Row 4 */ + {149, 0}, { 2, 1}, { 6, 2}, { 5, 3}, { 9, 2}, {149, 0}, /* Row 5 */ + {148, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 3, 1}, { 2, 3}, { 9, 2}, {148, 0}, /* Row 6 */ + {147, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 3, 2}, { 2, 3}, { 9, 2}, /* Row 7 */ + {147, 0}, + {146, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 2, 3}, { 9, 2}, /* Row 8 */ + {146, 0}, + {145, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 7, 2}, { 2, 3}, { 9, 2}, /* Row 9 */ + {145, 0}, + {144, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 9, 2}, { 2, 3}, { 9, 2}, /* Row 10 */ + {144, 0}, + {143, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 11, 2}, { 2, 3}, { 9, 2}, /* Row 11 */ + {143, 0}, + {142, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 13, 2}, { 2, 3}, { 9, 2}, /* Row 12 */ + {142, 0}, + {141, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 15, 2}, { 2, 3}, { 9, 2}, /* Row 13 */ + {141, 0}, + {140, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 17, 2}, { 2, 3}, { 9, 2}, /* Row 14 */ + {140, 0}, + {139, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 19, 2}, { 2, 3}, { 9, 2}, /* Row 15 */ + {139, 0}, + {138, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 21, 2}, { 2, 3}, { 9, 2}, /* Row 16 */ + {138, 0}, + {137, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, { 2, 3}, { 9, 2}, /* Row 17 */ + {137, 0}, + {136, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 25, 2}, { 2, 3}, { 9, 2}, /* Row 18 */ + {136, 0}, + {135, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 27, 2}, { 2, 3}, { 9, 2}, /* Row 19 */ + {135, 0}, + {134, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 29, 2}, { 2, 3}, { 9, 2}, /* Row 20 */ + {134, 0}, + {133, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 31, 2}, { 2, 3}, { 9, 2}, /* Row 21 */ + {133, 0}, + {132, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 33, 2}, { 2, 3}, { 9, 2}, /* Row 22 */ + {132, 0}, + {131, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 35, 2}, { 2, 3}, { 9, 2}, /* Row 23 */ + {131, 0}, + {130, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 37, 2}, { 2, 3}, { 9, 2}, /* Row 24 */ + {130, 0}, + {129, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 39, 2}, { 2, 3}, { 9, 2}, /* Row 25 */ + {129, 0}, + {128, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 41, 2}, { 2, 3}, { 9, 2}, /* Row 26 */ + {128, 0}, + {127, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 43, 2}, { 2, 3}, { 9, 2}, /* Row 27 */ + {127, 0}, + {126, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 45, 2}, { 2, 3}, { 9, 2}, /* Row 28 */ + {126, 0}, + {125, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 47, 2}, { 2, 3}, { 9, 2}, /* Row 29 */ + {125, 0}, + {124, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 49, 2}, { 2, 3}, { 9, 2}, /* Row 30 */ + {124, 0}, + {123, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 51, 2}, { 2, 3}, { 9, 2}, /* Row 31 */ + {123, 0}, + {122, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 53, 2}, { 2, 3}, { 9, 2}, /* Row 32 */ + {122, 0}, + {121, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 55, 2}, { 2, 3}, { 9, 2}, /* Row 33 */ + {121, 0}, + {120, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 57, 2}, { 2, 3}, { 9, 2}, /* Row 34 */ + {120, 0}, + {119, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 59, 2}, { 2, 3}, { 9, 2}, /* Row 35 */ + {119, 0}, + {118, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 61, 2}, { 2, 3}, { 9, 2}, /* Row 36 */ + { 56, 0}, { 10, 4}, { 52, 0}, + {117, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 63, 2}, { 2, 3}, { 9, 2}, /* Row 37 */ + { 53, 0}, { 14, 4}, { 50, 0}, + {116, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 65, 2}, { 2, 3}, { 9, 2}, /* Row 38 */ + { 50, 0}, { 18, 4}, { 48, 0}, + {115, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 67, 2}, { 2, 3}, { 9, 2}, /* Row 39 */ + { 48, 0}, { 20, 4}, { 47, 0}, + {114, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 24, 2}, { 10, 4}, { 35, 2}, /* Row 40 */ + { 2, 3}, { 9, 2}, { 46, 0}, { 22, 4}, { 46, 0}, + {113, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, { 14, 4}, { 34, 2}, /* Row 41 */ + { 2, 3}, { 9, 2}, { 45, 0}, { 23, 4}, { 45, 0}, + { 48, 0}, { 11, 4}, { 53, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, /* Row 42 */ + { 17, 4}, { 33, 2}, { 2, 3}, { 9, 2}, { 43, 0}, { 25, 4}, { 44, 0}, + { 46, 0}, { 14, 4}, { 51, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, /* Row 43 */ + { 19, 4}, { 33, 2}, { 2, 3}, { 9, 2}, { 42, 0}, { 26, 4}, { 43, 0}, + { 44, 0}, { 18, 4}, { 48, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, /* Row 44 */ + { 21, 4}, { 33, 2}, { 2, 3}, { 9, 2}, { 40, 0}, { 28, 4}, { 42, 0}, + { 43, 0}, { 20, 4}, { 46, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, /* Row 45 */ + { 23, 4}, { 33, 2}, { 2, 3}, { 9, 2}, { 39, 0}, { 28, 4}, { 42, 0}, + { 42, 0}, { 22, 4}, { 44, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 23, 2}, /* Row 46 */ + { 25, 4}, { 8, 3}, { 25, 2}, { 2, 3}, { 9, 2}, { 37, 0}, { 30, 4}, { 41, 0}, + { 42, 0}, { 23, 4}, { 42, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, { 24, 2}, /* Row 47 */ + { 26, 4}, { 9, 3}, { 24, 2}, { 2, 3}, { 9, 2}, { 36, 0}, { 14, 4}, { 2, 5}, + { 14, 4}, { 41, 0}, + { 41, 0}, { 25, 4}, { 1, 0}, { 9, 6}, { 30, 0}, { 2, 1}, { 6, 2}, { 2, 3}, /* Row 48 */ + { 2, 1}, { 24, 2}, { 28, 4}, { 9, 3}, { 24, 2}, { 2, 3}, { 9, 2}, { 34, 0}, + { 12, 4}, { 8, 5}, { 12, 4}, { 2, 6}, { 38, 0}, + { 40, 0}, { 27, 4}, { 11, 6}, { 27, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, /* Row 49 */ + { 25, 2}, { 28, 4}, { 10, 3}, { 24, 2}, { 2, 3}, { 9, 2}, { 33, 0}, { 11, 4}, + { 10, 5}, { 11, 4}, { 3, 6}, { 37, 0}, + { 39, 0}, { 29, 4}, { 12, 6}, { 24, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, /* Row 50 */ + { 25, 2}, { 11, 4}, { 6, 5}, { 13, 4}, { 10, 3}, { 24, 2}, { 2, 3}, { 9, 2}, + { 31, 0}, { 11, 4}, { 12, 5}, { 11, 4}, { 3, 6}, { 36, 0}, + { 39, 0}, { 29, 4}, { 12, 6}, { 23, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, /* Row 51 */ + { 26, 2}, { 10, 4}, { 8, 5}, { 12, 4}, { 11, 3}, { 24, 2}, { 2, 3}, { 9, 2}, + { 30, 0}, { 11, 4}, { 12, 5}, { 11, 4}, { 4, 6}, { 35, 0}, + { 38, 0}, { 31, 4}, { 12, 6}, { 21, 0}, { 2, 1}, { 6, 2}, { 2, 3}, { 2, 1}, /* Row 52 */ + { 27, 2}, { 10, 4}, { 9, 5}, { 12, 4}, { 11, 3}, { 24, 2}, { 2, 3}, { 9, 2}, + { 28, 0}, { 11, 4}, { 14, 5}, { 10, 4}, { 5, 6}, { 34, 0}, + { 38, 0}, { 12, 4}, { 5, 5}, { 14, 4}, { 12, 6}, { 20, 0}, { 2, 1}, { 6, 2}, /* Row 53 */ + { 2, 3}, { 2, 1}, { 27, 2}, { 10, 4}, { 11, 5}, { 11, 4}, { 12, 3}, { 24, 2}, + { 2, 3}, { 9, 2}, { 27, 0}, { 11, 4}, { 14, 5}, { 10, 4}, { 6, 6}, { 33, 0}, + { 37, 0}, { 11, 4}, { 8, 5}, { 14, 4}, { 12, 6}, { 18, 0}, { 2, 1}, { 6, 2}, /* Row 54 */ + { 2, 3}, { 2, 1}, { 28, 2}, { 10, 4}, { 12, 5}, { 11, 4}, { 12, 3}, { 24, 2}, + { 2, 3}, { 9, 2}, { 25, 0}, { 11, 4}, { 15, 5}, { 10, 4}, { 7, 6}, { 32, 0}, + { 37, 0}, { 10, 4}, { 10, 5}, { 13, 4}, { 12, 6}, { 17, 0}, { 2, 1}, { 6, 2}, /* Row 55 */ + { 2, 3}, { 2, 1}, { 29, 2}, { 9, 4}, { 13, 5}, { 11, 4}, { 12, 3}, { 25, 2}, + { 2, 3}, { 9, 2}, { 24, 0}, { 11, 4}, { 15, 5}, { 10, 4}, { 7, 6}, { 32, 0}, + { 36, 0}, { 10, 4}, { 11, 5}, { 14, 4}, { 12, 6}, { 15, 0}, { 2, 1}, { 6, 2}, /* Row 56 */ + { 2, 3}, { 2, 1}, { 30, 2}, { 9, 4}, { 14, 5}, { 11, 4}, { 12, 3}, { 25, 2}, + { 2, 3}, { 9, 2}, { 22, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 8, 6}, { 31, 0}, + { 36, 0}, { 10, 4}, { 12, 5}, { 13, 4}, { 12, 6}, { 14, 0}, { 2, 1}, { 6, 2}, /* Row 57 */ + { 2, 3}, { 2, 1}, { 31, 2}, { 9, 4}, { 14, 5}, { 11, 4}, { 12, 3}, { 26, 2}, + { 2, 3}, { 9, 2}, { 21, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 8, 6}, { 31, 0}, + { 36, 0}, { 9, 4}, { 14, 5}, { 13, 4}, { 12, 6}, { 12, 0}, { 2, 1}, { 6, 2}, /* Row 58 */ + { 2, 3}, { 2, 1}, { 32, 2}, { 8, 4}, { 16, 5}, { 11, 4}, { 12, 3}, { 26, 2}, + { 2, 3}, { 9, 2}, { 19, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 10, 6}, { 30, 0}, + { 36, 0}, { 9, 4}, { 14, 5}, { 13, 4}, { 12, 6}, { 11, 0}, { 2, 1}, { 6, 2}, /* Row 59 */ + { 2, 3}, { 2, 1}, { 33, 2}, { 8, 4}, { 16, 5}, { 11, 4}, { 12, 3}, { 27, 2}, + { 2, 3}, { 9, 2}, { 18, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 10, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 13, 4}, { 12, 6}, { 9, 0}, { 2, 1}, { 6, 2}, /* Row 60 */ + { 2, 3}, { 2, 1}, { 34, 2}, { 8, 4}, { 17, 5}, { 11, 4}, { 12, 3}, { 27, 2}, + { 2, 3}, { 9, 2}, { 16, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 11, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 13, 4}, { 12, 6}, { 8, 0}, { 2, 1}, { 6, 2}, /* Row 61 */ + { 2, 3}, { 2, 1}, { 35, 2}, { 8, 4}, { 17, 5}, { 11, 4}, { 12, 3}, { 28, 2}, + { 2, 3}, { 9, 2}, { 15, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 12, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 17, 5}, { 13, 4}, { 12, 6}, { 6, 0}, { 2, 1}, { 6, 2}, /* Row 62 */ + { 2, 3}, { 2, 1}, { 36, 2}, { 8, 4}, { 18, 5}, { 11, 4}, { 12, 3}, { 28, 2}, + { 2, 3}, { 9, 2}, { 13, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 13, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 17, 5}, { 13, 4}, { 12, 6}, { 5, 0}, { 2, 1}, { 6, 2}, /* Row 63 */ + { 2, 3}, { 2, 1}, { 37, 2}, { 8, 4}, { 18, 5}, { 11, 4}, { 12, 3}, { 29, 2}, + { 2, 3}, { 9, 2}, { 12, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 13, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 18, 5}, { 13, 4}, { 12, 6}, { 3, 0}, { 2, 1}, { 6, 2}, /* Row 64 */ + { 2, 3}, { 2, 1}, { 38, 2}, { 8, 4}, { 19, 5}, { 11, 4}, { 12, 3}, { 29, 2}, + { 2, 3}, { 9, 2}, { 10, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 18, 5}, { 13, 4}, { 12, 6}, { 2, 0}, { 2, 1}, { 6, 2}, /* Row 65 */ + { 2, 3}, { 2, 1}, { 39, 2}, { 8, 4}, { 19, 5}, { 11, 4}, { 12, 3}, { 30, 2}, + { 2, 3}, { 9, 2}, { 9, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 13, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 19, 5}, { 13, 4}, { 12, 6}, { 2, 1}, { 6, 2}, { 2, 3}, /* Row 66 */ + { 2, 1}, { 40, 2}, { 8, 4}, { 20, 5}, { 11, 4}, { 12, 3}, { 30, 2}, { 2, 3}, + { 9, 2}, { 7, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 19, 5}, { 13, 4}, { 11, 6}, { 1, 3}, { 1, 1}, { 6, 2}, /* Row 67 */ + { 2, 3}, { 2, 1}, { 41, 2}, { 8, 4}, { 20, 5}, { 11, 4}, { 12, 3}, { 31, 2}, + { 2, 3}, { 9, 2}, { 6, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 20, 5}, { 13, 4}, { 9, 6}, { 3, 3}, { 5, 2}, { 2, 3}, /* Row 68 */ + { 2, 1}, { 42, 2}, { 8, 4}, { 21, 5}, { 11, 4}, { 12, 3}, { 31, 2}, { 2, 3}, + { 9, 2}, { 4, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 31, 0}, + { 36, 0}, { 8, 4}, { 20, 5}, { 13, 4}, { 8, 6}, { 4, 3}, { 4, 2}, { 2, 3}, /* Row 69 */ + { 2, 1}, { 43, 2}, { 8, 4}, { 21, 5}, { 11, 4}, { 12, 3}, { 32, 2}, { 2, 3}, + { 9, 2}, { 3, 0}, { 11, 4}, { 15, 5}, { 10, 4}, { 15, 6}, { 31, 0}, + { 36, 0}, { 8, 4}, { 21, 5}, { 13, 4}, { 6, 6}, { 6, 3}, { 2, 2}, { 2, 3}, /* Row 70 */ + { 2, 1}, { 44, 2}, { 8, 4}, { 22, 5}, { 11, 4}, { 12, 3}, { 32, 2}, { 2, 3}, + { 9, 2}, { 1, 0}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 32, 0}, + { 36, 0}, { 8, 4}, { 21, 5}, { 13, 4}, { 5, 6}, { 7, 3}, { 1, 2}, { 2, 3}, /* Row 71 */ + { 2, 1}, { 45, 2}, { 8, 4}, { 22, 5}, { 11, 4}, { 12, 3}, { 33, 2}, { 2, 3}, + { 9, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 32, 0}, + { 36, 0}, { 8, 4}, { 22, 5}, { 13, 4}, { 3, 6}, { 10, 3}, { 2, 1}, { 46, 2}, /* Row 72 */ + { 8, 4}, { 23, 5}, { 11, 4}, { 12, 3}, { 33, 2}, { 2, 3}, { 7, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 33, 0}, + { 36, 0}, { 8, 4}, { 22, 5}, { 13, 4}, { 2, 6}, { 11, 3}, { 1, 1}, { 47, 2}, /* Row 73 */ + { 8, 4}, { 23, 5}, { 11, 4}, { 12, 3}, { 34, 2}, { 2, 3}, { 6, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 33, 0}, + { 36, 0}, { 8, 4}, { 23, 5}, { 13, 4}, { 12, 3}, { 48, 2}, { 8, 4}, { 24, 5}, /* Row 74 */ + { 11, 4}, { 12, 3}, { 34, 2}, { 2, 3}, { 4, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 34, 0}, + { 36, 0}, { 8, 4}, { 23, 5}, { 13, 4}, { 13, 3}, { 47, 2}, { 8, 4}, { 24, 5}, /* Row 75 */ + { 11, 4}, { 12, 3}, { 35, 2}, { 2, 3}, { 3, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 34, 0}, + { 36, 0}, { 8, 4}, { 24, 5}, { 13, 4}, { 12, 3}, { 47, 2}, { 8, 4}, { 25, 5}, /* Row 76 */ + { 11, 4}, { 12, 3}, { 35, 2}, { 2, 3}, { 1, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 35, 0}, + { 36, 0}, { 8, 4}, { 24, 5}, { 13, 4}, { 12, 3}, { 47, 2}, { 8, 4}, { 25, 5}, /* Row 77 */ + { 11, 4}, { 12, 3}, { 36, 2}, { 2, 3}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, + { 35, 0}, + { 36, 0}, { 8, 4}, { 25, 5}, { 13, 4}, { 12, 3}, { 46, 2}, { 8, 4}, { 26, 5}, /* Row 78 */ + { 11, 4}, { 12, 3}, { 36, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 36, 0}, + { 36, 0}, { 8, 4}, { 25, 5}, { 13, 4}, { 12, 3}, { 46, 2}, { 8, 4}, { 26, 5}, /* Row 79 */ + { 11, 4}, { 12, 3}, { 36, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 36, 0}, + { 36, 0}, { 8, 4}, { 26, 5}, { 13, 4}, { 12, 3}, { 45, 2}, { 8, 4}, { 27, 5}, /* Row 80 */ + { 11, 4}, { 12, 3}, { 34, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 37, 0}, + { 36, 0}, { 8, 4}, { 26, 5}, { 13, 4}, { 12, 3}, { 45, 2}, { 8, 4}, { 27, 5}, /* Row 81 */ + { 11, 4}, { 12, 3}, { 34, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 37, 0}, + { 36, 0}, { 8, 4}, { 27, 5}, { 13, 4}, { 12, 3}, { 44, 2}, { 8, 4}, { 28, 5}, /* Row 82 */ + { 11, 4}, { 12, 3}, { 32, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 38, 0}, + { 36, 0}, { 8, 4}, { 27, 5}, { 13, 4}, { 12, 3}, { 44, 2}, { 8, 4}, { 28, 5}, /* Row 83 */ + { 11, 4}, { 12, 3}, { 32, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 38, 0}, + { 36, 0}, { 8, 4}, { 28, 5}, { 13, 4}, { 12, 3}, { 43, 2}, { 8, 4}, { 29, 5}, /* Row 84 */ + { 11, 4}, { 12, 3}, { 30, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 39, 0}, + { 36, 0}, { 8, 4}, { 28, 5}, { 13, 4}, { 12, 3}, { 43, 2}, { 8, 4}, { 29, 5}, /* Row 85 */ + { 11, 4}, { 12, 3}, { 30, 2}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 39, 0}, + { 36, 0}, { 8, 4}, { 29, 5}, { 13, 4}, { 12, 3}, { 42, 2}, { 8, 4}, { 14, 5}, /* Row 86 */ + { 1, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 28, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 40, 0}, + { 36, 0}, { 8, 4}, { 29, 5}, { 13, 4}, { 12, 3}, { 42, 2}, { 8, 4}, { 14, 5}, /* Row 87 */ + { 1, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 28, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 40, 0}, + { 36, 0}, { 8, 4}, { 30, 5}, { 13, 4}, { 12, 3}, { 41, 2}, { 8, 4}, { 14, 5}, /* Row 88 */ + { 2, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 26, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 41, 0}, + { 36, 0}, { 8, 4}, { 30, 5}, { 13, 4}, { 12, 3}, { 41, 2}, { 8, 4}, { 14, 5}, /* Row 89 */ + { 2, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 26, 2}, { 11, 4}, { 15, 5}, { 11, 4}, + { 14, 6}, { 41, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 1, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 40, 2}, /* Row 90 */ + { 8, 4}, { 14, 5}, { 3, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 24, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 1, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 40, 2}, /* Row 91 */ + { 8, 4}, { 14, 5}, { 3, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 24, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 2, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 39, 2}, /* Row 92 */ + { 8, 4}, { 14, 5}, { 4, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 22, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 2, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 39, 2}, /* Row 93 */ + { 8, 4}, { 14, 5}, { 4, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 22, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 3, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 38, 2}, /* Row 94 */ + { 8, 4}, { 14, 5}, { 5, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 20, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 3, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 38, 2}, /* Row 95 */ + { 8, 4}, { 14, 5}, { 5, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 20, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 4, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 37, 2}, /* Row 96 */ + { 8, 4}, { 14, 5}, { 6, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 18, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 4, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 37, 2}, /* Row 97 */ + { 8, 4}, { 14, 5}, { 6, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 18, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 5, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 36, 2}, /* Row 98 */ + { 8, 4}, { 14, 5}, { 7, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 16, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 2, 3}, { 12, 6}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 5, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 36, 2}, /* Row 99 */ + { 8, 4}, { 14, 5}, { 7, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 16, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 3, 3}, { 11, 6}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 6, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 35, 2}, /* Row 100 */ + { 8, 4}, { 14, 5}, { 8, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 14, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 5, 3}, { 9, 6}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 6, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 35, 2}, /* Row 101 */ + { 8, 4}, { 14, 5}, { 8, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 14, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 6, 3}, { 8, 6}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 7, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 34, 2}, /* Row 102 */ + { 8, 4}, { 14, 5}, { 9, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 12, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 8, 3}, { 6, 6}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 7, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 34, 2}, /* Row 103 */ + { 8, 4}, { 14, 5}, { 9, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 12, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 9, 3}, { 5, 6}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 33, 2}, /* Row 104 */ + { 8, 4}, { 14, 5}, { 10, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 10, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 11, 3}, { 3, 6}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 33, 2}, /* Row 105 */ + { 8, 4}, { 14, 5}, { 10, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 10, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 12, 3}, { 2, 6}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 9, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 32, 2}, /* Row 106 */ + { 8, 4}, { 14, 5}, { 11, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 8, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 50, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 9, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 32, 2}, /* Row 107 */ + { 8, 4}, { 14, 5}, { 11, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 8, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 15, 3}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 10, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 31, 2}, /* Row 108 */ + { 8, 4}, { 14, 5}, { 12, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 6, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 15, 3}, { 2, 2}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 10, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 31, 2}, /* Row 109 */ + { 8, 4}, { 14, 5}, { 12, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 6, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 15, 3}, { 3, 2}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 30, 2}, /* Row 110 */ + { 8, 4}, { 14, 5}, { 13, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 4, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 6, 2}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 30, 2}, /* Row 111 */ + { 8, 4}, { 14, 5}, { 13, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 4, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 7, 2}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 12, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 29, 2}, /* Row 112 */ + { 8, 4}, { 14, 5}, { 14, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 2, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 16, 3}, { 7, 2}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 12, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 29, 2}, /* Row 113 */ + { 8, 4}, { 14, 5}, { 14, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 2, 2}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 1, 2}, { 2, 3}, { 7, 2}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 13, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 28, 2}, /* Row 114 */ + { 8, 4}, { 14, 5}, { 15, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 11, 4}, { 15, 5}, + { 11, 4}, { 14, 3}, { 3, 2}, { 2, 3}, { 7, 2}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 13, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 28, 2}, /* Row 115 */ + { 8, 4}, { 14, 5}, { 15, 4}, { 15, 5}, { 11, 4}, { 12, 3}, { 11, 4}, { 15, 5}, + { 11, 4}, { 14, 3}, { 4, 2}, { 2, 3}, { 7, 2}, { 41, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 14, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 27, 2}, /* Row 116 */ + { 8, 4}, { 14, 5}, { 16, 4}, { 15, 5}, { 11, 4}, { 10, 3}, { 11, 4}, { 15, 5}, + { 11, 4}, { 14, 3}, { 6, 2}, { 2, 3}, { 7, 2}, { 40, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 14, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 27, 2}, /* Row 117 */ + { 8, 4}, { 14, 5}, { 16, 4}, { 15, 5}, { 11, 4}, { 10, 3}, { 11, 4}, { 15, 5}, + { 11, 4}, { 14, 3}, { 7, 2}, { 2, 3}, { 7, 2}, { 39, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 15, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 26, 2}, /* Row 118 */ + { 8, 4}, { 14, 5}, { 17, 4}, { 15, 5}, { 11, 4}, { 8, 3}, { 11, 4}, { 15, 5}, + { 11, 4}, { 14, 3}, { 9, 2}, { 2, 3}, { 7, 2}, { 38, 0}, + { 35, 0}, { 1, 1}, { 8, 4}, { 16, 5}, { 15, 4}, { 14, 5}, { 13, 4}, { 12, 3}, /* Row 119 */ + { 26, 2}, { 8, 4}, { 14, 5}, { 17, 4}, { 15, 5}, { 11, 4}, { 8, 3}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 10, 2}, { 2, 3}, { 7, 2}, { 37, 0}, + { 34, 0}, { 2, 1}, { 8, 4}, { 16, 5}, { 16, 4}, { 14, 5}, { 13, 4}, { 12, 3}, /* Row 120 */ + { 25, 2}, { 8, 4}, { 14, 5}, { 18, 4}, { 15, 5}, { 11, 4}, { 6, 3}, { 11, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 12, 2}, { 2, 3}, { 7, 2}, { 36, 0}, + { 33, 0}, { 2, 1}, { 1, 2}, { 8, 4}, { 16, 5}, { 16, 4}, { 14, 5}, { 13, 4}, /* Row 121 */ + { 12, 3}, { 25, 2}, { 8, 4}, { 14, 5}, { 18, 4}, { 15, 5}, { 11, 4}, { 6, 3}, + { 11, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 13, 2}, { 2, 3}, { 7, 2}, { 35, 0}, + { 32, 0}, { 2, 1}, { 2, 2}, { 8, 4}, { 16, 5}, { 17, 4}, { 14, 5}, { 13, 4}, /* Row 122 */ + { 12, 3}, { 24, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 1, 3}, { 10, 4}, { 15, 5}, + { 11, 4}, { 4, 3}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 15, 2}, { 2, 3}, + { 7, 2}, { 34, 0}, + { 31, 0}, { 2, 1}, { 3, 2}, { 8, 4}, { 16, 5}, { 17, 4}, { 14, 5}, { 13, 4}, /* Row 123 */ + { 12, 3}, { 24, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 1, 3}, { 10, 4}, { 15, 5}, + { 11, 4}, { 4, 3}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 16, 2}, { 2, 3}, + { 7, 2}, { 33, 0}, + { 30, 0}, { 2, 1}, { 4, 2}, { 8, 4}, { 16, 5}, { 18, 4}, { 14, 5}, { 13, 4}, /* Row 124 */ + { 12, 3}, { 23, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 2, 3}, { 10, 4}, { 15, 5}, + { 11, 4}, { 2, 3}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 18, 2}, { 2, 3}, + { 7, 2}, { 32, 0}, + { 29, 0}, { 2, 1}, { 5, 2}, { 8, 4}, { 16, 5}, { 18, 4}, { 14, 5}, { 13, 4}, /* Row 125 */ + { 12, 3}, { 23, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 2, 3}, { 10, 4}, { 15, 5}, + { 11, 4}, { 2, 3}, { 11, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 19, 2}, { 2, 3}, + { 7, 2}, { 31, 0}, + { 28, 0}, { 2, 1}, { 5, 2}, { 1, 3}, { 8, 4}, { 16, 5}, { 19, 4}, { 14, 5}, /* Row 126 */ + { 13, 4}, { 12, 3}, { 22, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 3, 3}, { 10, 4}, + { 15, 5}, { 22, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 21, 2}, { 2, 3}, { 7, 2}, + { 30, 0}, + { 27, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 8, 4}, { 16, 5}, { 19, 4}, { 14, 5}, /* Row 127 */ + { 13, 4}, { 12, 3}, { 22, 2}, { 8, 4}, { 14, 5}, { 8, 4}, { 3, 3}, { 10, 4}, + { 15, 5}, { 22, 4}, { 15, 5}, { 11, 4}, { 14, 3}, { 22, 2}, { 2, 3}, { 7, 2}, + { 29, 0}, + { 26, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 1, 1}, { 8, 4}, { 16, 5}, { 8, 4}, /* Row 128 */ + { 1, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 21, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 4, 3}, { 10, 4}, { 15, 5}, { 20, 4}, { 15, 5}, { 11, 4}, { 14, 3}, + { 24, 2}, { 2, 3}, { 7, 2}, { 28, 0}, + { 25, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 8, 4}, { 16, 5}, { 8, 4}, /* Row 129 */ + { 1, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 21, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 4, 3}, { 10, 4}, { 15, 5}, { 20, 4}, { 15, 5}, { 11, 4}, { 14, 3}, + { 25, 2}, { 2, 3}, { 7, 2}, { 27, 0}, + { 24, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 1, 2}, { 8, 4}, { 16, 5}, /* Row 130 */ + { 8, 4}, { 2, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 20, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 5, 3}, { 10, 4}, { 15, 5}, { 18, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 27, 2}, { 2, 3}, { 7, 2}, { 26, 0}, + { 23, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 2, 2}, { 8, 4}, { 16, 5}, /* Row 131 */ + { 8, 4}, { 2, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 20, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 5, 3}, { 10, 4}, { 15, 5}, { 18, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 28, 2}, { 2, 3}, { 7, 2}, { 25, 0}, + { 22, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 3, 2}, { 8, 4}, { 16, 5}, /* Row 132 */ + { 8, 4}, { 3, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 19, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 6, 3}, { 10, 4}, { 15, 5}, { 16, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 30, 2}, { 2, 3}, { 7, 2}, { 24, 0}, + { 21, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 4, 2}, { 8, 4}, { 16, 5}, /* Row 133 */ + { 8, 4}, { 3, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 19, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 6, 3}, { 10, 4}, { 15, 5}, { 16, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 31, 2}, { 2, 3}, { 7, 2}, { 23, 0}, + { 20, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 8, 4}, { 16, 5}, /* Row 134 */ + { 8, 4}, { 4, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 18, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 7, 3}, { 10, 4}, { 15, 5}, { 14, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 33, 2}, { 2, 3}, { 7, 2}, { 22, 0}, + { 19, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 6, 2}, { 8, 4}, { 16, 5}, /* Row 135 */ + { 8, 4}, { 4, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 18, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 7, 3}, { 10, 4}, { 15, 5}, { 14, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 34, 2}, { 2, 3}, { 7, 2}, { 21, 0}, + { 18, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 7, 2}, { 8, 4}, { 16, 5}, /* Row 136 */ + { 8, 4}, { 5, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 17, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 8, 3}, { 10, 4}, { 15, 5}, { 12, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 36, 2}, { 2, 3}, { 7, 2}, { 20, 0}, + { 17, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 8, 2}, { 8, 4}, { 16, 5}, /* Row 137 */ + { 8, 4}, { 5, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 17, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 8, 3}, { 10, 4}, { 15, 5}, { 12, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 37, 2}, { 2, 3}, { 7, 2}, { 19, 0}, + { 16, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 9, 2}, { 8, 4}, { 16, 5}, /* Row 138 */ + { 8, 4}, { 6, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 16, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 9, 3}, { 10, 4}, { 15, 5}, { 10, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 39, 2}, { 2, 3}, { 7, 2}, { 18, 0}, + { 15, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 10, 2}, { 8, 4}, { 16, 5}, /* Row 139 */ + { 8, 4}, { 6, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 16, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 9, 3}, { 10, 4}, { 15, 5}, { 10, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 40, 2}, { 2, 3}, { 7, 2}, { 17, 0}, + { 14, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 11, 2}, { 8, 4}, { 16, 5}, /* Row 140 */ + { 8, 4}, { 7, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 15, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 10, 3}, { 10, 4}, { 15, 5}, { 8, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 42, 2}, { 2, 3}, { 7, 2}, { 16, 0}, + { 13, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 12, 2}, { 8, 4}, { 16, 5}, /* Row 141 */ + { 8, 4}, { 7, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 15, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 10, 3}, { 10, 4}, { 15, 5}, { 8, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 43, 2}, { 2, 3}, { 7, 2}, { 15, 0}, + { 12, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 13, 2}, { 8, 4}, { 16, 5}, /* Row 142 */ + { 8, 4}, { 8, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 14, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 11, 3}, { 10, 4}, { 15, 5}, { 6, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 45, 2}, { 2, 3}, { 7, 2}, { 14, 0}, + { 11, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 14, 2}, { 8, 4}, { 16, 5}, /* Row 143 */ + { 8, 4}, { 8, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 14, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 11, 3}, { 10, 4}, { 15, 5}, { 6, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 46, 2}, { 2, 3}, { 7, 2}, { 13, 0}, + { 10, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 15, 2}, { 8, 4}, { 16, 5}, /* Row 144 */ + { 8, 4}, { 9, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 13, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 12, 3}, { 10, 4}, { 15, 5}, { 4, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 48, 2}, { 2, 3}, { 7, 2}, { 12, 0}, + { 9, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 16, 2}, { 8, 4}, { 16, 5}, /* Row 145 */ + { 8, 4}, { 9, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 13, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 12, 3}, { 10, 4}, { 15, 5}, { 4, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 49, 2}, { 2, 3}, { 7, 2}, { 11, 0}, + { 8, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 17, 2}, { 8, 4}, { 16, 5}, /* Row 146 */ + { 8, 4}, { 10, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 12, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 13, 3}, { 10, 4}, { 15, 5}, { 2, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 51, 2}, { 2, 3}, { 7, 2}, { 10, 0}, + { 7, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 18, 2}, { 8, 4}, { 16, 5}, /* Row 147 */ + { 8, 4}, { 10, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 12, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 13, 3}, { 10, 4}, { 15, 5}, { 2, 4}, { 15, 5}, { 11, 4}, + { 14, 3}, { 52, 2}, { 2, 3}, { 7, 2}, { 9, 0}, + { 6, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 19, 2}, { 8, 4}, { 16, 5}, /* Row 148 */ + { 8, 4}, { 11, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 11, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 10, 4}, { 30, 5}, { 11, 4}, { 14, 3}, { 54, 2}, + { 2, 3}, { 7, 2}, { 8, 0}, + { 5, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 20, 2}, { 8, 4}, { 16, 5}, /* Row 149 */ + { 8, 4}, { 11, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 11, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 10, 4}, { 30, 5}, { 11, 4}, { 14, 3}, { 55, 2}, + { 2, 3}, { 7, 2}, { 7, 0}, + { 4, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 21, 2}, { 8, 4}, { 16, 5}, /* Row 150 */ + { 8, 4}, { 12, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 10, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 1, 2}, { 10, 4}, { 28, 5}, { 11, 4}, { 14, 3}, + { 57, 2}, { 2, 3}, { 7, 2}, { 6, 0}, + { 3, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 22, 2}, { 8, 4}, { 16, 5}, /* Row 151 */ + { 8, 4}, { 12, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 10, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 1, 2}, { 10, 4}, { 28, 5}, { 11, 4}, { 14, 3}, + { 58, 2}, { 2, 3}, { 7, 2}, { 5, 0}, + { 2, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 23, 2}, { 8, 4}, { 16, 5}, /* Row 152 */ + { 8, 4}, { 13, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 9, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 2, 2}, { 10, 4}, { 26, 5}, { 11, 4}, { 14, 3}, + { 60, 2}, { 2, 3}, { 7, 2}, { 4, 0}, + { 1, 0}, { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 24, 2}, { 8, 4}, { 16, 5}, /* Row 153 */ + { 8, 4}, { 13, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 9, 2}, { 8, 4}, + { 14, 5}, { 8, 4}, { 14, 3}, { 2, 2}, { 10, 4}, { 26, 5}, { 11, 4}, { 14, 3}, + { 61, 2}, { 2, 3}, { 7, 2}, { 3, 0}, + { 2, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 25, 2}, { 8, 4}, { 16, 5}, { 8, 4}, /* Row 154 */ + { 14, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 8, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 3, 2}, { 10, 4}, { 24, 5}, { 11, 4}, { 14, 3}, { 63, 2}, + { 2, 3}, { 7, 2}, { 2, 0}, + { 1, 1}, { 5, 2}, { 2, 3}, { 2, 1}, { 26, 2}, { 8, 4}, { 16, 5}, { 8, 4}, /* Row 155 */ + { 14, 3}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 8, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 3, 2}, { 10, 4}, { 24, 5}, { 11, 4}, { 14, 3}, { 64, 2}, + { 2, 3}, { 7, 2}, { 1, 0}, + { 5, 2}, { 2, 3}, { 2, 1}, { 27, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 156 */ + { 1, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 7, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 4, 2}, { 10, 4}, { 22, 5}, { 11, 4}, { 14, 3}, { 66, 2}, + { 2, 3}, { 7, 2}, + { 4, 2}, { 2, 3}, { 2, 1}, { 28, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 157 */ + { 1, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 7, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 4, 2}, { 10, 4}, { 22, 5}, { 11, 4}, { 14, 3}, { 67, 2}, + { 2, 3}, { 6, 2}, + { 3, 2}, { 2, 3}, { 2, 1}, { 29, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 158 */ + { 2, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 6, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 5, 2}, { 10, 4}, { 20, 5}, { 11, 4}, { 14, 3}, { 69, 2}, + { 2, 3}, { 5, 2}, + { 3, 2}, { 2, 3}, { 1, 1}, { 30, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 159 */ + { 2, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 6, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 5, 2}, { 10, 4}, { 20, 5}, { 11, 4}, { 14, 3}, { 70, 2}, + { 2, 3}, { 4, 2}, + { 4, 2}, { 2, 3}, { 30, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 3, 2}, /* Row 160 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 5, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 5, 2}, { 11, 4}, { 19, 5}, { 10, 4}, { 14, 3}, { 72, 2}, { 3, 3}, + { 2, 2}, + { 5, 2}, { 2, 3}, { 29, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 3, 2}, /* Row 161 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 5, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 5, 2}, { 11, 4}, { 18, 5}, { 11, 4}, { 14, 3}, { 72, 2}, { 3, 3}, + { 2, 2}, + { 6, 2}, { 2, 3}, { 28, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 4, 2}, /* Row 162 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 4, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 4, 2}, { 11, 4}, { 19, 5}, { 10, 4}, { 14, 3}, { 72, 2}, { 2, 3}, + { 2, 1}, { 2, 2}, + { 7, 2}, { 2, 3}, { 27, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 4, 2}, /* Row 163 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 4, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 4, 2}, { 11, 4}, { 18, 5}, { 11, 4}, { 14, 3}, { 71, 2}, { 2, 3}, + { 2, 1}, { 3, 2}, + { 8, 2}, { 2, 3}, { 26, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 5, 2}, /* Row 164 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 3, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 3, 2}, { 11, 4}, { 20, 5}, { 11, 4}, { 13, 3}, { 70, 2}, { 2, 3}, + { 2, 1}, { 4, 2}, + { 9, 2}, { 2, 3}, { 25, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 5, 2}, /* Row 165 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 3, 2}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 3, 2}, { 11, 4}, { 20, 5}, { 11, 4}, { 13, 3}, { 69, 2}, { 2, 3}, + { 2, 1}, { 5, 2}, + { 1, 0}, { 9, 2}, { 2, 3}, { 24, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 166 */ + { 6, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 2, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 2, 2}, { 11, 4}, { 22, 5}, { 11, 4}, { 13, 3}, { 67, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 1, 0}, + { 2, 0}, { 9, 2}, { 2, 3}, { 23, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 167 */ + { 6, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 2, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 2, 2}, { 11, 4}, { 22, 5}, { 11, 4}, { 13, 3}, { 66, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 2, 0}, + { 3, 0}, { 9, 2}, { 2, 3}, { 22, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 168 */ + { 7, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 1, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 1, 2}, { 11, 4}, { 24, 5}, { 11, 4}, { 13, 3}, { 64, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 3, 0}, + { 4, 0}, { 9, 2}, { 2, 3}, { 21, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 169 */ + { 7, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 1, 2}, { 8, 4}, { 14, 5}, + { 8, 4}, { 14, 3}, { 1, 2}, { 11, 4}, { 24, 5}, { 11, 4}, { 13, 3}, { 63, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 4, 0}, + { 5, 0}, { 9, 2}, { 2, 3}, { 20, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 170 */ + { 8, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 11, 4}, { 26, 5}, { 11, 4}, { 13, 3}, { 61, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 5, 0}, + { 6, 0}, { 9, 2}, { 2, 3}, { 19, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 171 */ + { 8, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 12, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 14, 3}, { 11, 4}, { 26, 5}, { 11, 4}, { 13, 3}, { 60, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 6, 0}, + { 7, 0}, { 9, 2}, { 2, 3}, { 18, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 172 */ + { 9, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 11, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 13, 3}, { 11, 4}, { 28, 5}, { 11, 4}, { 13, 3}, { 58, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 7, 0}, + { 8, 0}, { 9, 2}, { 2, 3}, { 17, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 173 */ + { 9, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 11, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 13, 3}, { 11, 4}, { 28, 5}, { 11, 4}, { 13, 3}, { 57, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 8, 0}, + { 9, 0}, { 9, 2}, { 2, 3}, { 16, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 174 */ + { 10, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 10, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 12, 3}, { 11, 4}, { 30, 5}, { 11, 4}, { 13, 3}, { 55, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 9, 0}, + { 10, 0}, { 9, 2}, { 2, 3}, { 15, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 175 */ + { 10, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 10, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 12, 3}, { 11, 4}, { 30, 5}, { 11, 4}, { 13, 3}, { 54, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 10, 0}, + { 11, 0}, { 9, 2}, { 2, 3}, { 14, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 176 */ + { 11, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 9, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 11, 3}, { 11, 4}, { 32, 5}, { 11, 4}, { 13, 3}, { 52, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 11, 0}, + { 12, 0}, { 9, 2}, { 2, 3}, { 13, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 177 */ + { 11, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 9, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 11, 3}, { 11, 4}, { 32, 5}, { 11, 4}, { 13, 3}, { 51, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 12, 0}, + { 13, 0}, { 9, 2}, { 2, 3}, { 12, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 178 */ + { 12, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 8, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 10, 3}, { 11, 4}, { 16, 5}, { 3, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 49, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 13, 0}, + { 14, 0}, { 9, 2}, { 2, 3}, { 11, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 179 */ + { 12, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 8, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 10, 3}, { 11, 4}, { 16, 5}, { 3, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 48, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 14, 0}, + { 15, 0}, { 9, 2}, { 2, 3}, { 10, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 180 */ + { 13, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 7, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 9, 3}, { 11, 4}, { 16, 5}, { 5, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 46, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 15, 0}, + { 16, 0}, { 9, 2}, { 2, 3}, { 9, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 181 */ + { 13, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 7, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 9, 3}, { 11, 4}, { 16, 5}, { 5, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 45, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 16, 0}, + { 17, 0}, { 9, 2}, { 2, 3}, { 8, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 182 */ + { 14, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 6, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 8, 3}, { 11, 4}, { 16, 5}, { 7, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 43, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 17, 0}, + { 18, 0}, { 9, 2}, { 2, 3}, { 7, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 183 */ + { 14, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 6, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 8, 3}, { 11, 4}, { 16, 5}, { 7, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 42, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 18, 0}, + { 19, 0}, { 9, 2}, { 2, 3}, { 6, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 184 */ + { 15, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 5, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 7, 3}, { 11, 4}, { 16, 5}, { 9, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 40, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 19, 0}, + { 20, 0}, { 9, 2}, { 2, 3}, { 5, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 185 */ + { 15, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 5, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 7, 3}, { 11, 4}, { 16, 5}, { 9, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 39, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 20, 0}, + { 21, 0}, { 9, 2}, { 2, 3}, { 4, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 186 */ + { 16, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 4, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 6, 3}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 37, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 21, 0}, + { 22, 0}, { 9, 2}, { 2, 3}, { 3, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 187 */ + { 16, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 4, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 6, 3}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 36, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 22, 0}, + { 23, 0}, { 9, 2}, { 2, 3}, { 2, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 188 */ + { 17, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 3, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 5, 3}, { 11, 4}, { 16, 5}, { 13, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 34, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 23, 0}, + { 24, 0}, { 9, 2}, { 2, 3}, { 1, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, /* Row 189 */ + { 17, 2}, { 11, 4}, { 14, 5}, { 13, 4}, { 3, 3}, { 8, 4}, { 14, 5}, { 8, 4}, + { 5, 3}, { 11, 4}, { 16, 5}, { 13, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 33, 2}, + { 2, 3}, { 2, 1}, { 5, 2}, { 24, 0}, + { 25, 0}, { 9, 2}, { 2, 3}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 18, 2}, /* Row 190 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 2, 3}, { 8, 4}, { 14, 5}, { 8, 4}, { 4, 3}, + { 11, 4}, { 16, 5}, { 15, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 31, 2}, { 2, 3}, + { 2, 1}, { 5, 2}, { 25, 0}, + { 26, 0}, { 9, 2}, { 1, 3}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 18, 2}, /* Row 191 */ + { 11, 4}, { 14, 5}, { 13, 4}, { 2, 3}, { 8, 4}, { 14, 5}, { 8, 4}, { 4, 3}, + { 11, 4}, { 16, 5}, { 15, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 30, 2}, { 2, 3}, + { 2, 1}, { 5, 2}, { 26, 0}, + { 27, 0}, { 9, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 19, 2}, { 11, 4}, /* Row 192 */ + { 14, 5}, { 13, 4}, { 1, 3}, { 8, 4}, { 14, 5}, { 8, 4}, { 3, 3}, { 11, 4}, + { 16, 5}, { 17, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 28, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 27, 0}, + { 28, 0}, { 8, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 19, 2}, { 11, 4}, /* Row 193 */ + { 14, 5}, { 13, 4}, { 1, 3}, { 8, 4}, { 14, 5}, { 8, 4}, { 3, 3}, { 11, 4}, + { 16, 5}, { 17, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 27, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 28, 0}, + { 29, 0}, { 7, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 20, 2}, { 11, 4}, /* Row 194 */ + { 14, 5}, { 21, 4}, { 14, 5}, { 8, 4}, { 2, 3}, { 11, 4}, { 16, 5}, { 19, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 25, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 29, 0}, + { 30, 0}, { 6, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 20, 2}, { 11, 4}, /* Row 195 */ + { 14, 5}, { 21, 4}, { 14, 5}, { 8, 4}, { 2, 3}, { 11, 4}, { 16, 5}, { 19, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 24, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 30, 0}, + { 31, 0}, { 5, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 21, 2}, { 11, 4}, /* Row 196 */ + { 14, 5}, { 20, 4}, { 14, 5}, { 8, 4}, { 1, 3}, { 11, 4}, { 16, 5}, { 11, 4}, + { 1, 3}, { 9, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 22, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 31, 0}, + { 32, 0}, { 4, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 21, 2}, { 11, 4}, /* Row 197 */ + { 14, 5}, { 20, 4}, { 14, 5}, { 8, 4}, { 1, 3}, { 11, 4}, { 16, 5}, { 11, 4}, + { 1, 3}, { 9, 4}, { 15, 5}, { 11, 4}, { 13, 3}, { 21, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 32, 0}, + { 33, 0}, { 3, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 22, 2}, { 11, 4}, /* Row 198 */ + { 14, 5}, { 19, 4}, { 14, 5}, { 19, 4}, { 16, 5}, { 11, 4}, { 3, 3}, { 9, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 19, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 33, 0}, + { 34, 0}, { 2, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 22, 2}, { 11, 4}, /* Row 199 */ + { 14, 5}, { 19, 4}, { 14, 5}, { 19, 4}, { 16, 5}, { 11, 4}, { 3, 3}, { 9, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 18, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 34, 0}, + { 35, 0}, { 1, 2}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 23, 2}, { 11, 4}, /* Row 200 */ + { 14, 5}, { 18, 4}, { 14, 5}, { 18, 4}, { 16, 5}, { 11, 4}, { 5, 3}, { 9, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 16, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 35, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 23, 2}, { 11, 4}, { 14, 5}, /* Row 201 */ + { 18, 4}, { 14, 5}, { 18, 4}, { 16, 5}, { 11, 4}, { 5, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 15, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 36, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 24, 2}, { 11, 4}, { 14, 5}, /* Row 202 */ + { 17, 4}, { 14, 5}, { 17, 4}, { 16, 5}, { 11, 4}, { 7, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 13, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 37, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 24, 2}, { 11, 4}, { 14, 5}, /* Row 203 */ + { 17, 4}, { 14, 5}, { 17, 4}, { 16, 5}, { 11, 4}, { 7, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 12, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 38, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 25, 2}, { 11, 4}, { 14, 5}, /* Row 204 */ + { 16, 4}, { 14, 5}, { 16, 4}, { 16, 5}, { 11, 4}, { 9, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 10, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 39, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 25, 2}, { 11, 4}, { 14, 5}, /* Row 205 */ + { 16, 4}, { 14, 5}, { 16, 4}, { 16, 5}, { 11, 4}, { 9, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 9, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 40, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 26, 2}, { 11, 4}, { 14, 5}, /* Row 206 */ + { 15, 4}, { 14, 5}, { 15, 4}, { 16, 5}, { 11, 4}, { 11, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 7, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 41, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 26, 2}, { 11, 4}, { 14, 5}, /* Row 207 */ + { 15, 4}, { 14, 5}, { 15, 4}, { 16, 5}, { 11, 4}, { 11, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 6, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 27, 2}, { 11, 4}, { 14, 5}, /* Row 208 */ + { 14, 4}, { 14, 5}, { 14, 4}, { 16, 5}, { 11, 4}, { 13, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 4, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 27, 2}, { 11, 4}, { 14, 5}, /* Row 209 */ + { 14, 4}, { 14, 5}, { 14, 4}, { 16, 5}, { 11, 4}, { 13, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 3, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 28, 2}, { 11, 4}, { 14, 5}, /* Row 210 */ + { 13, 4}, { 14, 5}, { 13, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 13, 3}, { 1, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 28, 2}, { 11, 4}, { 14, 5}, /* Row 211 */ + { 13, 4}, { 14, 5}, { 13, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 9, 4}, { 15, 5}, + { 11, 4}, { 15, 3}, { 2, 1}, { 5, 2}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 29, 2}, { 11, 4}, { 14, 5}, /* Row 212 */ + { 12, 4}, { 14, 5}, { 12, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 2, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 13, 3}, { 2, 1}, { 5, 2}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 29, 2}, { 11, 4}, { 14, 5}, /* Row 213 */ + { 12, 4}, { 14, 5}, { 12, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 2, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 5, 2}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 30, 2}, { 11, 4}, { 14, 5}, /* Row 214 */ + { 11, 4}, { 14, 5}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 4, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 3, 2}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 30, 2}, { 11, 4}, { 14, 5}, /* Row 215 */ + { 11, 4}, { 14, 5}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 4, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 3}, { 2, 2}, { 50, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 31, 2}, { 11, 4}, { 14, 5}, /* Row 216 */ + { 10, 4}, { 14, 5}, { 10, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 6, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 12, 3}, { 1, 6}, { 1, 2}, { 51, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 31, 2}, { 11, 4}, { 14, 5}, /* Row 217 */ + { 10, 4}, { 14, 5}, { 10, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 6, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 11, 3}, { 3, 6}, { 51, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 32, 2}, { 11, 4}, { 14, 5}, /* Row 218 */ + { 9, 4}, { 14, 5}, { 9, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 8, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 9, 3}, { 5, 6}, { 50, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 32, 2}, { 11, 4}, { 14, 5}, /* Row 219 */ + { 9, 4}, { 14, 5}, { 9, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 8, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 8, 3}, { 6, 6}, { 50, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 33, 2}, { 11, 4}, { 14, 5}, /* Row 220 */ + { 8, 4}, { 14, 5}, { 8, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 10, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 6, 3}, { 8, 6}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 33, 2}, { 11, 4}, { 14, 5}, /* Row 221 */ + { 8, 4}, { 14, 5}, { 8, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 10, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 5, 3}, { 9, 6}, { 49, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 34, 2}, { 11, 4}, { 14, 5}, /* Row 222 */ + { 7, 4}, { 14, 5}, { 7, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 12, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 3, 3}, { 11, 6}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 34, 2}, { 11, 4}, { 14, 5}, /* Row 223 */ + { 7, 4}, { 14, 5}, { 7, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 12, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 2, 3}, { 12, 6}, { 48, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 35, 2}, { 11, 4}, { 14, 5}, /* Row 224 */ + { 6, 4}, { 14, 5}, { 6, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 14, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 35, 2}, { 11, 4}, { 14, 5}, /* Row 225 */ + { 6, 4}, { 14, 5}, { 6, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 14, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 47, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 36, 2}, { 11, 4}, { 14, 5}, /* Row 226 */ + { 5, 4}, { 14, 5}, { 5, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 16, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 36, 2}, { 11, 4}, { 14, 5}, /* Row 227 */ + { 5, 4}, { 14, 5}, { 5, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 16, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 46, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 37, 2}, { 11, 4}, { 14, 5}, /* Row 228 */ + { 4, 4}, { 14, 5}, { 4, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 18, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 37, 2}, { 11, 4}, { 14, 5}, /* Row 229 */ + { 4, 4}, { 14, 5}, { 4, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 18, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 45, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 38, 2}, { 11, 4}, { 14, 5}, /* Row 230 */ + { 3, 4}, { 14, 5}, { 3, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 20, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 38, 2}, { 11, 4}, { 14, 5}, /* Row 231 */ + { 3, 4}, { 14, 5}, { 3, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 20, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 44, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 39, 2}, { 11, 4}, { 14, 5}, /* Row 232 */ + { 2, 4}, { 14, 5}, { 2, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 22, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 3}, { 39, 2}, { 11, 4}, { 14, 5}, /* Row 233 */ + { 2, 4}, { 14, 5}, { 2, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 22, 2}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 43, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 1, 6}, { 13, 3}, { 40, 2}, { 11, 4}, /* Row 234 */ + { 14, 5}, { 1, 4}, { 14, 5}, { 1, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 24, 2}, + { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 2, 6}, { 12, 3}, { 40, 2}, { 11, 4}, /* Row 235 */ + { 14, 5}, { 1, 4}, { 14, 5}, { 1, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 24, 2}, + { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 42, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 3, 6}, { 11, 3}, { 41, 2}, { 11, 4}, /* Row 236 */ + { 44, 5}, { 11, 4}, { 15, 3}, { 26, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, + { 41, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 4, 6}, { 11, 3}, { 40, 2}, { 11, 4}, /* Row 237 */ + { 44, 5}, { 11, 4}, { 15, 3}, { 26, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, + { 41, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 5, 6}, { 11, 3}, { 40, 2}, { 11, 4}, /* Row 238 */ + { 42, 5}, { 11, 4}, { 15, 3}, { 28, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, + { 40, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 6, 6}, { 8, 3}, { 1, 2}, { 2, 3}, /* Row 239 */ + { 39, 2}, { 11, 4}, { 42, 5}, { 11, 4}, { 15, 3}, { 28, 2}, { 9, 4}, { 15, 5}, + { 11, 4}, { 14, 6}, { 40, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 7, 6}, { 7, 3}, { 2, 2}, { 2, 3}, /* Row 240 */ + { 39, 2}, { 11, 4}, { 40, 5}, { 11, 4}, { 15, 3}, { 30, 2}, { 9, 4}, { 15, 5}, + { 11, 4}, { 14, 6}, { 39, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 8, 6}, { 6, 3}, { 3, 2}, { 2, 3}, /* Row 241 */ + { 38, 2}, { 11, 4}, { 40, 5}, { 11, 4}, { 15, 3}, { 29, 2}, { 1, 3}, { 9, 4}, + { 15, 5}, { 11, 4}, { 14, 6}, { 39, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 9, 6}, { 5, 3}, { 4, 2}, { 2, 3}, /* Row 242 */ + { 38, 2}, { 11, 4}, { 38, 5}, { 11, 4}, { 15, 3}, { 29, 2}, { 2, 3}, { 1, 1}, + { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 38, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 10, 6}, { 4, 3}, { 5, 2}, { 2, 3}, /* Row 243 */ + { 37, 2}, { 11, 4}, { 38, 5}, { 11, 4}, { 15, 3}, { 28, 2}, { 2, 3}, { 2, 1}, + { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 38, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 11, 6}, { 3, 3}, { 6, 2}, { 2, 3}, /* Row 244 */ + { 37, 2}, { 11, 4}, { 36, 5}, { 11, 4}, { 15, 3}, { 28, 2}, { 2, 3}, { 2, 1}, + { 2, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 37, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 12, 6}, { 2, 3}, { 7, 2}, { 2, 3}, /* Row 245 */ + { 36, 2}, { 11, 4}, { 36, 5}, { 11, 4}, { 15, 3}, { 27, 2}, { 2, 3}, { 2, 1}, + { 3, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 37, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 13, 6}, { 1, 3}, { 8, 2}, { 2, 3}, /* Row 246 */ + { 36, 2}, { 11, 4}, { 34, 5}, { 11, 4}, { 15, 3}, { 27, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 36, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 9, 2}, { 2, 3}, { 35, 2}, /* Row 247 */ + { 11, 4}, { 34, 5}, { 11, 4}, { 15, 3}, { 26, 2}, { 2, 3}, { 2, 1}, { 5, 2}, + { 1, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 36, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 1, 0}, { 9, 2}, { 2, 3}, /* Row 248 */ + { 35, 2}, { 11, 4}, { 32, 5}, { 11, 4}, { 15, 3}, { 26, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 2, 0}, { 10, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 35, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 2, 0}, { 9, 2}, { 2, 3}, /* Row 249 */ + { 34, 2}, { 11, 4}, { 32, 5}, { 11, 4}, { 15, 3}, { 25, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 4, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 35, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 3, 0}, { 9, 2}, { 2, 3}, /* Row 250 */ + { 34, 2}, { 11, 4}, { 30, 5}, { 11, 4}, { 15, 3}, { 25, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 6, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 34, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 4, 0}, { 9, 2}, { 2, 3}, /* Row 251 */ + { 33, 2}, { 11, 4}, { 30, 5}, { 11, 4}, { 15, 3}, { 24, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 7, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 34, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 5, 0}, { 9, 2}, { 2, 3}, /* Row 252 */ + { 33, 2}, { 11, 4}, { 28, 5}, { 11, 4}, { 15, 3}, { 24, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 9, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 33, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 6, 0}, { 9, 2}, { 2, 3}, /* Row 253 */ + { 32, 2}, { 11, 4}, { 28, 5}, { 11, 4}, { 15, 3}, { 23, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 10, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 33, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 7, 0}, { 9, 2}, { 2, 3}, /* Row 254 */ + { 32, 2}, { 11, 4}, { 26, 5}, { 11, 4}, { 15, 3}, { 23, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 12, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 32, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 8, 0}, { 9, 2}, { 2, 3}, /* Row 255 */ + { 31, 2}, { 11, 4}, { 26, 5}, { 11, 4}, { 15, 3}, { 22, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 13, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 32, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 9, 0}, { 9, 2}, { 2, 3}, /* Row 256 */ + { 31, 2}, { 11, 4}, { 24, 5}, { 11, 4}, { 15, 3}, { 22, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 15, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 31, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 10, 0}, { 9, 2}, { 2, 3}, /* Row 257 */ + { 30, 2}, { 11, 4}, { 24, 5}, { 11, 4}, { 15, 3}, { 21, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 16, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 31, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 11, 0}, { 9, 2}, { 2, 3}, /* Row 258 */ + { 30, 2}, { 11, 4}, { 22, 5}, { 11, 4}, { 15, 3}, { 21, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 18, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 12, 0}, { 9, 2}, { 2, 3}, /* Row 259 */ + { 29, 2}, { 11, 4}, { 22, 5}, { 11, 4}, { 15, 3}, { 20, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 19, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 13, 0}, { 9, 2}, { 2, 3}, /* Row 260 */ + { 29, 2}, { 11, 4}, { 20, 5}, { 11, 4}, { 15, 3}, { 20, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 21, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 14, 0}, { 9, 2}, { 2, 3}, /* Row 261 */ + { 28, 2}, { 11, 4}, { 20, 5}, { 11, 4}, { 15, 3}, { 19, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 22, 0}, { 9, 4}, { 15, 5}, { 11, 4}, { 14, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 15, 0}, { 9, 2}, { 2, 3}, /* Row 262 */ + { 28, 2}, { 11, 4}, { 18, 5}, { 11, 4}, { 15, 3}, { 19, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 24, 0}, { 9, 4}, { 15, 5}, { 10, 4}, { 14, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 16, 0}, { 9, 2}, { 2, 3}, /* Row 263 */ + { 27, 2}, { 11, 4}, { 18, 5}, { 11, 4}, { 15, 3}, { 18, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 25, 0}, { 9, 4}, { 15, 5}, { 10, 4}, { 14, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 17, 0}, { 9, 2}, { 2, 3}, /* Row 264 */ + { 27, 2}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 18, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 27, 0}, { 9, 4}, { 14, 5}, { 10, 4}, { 15, 6}, { 28, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 18, 0}, { 9, 2}, { 2, 3}, /* Row 265 */ + { 26, 2}, { 11, 4}, { 16, 5}, { 11, 4}, { 15, 3}, { 17, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 28, 0}, { 9, 4}, { 14, 5}, { 10, 4}, { 15, 6}, { 28, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 19, 0}, { 9, 2}, { 2, 3}, /* Row 266 */ + { 26, 2}, { 11, 4}, { 14, 5}, { 11, 4}, { 15, 3}, { 17, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 30, 0}, { 9, 4}, { 13, 5}, { 10, 4}, { 16, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 20, 0}, { 9, 2}, { 2, 3}, /* Row 267 */ + { 25, 2}, { 11, 4}, { 14, 5}, { 11, 4}, { 15, 3}, { 16, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 31, 0}, { 9, 4}, { 13, 5}, { 9, 4}, { 17, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 21, 0}, { 9, 2}, { 2, 3}, /* Row 268 */ + { 25, 2}, { 11, 4}, { 12, 5}, { 11, 4}, { 15, 3}, { 16, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 33, 0}, { 9, 4}, { 11, 5}, { 10, 4}, { 17, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 22, 0}, { 9, 2}, { 2, 3}, /* Row 269 */ + { 24, 2}, { 12, 4}, { 10, 5}, { 12, 4}, { 15, 3}, { 15, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 34, 0}, { 9, 4}, { 11, 5}, { 10, 4}, { 17, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 23, 0}, { 9, 2}, { 2, 3}, /* Row 270 */ + { 24, 2}, { 12, 4}, { 8, 5}, { 12, 4}, { 15, 3}, { 15, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 36, 0}, { 9, 4}, { 8, 5}, { 11, 4}, { 18, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 24, 0}, { 9, 2}, { 2, 3}, /* Row 271 */ + { 23, 2}, { 14, 4}, { 4, 5}, { 14, 4}, { 15, 3}, { 14, 2}, { 2, 3}, { 2, 1}, + { 5, 2}, { 37, 0}, { 11, 4}, { 4, 5}, { 13, 4}, { 18, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 25, 0}, { 9, 2}, { 2, 3}, /* Row 272 */ + { 23, 2}, { 30, 4}, { 15, 3}, { 14, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 39, 0}, + { 26, 4}, { 19, 6}, { 27, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 26, 0}, { 9, 2}, { 2, 3}, /* Row 273 */ + { 22, 2}, { 30, 4}, { 15, 3}, { 13, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 40, 0}, + { 26, 4}, { 18, 6}, { 28, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 27, 0}, { 9, 2}, { 2, 3}, /* Row 274 */ + { 22, 2}, { 28, 4}, { 15, 3}, { 13, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 42, 0}, + { 24, 4}, { 19, 6}, { 28, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 28, 0}, { 9, 2}, { 2, 3}, /* Row 275 */ + { 21, 2}, { 28, 4}, { 15, 3}, { 12, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 43, 0}, + { 23, 4}, { 20, 6}, { 28, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 29, 0}, { 9, 2}, { 2, 3}, /* Row 276 */ + { 21, 2}, { 26, 4}, { 15, 3}, { 12, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 45, 0}, + { 21, 4}, { 20, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 30, 0}, { 9, 2}, { 2, 3}, /* Row 277 */ + { 20, 2}, { 26, 4}, { 15, 3}, { 11, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 46, 0}, + { 20, 4}, { 21, 6}, { 29, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 31, 0}, { 9, 2}, { 2, 3}, /* Row 278 */ + { 20, 2}, { 24, 4}, { 15, 3}, { 11, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 48, 0}, + { 18, 4}, { 21, 6}, { 30, 0}, + { 36, 0}, { 8, 4}, { 16, 5}, { 8, 4}, { 14, 6}, { 32, 0}, { 9, 2}, { 2, 3}, /* Row 279 */ + { 20, 2}, { 22, 4}, { 16, 3}, { 10, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 51, 0}, + { 14, 4}, { 23, 6}, { 30, 0}, + { 50, 0}, { 32, 6}, { 33, 0}, { 9, 2}, { 2, 3}, { 20, 2}, { 20, 4}, { 16, 3}, /* Row 280 */ + { 10, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 55, 0}, { 8, 4}, { 25, 6}, { 31, 0}, + { 50, 0}, { 32, 6}, { 34, 0}, { 9, 2}, { 2, 3}, { 21, 2}, { 16, 4}, { 18, 3}, /* Row 281 */ + { 9, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 61, 0}, { 28, 6}, { 31, 0}, + { 50, 0}, { 32, 6}, { 35, 0}, { 9, 2}, { 2, 3}, { 22, 2}, { 12, 4}, { 19, 3}, /* Row 282 */ + { 9, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 62, 0}, { 27, 6}, { 32, 0}, + { 50, 0}, { 32, 6}, { 36, 0}, { 9, 2}, { 2, 3}, { 23, 2}, { 8, 4}, { 20, 3}, /* Row 283 */ + { 9, 2}, { 2, 3}, { 2, 1}, { 5, 2}, { 64, 0}, { 26, 6}, { 32, 0}, + { 50, 0}, { 32, 6}, { 37, 0}, { 9, 2}, { 2, 3}, { 24, 2}, { 25, 3}, { 9, 2}, /* Row 284 */ + { 2, 3}, { 2, 1}, { 5, 2}, { 66, 0}, { 23, 6}, { 34, 0}, + { 50, 0}, { 32, 6}, { 38, 0}, { 9, 2}, { 2, 3}, { 25, 2}, { 21, 3}, { 10, 2}, /* Row 285 */ + { 2, 3}, { 2, 1}, { 5, 2}, { 67, 0}, { 23, 6}, { 34, 0}, + { 50, 0}, { 32, 6}, { 39, 0}, { 9, 2}, { 2, 3}, { 26, 2}, { 17, 3}, { 11, 2}, /* Row 286 */ + { 2, 3}, { 2, 1}, { 5, 2}, { 69, 0}, { 20, 6}, { 36, 0}, + { 50, 0}, { 32, 6}, { 40, 0}, { 9, 2}, { 2, 3}, { 27, 2}, { 13, 3}, { 12, 2}, /* Row 287 */ + { 2, 3}, { 2, 1}, { 5, 2}, { 70, 0}, { 20, 6}, { 36, 0}, + { 50, 0}, { 32, 6}, { 41, 0}, { 9, 2}, { 2, 3}, { 50, 2}, { 2, 3}, { 2, 1}, /* Row 288 */ + { 5, 2}, { 72, 0}, { 17, 6}, { 38, 0}, + { 50, 0}, { 32, 6}, { 42, 0}, { 9, 2}, { 2, 3}, { 48, 2}, { 2, 3}, { 2, 1}, /* Row 289 */ + { 5, 2}, { 74, 0}, { 14, 6}, { 40, 0}, + { 50, 0}, { 32, 6}, { 43, 0}, { 9, 2}, { 2, 3}, { 46, 2}, { 2, 3}, { 2, 1}, /* Row 290 */ + { 5, 2}, {129, 0}, + { 50, 0}, { 32, 6}, { 44, 0}, { 9, 2}, { 2, 3}, { 44, 2}, { 2, 3}, { 2, 1}, /* Row 291 */ + { 5, 2}, {130, 0}, + { 50, 0}, { 32, 6}, { 45, 0}, { 9, 2}, { 2, 3}, { 42, 2}, { 2, 3}, { 2, 1}, /* Row 292 */ + { 5, 2}, {131, 0}, + { 50, 0}, { 32, 6}, { 46, 0}, { 9, 2}, { 2, 3}, { 40, 2}, { 2, 3}, { 2, 1}, /* Row 293 */ + { 5, 2}, {132, 0}, + {129, 0}, { 9, 2}, { 2, 3}, { 38, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {133, 0}, /* Row 294 */ + {130, 0}, { 9, 2}, { 2, 3}, { 36, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {134, 0}, /* Row 295 */ + {131, 0}, { 9, 2}, { 2, 3}, { 34, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {135, 0}, /* Row 296 */ + {132, 0}, { 9, 2}, { 2, 3}, { 32, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {136, 0}, /* Row 297 */ + {133, 0}, { 9, 2}, { 2, 3}, { 30, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {137, 0}, /* Row 298 */ + {134, 0}, { 9, 2}, { 2, 3}, { 28, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {138, 0}, /* Row 299 */ + {135, 0}, { 9, 2}, { 2, 3}, { 26, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {139, 0}, /* Row 300 */ + {136, 0}, { 9, 2}, { 2, 3}, { 24, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {140, 0}, /* Row 301 */ + {137, 0}, { 9, 2}, { 2, 3}, { 22, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {141, 0}, /* Row 302 */ + {138, 0}, { 9, 2}, { 2, 3}, { 20, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {142, 0}, /* Row 303 */ + {139, 0}, { 9, 2}, { 2, 3}, { 18, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {143, 0}, /* Row 304 */ + {140, 0}, { 9, 2}, { 2, 3}, { 16, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {144, 0}, /* Row 305 */ + {141, 0}, { 9, 2}, { 2, 3}, { 14, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {145, 0}, /* Row 306 */ + {142, 0}, { 9, 2}, { 2, 3}, { 12, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {146, 0}, /* Row 307 */ + {143, 0}, { 9, 2}, { 2, 3}, { 10, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {147, 0}, /* Row 308 */ + {144, 0}, { 9, 2}, { 2, 3}, { 8, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {148, 0}, /* Row 309 */ + {145, 0}, { 9, 2}, { 2, 3}, { 6, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {149, 0}, /* Row 310 */ + {146, 0}, { 9, 2}, { 2, 3}, { 4, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {150, 0}, /* Row 311 */ + {147, 0}, { 9, 2}, { 2, 3}, { 2, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {151, 0}, /* Row 312 */ + {148, 0}, { 9, 2}, { 4, 3}, { 2, 1}, { 5, 2}, {152, 0}, /* Row 313 */ + {149, 0}, { 9, 2}, { 2, 3}, { 2, 1}, { 5, 2}, {153, 0}, /* Row 314 */ + {150, 0}, { 9, 2}, { 2, 1}, { 5, 2}, {154, 0}, /* Row 315 */ + {151, 0}, { 7, 2}, { 2, 1}, { 5, 2}, {155, 0}, /* Row 316 */ + {152, 0}, { 12, 2}, {156, 0}, /* Row 317 */ + {153, 0}, { 10, 2}, {157, 0}, /* Row 318 */ + {154, 0}, { 8, 2}, {158, 0}, /* Row 319 */ +}; + +/**************************************************************************** + * Public Bitmap Structure Defintions + ****************************************************************************/ + +const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap320x320 = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_nuttxLut, // Index 0: Unselected LUT + g_nuttxLut, // Index 1: Selected LUT + }, + g_nuttxRleEntries // data - Pointer to the beginning of the RLE data +}; From eec375cf0e2b8fa8c4f877f288ab2c68a9cbcd09 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Oct 2013 16:10:08 -0600 Subject: [PATCH 139/390] Add a 320x320 NuttX logo image --- Kconfig | 3 ++- nxwm/include/nxwmconfig.hxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index 2de112c3f..7ba639404 100644 --- a/Kconfig +++ b/Kconfig @@ -486,10 +486,11 @@ config NXWM_DISABLE_BACKGROUND_IMAGE config NXWM_BACKGROUND_IMAGE string "Background Image" + default "NXWidgets::g_nuttxBitmap160x160" depends on !NXWM_DISABLE_BACKGROUND_IMAGE ---help--- The name of the image to use in the background window. Default: - NXWidgets::g_nuttxBitmap + "NXWidgets::g_nuttxBitmap160x160" comment "Application Window Configuration" diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 7715224e2..a10491d39 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -270,11 +270,11 @@ /* Background Image **********************************************************/ /** * CONFIG_NXWM_BACKGROUND_IMAGE - The name of the image to use in the - * background window. Default:NXWidgets::g_nuttxBitmap + * background window. Default:NXWidgets::g_nuttxBitmap160x160 */ #ifndef CONFIG_NXWM_BACKGROUND_IMAGE -# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap +# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap160x160 #endif /* Start Window Configuration ***********************************************/ From 07d226c8c52ccd070709a1ee8fcced14137fb479 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Oct 2013 16:11:33 -0600 Subject: [PATCH 140/390] SAMA5D3x-EK NxWM configuration: use 320x320 NuttX logo as the background --- libnxwidgets/src/glyph_nxlogo.cxx | 3453 ----------------------------- 1 file changed, 3453 deletions(-) delete mode 100644 libnxwidgets/src/glyph_nxlogo.cxx diff --git a/libnxwidgets/src/glyph_nxlogo.cxx b/libnxwidgets/src/glyph_nxlogo.cxx deleted file mode 100644 index 5f1bd7dbf..000000000 --- a/libnxwidgets/src/glyph_nxlogo.cxx +++ /dev/null @@ -1,3453 +0,0 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/src/glyph_nxlogo.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "nxconfig.hxx" -#include "crlepalettebitmap.hxx" -#include "glyphs.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Bitmap Data - ****************************************************************************/ - -using namespace NXWidgets; - -/* RGB24 (8-8-8) Colors */ - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -# define BITMAP_NLUTCODES 164 /* Number of unique RGB colors in the image */ - -static const uint32_t g_nuttxLut[BITMAP_NLUTCODES] = -{ - 0x000000, 0x102028, 0x5898e0, 0x3c30e4, 0x3c34e4, 0x0c0828, 0x382ce4, 0x3c34e8, /* Codes 0-7 */ - 0x3834d4, 0x241c74, 0x2c2490, 0x343c8c, 0x5ca0ec, 0x4454d0, 0x2c288c, 0x5ca0e8, /* Codes 8-15 */ - 0x3830d4, 0x687078, 0xd0e4f0, 0x3428e4, 0x24282c, 0xcce4f0, 0x848cec, 0xdcf4f4, /* Codes 16-23 */ - 0xd8ecf0, 0x2c24e0, 0xa8b8c4, 0xb4c4f0, 0x5854e4, 0xd8f0f0, 0xd8f0f4, 0x484890, /* Codes 24-31 */ - 0x2c287c, 0x28287c, 0x282478, 0x342cb4, 0xcce0f0, 0xd8e8f4, 0xa8bcc8, 0x587c98, /* Codes 32-39 */ - 0x5c98bc, 0x2c4c60, 0xe0f8fc, 0x1c1478, 0x2c2884, 0x302894, 0xfcfcfc, 0xd4e8f4, /* Codes 40-47 */ - 0x5090b8, 0x101c20, 0xd8ecf8, 0x5c94bc, 0x8c90ec, 0x7c84bc, 0xc8e0f0, 0x98c0d8, /* Codes 48-55 */ - 0xe8f0f8, 0x94bcd8, 0x3830e4, 0xb0bcec, 0xf4f8fc, 0xe4f0f8, 0x3c34ec, 0x142028, /* Codes 56-63 */ - 0x5894bc, 0x5078ac, 0x5084b4, 0x282080, 0x3428b4, 0xd0e4f4, 0x70a4c8, 0x3c34d8, /* Codes 64-71 */ - 0x7880b0, 0x5490b8, 0x5484b4, 0x281c78, 0x5ca4ec, 0xdcf4fc, 0x181078, 0x2c2880, /* Codes 72-79 */ - 0x382cd0, 0x342cb8, 0x1c1888, 0x888cf0, 0xc4e0f0, 0x98c4dc, 0x180c74, 0x5080b0, /* Codes 80-87 */ - 0x282480, 0x04000c, 0x282474, 0x4038f4, 0x3024ec, 0x302c9c, 0x7c84b4, 0x0c1c28, /* Codes 88-95 */ - 0x5090e0, 0x3020e4, 0xd8f0f8, 0x7478b4, 0x100870, 0x08006c, 0x24188c, 0x201c7c, /* Codes 96-103 */ - 0x2c2090, 0x5098d0, 0xd4e4f0, 0x589cd0, 0x3840e0, 0x4048e4, 0xc4dcf0, 0xdcf4f8, /* Codes 104-111 */ - 0x3024e8, 0x342cac, 0x4878b8, 0x4048e0, 0x8084e8, 0x2c248c, 0x3430bc, 0x241c70, /* Codes 112-119 */ - 0x141074, 0x3428e0, 0x342cec, 0x2c24b4, 0x201c78, 0x3028d0, 0x241c8c, 0x7078b4, /* Codes 120-127 */ - 0x040028, 0xd4e8f0, 0x4c7cd4, 0x282078, 0x5484b0, 0x20285c, 0x20187c, 0x4c7cb0, /* Codes 128-135 */ - 0x3830d0, 0x4034f0, 0x2820c8, 0xdcf0f4, 0x34408c, 0x98d4ec, 0x2c1ce0, 0x5080ac, /* Codes 136-143 */ - 0x3c30e8, 0x7078a8, 0x04001c, 0x2c3034, 0x305064, 0x2c4458, 0x74a8c8, 0xf8f8fc, /* Codes 144-151 */ - 0xdcecf8, 0xb0c0dc, 0xa0b0bc, 0xb4d4e4, 0x707880, 0x7c98a8, 0xdcf4f0, 0x2820ac, /* Codes 152-159 */ - 0x201874, 0x302898, 0x3844ac, 0x507ce0, /* Codes 160-163 */ -}; - -/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ - -#elif CONFIG_NXWIDGETS_BPP == 16 -# define BITMAP_NLUTCODES 141 /* Number of unique RGB colors in the image */ - -static const uint16_t g_nuttxLut[BITMAP_NLUTCODES] = -{ - 0x0000, 0x1105, 0x5cdc, 0x399c, 0x41bc, 0x0845, 0x397c, 0x39bc, 0x41bd, 0x39ba, /* Codes 0-9 */ - 0x28ee, 0x3132, 0x31f2, 0x5d1d, 0x42ba, 0x3152, 0x399a, 0x6b8f, 0xd73e, 0x315c, /* Codes 10-19 */ - 0x2945, 0x8c7d, 0xe7be, 0xdf7e, 0x313c, 0xadd9, 0xb63e, 0x5abd, 0xdf9e, 0xdf9f, /* Codes 20-29 */ - 0x4a52, 0x2950, 0x292f, 0x3176, 0xcf1e, 0xdf5f, 0xadf9, 0x5bf3, 0x5cd8, 0x326c, /* Codes 30-39 */ - 0xe7df, 0x18af, 0x3153, 0xdf5e, 0xffff, 0x5497, 0x10e4, 0xdf7f, 0x5cb8, 0x8c9d, /* Codes 40-49 */ - 0x8437, 0x9e1b, 0xef9f, 0x9dfb, 0xb5fe, 0xffdf, 0x41be, 0x53d6, 0x5436, 0x2910, /* Codes 50-59 */ - 0x3156, 0x7539, 0x39bb, 0x7c16, 0x95fb, 0x28ef, 0x653d, 0xe7bf, 0x188f, 0x397a, /* Codes 60-69 */ - 0x3977, 0x20d1, 0x8c7e, 0xe79f, 0x9e3b, 0x186e, 0x5416, 0x2930, 0x0801, 0x41de, /* Codes 70-79 */ - 0x313d, 0x3173, 0x7c36, 0x08e5, 0x549c, 0xd75f, 0x311c, 0x73d6, 0x3150, 0x315d, /* Codes 80-89 */ - 0x104e, 0x080e, 0x20f0, 0x2912, 0x54da, 0xdf3e, 0x5cfa, 0x3a1c, 0x425c, 0xcefe, /* Codes 90-99 */ - 0x4bd7, 0x843d, 0x2932, 0x3997, 0xf7df, 0x397d, 0x2936, 0x20ef, 0x315a, 0x20f1, /* Codes 100-109 */ - 0x0005, 0xd75e, 0x53fa, 0x290f, 0x214b, 0x20cf, 0x4bf6, 0x2919, 0x3212, 0x9ebd, /* Codes 110-119 */ - 0x28fc, 0x5415, 0x399d, 0x73d5, 0x0804, 0x3187, 0x328d, 0x2a2b, 0x7559, 0xe77f, /* Codes 120-129 */ - 0xb61c, 0x3186, 0xa598, 0xbebd, 0x73d0, 0x84d5, 0x5cb7, 0x2916, 0x20ce, 0x3a35, /* Codes 130-139 */ - 0x53fc /* Codes 140-140 */ -}; - -/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used - * to lookup an 8-bit value. There is no savings in that! It would be better to just put - * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these - * pointless lookups. But these p;ointless lookups do make the logic compatible with the - * 16- and 24-bit types. - */ - -#elif CONFIG_NXWIDGETS_BPP == 8 -# ifdef CONFIG_NXWIDGETS_GREYSCALE -# define BITMAP_NLUTCODES 116 /* Number of unique greyscale levels in the image */ - -/* 8-bit Greyscale */ - -static const uint8_t g_nuttxLut[BITMAP_NLUTCODES] = -{ - 0x00, 0x19, 0x8b, 0x46, 0x4a, 0x0b, 0x8d, 0x41, 0x44, 0x27, 0x32, 0x92, 0x59, 0x34, 0x6d, 0xdb, /* Codes 0-15 */ - 0x3f, 0x26, 0x91, 0xec, 0xe5, 0x39, 0xb4, 0xc0, 0x62, 0xe6, 0x4c, 0x2f, 0x2e, 0x3c, 0xda, 0xe4, /* Codes 16-31 */ - 0x72, 0x86, 0xed, 0x1d, 0x35, 0xe2, 0xfc, 0xe3, 0x7d, 0x16, 0x97, 0x87, 0xee, 0xb2, 0x42, 0xbc, /* Codes 32-47 */ - 0xf6, 0x4b, 0x1c, 0x70, 0x90, 0x77, 0x2c, 0xdf, 0x96, 0x29, 0x45, 0x7f, 0x81, 0xb1, 0x28, 0xea, /* Codes 48-63 */ - 0x40, 0x3d, 0x23, 0x95, 0xe9, 0xd6, 0xb7, 0x2d, 0x02, 0x3a, 0x85, 0x17, 0x82, 0xe7, 0x7b, 0x33, /* Codes 64-79 */ - 0x0e, 0x25, 0x84, 0xe0, 0x8c, 0x4d, 0x56, 0x1e, 0x3b, 0x6e, 0x31, 0x3e, 0xf3, 0x1a, 0x20, 0x04, /* Codes 80-95 */ - 0xe1, 0x74, 0x2a, 0x79, 0x21, 0x71, 0xc4, 0x76, 0x48, 0x98, 0xf7, 0x94, 0xe8, 0xbe, 0xac, 0xc9, /* Codes 96-111 */ - 0x75, 0x8e, 0x49, 0x7a /* Codes 112-115 */ -}; - -# else /* CONFIG_NXWIDGETS_GREYSCALE */ -# define BITMAP_NLUTCODES 27 /* Number of unique RGB colors in the image */ - -/* RGB8 (332) Colors */ - -static const nxgl_mxpixel_t g_nuttxLut[BITMAP_NLUTCODES] = -{ - 0x00, 0x25, 0x77, 0x4b, 0x01, 0x47, 0x26, 0x4a, 0x4f, 0x72, 0xdf, 0x93, 0xff, 0x27, 0xbb, 0xdb, /* Codes 0-15 */ - 0x6f, 0x29, 0x53, 0x97, 0x73, 0x22, 0x05, 0x02, 0x57, 0xbf, 0x4e /* Codes 16-26 */ -}; - -# endif -#else -# error "Unsupport pixel format" -#endif - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 - -static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = -{ - { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ - { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 2, 7}, { 3, 4}, { 1, 5}, /* Row 1 */ - { 75, 0}, - { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ - { 1, 7}, { 3, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 12}, /* Row 3 */ - { 1, 13}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 4 */ - { 1, 6}, { 1, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 5 */ - { 1, 6}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 71, 0}, - { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 6 */ - { 1, 6}, { 5, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 70, 0}, - { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 7 */ - { 1, 6}, { 7, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 69, 0}, - { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 8 */ - { 1, 6}, { 9, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 68, 0}, - { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 9 */ - { 1, 6}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 67, 0}, - { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 10 */ - { 1, 6}, { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 66, 0}, - { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 11 */ - { 1, 6}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 65, 0}, - { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 12 */ - { 1, 6}, { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 64, 0}, - { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 13 */ - { 1, 6}, { 19, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 63, 0}, - { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 14 */ - { 1, 6}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 62, 0}, - { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 15 */ - { 1, 6}, { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 61, 0}, - { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 16 */ - { 1, 6}, { 25, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 60, 0}, - { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 17 */ - { 1, 6}, { 27, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 59, 0}, - { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 18 */ - { 1, 6}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 26, 0}, - { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, - { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 19 */ - { 1, 6}, { 10, 4}, { 5, 19}, { 16, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, - { 1, 5}, { 23, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, - { 1, 20}, { 23, 0}, - { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, /* Row 20 */ - { 1, 6}, { 9, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 3, 24}, { 1, 23}, { 1, 22}, - { 1, 25}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 22, 0}, - { 11, 18}, { 1, 20}, { 22, 0}, - { 23, 0}, { 1, 17}, { 5, 18}, { 1, 26}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ - { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, - { 1, 21}, { 5, 18}, { 1, 21}, { 1, 23}, { 1, 28}, { 15, 4}, { 1, 16}, { 1, 14}, - { 1, 7}, { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 1, 21}, { 11, 18}, { 1, 20}, - { 21, 0}, - { 21, 0}, { 1, 20}, { 1, 18}, { 1, 21}, { 5, 18}, { 1, 21}, { 1, 18}, { 1, 20}, /* Row 22 */ - { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 9, 4}, { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 29}, { 1, 28}, - { 4, 7}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 19, 0}, - { 14, 18}, { 21, 0}, - { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, /* Row 23 */ - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 10, 4}, { 1, 22}, { 1, 21}, { 10, 18}, - { 1, 30}, { 1, 31}, { 1, 32}, { 1, 33}, { 1, 34}, { 1, 35}, { 1, 7}, { 10, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, - { 4, 18}, { 1, 36}, { 2, 37}, { 1, 36}, { 4, 18}, { 1, 21}, { 1, 17}, { 20, 0}, - { 20, 0}, { 1, 38}, { 1, 21}, { 11, 18}, { 1, 39}, { 4, 40}, { 1, 41}, { 13, 0}, /* Row 24 */ - { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 3, 36}, { 5, 18}, { 1, 42}, { 1, 43}, - { 3, 44}, { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, - { 1, 5}, { 16, 0}, { 5, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 47}, - { 1, 48}, { 1, 49}, { 18, 0}, - { 19, 0}, { 1, 17}, { 1, 21}, { 12, 18}, { 1, 50}, { 1, 48}, { 3, 40}, { 1, 51}, /* Row 25 */ - { 1, 40}, { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 11, 4}, { 1, 52}, { 1, 21}, { 3, 18}, { 1, 37}, { 3, 46}, - { 1, 37}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 45}, { 1, 7}, { 10, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, - { 3, 18}, { 1, 54}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, { 1, 40}, - { 1, 49}, { 17, 0}, - { 19, 0}, { 5, 18}, { 1, 54}, { 2, 56}, { 1, 37}, { 5, 18}, { 1, 21}, { 1, 57}, /* Row 26 */ - { 4, 40}, { 1, 51}, { 1, 41}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 11, 4}, { 1, 58}, { 1, 59}, { 3, 18}, - { 1, 21}, { 1, 60}, { 4, 46}, { 1, 37}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, - { 1, 45}, { 1, 7}, { 10, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, - { 13, 0}, { 5, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 2, 40}, - { 1, 49}, { 16, 0}, - { 18, 0}, { 1, 17}, { 1, 21}, { 3, 18}, { 1, 37}, { 4, 46}, { 1, 37}, { 5, 18}, /* Row 27 */ - { 1, 50}, { 1, 48}, { 5, 40}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 24}, { 3, 18}, - { 1, 37}, { 6, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, - { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, - { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 57}, { 3, 40}, - { 16, 0}, - { 18, 0}, { 4, 18}, { 1, 54}, { 5, 46}, { 1, 60}, { 1, 36}, { 4, 18}, { 1, 21}, /* Row 28 */ - { 1, 57}, { 4, 40}, { 1, 51}, { 1, 41}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, - { 1, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 24}, - { 3, 18}, { 1, 61}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, - { 1, 34}, { 1, 62}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, - { 10, 0}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 55}, - { 2, 40}, { 1, 51}, { 1, 41}, { 15, 0}, - { 18, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 29 */ - { 5, 40}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 3, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 4, 40}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 30 */ - { 4, 40}, { 1, 51}, { 1, 41}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, - { 1, 62}, { 12, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 7, 0}, - { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, - { 1, 63}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 31 */ - { 5, 40}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 9, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 3, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 5, 40}, { 1, 41}, - { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 32 */ - { 4, 40}, { 1, 51}, { 1, 41}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 4}, { 1, 8}, - { 1, 11}, { 1, 15}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 9, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, - { 13, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 6, 40}, { 1, 63}, - { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 9, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 33 */ - { 3, 40}, { 1, 64}, { 1, 65}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 3, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 34 */ - { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 68}, { 1, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 10, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 69}, { 1, 70}, { 5, 40}, { 1, 51}, { 1, 41}, - { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 10, 46}, { 1, 56}, { 5, 18}, { 1, 50}, { 1, 48}, /* Row 35 */ - { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 34}, { 1, 71}, { 1, 11}, { 1, 15}, - { 1, 6}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 16}, { 1, 14}, - { 1, 7}, { 3, 4}, { 1, 72}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 50}, { 1, 73}, { 6, 40}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 57}, /* Row 36 */ - { 1, 74}, { 1, 67}, { 3, 44}, { 1, 75}, { 1, 76}, { 1, 6}, { 21, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, - { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 1, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 11, 46}, { 1, 56}, { 5, 18}, { 1, 77}, { 1, 78}, /* Row 37 */ - { 4, 44}, { 1, 79}, { 1, 80}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 38 */ - { 5, 44}, { 1, 81}, { 22, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 12, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, - { 1, 16}, { 1, 82}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 12, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 39 */ - { 4, 44}, { 1, 34}, { 1, 62}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 13, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, - { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, - { 1, 48}, { 6, 40}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 40 */ - { 5, 44}, { 1, 35}, { 21, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 13, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 13, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 41 */ - { 4, 44}, { 1, 34}, { 1, 62}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, - { 1, 48}, { 6, 40}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 42 */ - { 5, 44}, { 1, 35}, { 20, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 14, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 14, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, /* Row 43 */ - { 4, 44}, { 1, 34}, { 1, 62}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 7, 46}, { 1, 61}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, - { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 15, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, /* Row 44 */ - { 5, 44}, { 1, 35}, { 19, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, - { 1, 84}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, - { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 61}, { 6, 46}, { 1, 56}, { 5, 18}, /* Row 45 */ - { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 18, 4}, { 1, 19}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 84}, { 7, 46}, { 1, 54}, { 4, 18}, /* Row 46 */ - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 18, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 4, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, - { 1, 41}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 56}, { 6, 46}, { 1, 56}, /* Row 47 */ - { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 17, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 7, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 9, 4}, { 1, 22}, - { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, - { 6, 40}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 54}, { 7, 46}, { 1, 54}, /* Row 48 */ - { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 19}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, - { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 85}, - { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 56}, { 6, 46}, /* Row 49 */ - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 16, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 1, 18}, { 1, 54}, { 7, 46}, /* Row 50 */ - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 16, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, { 1, 41}, - { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 56}, { 6, 46}, /* Row 51 */ - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 15, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 54}, { 7, 46}, /* Row 52 */ - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 15, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 4, 44}, { 1, 67}, { 1, 87}, { 1, 41}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 56}, { 6, 46}, /* Row 53 */ - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 14, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 5, 44}, { 1, 88}, { 1, 89}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 3, 18}, { 1, 54}, { 7, 46}, /* Row 54 */ - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 14, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 90}, { 1, 62}, { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 56}, { 6, 46}, /* Row 55 */ - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 13, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 5, 44}, { 1, 33}, { 1, 91}, { 2, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 4, 18}, { 1, 54}, { 7, 46}, /* Row 56 */ - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 13, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 92}, { 1, 23}, - { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, - { 1, 93}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 56}, { 6, 46}, /* Row 57 */ - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 12, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 94}, { 1, 21}, - { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 34}, { 1, 62}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 5, 18}, { 1, 54}, { 7, 46}, /* Row 58 */ - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 12, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, - { 2, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 19, 0}, - { 17, 0}, { 1, 95}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 6, 18}, { 1, 56}, /* Row 59 */ - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, - { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 53}, - { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, - { 5, 44}, { 1, 34}, { 1, 62}, { 3, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, - { 1, 5}, { 18, 0}, - { 16, 0}, { 1, 1}, { 1, 96}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 60 */ - { 6, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, - { 1, 35}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, - { 2, 18}, { 1, 21}, { 1, 47}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, - { 1, 42}, { 1, 43}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 5, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 17, 0}, - { 15, 0}, { 1, 1}, { 1, 2}, { 1, 97}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 61 */ - { 1, 36}, { 7, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, - { 4, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 53}, { 1, 21}, - { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 34}, { 1, 62}, { 6, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, - { 16, 0}, - { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, /* Row 62 */ - { 8, 46}, { 1, 36}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, - { 1, 53}, { 5, 44}, { 1, 35}, { 10, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, { 1, 42}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 101}, { 1, 42}, { 4, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 8, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 15, 0}, - { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 102}, { 1, 98}, { 2, 18}, /* Row 63 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, - { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 98}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 14, 0}, - { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 105}, { 1, 106}, /* Row 64 */ - { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, - { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, - { 1, 35}, { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, - { 2, 18}, { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 9, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, - { 6, 44}, { 1, 35}, { 11, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, - { 13, 0}, - { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 108}, /* Row 65 */ - { 1, 29}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, - { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, - { 4, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, - { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, - { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 12, 0}, - { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 66 */ - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, - { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 7, 18}, { 1, 56}, { 7, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 14, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 11, 0}, - { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 67 */ - { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, - { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 5, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, - { 1, 62}, { 15, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 10, 0}, - { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 68 */ - { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 7, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 2, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 5, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, - { 17, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 9, 0}, - { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 69 */ - { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 6, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 34}, { 1, 62}, { 18, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, - { 8, 0}, - { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 70 */ - { 4, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 2, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 6, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 3, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 3, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, - { 20, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 7, 0}, - { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 71 */ - { 5, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 2, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 5, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 1, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 34}, { 1, 62}, { 21, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, - { 6, 0}, - { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 72 */ - { 6, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 3, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 5, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 4, 44}, { 1, 43}, { 1, 42}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 1, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, - { 23, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 5, 0}, - { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 73 */ - { 7, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 3, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 4, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 110}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, - { 24, 4}, { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 4, 0}, - { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 74 */ - { 8, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 4, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, - { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 4, 4}, { 1, 19}, - { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 43}, { 1, 111}, { 3, 18}, { 1, 54}, { 15, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 26, 4}, { 1, 16}, { 1, 14}, { 1, 7}, - { 2, 4}, { 1, 5}, { 3, 0}, - { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, /* Row 75 */ - { 9, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 4, 44}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 3, 4}, - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 5, 44}, { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 56}, { 13, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, - { 1, 16}, { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, { 2, 0}, - { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 10, 4}, /* Row 76 */ - { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 5, 44}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, - { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 3, 4}, { 1, 19}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 33}, { 1, 112}, { 1, 23}, { 3, 18}, { 1, 54}, { 13, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 29, 4}, { 1, 16}, { 1, 14}, { 1, 7}, - { 2, 4}, { 1, 5}, { 1, 0}, - { 1, 2}, { 1, 6}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 11, 4}, { 1, 19}, /* Row 77 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, - { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 2, 4}, { 1, 19}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 33}, { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 56}, { 11, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 16}, - { 1, 14}, { 1, 7}, { 2, 4}, { 1, 5}, - { 1, 3}, { 1, 7}, { 1, 104}, { 1, 107}, { 1, 109}, { 12, 4}, { 1, 19}, { 1, 24}, /* Row 78 */ - { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 54}, { 11, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 32, 4}, { 1, 16}, { 1, 14}, { 1, 7}, - { 2, 4}, - { 1, 4}, { 1, 113}, { 1, 114}, { 1, 115}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 79 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, - { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 56}, { 9, 46}, { 1, 61}, { 4, 18}, - { 1, 42}, { 1, 43}, { 5, 44}, { 1, 34}, { 1, 62}, { 33, 4}, { 1, 16}, { 1, 14}, - { 1, 62}, { 1, 4}, - { 1, 4}, { 1, 7}, { 1, 117}, { 1, 8}, { 13, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 80 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 4}, { 1, 116}, { 4, 18}, { 1, 54}, { 9, 46}, { 1, 37}, { 3, 18}, - { 1, 21}, { 1, 53}, { 6, 44}, { 1, 35}, { 35, 4}, { 1, 118}, { 1, 119}, { 1, 7}, - { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 81 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, - { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 62}, { 1, 19}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 60}, { 1, 21}, - { 3, 18}, { 1, 98}, { 1, 120}, { 5, 44}, { 1, 33}, { 1, 62}, { 34, 4}, { 1, 8}, - { 1, 11}, { 1, 76}, { 1, 3}, - { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 19}, { 1, 24}, { 2, 18}, /* Row 82 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, - { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 35}, { 1, 121}, { 1, 24}, { 2, 18}, - { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 33}, { 1, 62}, { 33, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 1, 4}, - { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, { 1, 19}, { 1, 24}, /* Row 83 */ - { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 33}, { 1, 7}, { 1, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 34}, { 1, 122}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 33}, { 1, 112}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, - { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 32, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, - { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 19}, /* Row 84 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 123}, { 1, 24}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 32}, { 1, 83}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 30, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 1, 0}, - { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, /* Row 85 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 124}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 43}, { 1, 111}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 5, 44}, { 1, 35}, { 29, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 2, 0}, - { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 19}, /* Row 86 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 4, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 27, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 3, 0}, - { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 6, 4}, { 1, 19}, /* Row 87 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 3, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, - { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 5, 44}, { 1, 35}, { 26, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 4, 0}, - { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 19}, /* Row 88 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 4, 44}, - { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 24, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, - { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 4, 4}, { 1, 19}, /* Row 89 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, - { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 23, 4}, { 1, 8}, - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, - { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 19}, /* Row 90 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 2, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 3, 44}, - { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 1, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, - { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, - { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 2, 4}, { 1, 19}, /* Row 91 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, - { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 2, 18}, { 1, 54}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 20, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, - { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 19}, /* Row 92 */ - { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, - { 5, 44}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, { 1, 53}, { 1, 44}, { 1, 103}, { 1, 98}, - { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 2, 44}, - { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, - { 18, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, - { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 121}, { 1, 24}, /* Row 93 */ - { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, - { 1, 33}, { 1, 7}, { 6, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, - { 1, 56}, { 5, 18}, { 1, 42}, { 1, 43}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, - { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 43}, { 1, 42}, - { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 54}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 17, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, - { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 125}, { 1, 24}, { 2, 18}, /* Row 94 */ - { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, - { 1, 7}, { 7, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, - { 4, 18}, { 1, 21}, { 1, 53}, { 1, 103}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, - { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 1, 44}, { 1, 53}, { 1, 21}, { 3, 18}, - { 1, 54}, { 8, 46}, { 1, 54}, { 5, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 15, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, - { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 126}, { 1, 98}, { 2, 18}, { 1, 36}, /* Row 95 */ - { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, - { 7, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, - { 1, 42}, { 1, 100}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, - { 1, 98}, { 1, 103}, { 1, 43}, { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, - { 6, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 35}, { 14, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 12, 0}, - { 13, 0}, { 1, 5}, { 3, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 96 */ - { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 4, 18}, { 1, 21}, - { 1, 99}, { 1, 98}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, - { 1, 103}, { 1, 53}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 7, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, - { 1, 62}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 13, 0}, - { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 97 */ - { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 8, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 5, 18}, { 1, 47}, - { 1, 21}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 100}, - { 1, 42}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 47}, { 1, 21}, - { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 14, 0}, - { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, /* Row 98 */ - { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 8, 18}, { 1, 36}, - { 7, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 99}, { 1, 21}, { 3, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 127}, { 1, 42}, { 3, 18}, { 1, 56}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, - { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, - { 16, 0}, { 1, 5}, { 1, 19}, { 1, 24}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, /* Row 99 */ - { 2, 18}, { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 25}, - { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 8, 18}, { 1, 36}, { 7, 46}, - { 1, 36}, { 2, 18}, { 1, 21}, { 1, 47}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 1, 53}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, { 1, 35}, { 8, 4}, { 1, 8}, - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, - { 17, 0}, { 1, 128}, { 1, 129}, { 2, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, /* Row 100 */ - { 1, 98}, { 1, 103}, { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 22}, { 1, 21}, - { 3, 18}, { 1, 54}, { 7, 46}, { 1, 54}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, - { 7, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 1, 44}, - { 1, 43}, { 1, 42}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 5, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 101 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 7, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 7, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 2, 44}, { 1, 53}, { 1, 21}, - { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 35}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 102 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 3, 44}, { 1, 43}, { 1, 42}, - { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, - { 1, 34}, { 1, 62}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, - { 1, 5}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 103 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 6, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 6, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 4, 44}, { 1, 53}, { 1, 21}, - { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 35}, { 2, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 104 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, { 1, 43}, { 1, 42}, - { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 5, 44}, - { 1, 34}, { 1, 62}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 105 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 5, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 5, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 94}, { 1, 21}, - { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 5, 44}, - { 1, 93}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 106 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 92}, - { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, - { 5, 44}, { 1, 88}, { 1, 130}, { 1, 6}, { 1, 4}, { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 107 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 4, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 4, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 1, 4}, - { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 5, 44}, { 1, 131}, { 1, 7}, { 1, 5}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 108 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, - { 1, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 4, 44}, { 1, 67}, { 1, 132}, { 1, 133}, { 25, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 109 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 3, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 3, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 3, 4}, - { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 2, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 25, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 110 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, - { 3, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 53}, { 1, 44}, { 1, 67}, { 1, 66}, { 1, 64}, { 1, 40}, { 1, 51}, - { 1, 41}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 111 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 2, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 2, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, - { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 86}, { 1, 66}, { 1, 64}, { 4, 40}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 112 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 54}, - { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, - { 5, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, - { 1, 21}, { 1, 85}, { 1, 51}, { 4, 40}, { 1, 51}, { 1, 41}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 113 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 1, 18}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 18}, { 1, 56}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, - { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, - { 1, 48}, { 6, 40}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 114 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 54}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 54}, { 8, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 25}, - { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, - { 5, 40}, { 1, 51}, { 1, 41}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 103}, /* Row 115 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, - { 6, 46}, { 1, 56}, { 1, 36}, { 7, 46}, { 1, 36}, { 1, 56}, { 7, 46}, { 1, 56}, - { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 22}, { 1, 21}, - { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, - { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 98}, { 1, 134}, /* Row 116 */ - { 5, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, - { 7, 46}, { 1, 84}, { 7, 46}, { 1, 84}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 25}, { 1, 23}, { 3, 18}, - { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, - { 1, 41}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 135}, /* Row 117 */ - { 1, 67}, { 4, 44}, { 1, 33}, { 1, 7}, { 18, 4}, { 1, 25}, { 1, 23}, { 4, 18}, - { 1, 56}, { 6, 46}, { 1, 61}, { 7, 46}, { 1, 61}, { 7, 46}, { 1, 56}, { 4, 18}, - { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 22}, { 1, 21}, { 2, 18}, - { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 118 */ - { 1, 66}, { 1, 67}, { 3, 44}, { 1, 79}, { 1, 136}, { 19, 4}, { 1, 22}, { 1, 21}, - { 3, 18}, { 1, 54}, { 22, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, - { 1, 34}, { 1, 62}, { 11, 4}, { 1, 25}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, - { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 119 */ - { 1, 64}, { 1, 66}, { 1, 67}, { 2, 44}, { 1, 79}, { 1, 45}, { 1, 16}, { 18, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 20, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 22}, { 1, 21}, { 2, 18}, { 1, 54}, - { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 120 */ - { 1, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 44}, { 1, 33}, { 1, 137}, { 1, 14}, - { 1, 16}, { 18, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 20, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 13, 4}, { 1, 138}, - { 1, 139}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, - { 5, 40}, { 1, 51}, { 1, 41}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 121 */ - { 2, 40}, { 1, 64}, { 1, 66}, { 1, 67}, { 1, 33}, { 2, 7}, { 1, 14}, { 1, 16}, - { 17, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 18, 46}, { 1, 56}, { 4, 18}, - { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 13, 4}, { 1, 8}, { 1, 140}, { 1, 141}, - { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, - { 6, 40}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 122 */ - { 3, 40}, { 1, 64}, { 1, 66}, { 1, 131}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 14}, - { 1, 16}, { 17, 4}, { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 18, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 12, 4}, { 1, 8}, - { 1, 11}, { 1, 15}, { 1, 142}, { 1, 23}, { 3, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 123 */ - { 4, 40}, { 1, 64}, { 1, 143}, { 1, 144}, { 2, 4}, { 1, 7}, { 1, 14}, { 1, 16}, - { 16, 4}, { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 16, 46}, { 1, 56}, { 4, 18}, - { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 12, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 145}, { 3, 18}, { 1, 54}, { 7, 46}, { 1, 56}, { 4, 18}, - { 1, 50}, { 1, 48}, { 6, 40}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 124 */ - { 5, 40}, { 1, 64}, { 1, 146}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 16, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 16, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 1, 147}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 125 */ - { 6, 40}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 14, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 11, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 126 */ - { 6, 40}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 14, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 127 */ - { 6, 40}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 12, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 10, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 128 */ - { 6, 40}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 14, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 12, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 57}, { 5, 40}, { 1, 51}, { 1, 41}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 129 */ - { 6, 40}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 10, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 9, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 50}, { 1, 48}, { 6, 40}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 130 */ - { 6, 40}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 10, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 56}, { 7, 46}, { 1, 54}, - { 3, 18}, { 1, 21}, { 1, 55}, { 5, 40}, { 1, 51}, { 1, 148}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 131 */ - { 6, 40}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 8, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 8, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 7, 46}, - { 1, 56}, { 4, 18}, { 1, 57}, { 6, 40}, { 1, 149}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 132 */ - { 6, 40}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 12, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 54}, { 8, 46}, { 1, 54}, { 3, 18}, { 1, 21}, - { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, - { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, - { 4, 18}, { 1, 57}, { 7, 40}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 133 */ - { 6, 40}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 56}, { 6, 46}, { 1, 56}, { 4, 18}, { 1, 42}, - { 1, 43}, { 6, 44}, { 1, 35}, { 7, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 1, 21}, { 2, 18}, { 1, 54}, { 6, 46}, - { 1, 56}, { 3, 18}, { 1, 69}, { 1, 150}, { 6, 40}, { 1, 51}, { 1, 148}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 134 */ - { 6, 40}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, - { 1, 22}, { 1, 21}, { 3, 18}, { 1, 36}, { 1, 151}, { 4, 46}, { 1, 151}, { 1, 36}, - { 3, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, { 6, 4}, { 1, 8}, - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 56}, - { 5, 46}, { 1, 54}, { 3, 18}, { 1, 50}, { 1, 73}, { 7, 40}, { 1, 41}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 135 */ - { 6, 40}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, - { 1, 25}, { 1, 23}, { 4, 18}, { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 36}, - { 4, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 6, 4}, { 1, 8}, { 1, 11}, - { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 1, 21}, { 2, 18}, - { 1, 36}, { 1, 56}, { 2, 46}, { 1, 56}, { 1, 54}, { 3, 18}, { 1, 21}, { 1, 57}, - { 8, 40}, { 1, 41}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 136 */ - { 6, 40}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 10, 4}, - { 1, 22}, { 1, 21}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 21}, { 1, 53}, { 6, 44}, - { 1, 34}, { 1, 62}, { 5, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, - { 1, 5}, { 19, 0}, { 5, 18}, { 2, 36}, { 5, 18}, { 1, 50}, { 1, 48}, { 8, 40}, - { 1, 63}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 137 */ - { 6, 40}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, - { 1, 25}, { 1, 23}, { 12, 18}, { 1, 42}, { 1, 43}, { 6, 44}, { 1, 35}, { 5, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, { 1, 17}, - { 1, 21}, { 9, 18}, { 1, 47}, { 1, 70}, { 9, 40}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 36}, { 2, 18}, { 1, 47}, { 1, 73}, /* Row 138 */ - { 6, 40}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, - { 1, 22}, { 1, 21}, { 10, 18}, { 1, 21}, { 1, 53}, { 6, 44}, { 1, 34}, { 1, 62}, - { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, - { 9, 18}, { 1, 47}, { 1, 70}, { 8, 40}, { 1, 51}, { 1, 41}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 36}, { 8, 46}, { 1, 69}, { 2, 47}, { 1, 152}, { 1, 73}, /* Row 139 */ - { 6, 40}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 8, 4}, - { 1, 19}, { 1, 27}, { 1, 21}, { 8, 18}, { 1, 21}, { 1, 153}, { 1, 103}, { 6, 44}, - { 1, 35}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 23, 0}, { 1, 147}, { 1, 154}, { 1, 18}, { 1, 21}, { 2, 18}, { 1, 21}, { 1, 47}, - { 1, 155}, { 1, 150}, { 10, 40}, { 15, 0}, - { 25, 0}, { 5, 48}, { 4, 73}, { 7, 40}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 7}, /* Row 140 */ - { 1, 14}, { 1, 16}, { 8, 4}, { 1, 19}, { 1, 22}, { 1, 23}, { 1, 21}, { 4, 18}, - { 1, 21}, { 1, 42}, { 1, 53}, { 1, 103}, { 6, 44}, { 1, 34}, { 1, 62}, { 3, 4}, - { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 156}, - { 1, 17}, { 1, 157}, { 1, 55}, { 1, 48}, { 1, 64}, { 9, 40}, { 1, 51}, { 1, 41}, - { 15, 0}, - { 25, 0}, { 16, 40}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 141 */ - { 9, 4}, { 1, 25}, { 1, 22}, { 1, 158}, { 2, 98}, { 1, 77}, { 1, 53}, { 1, 43}, - { 7, 44}, { 1, 33}, { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, - { 1, 4}, { 1, 5}, { 30, 0}, { 1, 63}, { 11, 40}, { 1, 51}, { 1, 40}, { 16, 0}, - { 25, 0}, { 16, 40}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 142 */ - { 10, 4}, { 1, 19}, { 1, 159}, { 1, 160}, { 1, 103}, { 7, 44}, { 1, 79}, { 1, 161}, - { 1, 136}, { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, - { 32, 0}, { 1, 41}, { 1, 51}, { 8, 40}, { 1, 51}, { 1, 40}, { 17, 0}, - { 25, 0}, { 16, 40}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 143 */ - { 11, 4}, { 1, 62}, { 1, 35}, { 1, 34}, { 5, 33}, { 1, 161}, { 1, 136}, { 1, 7}, - { 3, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 34, 0}, - { 8, 40}, { 1, 51}, { 1, 40}, { 18, 0}, - { 25, 0}, { 16, 40}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 144 */ - { 12, 4}, { 7, 7}, { 4, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, - { 1, 5}, { 35, 0}, { 1, 49}, { 7, 40}, { 1, 41}, { 19, 0}, - { 25, 0}, { 16, 40}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 145 */ - { 21, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 64, 0}, - { 25, 0}, { 16, 40}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, /* Row 146 */ - { 19, 4}, { 1, 8}, { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 65, 0}, - { 64, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 17, 4}, { 1, 8}, /* Row 147 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, - { 65, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 15, 4}, { 1, 8}, /* Row 148 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, - { 66, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 13, 4}, { 1, 8}, /* Row 149 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, - { 67, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 11, 4}, { 1, 8}, /* Row 150 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, - { 68, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 9, 4}, { 1, 8}, /* Row 151 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, - { 69, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 7, 4}, { 1, 8}, /* Row 152 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, - { 70, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 5, 4}, { 1, 8}, /* Row 153 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 3, 4}, { 1, 8}, /* Row 154 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 16}, { 1, 4}, { 1, 8}, /* Row 155 */ - { 1, 11}, { 1, 15}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 14}, { 1, 118}, { 1, 11}, { 1, 15}, /* Row 156 */ - { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, - { 74, 0}, { 1, 5}, { 3, 4}, { 1, 7}, { 1, 162}, { 1, 15}, { 1, 6}, { 1, 4}, /* Row 157 */ - { 1, 5}, { 76, 0}, - { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 163}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ - { 77, 0}, - { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ - }; - -#elif CONFIG_NXWIDGETS_BPP == 16 - -static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = -{ - { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ - { 75, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 2, 8}, { 3, 4}, { 1, 5}, /* Row 1 */ - { 75, 0}, - { 74, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 10}, { 1, 11}, /* Row 2 */ - { 1, 8}, { 3, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 3 */ - { 1, 14}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 4 */ - { 1, 6}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 5 */ - { 1, 6}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 71, 0}, - { 70, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 6 */ - { 1, 6}, { 4, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 70, 0}, - { 69, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 7 */ - { 1, 6}, { 6, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 69, 0}, - { 68, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 8 */ - { 1, 6}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 68, 0}, - { 67, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 9 */ - { 1, 6}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 67, 0}, - { 66, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 10 */ - { 1, 6}, { 12, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 66, 0}, - { 65, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 11 */ - { 1, 6}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 65, 0}, - { 64, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 12 */ - { 1, 6}, { 16, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 64, 0}, - { 63, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 13 */ - { 1, 6}, { 18, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 63, 0}, - { 62, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 14 */ - { 1, 6}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 62, 0}, - { 61, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 15 */ - { 1, 6}, { 22, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 61, 0}, - { 60, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 16 */ - { 1, 6}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 60, 0}, - { 59, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 17 */ - { 1, 6}, { 26, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 59, 0}, - { 58, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 18 */ - { 1, 6}, { 28, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 26, 0}, { 1, 17}, { 5, 18}, { 1, 17}, { 25, 0}, - { 57, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 19 */ - { 1, 6}, { 10, 4}, { 5, 19}, { 15, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, - { 3, 4}, { 1, 5}, { 23, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 23, 0}, - { 56, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, /* Row 20 */ - { 1, 6}, { 9, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 3, 23}, { 1, 22}, { 1, 21}, - { 1, 24}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 22, 0}, { 11, 18}, { 1, 20}, { 22, 0}, - { 23, 0}, { 1, 17}, { 5, 18}, { 1, 25}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 21 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, - { 7, 18}, { 1, 22}, { 1, 27}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, - { 3, 4}, { 1, 5}, { 20, 0}, { 1, 17}, { 12, 18}, { 1, 20}, { 21, 0}, - { 21, 0}, { 1, 20}, { 9, 18}, { 1, 20}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 6}, /* Row 22 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 9, 4}, { 1, 19}, { 1, 26}, - { 9, 18}, { 1, 28}, { 1, 27}, { 4, 8}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 19, 0}, { 14, 18}, { 21, 0}, - { 21, 0}, { 11, 18}, { 1, 20}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, /* Row 23 */ - { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, { 1, 21}, { 11, 18}, { 1, 29}, - { 1, 30}, { 2, 31}, { 1, 32}, { 1, 33}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 17, 0}, { 1, 17}, { 5, 18}, { 1, 34}, - { 2, 35}, { 1, 34}, { 5, 18}, { 1, 17}, { 20, 0}, - { 20, 0}, { 1, 36}, { 12, 18}, { 1, 37}, { 4, 38}, { 1, 39}, { 13, 0}, { 1, 1}, /* Row 24 */ - { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 10, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 3, 34}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, - { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, - { 1, 5}, { 16, 0}, { 5, 18}, { 1, 43}, { 4, 44}, { 1, 43}, { 4, 18}, { 1, 35}, - { 1, 45}, { 1, 46}, { 18, 0}, - { 19, 0}, { 1, 17}, { 13, 18}, { 1, 47}, { 1, 45}, { 3, 38}, { 1, 48}, { 1, 38}, /* Row 25 */ - { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 11, 4}, { 1, 49}, { 4, 18}, { 1, 35}, { 3, 44}, { 1, 43}, { 5, 18}, - { 1, 50}, { 4, 31}, { 1, 42}, { 1, 8}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, - { 1, 8}, { 3, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 4, 18}, { 1, 34}, { 6, 44}, - { 1, 34}, { 4, 18}, { 1, 51}, { 1, 38}, { 1, 46}, { 17, 0}, - { 19, 0}, { 5, 18}, { 1, 34}, { 2, 52}, { 1, 35}, { 6, 18}, { 1, 53}, { 4, 38}, /* Row 26 */ - { 1, 48}, { 1, 39}, { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 11, 4}, { 1, 3}, { 1, 54}, { 4, 18}, { 1, 55}, - { 4, 44}, { 1, 43}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 42}, { 1, 8}, - { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 13, 0}, - { 5, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 2, 38}, { 1, 46}, - { 16, 0}, - { 18, 0}, { 1, 17}, { 4, 18}, { 1, 43}, { 4, 44}, { 1, 35}, { 5, 18}, { 1, 47}, /* Row 27 */ - { 1, 45}, { 5, 38}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 12, 4}, { 1, 19}, { 1, 23}, { 3, 18}, { 1, 35}, - { 6, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 11, 0}, { 1, 17}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 3, 38}, { 16, 0}, - { 18, 0}, { 4, 18}, { 1, 34}, { 5, 44}, { 1, 55}, { 1, 34}, { 5, 18}, { 1, 53}, /* Row 28 */ - { 4, 38}, { 1, 48}, { 1, 39}, { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, - { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 13, 4}, { 1, 19}, { 1, 23}, { 3, 18}, - { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, - { 1, 56}, { 10, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, - { 10, 0}, { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 51}, { 2, 38}, - { 1, 48}, { 1, 39}, { 15, 0}, - { 18, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 29 */ - { 5, 38}, { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 14, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 4, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 4, 38}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 30 */ - { 1, 48}, { 1, 39}, { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 15, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 8, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, - { 11, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 7, 0}, - { 5, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 1}, - { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 31 */ - { 5, 38}, { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 4, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 5, 38}, { 1, 39}, - { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 4, 38}, /* Row 32 */ - { 1, 48}, { 1, 39}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 9, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 4, 0}, { 5, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 1}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 9, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 33 */ - { 3, 38}, { 1, 48}, { 1, 57}, { 1, 13}, { 1, 6}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 4, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 5, 18}, { 1, 53}, { 2, 38}, /* Row 34 */ - { 1, 48}, { 1, 58}, { 1, 59}, { 1, 60}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 10, 44}, { 1, 52}, - { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, { 1, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 3, 4}, { 1, 5}, { 1, 0}, { 5, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 61}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 10, 44}, { 1, 52}, { 5, 18}, { 1, 47}, { 1, 45}, /* Row 35 */ - { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 1, 32}, { 1, 62}, { 1, 12}, { 1, 13}, - { 1, 6}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 11, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 3, 4}, { 1, 63}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, - { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 5, 18}, { 1, 64}, { 1, 58}, /* Row 36 */ - { 1, 59}, { 3, 31}, { 1, 65}, { 1, 66}, { 1, 6}, { 21, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, - { 1, 32}, { 1, 56}, { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 1, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, - { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 11, 44}, { 1, 52}, { 5, 18}, { 1, 67}, { 1, 68}, /* Row 37 */ - { 5, 31}, { 1, 69}, { 22, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, - { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 38 */ - { 1, 70}, { 1, 7}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 12, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, - { 1, 7}, { 1, 16}, { 1, 71}, { 1, 67}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 12, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 39 */ - { 4, 31}, { 1, 32}, { 1, 56}, { 21, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, - { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, - { 6, 38}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 40 */ - { 1, 33}, { 1, 7}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 13, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, - { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 41 */ - { 4, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, - { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, - { 6, 38}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 42 */ - { 1, 33}, { 1, 7}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 14, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, - { 5, 38}, { 1, 48}, { 1, 39}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 14, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, /* Row 43 */ - { 4, 31}, { 1, 32}, { 1, 56}, { 19, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 73}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, - { 1, 7}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, /* Row 44 */ - { 1, 33}, { 1, 7}, { 18, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, - { 1, 56}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 73}, { 6, 44}, { 1, 52}, { 5, 18}, /* Row 45 */ - { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 18, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, - { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 46 */ - { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 17, 4}, { 1, 19}, { 1, 23}, { 2, 18}, - { 1, 34}, { 7, 44}, { 2, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, - { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 52}, { 6, 44}, { 1, 52}, /* Row 47 */ - { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, - { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 2, 34}, { 7, 44}, { 1, 34}, { 5, 18}, /* Row 48 */ - { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 16, 4}, { 1, 19}, { 1, 23}, { 2, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, - { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, - { 1, 48}, { 1, 39}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 6, 44}, /* Row 49 */ - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 16, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, - { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, - { 1, 58}, { 1, 48}, { 4, 38}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 7, 44}, /* Row 50 */ - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 1, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 6, 44}, /* Row 51 */ - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 15, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, - { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, - { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 7, 44}, /* Row 52 */ - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 14, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 4, 31}, { 1, 59}, { 1, 76}, { 1, 39}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 6, 44}, /* Row 53 */ - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 14, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, - { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, - { 5, 31}, { 1, 77}, { 1, 78}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 7, 44}, /* Row 54 */ - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 13, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 6, 44}, /* Row 55 */ - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 13, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 4}, { 1, 21}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, - { 1, 79}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 7, 44}, /* Row 56 */ - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 80}, { 1, 22}, - { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 81}, - { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 6, 44}, /* Row 57 */ - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 12, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 82}, { 4, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, - { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 7, 44}, /* Row 58 */ - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 2, 7}, - { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 19, 0}, - { 17, 0}, { 1, 83}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 6, 18}, { 1, 52}, /* Row 59 */ - { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, - { 11, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 3, 31}, { 1, 50}, { 4, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, - { 1, 56}, { 2, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, - { 18, 0}, - { 16, 0}, { 1, 1}, { 1, 84}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 60 */ - { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, - { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 3, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 17, 0}, - { 15, 0}, { 1, 1}, { 1, 2}, { 1, 86}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 61 */ - { 1, 34}, { 7, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, - { 4, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 52}, { 7, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 1, 88}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 5, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 16, 0}, - { 14, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, /* Row 62 */ - { 8, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, - { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 91}, { 1, 40}, { 4, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 15, 0}, - { 13, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 71}, { 1, 29}, { 2, 18}, /* Row 63 */ - { 1, 34}, { 8, 44}, { 1, 34}, { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 9, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 29}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, - { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, - { 1, 5}, { 14, 0}, - { 12, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 94}, { 1, 95}, /* Row 64 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, - { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, - { 9, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, - { 1, 7}, { 9, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, - { 13, 0}, - { 11, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 97}, /* Row 65 */ - { 1, 28}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, - { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, - { 4, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 12, 0}, - { 10, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 66 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, - { 5, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, - { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 11, 0}, - { 9, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 67 */ - { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, - { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 19}, - { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, - { 2, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, - { 14, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 10, 0}, - { 8, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 68 */ - { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, - { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 5, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 15, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 9, 0}, - { 7, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 69 */ - { 3, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 6, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, - { 1, 56}, { 17, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, - { 8, 0}, - { 6, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 70 */ - { 4, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, - { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 3, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 18, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 7, 0}, - { 5, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 71 */ - { 5, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 2, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 5, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 1, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, - { 1, 56}, { 20, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, - { 6, 0}, - { 4, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 72 */ - { 6, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 4, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, - { 1, 41}, { 1, 40}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 1, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, { 1, 7}, { 21, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 5, 0}, - { 3, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 73 */ - { 7, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 3, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 4, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 99}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 23, 4}, - { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 4, 0}, - { 2, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 74 */ - { 8, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 3, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, - { 1, 41}, { 1, 67}, { 3, 18}, { 1, 34}, { 15, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, - { 2, 4}, { 1, 5}, { 3, 0}, - { 1, 0}, { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, /* Row 75 */ - { 9, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, - { 1, 29}, { 1, 92}, { 4, 31}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 3, 4}, - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, { 1, 52}, { 13, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 26, 4}, { 1, 7}, { 1, 16}, - { 1, 15}, { 1, 8}, { 2, 4}, { 1, 5}, { 2, 0}, - { 1, 1}, { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 10, 4}, /* Row 76 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, - { 1, 50}, { 5, 31}, { 1, 33}, { 1, 7}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, - { 1, 22}, { 3, 18}, { 1, 34}, { 13, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, - { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, - { 1, 5}, { 1, 0}, - { 1, 2}, { 1, 6}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 11, 4}, { 1, 19}, /* Row 77 */ - { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, - { 5, 31}, { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, - { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 19}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 8}, { 1, 21}, { 4, 18}, { 1, 52}, { 11, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 5, 31}, { 1, 32}, { 1, 56}, { 29, 4}, { 1, 7}, { 1, 16}, { 1, 15}, - { 1, 8}, { 2, 4}, { 1, 5}, - { 1, 3}, { 1, 8}, { 1, 93}, { 1, 96}, { 1, 98}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 78 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 72}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, - { 1, 33}, { 1, 7}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 24}, { 1, 22}, - { 3, 18}, { 1, 34}, { 11, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, - { 1, 7}, { 30, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 8}, { 2, 4}, - { 1, 4}, { 1, 33}, { 1, 100}, { 1, 98}, { 13, 4}, { 1, 19}, { 1, 23}, { 2, 18}, /* Row 79 */ - { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 80}, - { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, - { 4, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, - { 1, 101}, { 4, 18}, { 1, 52}, { 9, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, - { 5, 31}, { 1, 32}, { 1, 56}, { 32, 4}, { 1, 7}, { 1, 16}, { 1, 15}, { 1, 56}, - { 1, 7}, - { 1, 4}, { 1, 8}, { 1, 102}, { 1, 9}, { 1, 7}, { 12, 4}, { 1, 19}, { 1, 23}, /* Row 80 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 8}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, - { 5, 31}, { 1, 33}, { 1, 7}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 4}, { 1, 101}, - { 4, 18}, { 1, 34}, { 9, 44}, { 1, 35}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 33}, - { 1, 7}, { 33, 4}, { 1, 7}, { 1, 103}, { 1, 10}, { 1, 8}, - { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, { 1, 19}, { 1, 23}, /* Row 81 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 8}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, - { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 56}, { 1, 19}, { 1, 23}, { 2, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 104}, { 4, 18}, { 1, 29}, - { 1, 68}, { 6, 31}, { 1, 56}, { 33, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 66}, - { 1, 3}, - { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 10, 4}, { 1, 19}, { 1, 23}, /* Row 82 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 8}, { 1, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, - { 1, 50}, { 5, 31}, { 1, 33}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 1, 21}, { 4, 18}, - { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 56}, { 32, 4}, - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, { 1, 19}, /* Row 83 */ - { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, - { 6, 31}, { 1, 8}, { 1, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 32}, { 1, 105}, { 1, 23}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 80}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 30, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 8, 4}, /* Row 84 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 5, 18}, { 1, 50}, { 5, 31}, { 1, 106}, { 1, 23}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 72}, { 4, 18}, - { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, - { 29, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 1, 0}, - { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 85 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 2, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 107}, { 1, 29}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, - { 1, 41}, { 1, 67}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 27, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, - { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 6, 4}, /* Row 86 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 5, 18}, { 1, 50}, { 4, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 5, 31}, { 1, 50}, { 4, 18}, - { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, - { 26, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 3, 0}, - { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 87 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 3, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 3, 31}, { 1, 92}, { 1, 29}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, - { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 24, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, - { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 4, 4}, /* Row 88 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 5, 18}, { 1, 50}, { 3, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 4, 31}, { 1, 50}, { 4, 18}, - { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, - { 23, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 5, 0}, - { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 89 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 4, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 92}, { 1, 29}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, - { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 21, 4}, - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 6, 0}, - { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 2, 4}, /* Row 90 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 5, 18}, { 1, 50}, { 2, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 3, 31}, { 1, 50}, { 4, 18}, - { 1, 34}, { 8, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, - { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 20, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, - { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 91 */ - { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 6, 31}, { 1, 8}, { 5, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, { 1, 41}, { 1, 31}, { 1, 92}, { 1, 29}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, - { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 2, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, - { 18, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 8, 0}, - { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 19}, /* Row 92 */ - { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, - { 6, 31}, { 1, 8}, { 6, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 50}, { 1, 31}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 2, 31}, { 1, 50}, { 4, 18}, { 1, 34}, - { 8, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 5, 31}, { 1, 32}, { 1, 56}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 9, 0}, - { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 19}, { 1, 23}, /* Row 93 */ - { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, - { 1, 8}, { 6, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, - { 5, 18}, { 1, 40}, { 1, 41}, { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 31}, { 1, 41}, { 1, 40}, { 4, 18}, - { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 15, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, - { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 108}, { 1, 23}, { 2, 18}, /* Row 94 */ - { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, - { 7, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 50}, - { 1, 92}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 1, 31}, { 1, 50}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 5, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, - { 14, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 11, 0}, - { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 109}, { 1, 29}, { 2, 18}, { 1, 34}, /* Row 95 */ - { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 7, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 40}, - { 1, 90}, { 1, 29}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, - { 1, 92}, { 1, 41}, { 1, 40}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 6, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, - { 1, 7}, { 12, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 12, 0}, - { 13, 0}, { 1, 5}, { 3, 4}, { 1, 89}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 96 */ - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 21}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 87}, { 1, 29}, { 2, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 1, 50}, { 4, 18}, - { 1, 34}, { 8, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, - { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, - { 14, 0}, { 1, 5}, { 2, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 97 */ - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 8, 4}, { 1, 24}, - { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 5, 18}, { 1, 85}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 90}, { 1, 40}, { 4, 18}, - { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 85}, { 3, 18}, { 1, 34}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 9, 4}, - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, - { 15, 0}, { 1, 5}, { 1, 4}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, /* Row 98 */ - { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 21}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 2, 18}, { 1, 29}, { 1, 87}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, - { 1, 87}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 5, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 15, 0}, - { 16, 0}, { 1, 5}, { 1, 19}, { 1, 23}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, /* Row 99 */ - { 2, 18}, { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 9, 4}, { 1, 24}, { 1, 22}, - { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 8, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 3, 18}, { 1, 85}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 1, 50}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, - { 17, 0}, { 1, 110}, { 1, 111}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, /* Row 100 */ - { 1, 29}, { 1, 92}, { 6, 31}, { 1, 8}, { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, - { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 34}, - { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 41}, { 1, 40}, { 3, 18}, - { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, - { 5, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 101 */ - { 6, 31}, { 1, 8}, { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 7, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 7, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 2, 31}, { 1, 50}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 1, 7}, - { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, - { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 102 */ - { 6, 31}, { 1, 8}, { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 3, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, - { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 103 */ - { 6, 31}, { 1, 8}, { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 6, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 6, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 4, 31}, { 1, 50}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 33}, { 2, 7}, - { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 104 */ - { 6, 31}, { 1, 8}, { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 5, 31}, { 1, 41}, { 1, 40}, { 3, 18}, { 1, 52}, { 7, 44}, - { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 32}, { 1, 56}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 105 */ - { 6, 31}, { 1, 8}, { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 5, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 5, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 82}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, { 1, 81}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 106 */ - { 6, 31}, { 1, 8}, { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 80}, { 1, 22}, { 3, 18}, { 1, 52}, - { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 5, 31}, { 1, 77}, { 1, 112}, { 1, 6}, - { 1, 4}, { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 107 */ - { 6, 31}, { 1, 8}, { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 4}, { 1, 21}, - { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 5, 31}, - { 1, 113}, { 1, 8}, { 1, 5}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 108 */ - { 6, 31}, { 1, 8}, { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 1, 4}, { 1, 24}, { 1, 22}, - { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 4, 31}, { 1, 59}, - { 1, 58}, { 1, 114}, { 25, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 109 */ - { 6, 31}, { 1, 8}, { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 3, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 2, 4}, - { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, - { 2, 31}, { 1, 59}, { 1, 58}, { 1, 48}, { 1, 38}, { 25, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 110 */ - { 6, 31}, { 1, 8}, { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, { 1, 24}, { 1, 22}, - { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 1, 31}, { 1, 59}, - { 1, 58}, { 1, 48}, { 1, 38}, { 1, 48}, { 1, 39}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 111 */ - { 6, 31}, { 1, 8}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 2, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 2, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, - { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, { 1, 75}, - { 1, 58}, { 1, 48}, { 4, 38}, { 24, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 112 */ - { 6, 31}, { 1, 8}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 34}, { 8, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 24}, { 1, 22}, - { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 74}, { 1, 48}, { 4, 38}, - { 1, 48}, { 1, 39}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 113 */ - { 6, 31}, { 1, 8}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 1, 18}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 18}, { 1, 52}, { 7, 44}, - { 1, 52}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, - { 1, 21}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, - { 6, 38}, { 23, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 114 */ - { 6, 31}, { 1, 8}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 2, 34}, - { 7, 44}, { 2, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, - { 1, 56}, { 7, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 92}, /* Row 115 */ - { 6, 31}, { 1, 8}, { 17, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, - { 1, 52}, { 1, 34}, { 7, 44}, { 1, 34}, { 1, 52}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 21}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 22, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 29}, { 1, 115}, /* Row 116 */ - { 6, 31}, { 1, 8}, { 18, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 7, 44}, { 1, 34}, - { 7, 44}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, - { 1, 56}, { 9, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 116}, /* Row 117 */ - { 1, 59}, { 5, 31}, { 1, 8}, { 18, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, - { 6, 44}, { 1, 73}, { 7, 44}, { 1, 73}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 21}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 21, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 118 */ - { 1, 58}, { 1, 59}, { 4, 31}, { 1, 16}, { 1, 7}, { 18, 4}, { 1, 21}, { 4, 18}, - { 1, 34}, { 22, 44}, { 1, 34}, { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, - { 11, 4}, { 1, 24}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, - { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 119 */ - { 1, 48}, { 1, 58}, { 1, 59}, { 3, 31}, { 1, 42}, { 1, 16}, { 1, 7}, { 17, 4}, - { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 20, 44}, { 1, 52}, { 4, 18}, { 1, 40}, - { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 12, 4}, { 1, 21}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 20, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 120 */ - { 1, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 2, 31}, { 1, 56}, { 1, 15}, { 1, 16}, - { 1, 7}, { 17, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 20, 44}, { 1, 34}, { 4, 18}, - { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 12, 4}, { 1, 7}, { 1, 117}, { 1, 73}, - { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, - { 1, 39}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 121 */ - { 2, 38}, { 1, 48}, { 1, 58}, { 1, 59}, { 1, 31}, { 2, 8}, { 1, 15}, { 1, 16}, - { 1, 7}, { 16, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 18, 44}, { 1, 52}, - { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 11, 4}, { 1, 7}, - { 1, 9}, { 1, 118}, { 1, 119}, { 3, 18}, { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, - { 1, 47}, { 1, 45}, { 6, 38}, { 19, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 122 */ - { 3, 38}, { 1, 48}, { 1, 58}, { 1, 113}, { 1, 8}, { 1, 4}, { 1, 8}, { 1, 15}, - { 1, 16}, { 1, 7}, { 16, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 18, 44}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 11, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 120}, { 1, 22}, { 3, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 123 */ - { 4, 38}, { 1, 48}, { 1, 121}, { 1, 122}, { 2, 4}, { 1, 8}, { 1, 15}, { 1, 16}, - { 1, 7}, { 15, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 16, 44}, { 1, 52}, - { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 10, 4}, { 1, 7}, - { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 123}, { 3, 18}, { 1, 34}, - { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 18, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 124 */ - { 5, 38}, { 1, 48}, { 1, 124}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 15, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 16, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 10, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 1, 125}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 125 */ - { 6, 38}, { 1, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 14, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 14, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 9, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 17}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 17, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 126 */ - { 6, 38}, { 2, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 14, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 14, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 9, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 4, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 127 */ - { 6, 38}, { 3, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 13, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 12, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 8, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 17}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 16, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 128 */ - { 6, 38}, { 4, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 13, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 12, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 8, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 7, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 53}, { 5, 38}, { 1, 48}, { 1, 39}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 129 */ - { 6, 38}, { 5, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 12, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 10, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 7, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 17}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 47}, { 1, 45}, { 6, 38}, { 15, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 130 */ - { 6, 38}, { 6, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 12, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 10, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 7, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 10, 0}, { 4, 18}, { 1, 52}, { 7, 44}, { 1, 34}, - { 4, 18}, { 1, 51}, { 5, 38}, { 1, 48}, { 1, 126}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 131 */ - { 6, 38}, { 7, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 11, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 8, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 6, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 17}, { 3, 18}, - { 1, 34}, { 7, 44}, { 1, 52}, { 4, 18}, { 1, 53}, { 6, 38}, { 1, 127}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 132 */ - { 6, 38}, { 8, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 11, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 4, 18}, { 1, 50}, - { 6, 31}, { 1, 32}, { 1, 56}, { 6, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, - { 1, 6}, { 1, 4}, { 1, 5}, { 13, 0}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, - { 4, 18}, { 1, 53}, { 7, 38}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 133 */ - { 6, 38}, { 9, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 10, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 52}, { 6, 44}, { 1, 52}, { 4, 18}, - { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 17}, { 3, 18}, - { 1, 34}, { 6, 44}, { 1, 52}, { 4, 18}, { 1, 128}, { 6, 38}, { 1, 48}, { 1, 126}, - { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 134 */ - { 6, 38}, { 10, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 10, 4}, { 1, 21}, { 4, 18}, { 1, 34}, { 1, 55}, { 4, 44}, { 1, 55}, { 1, 34}, - { 4, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 5, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 18}, { 1, 52}, - { 5, 44}, { 1, 34}, { 3, 18}, { 1, 47}, { 1, 45}, { 7, 38}, { 1, 39}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 135 */ - { 6, 38}, { 11, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 9, 4}, { 1, 24}, { 1, 22}, { 4, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, - { 1, 34}, { 4, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, { 1, 7}, { 4, 4}, - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 17, 0}, - { 1, 17}, { 3, 18}, { 1, 34}, { 1, 52}, { 2, 44}, { 1, 52}, { 1, 34}, { 4, 18}, - { 1, 53}, { 8, 38}, { 1, 39}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 136 */ - { 6, 38}, { 12, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 9, 4}, { 1, 21}, { 6, 18}, { 2, 34}, { 6, 18}, { 1, 50}, { 6, 31}, { 1, 32}, - { 1, 56}, { 4, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 19, 0}, { 5, 18}, { 2, 34}, { 5, 18}, { 1, 47}, { 1, 45}, { 8, 38}, - { 1, 1}, { 13, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 137 */ - { 6, 38}, { 13, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 8, 4}, { 1, 24}, { 1, 22}, { 12, 18}, { 1, 40}, { 1, 41}, { 6, 31}, { 1, 33}, - { 1, 7}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 20, 0}, { 1, 17}, { 10, 18}, { 1, 35}, { 1, 61}, { 9, 38}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 34}, { 2, 18}, { 1, 35}, { 1, 45}, /* Row 138 */ - { 6, 38}, { 14, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 8, 4}, { 1, 21}, { 12, 18}, { 1, 50}, { 6, 31}, { 1, 32}, { 1, 56}, { 3, 4}, - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 22, 0}, - { 9, 18}, { 1, 35}, { 1, 61}, { 8, 38}, { 1, 48}, { 1, 39}, { 14, 0}, - { 18, 0}, { 3, 18}, { 1, 34}, { 8, 44}, { 1, 18}, { 2, 35}, { 1, 129}, { 1, 45}, /* Row 139 */ - { 6, 38}, { 15, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, - { 7, 4}, { 1, 19}, { 1, 26}, { 10, 18}, { 1, 130}, { 1, 107}, { 6, 31}, { 1, 33}, - { 1, 7}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 23, 0}, { 1, 131}, { 1, 132}, { 5, 18}, { 1, 35}, { 1, 133}, { 1, 128}, - { 10, 38}, { 15, 0}, - { 25, 0}, { 9, 45}, { 7, 38}, { 16, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, /* Row 140 */ - { 1, 16}, { 1, 7}, { 7, 4}, { 1, 19}, { 1, 21}, { 1, 22}, { 6, 18}, { 1, 40}, - { 1, 50}, { 1, 107}, { 6, 31}, { 1, 32}, { 1, 56}, { 2, 4}, { 1, 7}, { 1, 9}, - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 134}, { 1, 17}, - { 1, 135}, { 1, 51}, { 1, 45}, { 1, 136}, { 9, 38}, { 1, 48}, { 1, 39}, { 15, 0}, - { 25, 0}, { 16, 38}, { 17, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 141 */ - { 1, 7}, { 8, 4}, { 1, 24}, { 1, 21}, { 1, 22}, { 2, 29}, { 1, 67}, { 1, 50}, - { 1, 41}, { 8, 31}, { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 1}, { 11, 38}, { 1, 48}, - { 1, 38}, { 16, 0}, - { 25, 0}, { 16, 38}, { 18, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 142 */ - { 1, 7}, { 9, 4}, { 1, 89}, { 1, 137}, { 1, 138}, { 1, 92}, { 8, 31}, { 1, 42}, - { 1, 16}, { 1, 7}, { 1, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, - { 1, 4}, { 1, 5}, { 32, 0}, { 1, 39}, { 1, 48}, { 8, 38}, { 1, 48}, { 1, 38}, - { 17, 0}, - { 25, 0}, { 16, 38}, { 19, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 143 */ - { 1, 7}, { 9, 4}, { 1, 7}, { 1, 56}, { 1, 33}, { 1, 32}, { 5, 31}, { 1, 42}, - { 1, 16}, { 1, 8}, { 2, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, - { 1, 4}, { 1, 5}, { 34, 0}, { 8, 38}, { 1, 48}, { 1, 38}, { 18, 0}, - { 25, 0}, { 16, 38}, { 20, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 144 */ - { 1, 7}, { 10, 4}, { 1, 7}, { 7, 8}, { 3, 4}, { 1, 7}, { 1, 9}, { 1, 12}, - { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 35, 0}, { 1, 46}, { 7, 38}, { 1, 39}, - { 19, 0}, - { 25, 0}, { 16, 38}, { 21, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 145 */ - { 1, 7}, { 19, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 64, 0}, - { 25, 0}, { 16, 38}, { 22, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, /* Row 146 */ - { 1, 7}, { 17, 4}, { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, - { 1, 5}, { 65, 0}, - { 64, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 15, 4}, /* Row 147 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 66, 0}, - { 65, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 13, 4}, /* Row 148 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 67, 0}, - { 66, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 11, 4}, /* Row 149 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 68, 0}, - { 67, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 9, 4}, /* Row 150 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 69, 0}, - { 68, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 7, 4}, /* Row 151 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 70, 0}, - { 69, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 5, 4}, /* Row 152 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 71, 0}, - { 70, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 3, 4}, /* Row 153 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 4}, /* Row 154 */ - { 1, 7}, { 1, 9}, { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 16}, { 1, 7}, { 1, 9}, /* Row 155 */ - { 1, 12}, { 1, 13}, { 1, 6}, { 1, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 15}, { 1, 103}, { 1, 12}, { 1, 13}, /* Row 156 */ - { 1, 6}, { 1, 4}, { 1, 5}, { 75, 0}, - { 74, 0}, { 1, 5}, { 3, 4}, { 1, 8}, { 1, 139}, { 1, 13}, { 1, 6}, { 1, 4}, /* Row 157 */ - { 1, 5}, { 76, 0}, - { 75, 0}, { 1, 5}, { 2, 4}, { 1, 3}, { 1, 140}, { 1, 6}, { 1, 4}, { 1, 5}, /* Row 158 */ - { 77, 0}, - { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ -}; - -#elif CONFIG_NXWIDGETS_BPP == 8 -# ifdef CONFIG_NXWIDGETS_GREYSCALE - - { 76, 0}, { 1, 1}, { 1, 2}, { 1, 3}, { 4, 4}, { 1, 5}, { 76, 0}, /* Row 0 */ - { 75, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 5, 4}, { 1, 5}, { 75, 0}, /* Row 1 */ - { 74, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 9}, { 1, 10}, /* Row 2 */ - { 4, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 3 */ - { 1, 12}, { 1, 13}, { 4, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 4 */ - { 1, 7}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 5 */ - { 1, 7}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 71, 0}, - { 70, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 6 */ - { 1, 7}, { 4, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 70, 0}, - { 69, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 7 */ - { 1, 7}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 69, 0}, - { 68, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 8 */ - { 1, 7}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 68, 0}, - { 67, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 9 */ - { 1, 7}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 67, 0}, - { 66, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 10 */ - { 1, 7}, { 12, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 66, 0}, - { 65, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 11 */ - { 1, 7}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 65, 0}, - { 64, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 12 */ - { 1, 7}, { 16, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 64, 0}, - { 63, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 13 */ - { 1, 7}, { 18, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 63, 0}, - { 62, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 14 */ - { 1, 7}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 62, 0}, - { 61, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 15 */ - { 1, 7}, { 22, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 61, 0}, - { 60, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 16 */ - { 1, 7}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 60, 0}, - { 59, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 17 */ - { 1, 7}, { 26, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 59, 0}, - { 58, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 18 */ - { 1, 7}, { 28, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 26, 0}, - { 1, 14}, { 5, 15}, { 1, 14}, { 25, 0}, - { 57, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 19 */ - { 1, 7}, { 10, 4}, { 5, 16}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, - { 1, 5}, { 23, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 23, 0}, - { 56, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, /* Row 20 */ - { 1, 7}, { 9, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 3, 20}, { 1, 19}, { 1, 18}, - { 1, 21}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 22, 0}, - { 11, 15}, { 1, 17}, { 22, 0}, - { 23, 0}, { 1, 14}, { 5, 15}, { 1, 22}, { 25, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 21 */ - { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, - { 7, 15}, { 1, 19}, { 1, 24}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, - { 1, 5}, { 20, 0}, { 1, 14}, { 12, 15}, { 1, 17}, { 21, 0}, - { 21, 0}, { 1, 17}, { 9, 15}, { 1, 17}, { 22, 0}, { 1, 1}, { 1, 6}, { 1, 7}, /* Row 22 */ - { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 9, 4}, { 1, 16}, { 1, 23}, - { 9, 15}, { 1, 20}, { 1, 24}, { 4, 4}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 4, 4}, { 1, 5}, { 19, 0}, { 14, 15}, { 21, 0}, - { 21, 0}, { 11, 15}, { 1, 17}, { 20, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, /* Row 23 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, { 1, 18}, { 11, 15}, { 1, 25}, - { 1, 26}, { 2, 27}, { 1, 28}, { 1, 29}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, - { 4, 4}, { 1, 5}, { 17, 0}, { 1, 14}, { 5, 15}, { 1, 30}, { 2, 31}, { 1, 30}, - { 5, 15}, { 1, 14}, { 20, 0}, - { 20, 0}, { 1, 22}, { 12, 15}, { 1, 32}, { 4, 33}, { 1, 7}, { 13, 0}, { 1, 1}, /* Row 24 */ - { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 10, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 3, 30}, { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, - { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 16, 0}, - { 5, 15}, { 1, 37}, { 4, 38}, { 1, 37}, { 4, 15}, { 1, 39}, { 1, 40}, { 1, 41}, - { 18, 0}, - { 19, 0}, { 1, 14}, { 13, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 11, 0}, { 1, 1}, /* Row 25 */ - { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, - { 1, 42}, { 4, 15}, { 1, 31}, { 3, 38}, { 1, 37}, { 5, 15}, { 1, 43}, { 4, 27}, - { 1, 36}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 14, 0}, - { 1, 14}, { 4, 15}, { 1, 30}, { 6, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 1, 33}, - { 1, 41}, { 17, 0}, - { 19, 0}, { 5, 15}, { 1, 30}, { 1, 44}, { 1, 34}, { 1, 31}, { 6, 15}, { 1, 45}, /* Row 26 */ - { 5, 33}, { 1, 7}, { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 11, 4}, { 1, 46}, { 1, 47}, { 4, 15}, { 1, 48}, - { 4, 38}, { 1, 37}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 36}, { 10, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 13, 0}, { 5, 15}, { 1, 34}, - { 6, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 2, 33}, { 1, 41}, { 16, 0}, - { 18, 0}, { 1, 14}, { 4, 15}, { 1, 37}, { 4, 38}, { 1, 31}, { 5, 15}, { 1, 31}, /* Row 27 */ - { 1, 40}, { 5, 33}, { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 12, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 31}, - { 6, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 4, 15}, - { 1, 30}, { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 3, 33}, { 16, 0}, - { 18, 0}, { 4, 15}, { 1, 30}, { 5, 38}, { 1, 48}, { 1, 30}, { 5, 15}, { 1, 45}, /* Row 28 */ - { 5, 33}, { 1, 7}, { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 13, 4}, { 1, 16}, { 1, 20}, { 3, 15}, { 1, 19}, - { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, - { 10, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 10, 0}, { 5, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 22}, { 3, 33}, { 1, 7}, { 15, 0}, - { 18, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 29 */ - { 5, 33}, { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 14, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, - { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 4, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 4, 33}, { 15, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 30 */ - { 1, 7}, { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 15, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 11, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 7, 0}, { 5, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 5, 33}, { 1, 50}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 31 */ - { 5, 33}, { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, - { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 4, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 5, 33}, { 1, 7}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 5, 33}, /* Row 32 */ - { 1, 7}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 9, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, - { 1, 8}, { 1, 13}, { 4, 4}, { 1, 5}, { 4, 0}, { 5, 15}, { 1, 34}, { 7, 38}, - { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 50}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 9, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 33 */ - { 4, 33}, { 1, 51}, { 1, 52}, { 1, 7}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 4, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 4, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 5, 15}, { 1, 45}, { 3, 33}, /* Row 34 */ - { 1, 53}, { 1, 54}, { 1, 21}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 4, 4}, { 1, 5}, { 1, 0}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 3, 15}, { 1, 55}, { 1, 56}, { 6, 33}, { 1, 7}, { 15, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 10, 38}, { 1, 34}, { 5, 15}, { 1, 31}, { 1, 40}, /* Row 35 */ - { 1, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 1, 28}, { 1, 58}, { 1, 7}, { 1, 11}, - { 1, 7}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 11, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 4, 4}, { 1, 59}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, - { 1, 31}, { 1, 60}, { 6, 33}, { 16, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 5, 15}, { 1, 61}, { 1, 53}, /* Row 36 */ - { 1, 57}, { 3, 27}, { 1, 62}, { 1, 56}, { 1, 7}, { 21, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, - { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 2, 4}, { 1, 21}, - { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, - { 1, 7}, { 16, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 11, 38}, { 1, 34}, { 5, 15}, { 1, 63}, { 1, 35}, /* Row 37 */ - { 5, 27}, { 1, 64}, { 22, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 3}, - { 1, 8}, { 1, 13}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 38 */ - { 1, 65}, { 1, 3}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 12, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, - { 1, 3}, { 1, 8}, { 1, 66}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 17, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 12, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 39 */ - { 4, 27}, { 1, 28}, { 1, 49}, { 21, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, - { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, - { 6, 33}, { 18, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 40 */ - { 1, 29}, { 1, 3}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 13, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, - { 6, 33}, { 1, 7}, { 18, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 41 */ - { 4, 27}, { 1, 28}, { 1, 49}, { 20, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, - { 6, 33}, { 19, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 42 */ - { 1, 29}, { 1, 3}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 14, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, - { 6, 33}, { 1, 7}, { 19, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 14, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, /* Row 43 */ - { 4, 27}, { 1, 28}, { 1, 49}, { 19, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 68}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, - { 1, 3}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, - { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, /* Row 44 */ - { 1, 29}, { 1, 3}, { 18, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, - { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, - { 1, 49}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 68}, { 6, 38}, { 1, 34}, { 5, 15}, /* Row 45 */ - { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 18, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 4, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 69}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 46 */ - { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 17, 4}, { 1, 16}, { 1, 20}, { 2, 15}, - { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 34}, { 6, 38}, { 1, 34}, /* Row 47 */ - { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 17, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, - { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 2, 30}, { 7, 38}, { 1, 30}, { 5, 15}, /* Row 48 */ - { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 16, 4}, { 1, 16}, { 1, 20}, { 2, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 21}, { 1, 19}, - { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, - { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 6, 38}, /* Row 49 */ - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 16, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, - { 1, 53}, { 5, 33}, { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 7, 38}, /* Row 50 */ - { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 1, 27}, { 1, 57}, { 1, 53}, { 3, 33}, { 1, 7}, { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 6, 38}, /* Row 51 */ - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 15, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 2, 27}, { 1, 57}, { 1, 53}, { 2, 33}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 7, 38}, /* Row 52 */ - { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 14, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 4, 27}, { 1, 57}, { 1, 53}, { 1, 7}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 6, 38}, /* Row 53 */ - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 14, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 5, 27}, { 1, 71}, { 1, 72}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 7, 38}, /* Row 54 */ - { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 13, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 6, 27}, { 1, 28}, { 1, 49}, { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 6, 38}, /* Row 55 */ - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 13, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 4}, { 1, 18}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, - { 1, 49}, { 1, 3}, { 1, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 7, 38}, /* Row 56 */ - { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 73}, { 1, 19}, - { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 36}, - { 1, 13}, { 3, 4}, { 1, 5}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 6, 38}, /* Row 57 */ - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 12, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 74}, { 4, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, - { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 7, 38}, /* Row 58 */ - { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 2, 3}, - { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 19, 0}, - { 17, 0}, { 1, 75}, { 1, 55}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 6, 15}, /* Row 59 */ - { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, - { 1, 49}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 3, 27}, { 1, 43}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, - { 18, 0}, - { 16, 0}, { 1, 1}, { 1, 76}, { 1, 37}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 60 */ - { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, - { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 3, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 3, 4}, { 1, 5}, { 17, 0}, - { 15, 0}, { 1, 1}, { 1, 6}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 61 */ - { 1, 30}, { 7, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, - { 4, 27}, { 1, 28}, { 1, 49}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, { 1, 34}, { 7, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 1, 79}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 16, 0}, - { 14, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 62 */ - { 8, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, - { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 80}, { 1, 34}, { 4, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 15, 0}, - { 13, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 9}, { 1, 77}, { 2, 15}, /* Row 63 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 3, 15}, { 1, 37}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 9, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 68}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, - { 14, 0}, - { 12, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 82}, { 1, 83}, /* Row 64 */ - { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 78}, { 4, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, - { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, - { 9, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, - { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 13, 0}, - { 11, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 85}, /* Row 65 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, - { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, - { 4, 27}, { 1, 28}, { 1, 49}, { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 3, 4}, { 1, 5}, { 12, 0}, - { 10, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 66 */ - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, - { 5, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, - { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 3, 4}, { 1, 5}, { 11, 0}, - { 9, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 67 */ - { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 7, 4}, { 1, 16}, - { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 2, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, - { 14, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 10, 0}, - { 8, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 68 */ - { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 1, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, - { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 5, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 15, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 9, 0}, - { 7, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 69 */ - { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 6, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 3, 15}, - { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, - { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 8, 0}, - { 6, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 70 */ - { 4, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, - { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 3, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 18, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 7, 0}, - { 5, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 71 */ - { 5, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 5, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 1, 15}, - { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, - { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 6, 0}, - { 4, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 72 */ - { 6, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, - { 1, 35}, { 1, 34}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 1, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 21, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 5, 0}, - { 3, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 73 */ - { 7, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 4, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 69}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, - { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, { 4, 0}, - { 2, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 74 */ - { 8, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 5, 15}, { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, - { 1, 87}, { 1, 34}, { 3, 15}, { 1, 30}, { 15, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 6, 27}, { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, - { 1, 5}, { 3, 0}, - { 1, 0}, { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, /* Row 75 */ - { 9, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 3, 4}, - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 34}, { 13, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, { 1, 8}, - { 1, 13}, { 3, 4}, { 1, 5}, { 2, 0}, - { 1, 1}, { 1, 6}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 10, 4}, /* Row 76 */ - { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, - { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 43}, { 5, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, - { 1, 19}, { 3, 15}, { 1, 30}, { 13, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, { 1, 5}, - { 1, 0}, - { 1, 2}, { 1, 7}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 11, 4}, { 1, 16}, /* Row 77 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 5, 27}, { 1, 87}, { 1, 34}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, - { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 16}, { 1, 20}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, - { 1, 4}, { 1, 18}, { 4, 15}, { 1, 34}, { 11, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, { 1, 8}, { 1, 13}, - { 3, 4}, { 1, 5}, - { 1, 3}, { 1, 4}, { 1, 28}, { 1, 84}, { 1, 86}, { 12, 4}, { 1, 16}, { 1, 20}, /* Row 78 */ - { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, - { 1, 67}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, - { 1, 29}, { 1, 3}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, - { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, { 1, 19}, - { 3, 15}, { 1, 30}, { 11, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, - { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 3, 4}, - { 1, 4}, { 1, 88}, { 1, 89}, { 1, 86}, { 13, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 79 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, - { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 35}, - { 4, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, - { 4, 15}, { 1, 34}, { 9, 38}, { 1, 19}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 28}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, { 1, 13}, { 1, 49}, { 1, 3}, - { 2, 4}, { 1, 90}, { 1, 8}, { 1, 3}, { 12, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 80 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, - { 1, 29}, { 1, 3}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, { 1, 6}, { 4, 15}, { 1, 69}, - { 9, 38}, { 1, 31}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 29}, { 1, 3}, { 33, 4}, - { 1, 3}, { 1, 91}, { 1, 81}, { 1, 4}, - { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 81 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, - { 1, 35}, { 4, 27}, { 1, 28}, { 1, 49}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 21}, - { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 92}, { 4, 15}, { 1, 68}, { 1, 93}, - { 6, 27}, { 1, 49}, { 33, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 56}, { 1, 8}, - { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 82 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 2, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 5, 27}, - { 1, 29}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 6, 27}, { 1, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 49}, { 32, 4}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, - { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 16}, { 1, 20}, /* Row 83 */ - { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, - { 2, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, - { 1, 34}, { 1, 35}, { 4, 27}, { 1, 28}, { 1, 7}, { 1, 20}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 21}, { 1, 19}, - { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 29}, { 1, 3}, { 30, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, - { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, { 1, 16}, /* Row 84 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 3, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 43}, { 5, 27}, { 1, 10}, { 1, 20}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 1, 67}, { 4, 15}, { 1, 30}, { 12, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 29, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 1, 0}, - { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, /* Row 85 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 3, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 81}, { 1, 77}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 87}, { 1, 34}, - { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 29}, { 1, 3}, { 27, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 2, 0}, - { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 6, 4}, { 1, 16}, /* Row 86 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 4, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 43}, { 4, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 2, 15}, { 1, 25}, { 1, 81}, { 5, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 14, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 26, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 3, 0}, - { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 16}, /* Row 87 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 4, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 34}, { 1, 35}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 35}, { 1, 34}, - { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, - { 1, 29}, { 1, 3}, { 24, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 4, 0}, - { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 4, 4}, { 1, 16}, /* Row 88 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 5, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 43}, { 3, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 2, 15}, { 1, 25}, { 1, 81}, { 4, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 16, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 23, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, - { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 16}, /* Row 89 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 5, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 35}, { 1, 34}, - { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 1, 69}, { 7, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 21, 4}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 6, 0}, - { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 2, 4}, { 1, 16}, /* Row 90 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 6, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 43}, { 2, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, - { 2, 15}, { 1, 25}, { 1, 81}, { 3, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, - { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, - { 1, 28}, { 1, 49}, { 20, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 7, 0}, - { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 16}, /* Row 91 */ - { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, - { 6, 27}, { 6, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 34}, { 1, 35}, { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 2, 27}, { 1, 35}, { 1, 34}, - { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 18, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, - { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 16}, { 1, 20}, /* Row 92 */ - { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, - { 7, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, - { 1, 27}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 2, 27}, { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, - { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, - { 1, 49}, { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, - { 1, 5}, { 9, 0}, - { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 16}, { 1, 20}, { 2, 15}, /* Row 93 */ - { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 7, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, - { 1, 35}, { 1, 81}, { 1, 25}, { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 25}, { 1, 81}, { 1, 27}, { 1, 35}, { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 5, 27}, { 1, 29}, { 1, 3}, { 15, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 1, 4}, { 1, 5}, { 10, 0}, - { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 73}, { 1, 20}, { 2, 15}, { 1, 30}, /* Row 94 */ - { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 18}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 43}, { 1, 81}, { 1, 25}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 27}, - { 1, 43}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 14, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, - { 12, 0}, { 1, 5}, { 4, 4}, { 1, 57}, { 1, 77}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 95 */ - { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 8, 4}, { 1, 21}, { 1, 19}, - { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 34}, { 1, 41}, { 1, 25}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 35}, - { 1, 34}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 6, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 12, 4}, - { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 12, 0}, - { 13, 0}, { 1, 5}, { 3, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 96 */ - { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 18}, { 4, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 78}, { 1, 77}, { 2, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 1, 43}, { 4, 15}, { 1, 30}, - { 8, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 5, 27}, { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 1, 4}, { 1, 5}, { 13, 0}, - { 14, 0}, { 1, 5}, { 2, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 97 */ - { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 9, 4}, { 1, 21}, { 1, 19}, - { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 5, 15}, { 1, 37}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 41}, { 1, 34}, { 4, 15}, { 1, 34}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 37}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, - { 15, 0}, { 1, 5}, { 1, 4}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, /* Row 98 */ - { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 18}, { 4, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 77}, { 1, 78}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 78}, - { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, - { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 15, 0}, - { 16, 0}, { 1, 5}, { 1, 16}, { 1, 20}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, /* Row 99 */ - { 2, 15}, { 1, 25}, { 1, 81}, { 6, 27}, { 10, 4}, { 1, 21}, { 1, 19}, { 4, 15}, - { 1, 34}, { 6, 38}, { 1, 34}, { 8, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, - { 1, 37}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 94}, - { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 5, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, - { 17, 0}, { 1, 95}, { 1, 96}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, /* Row 100 */ - { 1, 25}, { 1, 81}, { 6, 27}, { 11, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, - { 1, 30}, { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 30}, { 8, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, - { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 5, 4}, - { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 101 */ - { 6, 27}, { 11, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 7, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 7, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 1, 3}, { 3, 4}, - { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 18, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 102 */ - { 6, 27}, { 12, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 3, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 19, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 103 */ - { 6, 27}, { 12, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 6, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 6, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 4, 27}, { 1, 43}, { 3, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 29}, { 2, 3}, { 1, 8}, - { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 104 */ - { 6, 27}, { 13, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 5, 27}, { 1, 35}, { 1, 34}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, - { 4, 15}, { 1, 43}, { 5, 27}, { 1, 28}, { 1, 49}, { 1, 8}, { 1, 7}, { 1, 11}, - { 1, 7}, { 1, 4}, { 1, 5}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 105 */ - { 6, 27}, { 13, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 5, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 5, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 74}, { 3, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 36}, { 1, 7}, { 1, 11}, - { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 106 */ - { 6, 27}, { 14, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 6, 27}, { 1, 28}, { 1, 73}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, - { 1, 30}, { 4, 15}, { 1, 43}, { 5, 27}, { 1, 54}, { 1, 97}, { 1, 7}, { 1, 4}, - { 1, 5}, { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 107 */ - { 6, 27}, { 14, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 4}, { 1, 18}, { 3, 15}, - { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 5, 27}, { 1, 98}, - { 1, 4}, { 1, 5}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 108 */ - { 6, 27}, { 15, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 1, 4}, { 1, 21}, { 1, 19}, { 3, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 4, 27}, { 1, 57}, { 1, 99}, - { 1, 9}, { 25, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 109 */ - { 6, 27}, { 15, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 3, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 2, 4}, { 1, 18}, - { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, { 2, 27}, - { 1, 57}, { 1, 53}, { 2, 33}, { 25, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 110 */ - { 6, 27}, { 16, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 21}, { 1, 19}, { 3, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 1, 27}, { 1, 57}, { 1, 53}, - { 3, 33}, { 1, 7}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 111 */ - { 6, 27}, { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 2, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 2, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 18}, - { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 1}, { 1, 53}, - { 5, 33}, { 24, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 112 */ - { 6, 27}, { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, - { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, - { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 21}, { 1, 19}, { 3, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 70}, { 6, 33}, { 1, 7}, { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 113 */ - { 6, 27}, { 17, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 1, 15}, { 1, 30}, { 7, 38}, { 1, 30}, { 1, 15}, { 1, 34}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 18}, - { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, - { 23, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 114 */ - { 6, 27}, { 18, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 2, 30}, { 7, 38}, - { 2, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, - { 7, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 45}, { 6, 33}, { 1, 7}, { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 25}, { 1, 81}, /* Row 115 */ - { 6, 27}, { 18, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, - { 1, 30}, { 7, 38}, { 1, 30}, { 1, 34}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 18}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 22, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 77}, { 1, 100}, /* Row 116 */ - { 6, 27}, { 19, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 7, 38}, { 1, 69}, { 7, 38}, - { 1, 69}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, - { 9, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 45}, { 6, 33}, { 1, 7}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 101}, /* Row 117 */ - { 1, 57}, { 5, 27}, { 19, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, - { 1, 68}, { 7, 38}, { 1, 68}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 34}, { 1, 35}, - { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 18}, { 3, 15}, { 1, 30}, { 7, 38}, - { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 21, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 118 */ - { 1, 53}, { 1, 57}, { 4, 27}, { 1, 8}, { 1, 3}, { 18, 4}, { 1, 18}, { 4, 15}, - { 1, 30}, { 22, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, - { 11, 4}, { 1, 21}, { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 45}, { 6, 33}, { 1, 7}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 119 */ - { 1, 33}, { 1, 53}, { 1, 57}, { 3, 27}, { 1, 36}, { 1, 8}, { 1, 3}, { 17, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 20, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 12, 4}, { 1, 18}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 20, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 120 */ - { 2, 33}, { 1, 53}, { 1, 57}, { 2, 27}, { 1, 49}, { 1, 13}, { 1, 8}, { 1, 3}, - { 17, 4}, { 1, 18}, { 4, 15}, { 1, 30}, { 20, 38}, { 1, 30}, { 4, 15}, { 1, 43}, - { 6, 27}, { 1, 28}, { 1, 49}, { 12, 4}, { 1, 3}, { 1, 79}, { 1, 63}, { 3, 15}, - { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 7}, { 19, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 121 */ - { 3, 33}, { 1, 53}, { 1, 57}, { 1, 27}, { 2, 4}, { 1, 13}, { 1, 8}, { 1, 3}, - { 16, 4}, { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 18, 38}, { 1, 34}, { 4, 15}, - { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 11, 4}, { 1, 3}, { 1, 8}, - { 1, 7}, { 1, 102}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, - { 1, 40}, { 6, 33}, { 19, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 122 */ - { 4, 33}, { 1, 53}, { 1, 62}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 16, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 18, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 28}, { 1, 49}, { 11, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 79}, - { 1, 19}, { 3, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, { 6, 33}, - { 1, 7}, { 18, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 123 */ - { 5, 33}, { 1, 103}, { 1, 3}, { 3, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 16, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 53}, { 3, 15}, { 1, 30}, { 7, 38}, { 1, 34}, - { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 18, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 124 */ - { 6, 33}, { 1, 95}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 18}, - { 4, 15}, { 1, 30}, { 16, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, { 1, 28}, - { 1, 49}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, - { 1, 5}, { 1, 27}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, { 1, 45}, - { 6, 33}, { 1, 7}, { 17, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 125 */ - { 6, 33}, { 1, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 14, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 2, 0}, { 1, 14}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 17, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 126 */ - { 6, 33}, { 2, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 14, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 14, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 28}, { 1, 49}, { 9, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 4, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 45}, { 6, 33}, { 1, 7}, { 16, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 127 */ - { 6, 33}, { 3, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 12, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 5, 0}, { 1, 14}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 16, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 128 */ - { 6, 33}, { 4, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 12, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 28}, { 1, 49}, { 8, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 7, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 45}, { 6, 33}, { 1, 7}, { 15, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 129 */ - { 6, 33}, { 5, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 10, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 8, 0}, { 1, 14}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 34}, { 4, 15}, { 1, 31}, { 1, 40}, { 6, 33}, { 15, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 130 */ - { 6, 33}, { 6, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 12, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 10, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 28}, { 1, 49}, { 7, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 10, 0}, { 4, 15}, { 1, 34}, { 7, 38}, { 1, 30}, { 4, 15}, - { 1, 22}, { 6, 33}, { 1, 104}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 131 */ - { 6, 33}, { 7, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 8, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 11, 0}, { 1, 14}, { 3, 15}, { 1, 30}, - { 7, 38}, { 1, 44}, { 4, 15}, { 1, 45}, { 6, 33}, { 1, 65}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 132 */ - { 6, 33}, { 8, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 4, 15}, { 1, 43}, { 6, 27}, - { 1, 28}, { 1, 49}, { 6, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 13, 0}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, - { 1, 45}, { 7, 33}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 133 */ - { 6, 33}, { 9, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 34}, { 6, 38}, { 1, 34}, { 4, 15}, { 1, 34}, - { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 14, 0}, { 1, 14}, { 3, 15}, { 1, 30}, - { 6, 38}, { 1, 44}, { 3, 15}, { 1, 55}, { 1, 105}, { 7, 33}, { 1, 104}, { 13, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 134 */ - { 6, 33}, { 10, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 10, 4}, - { 1, 18}, { 4, 15}, { 1, 30}, { 1, 106}, { 4, 38}, { 1, 106}, { 1, 30}, { 4, 15}, - { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 5, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 16, 0}, { 4, 15}, { 1, 34}, { 5, 38}, - { 1, 30}, { 3, 15}, { 1, 31}, { 1, 60}, { 7, 33}, { 1, 7}, { 13, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 135 */ - { 6, 33}, { 11, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, - { 1, 21}, { 1, 19}, { 4, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, - { 4, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, { 4, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 17, 0}, { 1, 14}, - { 3, 15}, { 1, 30}, { 1, 34}, { 2, 38}, { 1, 34}, { 1, 30}, { 4, 15}, { 1, 45}, - { 8, 33}, { 1, 7}, { 13, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 136 */ - { 6, 33}, { 12, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, - { 1, 18}, { 6, 15}, { 2, 30}, { 6, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, - { 4, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 19, 0}, { 5, 15}, { 2, 30}, { 5, 15}, { 1, 31}, { 1, 40}, { 8, 33}, { 1, 50}, - { 13, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 137 */ - { 6, 33}, { 13, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, - { 1, 21}, { 1, 19}, { 12, 15}, { 1, 34}, { 1, 35}, { 6, 27}, { 1, 29}, { 1, 3}, - { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 20, 0}, { 1, 14}, { 10, 15}, { 1, 39}, { 1, 107}, { 9, 33}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 30}, { 2, 15}, { 1, 96}, { 1, 60}, /* Row 138 */ - { 6, 33}, { 14, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 8, 4}, - { 1, 18}, { 12, 15}, { 1, 43}, { 6, 27}, { 1, 28}, { 1, 49}, { 3, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 22, 0}, { 9, 15}, - { 1, 39}, { 1, 107}, { 9, 33}, { 1, 7}, { 14, 0}, - { 18, 0}, { 3, 15}, { 1, 30}, { 8, 38}, { 1, 55}, { 2, 96}, { 1, 108}, { 1, 60}, /* Row 139 */ - { 6, 33}, { 15, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, - { 1, 16}, { 1, 23}, { 10, 15}, { 1, 109}, { 1, 81}, { 6, 27}, { 1, 29}, { 1, 3}, - { 2, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 23, 0}, { 1, 28}, { 1, 110}, { 5, 15}, { 1, 39}, { 1, 111}, { 1, 105}, { 10, 33}, - { 15, 0}, - { 25, 0}, { 1, 59}, { 4, 40}, { 4, 60}, { 7, 33}, { 16, 0}, { 1, 5}, { 4, 4}, /* Row 140 */ - { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 16}, { 1, 18}, { 1, 19}, { 6, 15}, - { 1, 34}, { 1, 43}, { 1, 81}, { 6, 27}, { 1, 28}, { 1, 49}, { 2, 4}, { 1, 3}, - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 27, 0}, { 1, 112}, - { 1, 14}, { 1, 113}, { 1, 22}, { 1, 40}, { 1, 76}, { 10, 33}, { 1, 7}, { 15, 0}, - { 25, 0}, { 16, 33}, { 17, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 141 */ - { 8, 4}, { 1, 21}, { 1, 18}, { 1, 19}, { 1, 77}, { 1, 25}, { 1, 34}, { 1, 43}, - { 1, 35}, { 8, 27}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 30, 0}, { 1, 50}, { 13, 33}, { 16, 0}, - { 25, 0}, { 16, 33}, { 18, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 142 */ - { 9, 4}, { 1, 16}, { 1, 10}, { 1, 66}, { 1, 81}, { 8, 27}, { 1, 36}, { 1, 8}, - { 1, 3}, { 1, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, - { 1, 5}, { 32, 0}, { 1, 7}, { 11, 33}, { 17, 0}, - { 25, 0}, { 16, 33}, { 19, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 143 */ - { 9, 4}, { 1, 3}, { 1, 49}, { 1, 29}, { 1, 28}, { 5, 27}, { 1, 36}, { 1, 8}, - { 3, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 34, 0}, { 10, 33}, { 18, 0}, - { 25, 0}, { 16, 33}, { 20, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 144 */ - { 10, 4}, { 1, 3}, { 10, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, - { 1, 4}, { 1, 5}, { 35, 0}, { 1, 41}, { 7, 33}, { 1, 7}, { 19, 0}, - { 25, 0}, { 16, 33}, { 21, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 145 */ - { 19, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 64, 0}, - { 25, 0}, { 16, 33}, { 22, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, /* Row 146 */ - { 17, 4}, { 1, 3}, { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, - { 65, 0}, - { 64, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 15, 4}, { 1, 3}, /* Row 147 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 66, 0}, - { 65, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 13, 4}, { 1, 3}, /* Row 148 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 67, 0}, - { 66, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 11, 4}, { 1, 3}, /* Row 149 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 68, 0}, - { 67, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 9, 4}, { 1, 3}, /* Row 150 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 69, 0}, - { 68, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 7, 4}, { 1, 3}, /* Row 151 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 70, 0}, - { 69, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 5, 4}, { 1, 3}, /* Row 152 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 71, 0}, - { 70, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 3, 4}, { 1, 3}, /* Row 153 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 72, 0}, - { 71, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 154 */ - { 1, 8}, { 1, 7}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 73, 0}, - { 72, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 8}, { 1, 3}, { 1, 8}, { 1, 7}, /* Row 155 */ - { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, { 74, 0}, - { 73, 0}, { 1, 5}, { 4, 4}, { 1, 13}, { 1, 91}, { 1, 7}, { 1, 11}, { 1, 7}, /* Row 156 */ - { 1, 4}, { 1, 5}, { 75, 0}, - { 74, 0}, { 1, 5}, { 4, 4}, { 1, 114}, { 1, 11}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 157 */ - { 76, 0}, - { 75, 0}, { 1, 5}, { 2, 4}, { 1, 8}, { 1, 115}, { 1, 7}, { 1, 4}, { 1, 5}, /* Row 158 */ - { 77, 0}, - { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ - -# else /* CONFIG_NXWIDGETS_GREYSCALE */ - -static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = -{ - { 76, 0}, { 1, 1}, { 1, 2}, { 5, 3}, { 1, 4}, { 76, 0}, /* Row 0 */ - { 75, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 6, 3}, { 1, 4}, { 75, 0}, /* Row 1 */ - { 74, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 2, 6}, { 4, 3}, { 1, 4}, /* Row 2 */ - { 74, 0}, - { 73, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 8}, /* Row 3 */ - { 1, 6}, { 4, 3}, { 1, 4}, { 73, 0}, - { 72, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 4 */ - { 2, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 72, 0}, - { 71, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 5 */ - { 4, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 71, 0}, - { 70, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 6 */ - { 6, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 70, 0}, - { 69, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 7 */ - { 8, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 69, 0}, - { 68, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 8 */ - { 10, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 68, 0}, - { 67, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 9 */ - { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 67, 0}, - { 66, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 10 */ - { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 66, 0}, - { 65, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 11 */ - { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 65, 0}, - { 64, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 12 */ - { 18, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 64, 0}, - { 63, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 13 */ - { 20, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 63, 0}, - { 62, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 14 */ - { 22, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 62, 0}, - { 61, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 15 */ - { 24, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 61, 0}, - { 60, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 16 */ - { 26, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 60, 0}, - { 59, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 17 */ - { 28, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 59, 0}, - { 58, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 18 */ - { 30, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 26, 0}, { 1, 9}, { 5, 10}, { 1, 9}, - { 25, 0}, - { 57, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 19 */ - { 10, 3}, { 5, 5}, { 17, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 23, 0}, { 1, 1}, - { 9, 10}, { 1, 1}, { 23, 0}, - { 56, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 20 */ - { 9, 3}, { 1, 5}, { 1, 11}, { 5, 12}, { 1, 11}, { 1, 13}, { 16, 3}, { 1, 6}, - { 4, 3}, { 1, 4}, { 22, 0}, { 11, 10}, { 1, 1}, { 22, 0}, - { 23, 0}, { 1, 9}, { 5, 10}, { 1, 14}, { 25, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 21 */ - { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 7, 10}, - { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 20, 0}, { 1, 9}, - { 12, 10}, { 1, 1}, { 21, 0}, - { 21, 0}, { 1, 1}, { 9, 10}, { 1, 1}, { 22, 0}, { 1, 1}, { 1, 2}, { 1, 5}, /* Row 22 */ - { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 15}, { 9, 10}, - { 1, 12}, { 1, 16}, { 16, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 19, 0}, { 14, 10}, - { 21, 0}, - { 21, 0}, { 11, 10}, { 1, 1}, { 20, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, /* Row 23 */ - { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 11}, { 11, 10}, { 1, 12}, { 1, 7}, - { 3, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 17, 0}, { 1, 9}, - { 6, 10}, { 2, 12}, { 6, 10}, { 1, 9}, { 20, 0}, - { 20, 0}, { 1, 14}, { 12, 10}, { 1, 9}, { 4, 2}, { 1, 17}, { 13, 0}, { 1, 1}, /* Row 24 */ - { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 10, 3}, { 1, 13}, - { 1, 12}, { 12, 10}, { 1, 12}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, - { 16, 0}, { 5, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 1, 1}, { 18, 0}, - { 19, 0}, { 1, 9}, { 13, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 11, 0}, { 1, 1}, /* Row 25 */ - { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, { 1, 19}, - { 4, 10}, { 5, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 12, 3}, { 1, 6}, { 4, 3}, - { 1, 4}, { 14, 0}, { 1, 9}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 14}, { 1, 2}, - { 1, 1}, { 17, 0}, - { 19, 0}, { 6, 10}, { 3, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 9, 0}, /* Row 26 */ - { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 11, 3}, - { 1, 5}, { 1, 14}, { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 12, 3}, - { 1, 6}, { 4, 3}, { 1, 4}, { 13, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 14}, - { 2, 2}, { 1, 1}, { 16, 0}, - { 18, 0}, { 1, 9}, { 4, 10}, { 6, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, /* Row 27 */ - { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, - { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 1, 11}, { 5, 6}, - { 1, 5}, { 12, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 11, 0}, { 1, 9}, { 5, 10}, - { 8, 12}, { 4, 10}, { 1, 14}, { 3, 2}, { 16, 0}, - { 18, 0}, { 5, 10}, { 6, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 6, 0}, /* Row 28 */ - { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 13, 3}, - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 13, 3}, - { 1, 6}, { 4, 3}, { 1, 4}, { 10, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 3, 2}, { 1, 17}, { 15, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 5, 0}, /* Row 29 */ - { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 14, 3}, - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, - { 13, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 8, 0}, { 1, 9}, { 5, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 15, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 3, 0}, /* Row 30 */ - { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 15, 3}, - { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, - { 1, 6}, { 4, 3}, { 1, 4}, { 7, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 5, 2}, { 1, 1}, { 14, 0}, - { 18, 0}, { 4, 10}, { 9, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 2, 0}, /* Row 31 */ - { 1, 1}, { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 16, 3}, - { 1, 5}, { 1, 12}, { 3, 10}, { 9, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, - { 14, 3}, { 1, 6}, { 4, 3}, { 1, 4}, { 5, 0}, { 1, 9}, { 5, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 1, 18}, { 5, 2}, { 1, 17}, { 14, 0}, - { 18, 0}, { 4, 10}, { 9, 12}, { 6, 10}, { 1, 14}, { 5, 2}, { 1, 17}, { 1, 1}, /* Row 32 */ - { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 17, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 10, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 15, 3}, { 1, 6}, - { 4, 3}, { 1, 4}, { 4, 0}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, - { 1, 1}, { 14, 0}, - { 18, 0}, { 4, 10}, { 10, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 4, 2}, { 1, 18}, /* Row 33 */ - { 1, 2}, { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 18, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, - { 1, 6}, { 4, 3}, { 1, 4}, { 2, 0}, { 1, 9}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 18}, { 6, 2}, { 15, 0}, - { 18, 0}, { 4, 10}, { 10, 12}, { 6, 10}, { 1, 14}, { 3, 2}, { 1, 20}, { 1, 6}, /* Row 34 */ - { 1, 5}, { 2, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 19, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 11, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, { 1, 6}, { 4, 3}, - { 1, 4}, { 1, 0}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 1, 17}, - { 15, 0}, - { 18, 0}, { 4, 10}, { 11, 12}, { 5, 10}, { 1, 12}, { 1, 18}, { 1, 2}, { 1, 20}, /* Row 35 */ - { 3, 6}, { 1, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 20, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 11, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 16, 3}, { 1, 6}, - { 4, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 2}, { 16, 0}, - { 18, 0}, { 4, 10}, { 11, 12}, { 6, 10}, { 1, 14}, { 1, 20}, { 5, 6}, { 1, 2}, /* Row 36 */ - { 1, 5}, { 21, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 4, 10}, { 1, 12}, - { 6, 6}, { 17, 3}, { 1, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, - { 18, 0}, { 4, 10}, { 12, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 22, 3}, /* Row 37 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, - { 17, 3}, { 1, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, - { 1, 18}, { 6, 2}, { 17, 0}, - { 18, 0}, { 4, 10}, { 12, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 22, 3}, /* Row 38 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 13, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 18, 3}, - { 1, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, - { 17, 0}, - { 18, 0}, { 4, 10}, { 13, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 22, 3}, { 1, 5}, /* Row 39 */ - { 1, 12}, { 3, 10}, { 13, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 17, 3}, - { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, - { 18, 0}, { 4, 10}, { 13, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 21, 3}, /* Row 40 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 16, 3}, - { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, - { 18, 0}, - { 18, 0}, { 4, 10}, { 14, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 21, 3}, { 1, 5}, /* Row 41 */ - { 1, 12}, { 3, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 15, 3}, - { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, - { 18, 0}, { 4, 10}, { 14, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 20, 3}, /* Row 42 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 15, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 14, 3}, - { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, - { 19, 0}, - { 18, 0}, { 4, 10}, { 15, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 20, 3}, { 1, 5}, /* Row 43 */ - { 1, 12}, { 3, 10}, { 15, 12}, { 5, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 13, 3}, - { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 20, 0}, - { 18, 0}, { 4, 10}, { 15, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 19, 3}, /* Row 44 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, - { 6, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 6, 2}, { 1, 17}, { 20, 0}, - { 18, 0}, { 4, 10}, { 16, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 19, 3}, { 1, 5}, /* Row 45 */ - { 1, 12}, { 3, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 5, 6}, - { 1, 5}, { 11, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, - { 6, 2}, { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 46 */ - { 1, 5}, { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 47 */ - { 18, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 48 */ - { 1, 5}, { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 49 */ - { 17, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 50 */ - { 1, 5}, { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 11}, { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 51 */ - { 16, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 24, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 52 */ - { 1, 5}, { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 11}, { 5, 6}, { 1, 20}, { 1, 17}, { 24, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 53 */ - { 15, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 25, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 54 */ - { 1, 5}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 11}, { 7, 6}, { 1, 3}, { 1, 4}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 55 */ - { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 3, 3}, { 1, 4}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 56 */ - { 1, 5}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 6, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 8, 6}, { 3, 3}, { 1, 4}, { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, /* Row 57 */ - { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, - { 1, 11}, { 5, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, - { 2, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 20, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, /* Row 58 */ - { 1, 5}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 1, 5}, { 3, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 19, 0}, - { 17, 0}, { 1, 22}, { 1, 12}, { 3, 10}, { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, /* Row 59 */ - { 1, 12}, { 6, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 8, 10}, - { 8, 12}, { 5, 10}, { 1, 11}, { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 5, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 18, 0}, - { 16, 0}, { 1, 1}, { 1, 18}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, { 7, 12}, /* Row 60 */ - { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, - { 7, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 3, 6}, - { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 6, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 17, 0}, - { 15, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 8, 10}, /* Row 61 */ - { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, - { 7, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 1, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 8, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 16, 0}, - { 14, 0}, { 1, 1}, { 1, 2}, { 2, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 9, 10}, /* Row 62 */ - { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 10, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 1, 23}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 1, 5}, { 9, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 15, 0}, - { 13, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 12}, { 3, 10}, /* Row 63 */ - { 8, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, - { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, - { 1, 11}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 11, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 14, 0}, - { 12, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 24}, { 1, 12}, /* Row 64 */ - { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, - { 1, 11}, { 5, 6}, { 1, 5}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, - { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 8, 12}, - { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 12, 3}, { 1, 6}, { 3, 3}, { 1, 4}, - { 13, 0}, - { 11, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 65 */ - { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, - { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 9, 10}, - { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 6}, { 3, 3}, { 1, 4}, - { 12, 0}, - { 10, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 1, 3}, /* Row 66 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, - { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 8, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, - { 8, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 15, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 11, 0}, - { 9, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 2, 3}, /* Row 67 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 12}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 8, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, - { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 10, 0}, - { 8, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 3, 3}, /* Row 68 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 6}, { 1, 11}, - { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 7, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 18, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 9, 0}, - { 7, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 4, 3}, /* Row 69 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 12}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 7, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, { 4, 10}, { 8, 12}, - { 5, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 20, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 8, 0}, - { 6, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 5, 3}, /* Row 70 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 6}, { 1, 11}, - { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 6, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, - { 8, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 21, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 7, 0}, - { 5, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 6, 3}, /* Row 71 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 12}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 6, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, - { 3, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 23, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 6, 0}, - { 4, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 7, 3}, /* Row 72 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 6}, { 1, 11}, - { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 5, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, - { 8, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 24, 3}, - { 1, 6}, { 3, 3}, { 1, 4}, { 5, 0}, - { 3, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 8, 3}, /* Row 73 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 12}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 5, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 4, 10}, { 8, 12}, - { 1, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 26, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 4, 0}, - { 2, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 9, 3}, /* Row 74 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 6}, { 1, 11}, - { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 4, 3}, { 1, 5}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, - { 15, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 27, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 3, 0}, - { 1, 0}, { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 10, 3}, /* Row 75 */ - { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 12}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 4, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 15, 12}, - { 4, 10}, { 1, 12}, { 7, 6}, { 29, 3}, { 1, 6}, { 3, 3}, { 1, 4}, { 2, 0}, - { 1, 1}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 11, 3}, { 1, 5}, /* Row 76 */ - { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 6}, { 1, 11}, { 5, 10}, - { 7, 12}, { 6, 10}, { 1, 11}, { 5, 6}, { 1, 5}, { 3, 3}, { 1, 5}, { 1, 12}, - { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, - { 13, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 1, 5}, { 30, 3}, { 1, 6}, { 3, 3}, - { 1, 4}, { 1, 0}, - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 6}, { 1, 2}, { 12, 3}, { 1, 5}, { 1, 12}, /* Row 77 */ - { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 12}, { 6, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, - { 3, 10}, { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 4, 10}, { 13, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 32, 3}, { 1, 6}, { 3, 3}, { 1, 4}, - { 2, 3}, { 1, 6}, { 1, 2}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 78 */ - { 3, 10}, { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, - { 5, 6}, { 1, 5}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 11, 12}, { 5, 10}, - { 1, 11}, { 6, 6}, { 1, 5}, { 33, 3}, { 1, 6}, { 3, 3}, - { 1, 3}, { 1, 5}, { 1, 18}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 79 */ - { 3, 10}, { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 12}, { 6, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 4, 10}, { 11, 12}, { 4, 10}, { 1, 12}, - { 7, 6}, { 35, 3}, { 1, 6}, { 2, 3}, - { 2, 3}, { 1, 6}, { 14, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 80 */ - { 1, 12}, { 7, 6}, { 1, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, - { 5, 6}, { 1, 5}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 4, 10}, { 1, 11}, - { 6, 6}, { 1, 5}, { 35, 3}, { 1, 5}, { 1, 6}, { 1, 3}, - { 3, 3}, { 1, 6}, { 13, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 81 */ - { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 12}, { 6, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 1, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, - { 1, 12}, { 1, 21}, { 6, 6}, { 36, 3}, { 1, 7}, { 1, 2}, { 1, 5}, - { 4, 3}, { 1, 6}, { 12, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 82 */ - { 1, 12}, { 7, 6}, { 2, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, - { 5, 6}, { 2, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 7, 6}, - { 1, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 35, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 83 */ - { 3, 10}, { 1, 12}, { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, - { 5, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, { 1, 12}, - { 6, 6}, { 1, 5}, { 33, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, - { 1, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 84 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 11}, { 5, 10}, { 7, 12}, - { 6, 10}, { 1, 11}, { 5, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, { 6, 6}, - { 32, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 0}, - { 2, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 85 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 3, 3}, { 1, 13}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 6, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 7, 6}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 30, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 2, 0}, - { 3, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 8, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 86 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 11}, { 5, 10}, { 7, 12}, - { 6, 10}, { 1, 11}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, - { 6, 6}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 29, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 3, 0}, - { 4, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 87 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 5, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 6, 6}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 27, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, - { 5, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 6, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 88 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 11}, { 5, 10}, { 7, 12}, - { 6, 10}, { 1, 11}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, - { 5, 6}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 26, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 5, 0}, - { 6, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 89 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 5, 3}, { 1, 13}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 4, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 5, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 1, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 6, 6}, { 1, 5}, { 24, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 6, 0}, - { 7, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 4, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 90 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 11}, { 5, 10}, { 7, 12}, - { 6, 10}, { 1, 11}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, - { 4, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 23, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, - { 8, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 91 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 3, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 4, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 3, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 6, 6}, { 1, 5}, { 21, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 8, 0}, - { 9, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 92 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 11}, { 5, 10}, { 7, 12}, - { 6, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, - { 3, 6}, { 1, 11}, { 5, 10}, { 8, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 20, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 9, 0}, - { 10, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, /* Row 93 */ - { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 7, 3}, { 1, 13}, { 1, 12}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 12}, { 2, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, - { 1, 12}, { 3, 6}, { 1, 12}, { 4, 10}, { 9, 12}, { 5, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 6, 6}, { 1, 5}, { 18, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 10, 0}, - { 11, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, /* Row 94 */ - { 3, 10}, { 1, 12}, { 7, 6}, { 8, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, - { 1, 11}, { 1, 6}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, - { 1, 11}, { 5, 10}, { 8, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, - { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 11, 0}, - { 12, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 95 */ - { 1, 12}, { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 12}, { 1, 21}, { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 2, 6}, - { 1, 12}, { 4, 10}, { 9, 12}, { 7, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 12, 0}, - { 13, 0}, { 1, 4}, { 3, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 96 */ - { 1, 12}, { 7, 6}, { 9, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 6, 10}, { 1, 11}, - { 1, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 6}, { 1, 11}, { 5, 10}, - { 8, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 14, 3}, { 1, 7}, - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, - { 14, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 97 */ - { 1, 12}, { 7, 6}, { 9, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, - { 1, 12}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 21}, { 1, 12}, { 4, 10}, - { 9, 12}, { 4, 10}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 14, 0}, - { 15, 0}, { 1, 4}, { 1, 3}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, /* Row 98 */ - { 1, 12}, { 7, 6}, { 10, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 10, 10}, { 7, 12}, - { 3, 10}, { 1, 12}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 1, 12}, - { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 11, 3}, { 1, 7}, { 1, 2}, - { 1, 5}, { 1, 3}, { 1, 4}, { 15, 0}, - { 16, 0}, { 1, 4}, { 1, 5}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, /* Row 99 */ - { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 9, 10}, { 7, 12}, - { 4, 10}, { 1, 12}, { 4, 10}, { 9, 12}, { 4, 10}, { 1, 12}, { 1, 6}, { 1, 11}, - { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, { 1, 5}, { 9, 3}, { 1, 7}, - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, - { 17, 0}, { 1, 4}, { 1, 12}, { 3, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, /* Row 100 */ - { 11, 3}, { 1, 11}, { 5, 10}, { 7, 12}, { 9, 10}, { 7, 12}, { 9, 10}, { 8, 12}, - { 5, 10}, { 1, 11}, { 2, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 17, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 11, 3}, { 1, 13}, /* Row 101 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 3, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 18, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 11}, /* Row 102 */ - { 5, 10}, { 7, 12}, { 8, 10}, { 7, 12}, { 8, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 4, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 5, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 12, 3}, { 1, 13}, /* Row 103 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 5, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 6, 6}, - { 1, 5}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 11}, /* Row 104 */ - { 5, 10}, { 7, 12}, { 7, 10}, { 7, 12}, { 7, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 6, 6}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, { 2, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 13, 3}, { 1, 13}, /* Row 105 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 7, 6}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 11}, /* Row 106 */ - { 5, 10}, { 7, 12}, { 6, 10}, { 7, 12}, { 6, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, { 6, 6}, - { 1, 18}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 14, 3}, { 1, 13}, /* Row 107 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 1, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 3}, { 1, 4}, { 24, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 11}, /* Row 108 */ - { 5, 10}, { 7, 12}, { 5, 10}, { 7, 12}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 2, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 5, 6}, { 1, 20}, { 1, 1}, { 25, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 15, 3}, { 1, 13}, /* Row 109 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 3, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 4, 6}, { 1, 20}, { 2, 2}, { 25, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 11}, /* Row 110 */ - { 5, 10}, { 7, 12}, { 4, 10}, { 7, 12}, { 4, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 4, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 2, 6}, { 1, 20}, { 3, 2}, { 1, 17}, { 24, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 16, 3}, { 1, 13}, /* Row 111 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 5, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 21}, { 1, 20}, { 5, 2}, { 24, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 11}, /* Row 112 */ - { 5, 10}, { 7, 12}, { 3, 10}, { 7, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 6, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 6, 2}, { 1, 17}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 17, 3}, { 1, 13}, /* Row 113 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 18}, { 6, 2}, { 23, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 11}, /* Row 114 */ - { 5, 10}, { 7, 12}, { 2, 10}, { 7, 12}, { 2, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 8, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 6, 2}, { 1, 17}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 18, 3}, { 1, 13}, /* Row 115 */ - { 1, 12}, { 4, 10}, { 8, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 9, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 1, 18}, { 6, 2}, { 22, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 6}, { 19, 3}, { 1, 11}, /* Row 116 */ - { 5, 10}, { 7, 12}, { 1, 10}, { 7, 12}, { 1, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 6, 2}, { 1, 17}, { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 18}, { 6, 6}, { 19, 3}, /* Row 117 */ - { 1, 13}, { 1, 12}, { 4, 10}, { 24, 12}, { 4, 10}, { 1, 12}, { 7, 6}, { 1, 5}, - { 11, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, - { 21, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 1, 2}, { 1, 20}, { 5, 6}, /* Row 118 */ - { 20, 3}, { 1, 11}, { 5, 10}, { 22, 12}, { 5, 10}, { 1, 11}, { 7, 6}, { 12, 3}, - { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, - { 20, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 2, 2}, { 1, 20}, { 5, 6}, /* Row 119 */ - { 19, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 22, 12}, { 4, 10}, { 1, 12}, { 7, 6}, - { 1, 5}, { 13, 3}, { 1, 11}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, - { 6, 2}, { 20, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 3, 2}, { 1, 20}, { 3, 6}, /* Row 120 */ - { 1, 3}, { 1, 6}, { 19, 3}, { 1, 11}, { 5, 10}, { 20, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, { 5, 10}, { 1, 14}, - { 6, 2}, { 1, 17}, { 19, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 4, 2}, { 1, 20}, { 2, 6}, /* Row 121 */ - { 2, 3}, { 1, 6}, { 18, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 20, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 14, 3}, { 1, 7}, { 1, 25}, { 4, 10}, { 8, 12}, - { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 19, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 5, 2}, { 1, 20}, { 1, 6}, /* Row 122 */ - { 3, 3}, { 1, 6}, { 18, 3}, { 1, 11}, { 5, 10}, { 18, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 14, 3}, { 1, 7}, { 1, 2}, { 1, 13}, { 1, 12}, { 3, 10}, { 8, 12}, - { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 18, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 6, 2}, { 1, 20}, { 4, 3}, /* Row 123 */ - { 1, 6}, { 17, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 18, 12}, { 4, 10}, { 1, 12}, - { 7, 6}, { 1, 5}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 20}, - { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, { 6, 2}, { 18, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 4, 3}, /* Row 124 */ - { 1, 6}, { 17, 3}, { 1, 11}, { 5, 10}, { 16, 12}, { 5, 10}, { 1, 11}, { 7, 6}, - { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 1, 17}, { 4, 10}, - { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 17, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 1, 0}, { 1, 4}, /* Row 125 */ - { 4, 3}, { 1, 6}, { 16, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 16, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 2, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, - { 6, 2}, { 17, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 2, 0}, { 1, 4}, /* Row 126 */ - { 4, 3}, { 1, 6}, { 16, 3}, { 1, 11}, { 5, 10}, { 14, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 12, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 4, 0}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 16, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 3, 0}, { 1, 4}, /* Row 127 */ - { 4, 3}, { 1, 6}, { 15, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 14, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 5, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, - { 6, 2}, { 16, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 4, 0}, { 1, 4}, /* Row 128 */ - { 4, 3}, { 1, 6}, { 15, 3}, { 1, 11}, { 5, 10}, { 12, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 7, 0}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 17}, { 15, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 5, 0}, { 1, 4}, /* Row 129 */ - { 4, 3}, { 1, 6}, { 14, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 12, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 8, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 12}, { 1, 18}, - { 6, 2}, { 15, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 6, 0}, { 1, 4}, /* Row 130 */ - { 4, 3}, { 1, 6}, { 14, 3}, { 1, 11}, { 5, 10}, { 10, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 10, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 10, 0}, - { 4, 10}, { 8, 12}, { 5, 10}, { 1, 14}, { 6, 2}, { 1, 26}, { 14, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 7, 0}, { 1, 4}, /* Row 131 */ - { 4, 3}, { 1, 6}, { 13, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 10, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 11, 0}, { 1, 9}, { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 6, 2}, - { 1, 17}, { 14, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 8, 0}, { 1, 4}, /* Row 132 */ - { 4, 3}, { 1, 6}, { 13, 3}, { 1, 11}, { 5, 10}, { 8, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 13, 0}, - { 4, 10}, { 8, 12}, { 4, 10}, { 1, 14}, { 7, 2}, { 14, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 9, 0}, { 1, 4}, /* Row 133 */ - { 4, 3}, { 1, 6}, { 12, 3}, { 1, 13}, { 1, 12}, { 4, 10}, { 8, 12}, { 4, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 14, 0}, { 1, 9}, { 4, 10}, { 7, 12}, { 3, 10}, { 1, 12}, { 1, 19}, - { 7, 2}, { 1, 26}, { 13, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 10, 0}, { 1, 4}, /* Row 134 */ - { 4, 3}, { 1, 6}, { 12, 3}, { 1, 11}, { 5, 10}, { 6, 12}, { 5, 10}, { 1, 11}, - { 7, 6}, { 8, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 16, 0}, - { 4, 10}, { 6, 12}, { 4, 10}, { 1, 12}, { 8, 2}, { 1, 17}, { 13, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 11, 0}, { 1, 4}, /* Row 135 */ - { 4, 3}, { 1, 6}, { 11, 3}, { 1, 13}, { 1, 12}, { 5, 10}, { 4, 12}, { 5, 10}, - { 1, 12}, { 7, 6}, { 1, 5}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, - { 1, 4}, { 17, 0}, { 1, 9}, { 4, 10}, { 4, 12}, { 5, 10}, { 1, 14}, { 8, 2}, - { 1, 17}, { 13, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 12, 0}, { 1, 4}, /* Row 136 */ - { 4, 3}, { 1, 6}, { 11, 3}, { 1, 11}, { 14, 10}, { 1, 11}, { 7, 6}, { 7, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 19, 0}, { 12, 10}, { 1, 12}, - { 1, 18}, { 8, 2}, { 1, 1}, { 13, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 13, 0}, { 1, 4}, /* Row 137 */ - { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, { 1, 12}, { 12, 10}, { 1, 12}, { 7, 6}, - { 1, 5}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 20, 0}, - { 1, 9}, { 10, 10}, { 1, 12}, { 10, 2}, { 14, 0}, - { 18, 0}, { 4, 10}, { 8, 12}, { 3, 10}, { 1, 12}, { 7, 2}, { 14, 0}, { 1, 4}, /* Row 138 */ - { 4, 3}, { 1, 6}, { 10, 3}, { 1, 11}, { 12, 10}, { 1, 11}, { 7, 6}, { 6, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 22, 0}, { 9, 10}, { 1, 12}, - { 10, 2}, { 1, 17}, { 14, 0}, - { 18, 0}, { 4, 10}, { 12, 12}, { 7, 2}, { 15, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 139 */ - { 9, 3}, { 1, 5}, { 1, 15}, { 10, 10}, { 1, 15}, { 7, 6}, { 1, 5}, { 5, 3}, - { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 23, 0}, { 1, 17}, { 1, 14}, - { 5, 10}, { 1, 12}, { 1, 10}, { 1, 19}, { 10, 2}, { 15, 0}, - { 25, 0}, { 1, 20}, { 4, 18}, { 11, 2}, { 16, 0}, { 1, 4}, { 4, 3}, { 1, 6}, /* Row 140 */ - { 9, 3}, { 1, 5}, { 1, 11}, { 1, 12}, { 6, 10}, { 1, 12}, { 1, 11}, { 8, 6}, - { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 27, 0}, { 2, 9}, - { 1, 19}, { 1, 14}, { 1, 18}, { 11, 2}, { 1, 17}, { 15, 0}, - { 25, 0}, { 16, 2}, { 17, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 10, 3}, { 1, 13}, /* Row 141 */ - { 1, 11}, { 4, 12}, { 1, 11}, { 9, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, - { 1, 3}, { 1, 4}, { 30, 0}, { 1, 1}, { 13, 2}, { 16, 0}, - { 25, 0}, { 16, 2}, { 18, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 5}, /* Row 142 */ - { 1, 13}, { 11, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, - { 32, 0}, { 1, 17}, { 11, 2}, { 17, 0}, - { 25, 0}, { 16, 2}, { 19, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 5}, /* Row 143 */ - { 7, 6}, { 6, 3}, { 1, 7}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 34, 0}, - { 10, 2}, { 18, 0}, - { 25, 0}, { 16, 2}, { 20, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 25, 3}, { 1, 7}, /* Row 144 */ - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 35, 0}, { 1, 1}, { 7, 2}, { 1, 17}, - { 19, 0}, - { 25, 0}, { 16, 2}, { 21, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 23, 3}, { 1, 7}, /* Row 145 */ - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 64, 0}, - { 25, 0}, { 16, 2}, { 22, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 21, 3}, { 1, 7}, /* Row 146 */ - { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 65, 0}, - { 64, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 19, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 147 */ - { 1, 3}, { 1, 4}, { 66, 0}, - { 65, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 17, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 148 */ - { 1, 3}, { 1, 4}, { 67, 0}, - { 66, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 15, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 149 */ - { 1, 3}, { 1, 4}, { 68, 0}, - { 67, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 13, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 150 */ - { 1, 3}, { 1, 4}, { 69, 0}, - { 68, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 11, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 151 */ - { 1, 3}, { 1, 4}, { 70, 0}, - { 69, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 9, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 152 */ - { 1, 3}, { 1, 4}, { 71, 0}, - { 70, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 7, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 153 */ - { 1, 3}, { 1, 4}, { 72, 0}, - { 71, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 5, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 154 */ - { 1, 3}, { 1, 4}, { 73, 0}, - { 72, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 3, 3}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 155 */ - { 1, 3}, { 1, 4}, { 74, 0}, - { 73, 0}, { 1, 4}, { 4, 3}, { 1, 6}, { 1, 5}, { 1, 7}, { 1, 2}, { 1, 5}, /* Row 156 */ - { 1, 3}, { 1, 4}, { 75, 0}, - { 74, 0}, { 1, 4}, { 5, 3}, { 1, 2}, { 1, 5}, { 1, 3}, { 1, 4}, { 76, 0}, /* Row 157 */ - { 75, 0}, { 1, 4}, { 2, 3}, { 1, 5}, { 1, 20}, { 1, 5}, { 1, 3}, { 1, 4}, /* Row 158 */ - { 77, 0}, - { 76, 0}, { 1, 4}, { 4, 3}, { 1, 4}, { 78, 0} /* Row 159 */ -}; - -# endif -#else -# warning "Other pixel depths not yet supported" -#endif - -/**************************************************************************** - * Public Bitmap Structure Defintions - ****************************************************************************/ - -const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap = -{ - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - 160, // width - Width in pixels - 160, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_nuttxLut, // Index 0: Unselected LUT - g_nuttxLut, // Index 1: Selected LUT - }, - g_nuttxRleEntries // data - Pointer to the beginning of the RLE data -}; From 8b207726d3cd38929c65241f0c0a4eaaa0d8a9cf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Oct 2013 12:07:14 -0600 Subject: [PATCH 141/390] New touchscreen scaling algorithm for the case where measured X values vary with y position (and vice versa) --- ChangeLog.txt | 4 +- Kconfig | 188 ++++++++++++++++++++++++---------- nxwm/include/ccalibration.hxx | 26 ++++- nxwm/src/ccalibration.cxx | 68 ++++++++++++ nxwm/src/ctouchscreen.cxx | 64 +++++++++++- 5 files changed, 294 insertions(+), 56 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index acaa08e50..b7fd3e9f1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -395,4 +395,6 @@ * NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 NuttX logo image. The older, smaller NuttX logo was renamed from nxlogo to nxlogo160x160 in all places (2015-10-15). - +* NxWM::CCalibration and NxWM::CTouchscreen: Add a complex touchscreen + scaling algorithm to handling the case where the measured X values also + vary with y position (and vice versa) (2013-10-17). diff --git a/Kconfig b/Kconfig index 7ba639404..7c7b0b8d4 100644 --- a/Kconfig +++ b/Kconfig @@ -11,7 +11,8 @@ config NXWIDGETS Enable support for NxWidgets if NXWIDGETS -comment "NX Server/Device Configuration" + +menu "NX Server/Device Configuration" config NXWIDGETS_FLICKERFREE bool "Enable Flicker Reduction Logic" @@ -91,7 +92,9 @@ config NXWIDGET_EVENTWAIT so that looping logic can sleep until something interesting happens with the window. -comment "NXWidget Configuration" +endmenu # NX Server/Device Configuration + +menu "NXWidget Configuration" config NXWIDGETS_BPP int "BPP" @@ -115,13 +118,15 @@ config NXWIDGETS_SYSTEM_CUSTOM_FONTID Set to override the system default font id (NXFONT_DEFAULT). if NXWIDGETS_SYSTEM_CUSTOM_FONTID + config NXWIDGETS_DEFAULT_FONTID int "Default Font ID" default 0 ---help--- Use this default NxWidgets font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif + +endif # NXWIDGETS_SYSTEM_CUSTOM_FONTID config NXWIDGETS_TNXARRAY_INITIALSIZE int "Initial Size of Dynamic Arrays" @@ -145,6 +150,7 @@ config NXWIDGETS_CUSTOM_FILLCOLORS of the default colors depend on the pixel depth). Default: n if NXWIDGETS_CUSTOM_FILLCOLORS + config NXWIDGETS_DEFAULT_BACKGROUNDCOLOR hex "Default Normal Background Color" ---help--- @@ -160,7 +166,8 @@ config NXWIDGETS_DEFAULT_HIGHLIGHTCOLOR ---help--- Highlight color. Currently this color is only used in clist boxes, progress bars, and slider grips. Default: RGB(192,192,192) -endif + +endif # NXWIDGETS_CUSTOM_FILLCOLORS config NXWIDGETS_CUSTOM_EDGECOLORS bool "Custom Default Edge Colors" @@ -172,6 +179,7 @@ config NXWIDGETS_CUSTOM_EDGECOLORS of the default colors depend on the pixel depth). Default: n. if NXWIDGETS_CUSTOM_EDGECOLORS + config NXWIDGETS_DEFAULT_SHINEEDGECOLOR hex "Default Shiny Edge Color" ---help--- @@ -181,7 +189,8 @@ config NXWIDGETS_DEFAULT_SHADOWEDGECOLOR hex "Default Shadow Edge Color" ---help--- Shadowed side border color. Default: RGB(35,58,73) -endif + +endif # NXWIDGETS_CUSTOM_EDGECOLORS config NXWIDGETS_CUSTOM_TEXTCOLORS bool "Custom Default Text colors" @@ -193,6 +202,7 @@ config NXWIDGETS_CUSTOM_TEXTCOLORS of the default colors depend on the pixel depth). Default: n. if NXWIDGETS_CUSTOM_TEXTCOLORS + config NXWIDGETS_DEFAULT_DISABLEDTEXTCOLOR hex "Default Disabled Text Color" ---help--- @@ -212,7 +222,8 @@ config NXWIDGETS_DEFAULT_FONTCOLOR hex "Default Default Font Color" ---help--- Default font color. Default: RGB(255,255,255) -endif + +endif # NXWIDGETS_CUSTOM_TEXTCOLORS config NXWIDGETS_TRANSPARENT_COLOR hex "Transparent Color" @@ -265,7 +276,8 @@ config NXWIDGET_MEMMONITOR Enable memory usage monitor instrumentation. This feature is only used by the NxWidget/NxWM unit tests. -endif +endmenu # NXWidget Configuration +endif # NxWidgets config NXWM bool "Enable NxWM" @@ -275,7 +287,8 @@ config NXWM Enable support for the NuttX Tiny Window Manager (NxWM) if NXWM -comment "General settings" + +menu "NxWM General settings" config NXWM_SYSTEM_CUSTOM_FONTID bool "Use Custom Default Font" @@ -284,13 +297,15 @@ config NXWM_SYSTEM_CUSTOM_FONTID Set to override the system default font id (NXFONT_DEFAULT). if NXWM_SYSTEM_CUSTOM_FONTID + config NXWM_DEFAULT_FONTID int "Font ID" default 0 ---help--- Use this NxWM default font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif + +endif # NXWM_SYSTEM_CUSTOM_FONTID config NXWM_UNITTEST bool "NxWM Unit Test" @@ -310,6 +325,7 @@ config NXWM_CUSTOM_FILLCOLORS of the default colors depend on the pixel depth). Default: n if NXWM_CUSTOM_FILLCOLORS + config NXWM_DEFAULT_BACKGROUNDCOLOR hex "Background Color" ---help--- @@ -319,7 +335,8 @@ config NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR hex "Normal Background Color" ---help--- Select background color. Default: RGB(206,227,241) -endif + +endif # NXWM_DEFAULT_BACKGROUNDCOLOR config NXWM_CUSTOM_EDGECOLORS bool "Custom Default Edge Colors" @@ -331,6 +348,7 @@ config NXWM_CUSTOM_EDGECOLORS of the default colors depend on the pixel depth). Default: n. if NXWM_CUSTOM_EDGECOLORS + config NXWM_DEFAULT_SHINEEDGECOLOR hex "Shiny Edge Color" ---help--- @@ -340,7 +358,8 @@ config NXWM_DEFAULT_SHADOWEDGECOLOR hex "Shadow Edge Color" ---help--- Color of the shadowed edge of a border. Default: RGB(0,0,0) -endif + +endif # NXWM_CUSTOM_EDGECOLORS config NXWM_CUSTOM_TEXTCOLORS bool "Custom Default Text colors" @@ -352,6 +371,7 @@ config NXWM_CUSTOM_TEXTCOLORS of the default colors depend on the pixel depth). Default: n. if NXWM_CUSTOM_TEXTCOLORS + config NXWM_DEFAULT_FONTCOLOR hex "Default Font Color" ---help--- @@ -362,8 +382,29 @@ config NXWM_TRANSPARENT_COLOR default 0x0 ---help--- The "transparent" color. Default: RGB(0,0,0) -endif +endif # NXWM_CUSTOM_TEXTCOLORS + +comment "Background Image" + +config NXWM_DISABLE_BACKGROUND_IMAGE + bool "Disable Background Image" + default n if !NXWM_DISABLE_MINIMIZE + default y if NXWM_DISABLE_MINIMIZE + ---help--- + Disable support for the "Desktop" background image. + +config NXWM_BACKGROUND_IMAGE + string "Background Image" + default "NXWidgets::g_nuttxBitmap160x160" + depends on !NXWM_DISABLE_BACKGROUND_IMAGE + ---help--- + The name of the image to use in the background window. Default: + "NXWidgets::g_nuttxBitmap160x160" + +endmenu # NxWM General Configuration + +menu "NxWM Taskbar Configuration" comment "Horizontal and vertical spacing of icons in the task bar" config NXWM_TASKBAR_VSPACING @@ -413,12 +454,14 @@ config NXWM_CUSTOM_TASKBAR_WIDTH vertical spacing. Default: 25 + 2*spacing if NXWM_CUSTOM_TASKBAR_WIDTH + config NXWM_TASKBAR_WIDTH int "Taskbar Width" default 29 ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*2 -endif + +endif # NXWM_CUSTOM_TASKBAR_WIDTH config NXWM_TASKBAR_ICONSCALE bool "Scale Icons" @@ -440,7 +483,7 @@ config NXWM_TASKBAR_ICONHEIGHT ---help--- Scaled height of each taskbar ICON in pixels. -endif #NXWM_TASKBAR_ICONSCALE +endif # NXWM_TASKBAR_ICONSCALE config NXWM_DISABLE_MINIMIZE bool "Disable Minimize Button" @@ -456,7 +499,9 @@ config NXWM_TASKBAR_NO_BORDER ---help--- Suppress drawing a the border around the taskbar. -comment "Tool Bar Configuration" +endmenu # NxWM Taskbar Configuration + +menu "NxWM Toolbar Configuration" config NXWM_CUSTOM_TOOLBAR_HEIGHT bool "Use Custom Toolbar Height" @@ -466,6 +511,7 @@ config NXWM_CUSTOM_TOOLBAR_HEIGHT the selected horizontal or vertical spacing. Default: 21 + 2*spacing if NXWM_CUSTOM_TOOLBAR_HEIGHT + config NXWM_TOOLBAR_HEIGHT int "Toolbar Height" default 25 @@ -473,26 +519,11 @@ config NXWM_TOOLBAR_HEIGHT The height of the tool bar in each application window. At present, all icons are 21 pixels in height and, hence, require a task bar of at least that size. Default: 21 + 2*2 -endif -comment "Background Image" +endif # NXWM_CUSTOM_TOOLBAR_HEIGHT +endmenu # NxWM Toolbar Configuration -config NXWM_DISABLE_BACKGROUND_IMAGE - bool "Disable Background Image" - default n if !NXWM_DISABLE_MINIMIZE - default y if NXWM_DISABLE_MINIMIZE - ---help--- - Disable support for the "Desktop" background image. - -config NXWM_BACKGROUND_IMAGE - string "Background Image" - default "NXWidgets::g_nuttxBitmap160x160" - depends on !NXWM_DISABLE_BACKGROUND_IMAGE - ---help--- - The name of the image to use in the background window. Default: - "NXWidgets::g_nuttxBitmap160x160" - -comment "Application Window Configuration" +menu "NxWM Application Window Configuration" config NXWM_CUSTOM_APPWINDOW_ICONS bool "Custom Start/Stop Application Window Icons" @@ -514,10 +545,10 @@ config NXWM_MINIMIZE_BITMAP ---help--- The glyph to use as the Minimize icon. Default: NxWM::g_minimizeBitmap -endif - -comment "Start Window Configuration" +endif # NXWM_CUSTOM_APPWINDOW_ICONS +endmenu # NxWM Application Window Configuration +menu "NxWM Start Window Configuration" comment "Horizontal and vertical spacing of icons in the task bar" config NXWM_STARTWINDOW_VSPACING @@ -539,12 +570,14 @@ config NXWM_CUSTOM_STARTWINDOW_ICON Select to override the default Start Window Icon: NxWM::g_playBitmap if NXWM_CUSTOM_STARTWINDOW_ICON + config NXWM_STARTWINDOW_ICON string "StartWindow Icon" default "NxWM::g_playBitmap" ---help--- The glyph to use as the start window icon. Default: NxWM::g_playBitmap -endif + +endif # NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_MQNAME string "Message Queue Name" @@ -582,7 +615,9 @@ config NXWM_STARTWINDOW_STACKSIZE The stack size to use when starting the StartWindow task. Default: 2048 bytes. -comment "NxConsole Window Configuration" +endmenu # Start Window Configuration + +menu "NxConsole Window Configuration" config NXWM_NXCONSOLE_PRIO int "NxConsole Task Priority" @@ -611,6 +646,7 @@ config NXWM_NXCONSOLE_CUSTOM_COLORS of the default colors depend on the pixel depth). Default: n if NXWM_NXCONSOLE_CUSTOM_COLORS + config NXWM_NXCONSOLE_WCOLOR hex "NxConsole Background Color" ---help--- @@ -622,7 +658,8 @@ config NXWM_NXCONSOLE_FONTCOLOR ---help--- The color of the fonts to use in the NxConsole window. Default: RGB(0,0,0) -endif + +endif # NXWM_NXCONSOLE_CUSTOM_COLORS config NXWM_NXCONSOLE_CUSTOM_FONTID bool "Use Custom Default Font" @@ -631,13 +668,15 @@ config NXWM_NXCONSOLE_CUSTOM_FONTID Set to override the system default font id (NXWM_DEFAULT_FONTID). if NXWM_NXCONSOLE_CUSTOM_FONTID + config NXWM_NXCONSOLE_FONTID int "NxConsole Font ID" default 0 ---help--- Use this default font ID in the NxConsole window instead of the NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 -endif + +endif # NXWM_NXCONSOLE_CUSTOM_FONTID config NXWM_CUSTOM_NXCONSOLE_ICON bool "Custom NxConsole Icon" @@ -646,12 +685,18 @@ config NXWM_CUSTOM_NXCONSOLE_ICON Select to override the default NxConsole Window Icon: NxWM::g_cmdBitmap if NXWM_CUSTOM_NXCONSOLE_ICON + config NXWM_NXCONSOLE_ICON string "NxConsole Icon" default "NxWM::g_cmdBitmap" ---help--- The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap -endif + +endif # NXWM_NXCONSOLE_ICON + +endmenu # NxConsole Window Configuration + +menu "NxWM Touchscreen Configuration" config NXWM_TOUCHSCREEN bool "Touchscreen Support" @@ -661,6 +706,7 @@ config NXWM_TOUCHSCREEN Define to build in touchscreen support. if NXWM_TOUCHSCREEN + comment "Touchscreen device settings" config NXWM_TOUCHSCREEN_DEVNO @@ -695,7 +741,10 @@ config NXWM_TOUCHSCREEN_LISTENERSTACK ---help--- Touchscreen listener thread stack size. Default 1024 -endif +endif # NXWM_TOUCHSCREEN +endmenu # NxWM Touchscreen Configuration + +menu "NxWM Keyboard Configuration" config NXWM_KEYBOARD bool "Keyboard Support" @@ -704,6 +753,7 @@ config NXWM_KEYBOARD Define to build in touchscreen support. if NXWM_KEYBOARD + comment "Keyboard device settings" config NXWM_KEYBOARD_DEVPATH @@ -737,9 +787,10 @@ config NXWM_KEYBOARD_LISTENERSTACK ---help--- Keyboard listener thread stack size. Default: 1024 -endif +endif # NXWM_KEYBOARD +endmenu # NxWM Keyboard Configuration -comment "Calibration display settings" +menu "NxWM Calibration display settings" config NXWM_CALIBRATION_MARGIN int "Calibration Margin" @@ -763,6 +814,7 @@ config NXWM_CALIBRATION_CUSTOM_COLORS on the pixel depth). Default: n if NXWM_CALIBRATION_CUSTOM_COLORS + config NXWM_CALIBRATION_BACKGROUNDCOLOR hex "Background Color" ---help--- @@ -786,7 +838,8 @@ config NXWM_CALIBRATION_TOUCHEDCOLOR ---help--- The color of the circle in the touchscreen calibration display after the touch is recorder. Default: RGB(255, 255, 96) (very light yellow) -endif + +endif # NXWM_CALIBRATION_CUSTOM_COLORS config NXWM_CALIBRATION_MESSAGES bool "Add Instructions in Center" @@ -845,6 +898,26 @@ config NXWM_CALIBRATION_DISCARD_MINMAX endif # NXWM_CALIBRATION_AVERAGE endif # NXWM_CALIBRATION_MESSAGES +config NXWM_CALIBRATION_ANISOTROPIC + bool "Anisotropic Scaling" + default n + ---help--- + Most touchscreens have the property that the X value consistent across + the entire vertial range of the display, i.e., if you press in the + upper left of the display and in the low right of the display, then + only the Y value will change. This is true of some touchscreens: + For some touchscreens the X values in the same vertical column will + change as the Y values change. Here I use the term anisotropic to + describe that (that is not really the correct use of term term, but + I have not yet thought of a better name). + + If you have such an LCD, then you may select this option to enable + some much more complex scaling alorithms to handle this case. Not + only are these algorithms more complex, but they are (currenly) + implemented using floating point. As a result, you should not select + this option if you have a lower end MCU without hardware floating + point support. + config NXWM_CUSTOM_CALIBRATION_ICON bool "Custom Calibration Icon" default n @@ -853,13 +926,15 @@ config NXWM_CUSTOM_CALIBRATION_ICON NxWM::g_calibrationBitmap if NXWM_CUSTOM_CALIBRATION_ICON + config NXWM_CALIBRATION_ICON string "Callibration Icon" default "NxWM::g_calibrationBitmap" ---help--- The ICON to use for the touchscreen calibration application. Default: NxWM::g_calibrationBitmap -endif + +endif # NXWM_CUSTOM_CALIBRATION_ICON config NXWM_CALIBRATION_SIGNO int "Calibration Signal Number" @@ -880,7 +955,9 @@ config NXWM_CALIBRATION_LISTENERSTACK ---help--- Calibration listener thread stack size. Default 2048 -comment "Hex Calculator display settings" +endmenu # NxWM Calibration display settings + +menu "NxWM Hex Calculator display settings" config NXWM_HEXCALCULATOR_CUSTOM_COLORS bool "Custom Hex Calculator Colors" @@ -893,12 +970,14 @@ config NXWM_HEXCALCULATOR_CUSTOM_COLORS pixel depth). Default: n if NXWM_HEXCALCULATOR_CUSTOM_COLORS + config NXWM_HEXCALCULATOR_BACKGROUNDCOLOR hex "Calculator Background Color" ---help--- The background color of the calculator display. Default: Same as NXWM_DEFAULT_BACKGROUNDCOLOR -endif + +endif # NXWM_HEXCALCULATOR_CUSTOM_COLORS config NXWM_CUSTOM_HEXCALCULATOR_ICON bool "Custom Hex Calculator Icon" @@ -908,13 +987,15 @@ config NXWM_CUSTOM_HEXCALCULATOR_ICON NxWM::g_calculatorBitmap if NXWM_CUSTOM_HEXCALCULATOR_ICON + config NXWM_HEXCALCULATOR_ICON string "Calculator Icon" default "NxWM::g_calculatorBitmap" ---help--- The ICON to use for the hex calculator application. Default: "NxWM::g_calculatorBitmap" -endif + +endif # NXWM_CUSTOM_HEXCALCULATOR_ICON config NXWM_HEXCALCULATOR_CUSTOM_FONTID bool "Use Custom Default Font" @@ -923,16 +1004,19 @@ config NXWM_HEXCALCULATOR_CUSTOM_FONTID Set to override the system default font id (NXWM_DEFAULT_FONTID). if NXWM_HEXCALCULATOR_CUSTOM_FONTID + config NXWM_HEXCALCULATOR_FONTID int "Calculator Font ID" default 0 ---help--- Use this default font ID in the calculator window instead of the NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 -endif + +endif # NXWM_HEXCALCULATOR_FONTID +endmenu # NxWM Hex Calculator display settings config NXWM_MEDIAPLAYER - bool "Enable Media Player" + bool "Enable NxWM Media Player" default n ---help--- Enable support for the MP3 Media Player. This features requires @@ -943,4 +1027,4 @@ config NXWM_MEDIAPLAYER NOTE: This application is currently under development and just a shell of an app which will be developed soon. -endif +endif # NXWM diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index 30a48f7eb..d9cf3a7de 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -85,14 +85,36 @@ namespace NxWM * Touchscreen calibration data */ +#ifdef CONFIG_NXWM_CALIBRATION_ANISOTROPIC + struct SCalibrationLine + { + float slope; /**< The slope of a line */ + float offset; /**< The offset of a line */ + }; + struct SCalibrationData { - b16_t xSlope; // X conversion: xSlope*(x) + xOffset + struct SCalibrationLine left; /**< Describes Y values along left edge */ + struct SCalibrationLine right; /**< Describes Y values along right edge */ + struct SCalibrationLine top; /**< Describes X values along top */ + struct SCalibrationLine bottom; /**< Describes X values along bottom edge */ + nxgl_coord_t leftX; /**< Left X value used in calibration */ + nxgl_coord_t rightX; /**< Right X value used in calibration */ + nxgl_coord_t topY; /**< Top Y value used in calibration */ + nxgl_coord_t bottomY; /**< Bottom Y value used in calibration */ + }; + +#else + struct SCalibrationData + { + b16_t xSlope; /**< X conversion: xSlope*(x) + xOffset */ b16_t xOffset; - b16_t ySlope; // Y conversion: ySlope*(y) + yOffset + b16_t ySlope; /**< Y conversion: ySlope*(y) + yOffset */ b16_t yOffset; }; +#endif + /** * The CCalibration class provides the the calibration window and obtains * callibration data. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 416f15883..01bdf3b44 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1128,6 +1128,72 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) return false; } +#ifdef CONFIG_NXWM_CALIBRATION_ANISOTROPIC + // X lines: + // + // x2 = slope*y1 + offset + // + // slope = (bottomY - topY) / (bottomX - topX) + // offset = (topY - topX * slope) + + float topX = (float)m_calibData[CALIB_UPPER_LEFT_INDEX].x; + float bottomX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; + + float topY = (float)m_calibData[CALIB_UPPER_LEFT_INDEX].y; + float bottomY = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].y; + + data.left.slope = (bottomX - topX) / (bottomY - topY); + data.left.offset = topX - topY * data.left.slope; + + gdbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); + + topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; + bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; + + topY = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].y; + bottomY = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].y; + + data.right.slope = (bottomX - topX) / (bottomY - topY); + data.right.offset = topX - topY * data.right.slope; + + gdbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); + + // Y lines: + // + // y2 = slope*x1 + offset + // + // slope = (rightX - topX) / (rightY - leftY) + // offset = (topX - leftY * slope) + + float leftX = (float)m_calibData[CALIB_UPPER_LEFT_INDEX].x; + float rightX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; + + float leftY = (float)m_calibData[CALIB_UPPER_LEFT_INDEX].y; + float rightY = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].y; + + data.top.slope = (rightY - leftY) / (rightX - leftX); + data.top.offset = leftY - leftX * data.top.slope; + + gdbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); + + leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; + rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; + + leftY = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].y; + rightY = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].y; + + data.bottom.slope = (rightY - leftY) / (rightX - leftX); + data.bottom.offset = leftY - leftX * data.bottom.slope; + + gdbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); + + // Save also the calibration screen positions + + data.leftX = CALIBRATION_LEFTX; + data.rightX = CALIBRATION_RIGHTX; + data.topY = CALIBRATION_TOPY; + data.bottomY = CALIBRATION_BOTTOMY; +#else // Calculate the calibration parameters // // (scaledX - LEFTX) / (rawX - leftX) = (RIGHTX - LEFTX) / (rightX - leftX) @@ -1169,6 +1235,8 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); +#endif + return true; } diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index ba25dd95f..1b9c53e4d 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -472,6 +472,66 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) } else { +#ifdef CONFIG_NXWM_CALIBRATION_ANISOTROPIC + // We have valid coordinates. Get the raw touch + // position from the sample + + float rawX = (float)sample->point[0].x; + float rawY = (float)sample->point[0].y; + + // Create a line (varying in X) that have the same matching Y values + // X lines: + // + // x2 = slope*y1 + offset + // + // X value calculated on the left side for the given value of y + + float leftX = rawY * m_calibData.left.slope + m_calibData.left.offset; + + // X value calculated on the right side for the given value of y + + float rightX = rawY * m_calibData.right.slope + m_calibData.right.offset; + + // Line of X values between (m_calibData.leftX,leftX) and (m_calibData.rightX,rightX) the + // are possible solutions: + // + // x2 = slope * x1 - offset + + struct SCalibrationLine xLine; + xLine.slope = (float)((int)m_calibData.rightX - (int)m_calibData.leftX) / (rightX - leftX); + xLine.offset = (float)m_calibData.leftX - leftX * xLine.slope; + + // Create a line (varying in Y) that have the same matching X value + // X lines: + // + // y2 = slope*x1 + offset + // + // Y value calculated on the top side for a given value of X + + float topY = rawX * m_calibData.top.slope + m_calibData.top.offset; + + // Y value calculated on the bottom side for a give value of X + + float bottomY = rawX * m_calibData.bottom.slope + m_calibData.bottom.offset; + + // Line of Y values between (topy,m_calibData.topY) and (bottomy,m_calibData.bottomY) that + // are possible solutions: + // + // y2 = slope * y1 - offset + + struct SCalibrationLine yLine; + yLine.slope = (float)((int)m_calibData.bottomY - (int)m_calibData.topY) / (bottomY - topY); + yLine.offset = (float)m_calibData.topY - topY * yLine.slope; + + // Then scale the raw x and y positions + + float scaledX = rawX * xLine.slope + xLine.offset; + float scaledY = rawY * yLine.slope + yLine.offset; + + x = (nxgl_coord_t)scaledX; + y = (nxgl_coord_t)scaledY; + +#else // We have valid coordinates. Get the raw touch // position from the sample @@ -517,7 +577,9 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) y = (nxgl_coord_t)bigY; } - vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); +#endif + + gvdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); } // Get the server handle and "inject the mouse data From c6533b640251ba0d0ba00442e6310e83cf46f6cb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Oct 2013 15:19:26 -0600 Subject: [PATCH 142/390] Minor tweaks to debug output; started renaming some icons to include size in the name; SAMA5 NxWM config needs libm --- Kconfig | 6 ++-- nxwm/Makefile | 2 +- .../{calculator.png => calculator24x25.png} | Bin .../{calibration.png => calibration24x21.png} | Bin nxwm/images/{cmd.png => cmd25x22.png} | Bin .../{minimize.png => minimize21x21.png} | Bin nxwm/images/{nxlogo.png => nxlogo25x25.png} | Bin nxwm/images/{play.png => play24x24.png} | Bin nxwm/images/play48x48.png | Bin 0 -> 374 bytes nxwm/images/{start.png => start25x25.png} | Bin nxwm/images/{stop.png => stop21x21.png} | Bin nxwm/include/nxwmconfig.hxx | 2 +- nxwm/include/nxwmglyphs.hxx | 2 +- nxwm/src/ccalibration.cxx | 33 ++++++++++++------ nxwm/src/ctouchscreen.cxx | 2 +- .../{glyph_play.cxx => glyph_play24x24.cxx} | 6 ++-- 16 files changed, 32 insertions(+), 21 deletions(-) rename nxwm/images/{calculator.png => calculator24x25.png} (100%) rename nxwm/images/{calibration.png => calibration24x21.png} (100%) rename nxwm/images/{cmd.png => cmd25x22.png} (100%) rename nxwm/images/{minimize.png => minimize21x21.png} (100%) rename nxwm/images/{nxlogo.png => nxlogo25x25.png} (100%) rename nxwm/images/{play.png => play24x24.png} (100%) create mode 100644 nxwm/images/play48x48.png rename nxwm/images/{start.png => start25x25.png} (100%) rename nxwm/images/{stop.png => stop21x21.png} (100%) rename nxwm/src/{glyph_play.cxx => glyph_play24x24.cxx} (98%) diff --git a/Kconfig b/Kconfig index 7c7b0b8d4..ef512a5e5 100644 --- a/Kconfig +++ b/Kconfig @@ -567,15 +567,15 @@ config NXWM_CUSTOM_STARTWINDOW_ICON bool "Custom Start Window Icon" default n ---help--- - Select to override the default Start Window Icon: NxWM::g_playBitmap + Select to override the default Start Window Icon: NxWM::g_playBitmap24x24 if NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_ICON string "StartWindow Icon" - default "NxWM::g_playBitmap" + default "NxWM::g_playBitmap24x24" ---help--- - The glyph to use as the start window icon. Default: NxWM::g_playBitmap + The glyph to use as the start window icon. Default: NxWM::g_playBitmap24x24 endif # NXWM_CUSTOM_STARTWINDOW_ICON diff --git a/nxwm/Makefile b/nxwm/Makefile index f4d148316..6efb464cf 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -72,7 +72,7 @@ endif # Images CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx -CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play.cxx glyph_start.cxx +CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play24x24.cxx glyph_start.cxx CXXSRCS += glyph_stop.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) diff --git a/nxwm/images/calculator.png b/nxwm/images/calculator24x25.png similarity index 100% rename from nxwm/images/calculator.png rename to nxwm/images/calculator24x25.png diff --git a/nxwm/images/calibration.png b/nxwm/images/calibration24x21.png similarity index 100% rename from nxwm/images/calibration.png rename to nxwm/images/calibration24x21.png diff --git a/nxwm/images/cmd.png b/nxwm/images/cmd25x22.png similarity index 100% rename from nxwm/images/cmd.png rename to nxwm/images/cmd25x22.png diff --git a/nxwm/images/minimize.png b/nxwm/images/minimize21x21.png similarity index 100% rename from nxwm/images/minimize.png rename to nxwm/images/minimize21x21.png diff --git a/nxwm/images/nxlogo.png b/nxwm/images/nxlogo25x25.png similarity index 100% rename from nxwm/images/nxlogo.png rename to nxwm/images/nxlogo25x25.png diff --git a/nxwm/images/play.png b/nxwm/images/play24x24.png similarity index 100% rename from nxwm/images/play.png rename to nxwm/images/play24x24.png diff --git a/nxwm/images/play48x48.png b/nxwm/images/play48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..24dddd781f67a9b2deb713999befb48bd31de992 GIT binary patch literal 374 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1SD@HQL70(Y)*K0-AbW|YuPggqExYQ z$&%}^1CPVS{27N;ru)BCO4Sn#`lT}Y7~|}UH<4Rb3a+TCG5Odg?Vu){peDy~XYqzQ zg+&{_EnrxqJVARkPf=2ANXuaQ{5tNoFax$2M;mt$lCwTM}2g%YpSIwf|YRZ5IP zYmL}~R$Sr^T78KxXx$|yqm@DIMr(>#jn)UTS%z9N?F_rw%oK9-oH%Rw5=SHUq8Y#t OVDNPHb6Mw<&;$SjvV{=< literal 0 HcmV?d00001 diff --git a/nxwm/images/start.png b/nxwm/images/start25x25.png similarity index 100% rename from nxwm/images/start.png rename to nxwm/images/start25x25.png diff --git a/nxwm/images/stop.png b/nxwm/images/stop21x21.png similarity index 100% rename from nxwm/images/stop.png rename to nxwm/images/stop21x21.png diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index a10491d39..5b42e3a70 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -312,7 +312,7 @@ */ #ifndef CONFIG_NXWM_STARTWINDOW_ICON -# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap +# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap24x24 #endif /** diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 5bcd4fb83..799ca61b6 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -70,7 +70,7 @@ namespace NxWM #endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; - extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; + extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap24x24; extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 01bdf3b44..51b536db0 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -73,6 +73,17 @@ #define CALIBRATION_CIRCLE_RADIUS 16 #define CALIBRATION_LINE_THICKNESS 2 +/* We want debug output from some logic in this file if either input/touchscreen + * or graphics debug is enabled. + */ + +#ifndef CONFIG_DEBUG_INPUT +# undef idbg +# define idbg gdbg +# undef ivdbg +# define ivdbg gvdbg +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -341,7 +352,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) m_touchPos.x = sample.point[0].x; m_touchPos.y = sample.point[0].y; - gvdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + ivdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", sample.point[0].id, sample.point[0].flags, sample.point[0].x, sample.point[0].y, sample.point[0].h, sample.point[0].w, sample.point[0].pressure); @@ -379,7 +390,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) { // Yes.. invoke the state machine. - gvdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", + ivdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y, m_touchPos.x, m_touchPos.y); @@ -682,7 +693,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) // Save the sample data - gvdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); + ivdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); m_sampleData[m_nsamples].x = m_touchPos.x; m_sampleData[m_nsamples].y = m_touchPos.y; @@ -771,7 +782,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) average.y = m_sampleData[0].y; #endif - gvdbg("Average: Touch x: %d y: %d\n", average.x, average.y); + ivdbg("Average: Touch x: %d y: %d\n", average.x, average.y); m_nsamples = 0; return true; } @@ -1016,7 +1027,7 @@ void CCalibration::stateMachine(void) break; } - gvdbg("New m_calphase=%d Screen x: %d y: %d\n", + ivdbg("New m_calphase=%d Screen x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y); } @@ -1145,7 +1156,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - gdbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); + idbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1156,7 +1167,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - gdbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); + idbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1174,7 +1185,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - gdbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); + idbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1185,7 +1196,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - gdbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); + idbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions @@ -1213,7 +1224,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - gdbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + idbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); // Similarly for Y // @@ -1234,7 +1245,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - gdbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + idbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); #endif return true; diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 1b9c53e4d..105908859 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -579,7 +579,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) #endif - gvdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); + vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); } // Get the server handle and "inject the mouse data diff --git a/nxwm/src/glyph_play.cxx b/nxwm/src/glyph_play24x24.cxx similarity index 98% rename from nxwm/src/glyph_play.cxx rename to nxwm/src/glyph_play24x24.cxx index 8c16addae..7ccce5e89 100644 --- a/nxwm/src/glyph_play.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_play.cxx + * NxWidgets/nxwm/src/glyph_play24x24.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -243,7 +243,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = * Public Bitmap Structure Defintions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap24x24 = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format From dda776d27c3679f743ea771f5a89d4fff4543ae2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Oct 2013 17:26:06 -0600 Subject: [PATCH 143/390] SAMA5 TSD: Fix to prohibit reading samples when not valid --- nxwm/src/ccalibration.cxx | 8 ++++---- nxwm/src/ctouchscreen.cxx | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 51b536db0..b52744554 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1156,7 +1156,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - idbg("Left slope: %f offset: %f\n", data.left.slope, data.left.offset); + idbg("Left slope: %f6.2 offset: %f6.2\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1167,7 +1167,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - idbg("Right slope: %f offset: %f\n", data.right.slope, data.right.offset); + idbg("Right slope: %f6.2 offset: %f6.2\n", data.right.slope, data.right.offset); // Y lines: // @@ -1185,7 +1185,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - idbg("Top slope: %f offset: %f\n", data.top.slope, data.top.offset); + idbg("Top slope: %f6.2 offset: %f6.2\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1196,7 +1196,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - idbg("Bottom slope: %f offset: %f\n", data.bottom.slope, data.bottom.offset); + idbg("Bottom slope: %f6.2 offset: %f6.2\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 105908859..b1f9f0557 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -531,6 +531,8 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) x = (nxgl_coord_t)scaledX; y = (nxgl_coord_t)scaledY; + vdbg("raw: (%f6.2, %f6.2) scaled: (%f6.2, %f6.2) (%d, %d)\n", + rawX, rawY, scaledX, scaledY, x, y); #else // We have valid coordinates. Get the raw touch // position from the sample @@ -577,9 +579,8 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) y = (nxgl_coord_t)bigY; } -#endif - vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); +#endif } // Get the server handle and "inject the mouse data From e940f21b0e4f775ddf2ca60679b86d53d7c92ca1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Oct 2013 17:54:04 -0600 Subject: [PATCH 144/390] Fix some floating point formats in debug statements --- nxwm/src/ccalibration.cxx | 8 ++++---- nxwm/src/ctouchscreen.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index b52744554..c7910f557 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1156,7 +1156,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - idbg("Left slope: %f6.2 offset: %f6.2\n", data.left.slope, data.left.offset); + idbg("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1167,7 +1167,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - idbg("Right slope: %f6.2 offset: %f6.2\n", data.right.slope, data.right.offset); + idbg("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1185,7 +1185,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - idbg("Top slope: %f6.2 offset: %f6.2\n", data.top.slope, data.top.offset); + idbg("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1196,7 +1196,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - idbg("Bottom slope: %f6.2 offset: %f6.2\n", data.bottom.slope, data.bottom.offset); + idbg("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index b1f9f0557..853132008 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -531,7 +531,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) x = (nxgl_coord_t)scaledX; y = (nxgl_coord_t)scaledY; - vdbg("raw: (%f6.2, %f6.2) scaled: (%f6.2, %f6.2) (%d, %d)\n", + vdbg("raw: (%6.2f, %6.2f) scaled: (%6.2f, %6.2f) (%d, %d)\n", rawX, rawY, scaledX, scaledY, x, y); #else // We have valid coordinates. Get the raw touch From d9c0ee5a6329d2cdf17de5349cfea5d8ba14f0ee Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Oct 2013 12:11:52 -0600 Subject: [PATCH 145/390] Add for audio sub-format in audion system. From Ken Pettit --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b7fd3e9f1..62a852aee 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -379,7 +379,7 @@ state due to e.g. powerdown or other manual intervention. From Petteri Aimonen (2013-6-4). -1.9 2013-xx-xx Gregory Nutt +1.9 2013-10-28 Gregory Nutt * NxWM::CCalibration.cxx/hxx: If CONFIG_NXWM_CALIBRATION_MESSAGES is defined then CCalibration will provide some instructions in the center @@ -398,3 +398,5 @@ * NxWM::CCalibration and NxWM::CTouchscreen: Add a complex touchscreen scaling algorithm to handling the case where the measured X values also vary with y position (and vice versa) (2013-10-17). + +1.10 2013-xx-xx Gregory Nutt From 85081352026fef7ffc21307c489318d6fbc0ff23 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Oct 2013 14:08:34 -0600 Subject: [PATCH 146/390] Prep for release 6.31 --- ChangeLog.txt | 2 +- ReleaseNotes.txt | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 62a852aee..05ae84939 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -390,7 +390,7 @@ * NxWidgets::CScaledImage: This new class is a wrapper for an class the exports IBitMap. It will perform scaling via bi-linear interpolation so that images can be scaled to any size desired (2013-10-15). -* NxWM::CTaskbar:: Can now be configured to scale taskbasr icons using +* NxWM::CTaskbar:: Can now be configured to scale taskbar icons using NxWidgets::CScaledImage (2013-10-15) * NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 NuttX logo image. The older, smaller NuttX logo was renamed from diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 7d7c2fb08..d08333b60 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -319,3 +319,34 @@ Bugfixes: * NxWidgets::CGlyphSliderHorizontal: Fix a drawing error (from Ken Pettit). * Update the way that NSH the Unit Tests are registered as built-in NSH applications. + +NxWidgets-1.9 +============= + +The 10th release of the NxWidgets package was made on October 28, 2013. This +release depends on NuttX-6.26 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.9: + +* NxWM::CCalibration.cxx/hxx: If CONFIG_NXWM_CALIBRATION_MESSAGES is + defined then CCalibration will provide some instructions in the center + of the display. +* NxWM::CCalibration.cxx/hxx: Add options to collect and average + multiple samples at each location. Also logic to discard the most + extreme samples before averaging. +* NxWidgets::CScaledImage: This new class is a wrapper for an class + the exports IBitMap. It will perform scaling via bi-linear interpolation + so that images can be scaled to any size desired. +* NxWM::CTaskbar:: Can now be configured to scale taskbar icons using + NxWidgets::CScaledImage. +* NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 + NuttX logo image. The older, smaller NuttX logo was renamed from + nxlogo to nxlogo160x160 in all places. +* NxWM::CCalibration and NxWM::CTouchscreen: Add a complex touchscreen + scaling algorithm to handling the case where the measured X values also + vary with y position (and vice versa). + +Bugfixes: + +(There are not bugfixes recorded for this release). From 0f8e716d116ee8dae7b2b9be4bae8619a02547d5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Oct 2013 10:11:43 -0600 Subject: [PATCH 147/390] Add interface definition for platform-specific storage of configuration data; Modify NxWM unit test to use these interfaces, if available, to save and restore touchscreen calibration data. --- ChangeLog.txt | 4 ++ Kconfig | 10 +++ UnitTests/nxwm/nxwm_main.cxx | 115 +++++++++++++++++++++++++++-------- 3 files changed, 102 insertions(+), 27 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 05ae84939..cbdecf6f7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -400,3 +400,7 @@ vary with y position (and vice versa) (2013-10-17). 1.10 2013-xx-xx Gregory Nutt + +* Kconfig and UnitTests/nxwm: Add logic to enable saving a recovering + touchscreen calibration data. This depends upon having platform-dependent + support for storate of configuration data (2013-10-30). diff --git a/Kconfig b/Kconfig index ef512a5e5..ae71bf997 100644 --- a/Kconfig +++ b/Kconfig @@ -741,6 +741,16 @@ config NXWM_TOUCHSCREEN_LISTENERSTACK ---help--- Touchscreen listener thread stack size. Default 1024 +config NXWM_TOUSCHCREEN_CONFIGDATA + bool "Touchscreen configuration data" + default n + depends on PLATFORM_CONFIGDATA + ---help--- + If the architecture supports retention of configuration data, then + you may select this option to save touchscreen configuration data. + Otherwise, the touchscreen calibration must be performed each time + that you boot the system. + endif # NXWM_TOUCHSCREEN endmenu # NxWM Touchscreen Configuration diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 26ab1b2d3..62b19bb23 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -44,13 +44,17 @@ #include #include +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +# include +#endif + #include "ctaskbar.hxx" #include "cstartwindow.hxx" #include "cnxconsole.hxx" #include "chexcalculator.hxx" #ifdef CONFIG_NXWM_MEDIAPLAYER -#include "cmediaplayer.hxx" +# include "cmediaplayer.hxx" #endif #ifdef CONFIG_NXWM_TOUCHSCREEN @@ -95,6 +99,7 @@ struct SNxWmTest #ifdef CONFIG_NXWM_TOUCHSCREEN NxWM::CTouchscreen *touchscreen; // The touchscreen struct NxWM::SCalibrationData calibData; // Calibration data + bool calibrated; // True: Touchscreen has been calibrated #endif #ifdef CONFIG_NXWIDGET_MEMMONITOR unsigned int mmInitial; // Initial memory usage @@ -491,17 +496,46 @@ static bool createCalibration(void) } showTestCaseMemory("createCalibration: After creating CCalibration"); - // Call CTaskBar::startApplication to start the Calibration application. Nothing - // will be displayed because the window manager has not yet been started. +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA + // Check if we have previously stored calibration data - printf("createCalibration: Start the calibration application\n"); - if (!g_nxwmtest.taskbar->startApplication(calibration, false)) + int ret = platform_getconfig(CONFIGDATA_TSCALIBRATION, 0, + (FAR uint8_t *)&g_nxwmtest.calibData, + sizeof(struct NxWM::SCalibrationData)); + if (ret == OK) { - printf("createCalibration ERROR: Failed to start the calibration application\n"); - delete calibration; - return false; + // We successfully got the calibration data from the platform-specific + // logic. This might fail if (1) calibration data was never saved, or + // (2) if some failure occurred while trying to obtain the configuration + // data. In either event, the appropriate thing to do is to perform + // the calibration. + + // Provide the calibration data to the touchscreen thread + + g_nxwmtest.touchscreen->setCalibrationData(g_nxwmtest.calibData); + g_nxwmtest.touchscreen->setEnabled(true); + g_nxwmtest.calibrated = true; } - showTestCaseMemory("createCalibration: After starting the start window application"); + else +#endif + { + // Call CTaskBar::startApplication to start the Calibration application. + // Nothing will be displayed because the window manager has not yet been + // started. + + printf("createCalibration: Start the calibration application\n"); + g_nxwmtest.calibrated = false; + + if (!g_nxwmtest.taskbar->startApplication(calibration, false)) + { + printf("createCalibration ERROR: Failed to start the calibration application\n"); + delete calibration; + return false; + } + + showTestCaseMemory("createCalibration: After starting the start window application"); + } + return true; } #endif @@ -727,27 +761,54 @@ int nxwm_main(int argc, char *argv[]) } #ifdef CONFIG_NXWM_TOUCHSCREEN - // Since we started the touchscreen calibration program maximized, it will run - // immediately when we start the window manager. There is no positive handshake - // to know whenthe touchscreen has been calibrated. If we really want to know, - // we have to poll +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA + // There are two possibilies: (1) We started the calibration earlier and now + // need to obtain the calibration data from the calibration process, or (2) + // We have already obtained stored calibration data in which case, the calibration + // process never ran. - printf("nxwm_main: Waiting for touchscreen calibration\n"); - while (!g_nxwmtest.touchscreen->isCalibrated()) + if (!g_nxwmtest.calibrated) +#endif { - std::sleep(2); + // Since we started the touchscreen calibration program maximized, it will + // run immediately when we start the window manager. There is no positive + // handshake to know whenthe touchscreen has been calibrated. If we really + // want to know, we have to poll + + printf("nxwm_main: Waiting for touchscreen calibration\n"); + while (!g_nxwmtest.touchscreen->isCalibrated()) + { + std::sleep(2); + } + + // This is how we would then recover the calibration data. After the + // calibration application creates the calibration data, it hands it to + // the touchscreen driver. After the touchscreen driver gets it, it will + // report isCalibrated() == true and then we can read the calibration data + // from the touchscreen driver. + + printf("nxwm_main: Getting calibration data from the touchscreen\n"); + if (!g_nxwmtest.touchscreen->getCalibrationData(g_nxwmtest.calibData)) + { + printf("nxwm_main: ERROR: Failed to get calibration data from the touchscreen\n"); + } + else + { +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA + // Save the new calibration data so that we do not have to do this + // again the next time we start up. + + int ret = platform_setconfig(CONFIGDATA_TSCALIBRATION, 0, + (FAR const uint8_t *)&g_nxwmtest.calibData, + sizeof(struct NxWM::SCalibrationData)); + if (ret != 0) + { + printf("nxwm_main: ERROR: Failed to save calibration data\n"); + } +#endif + g_nxwmtest.calibrated = true; + } } - - // This is how we would then recover the calibration data. After the calibration - // application creates the calibration data, it hands it to the touchscreen driver - // After the touchscreen driver gets it, it will report isCalibrated() == true - // and then we can read the calibration data from the touchscreen driver. - - printf("nxwm_main: Getting calibration data from the touchscreen\n"); - if (!g_nxwmtest.touchscreen->getCalibrationData(g_nxwmtest.calibData)) - { - printf("nxwm_main: ERROR: Failed to get calibration data from the touchscreen\n"); - } #endif // Wait a little bit for the display to stabilize. Then simulate pressing of From ecb7bd7c43a2903255fd4cb8169a6a1b59f2e73d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Oct 2013 10:29:51 -0600 Subject: [PATCH 148/390] Spark configuration updated by David Sidrane --- ChangeLog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index cbdecf6f7..28c5ae888 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -403,4 +403,5 @@ * Kconfig and UnitTests/nxwm: Add logic to enable saving a recovering touchscreen calibration data. This depends upon having platform-dependent - support for storate of configuration data (2013-10-30). + support for storate of configuration data. Portions suggested by + Ken Pettit (2013-10-30). From 7a165b1eb963678ffc5e98d4ae7c2de78993ab09 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Oct 2013 11:21:25 -0600 Subject: [PATCH 149/390] Saving of touchscreen calibration but be done in CCalbration each time the touchscreen is calibrated, not just once on startup --- ChangeLog.txt | 5 +++++ UnitTests/nxwm/nxwm_main.cxx | 2 +- nxwm/src/ccalibration.cxx | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 28c5ae888..53ea2745f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -405,3 +405,8 @@ touchscreen calibration data. This depends upon having platform-dependent support for storate of configuration data. Portions suggested by Ken Pettit (2013-10-30). +* NxWM:Calibration: Saving of calibration data must be performed in + CCalibration, not in UnitTests/nxwm. Why? Because the touchscreen + calibration could also be initiated from other ways other than through + the one-time, start-up initialization logic (2013-10-30). + diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 62b19bb23..0787a6cba 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -794,7 +794,7 @@ int nxwm_main(int argc, char *argv[]) } else { -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +#if 0 // ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA. Done in CCalibration // Save the new calibration data so that we do not have to do this // again the next time we start up. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index c7910f557..562ef206e 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -45,6 +45,10 @@ #include #include +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +# include +#endif + #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" #include "ctouchscreen.hxx" @@ -1099,7 +1103,20 @@ void CCalibration::finishCalibration(void) struct SCalibrationData caldata; if (createCalibrationData(caldata)) { - // And provide this to the touchscreen, enabling touchscreen processing +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA + // Save the new calibration data. The saved calibration + // data may be used to avoided recalibrating in the future. + + int ret = platform_setconfig(CONFIGDATA_TSCALIBRATION, 0, + (FAR const uint8_t *)&caldata, + sizeof(struct SCalibrationData)); + if (ret != 0) + { + gdbg("ERROR: Failed to save calibration data\n"); + } +#endif + // And provide the calibration data to the touchscreen, enabling + // touchscreen processing m_touchscreen->setEnabled(false); m_touchscreen->setCalibrationData(caldata); From ef56d18271a56110acf9fac2a295ac6b2a0a4c7f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Oct 2013 17:16:58 -0600 Subject: [PATCH 150/390] Fix typos introduced into NxWM configuration by an earlier check-in today --- Kconfig | 2 +- UnitTests/nxwm/nxwm_main.cxx | 10 +++++----- nxwm/src/ccalibration.cxx | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Kconfig b/Kconfig index ae71bf997..0ee006aba 100644 --- a/Kconfig +++ b/Kconfig @@ -741,7 +741,7 @@ config NXWM_TOUCHSCREEN_LISTENERSTACK ---help--- Touchscreen listener thread stack size. Default 1024 -config NXWM_TOUSCHCREEN_CONFIGDATA +config NXWM_TOUCHSCREEN_CONFIGDATA bool "Touchscreen configuration data" default n depends on PLATFORM_CONFIGDATA diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 0787a6cba..167984b14 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -44,8 +44,8 @@ #include #include -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA -# include +#ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA +# include #endif #include "ctaskbar.hxx" @@ -496,7 +496,7 @@ static bool createCalibration(void) } showTestCaseMemory("createCalibration: After creating CCalibration"); -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +#ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA // Check if we have previously stored calibration data int ret = platform_getconfig(CONFIGDATA_TSCALIBRATION, 0, @@ -761,7 +761,7 @@ int nxwm_main(int argc, char *argv[]) } #ifdef CONFIG_NXWM_TOUCHSCREEN -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +#ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA // There are two possibilies: (1) We started the calibration earlier and now // need to obtain the calibration data from the calibration process, or (2) // We have already obtained stored calibration data in which case, the calibration @@ -794,7 +794,7 @@ int nxwm_main(int argc, char *argv[]) } else { -#if 0 // ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA. Done in CCalibration +#if 0 // ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA. Done in CCalibration // Save the new calibration data so that we do not have to do this // again the next time we start up. diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 562ef206e..74be1fd09 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -45,8 +45,8 @@ #include #include -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA -# include +#ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA +# include #endif #include "nxwmconfig.hxx" @@ -1103,7 +1103,7 @@ void CCalibration::finishCalibration(void) struct SCalibrationData caldata; if (createCalibrationData(caldata)) { -#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +#ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA // Save the new calibration data. The saved calibration // data may be used to avoided recalibrating in the future. From 038ffbe07b843a327bc4b4626e1013e07d8c43d4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 7 Dec 2013 11:04:08 -0600 Subject: [PATCH 151/390] Prep for the NuttX-6.32 Release --- ChangeLog.txt | 5 +++-- ReleaseNotes.txt | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 53ea2745f..f45fde705 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -399,9 +399,9 @@ scaling algorithm to handling the case where the measured X values also vary with y position (and vice versa) (2013-10-17). -1.10 2013-xx-xx Gregory Nutt +1.10 2013-12-07 Gregory Nutt -* Kconfig and UnitTests/nxwm: Add logic to enable saving a recovering +* Kconfig and UnitTests/nxwm: Add logic to enable saving and recovering touchscreen calibration data. This depends upon having platform-dependent support for storate of configuration data. Portions suggested by Ken Pettit (2013-10-30). @@ -410,3 +410,4 @@ calibration could also be initiated from other ways other than through the one-time, start-up initialization logic (2013-10-30). +1.11 2014-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index d08333b60..316949e0f 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -349,4 +349,18 @@ Additional new features and extended functionality in Version 1.9: Bugfixes: -(There are not bugfixes recorded for this release). +(There are no bugfixes recorded for this release). + +NxWidgets-1.9 +============= + +The 11th release of the NxWidgets package was made on December 7, 2013. This +release depends on NuttX-6.26 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.10: + +* NxWM:Calibration and UnitTests/nxwm: Add logic to enable saving and + recovering touchscreen calibration data. This depends upon having + platform-dependent support for storage of configuration data. Portions + suggested by Ken Pettit. From cd15af22fa9a5cae8c1543f125616c4a768064b7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 10 Dec 2013 09:23:54 -0600 Subject: [PATCH 152/390] Move include/nuttx/fb.h to include/nuttx/video/fb.h --- libnxwidgets/src/glyph_arrowdown.cxx | 2 +- libnxwidgets/src/glyph_arrowleft.cxx | 2 +- libnxwidgets/src/glyph_arrowright.cxx | 2 +- libnxwidgets/src/glyph_arrowup.cxx | 2 +- libnxwidgets/src/glyph_backspace.cxx | 2 +- libnxwidgets/src/glyph_capslock.cxx | 2 +- libnxwidgets/src/glyph_checkboxmu.cxx | 2 +- libnxwidgets/src/glyph_checkboxoff.cxx | 2 +- libnxwidgets/src/glyph_checkboxon.cxx | 2 +- libnxwidgets/src/glyph_control.cxx | 2 +- libnxwidgets/src/glyph_cycle.cxx | 2 +- libnxwidgets/src/glyph_nxlogo160x160.cxx | 2 +- libnxwidgets/src/glyph_nxlogo320x320.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonmu.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonoff.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonon.cxx | 2 +- libnxwidgets/src/glyph_return.cxx | 2 +- libnxwidgets/src/glyph_screendepthdown.cxx | 2 +- libnxwidgets/src/glyph_screendepthup.cxx | 2 +- libnxwidgets/src/glyph_screenflipdown.cxx | 2 +- libnxwidgets/src/glyph_screenflipup.cxx | 2 +- libnxwidgets/src/glyph_shift.cxx | 2 +- libnxwidgets/src/glyph_windowclose.cxx | 2 +- libnxwidgets/src/glyph_windowdepthdown.cxx | 2 +- libnxwidgets/src/glyph_windowdepthup.cxx | 2 +- nxwm/src/glyph_calculator.cxx | 2 +- nxwm/src/glyph_calibration.cxx | 2 +- nxwm/src/glyph_cmd.cxx | 2 +- nxwm/src/glyph_mediaplayer.cxx | 2 +- nxwm/src/glyph_minimize.cxx | 2 +- nxwm/src/glyph_mplayer_controls.cxx | 2 +- nxwm/src/glyph_nsh.cxx | 2 +- nxwm/src/glyph_play24x24.cxx | 2 +- nxwm/src/glyph_start.cxx | 2 +- nxwm/src/glyph_stop.cxx | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/libnxwidgets/src/glyph_arrowdown.cxx b/libnxwidgets/src/glyph_arrowdown.cxx index ec2a6baf0..acff11f6a 100644 --- a/libnxwidgets/src/glyph_arrowdown.cxx +++ b/libnxwidgets/src/glyph_arrowdown.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_arrowleft.cxx b/libnxwidgets/src/glyph_arrowleft.cxx index 6b3e8ee92..5a00ecca9 100644 --- a/libnxwidgets/src/glyph_arrowleft.cxx +++ b/libnxwidgets/src/glyph_arrowleft.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_arrowright.cxx b/libnxwidgets/src/glyph_arrowright.cxx index 74763a6fd..e80966ab7 100644 --- a/libnxwidgets/src/glyph_arrowright.cxx +++ b/libnxwidgets/src/glyph_arrowright.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_arrowup.cxx b/libnxwidgets/src/glyph_arrowup.cxx index 9ec840d43..ee9add5b2 100644 --- a/libnxwidgets/src/glyph_arrowup.cxx +++ b/libnxwidgets/src/glyph_arrowup.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_backspace.cxx b/libnxwidgets/src/glyph_backspace.cxx index 967963347..e7cabef29 100644 --- a/libnxwidgets/src/glyph_backspace.cxx +++ b/libnxwidgets/src/glyph_backspace.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_capslock.cxx b/libnxwidgets/src/glyph_capslock.cxx index 663e601f0..29281e9df 100644 --- a/libnxwidgets/src/glyph_capslock.cxx +++ b/libnxwidgets/src/glyph_capslock.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_checkboxmu.cxx b/libnxwidgets/src/glyph_checkboxmu.cxx index 681c17445..1068b7e45 100644 --- a/libnxwidgets/src/glyph_checkboxmu.cxx +++ b/libnxwidgets/src/glyph_checkboxmu.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_checkboxoff.cxx b/libnxwidgets/src/glyph_checkboxoff.cxx index 250d2455e..7be6a50b2 100644 --- a/libnxwidgets/src/glyph_checkboxoff.cxx +++ b/libnxwidgets/src/glyph_checkboxoff.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_checkboxon.cxx b/libnxwidgets/src/glyph_checkboxon.cxx index 5b9c18b78..bbf37ddcd 100644 --- a/libnxwidgets/src/glyph_checkboxon.cxx +++ b/libnxwidgets/src/glyph_checkboxon.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_control.cxx b/libnxwidgets/src/glyph_control.cxx index ffbdf965b..028a7197c 100644 --- a/libnxwidgets/src/glyph_control.cxx +++ b/libnxwidgets/src/glyph_control.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx index d706adddb..4b0adac84 100644 --- a/libnxwidgets/src/glyph_cycle.cxx +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_nxlogo160x160.cxx b/libnxwidgets/src/glyph_nxlogo160x160.cxx index bd6d280b9..e4f043936 100644 --- a/libnxwidgets/src/glyph_nxlogo160x160.cxx +++ b/libnxwidgets/src/glyph_nxlogo160x160.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_nxlogo320x320.cxx b/libnxwidgets/src/glyph_nxlogo320x320.cxx index 174c69355..68c081a28 100644 --- a/libnxwidgets/src/glyph_nxlogo320x320.cxx +++ b/libnxwidgets/src/glyph_nxlogo320x320.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonmu.cxx b/libnxwidgets/src/glyph_radiobuttonmu.cxx index a9e4d6708..58888194d 100644 --- a/libnxwidgets/src/glyph_radiobuttonmu.cxx +++ b/libnxwidgets/src/glyph_radiobuttonmu.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonoff.cxx b/libnxwidgets/src/glyph_radiobuttonoff.cxx index 029b93896..4fc90a333 100644 --- a/libnxwidgets/src/glyph_radiobuttonoff.cxx +++ b/libnxwidgets/src/glyph_radiobuttonoff.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonon.cxx b/libnxwidgets/src/glyph_radiobuttonon.cxx index 242f6f373..b634af053 100644 --- a/libnxwidgets/src/glyph_radiobuttonon.cxx +++ b/libnxwidgets/src/glyph_radiobuttonon.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_return.cxx b/libnxwidgets/src/glyph_return.cxx index 47314f65c..7a8eba024 100644 --- a/libnxwidgets/src/glyph_return.cxx +++ b/libnxwidgets/src/glyph_return.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_screendepthdown.cxx b/libnxwidgets/src/glyph_screendepthdown.cxx index c3f0e15ee..495c68cda 100644 --- a/libnxwidgets/src/glyph_screendepthdown.cxx +++ b/libnxwidgets/src/glyph_screendepthdown.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_screendepthup.cxx b/libnxwidgets/src/glyph_screendepthup.cxx index e4574a367..b5c389f9c 100644 --- a/libnxwidgets/src/glyph_screendepthup.cxx +++ b/libnxwidgets/src/glyph_screendepthup.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_screenflipdown.cxx b/libnxwidgets/src/glyph_screenflipdown.cxx index 253ad6afb..d775d0e50 100644 --- a/libnxwidgets/src/glyph_screenflipdown.cxx +++ b/libnxwidgets/src/glyph_screenflipdown.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_screenflipup.cxx b/libnxwidgets/src/glyph_screenflipup.cxx index 63b58a4a6..7f412345f 100644 --- a/libnxwidgets/src/glyph_screenflipup.cxx +++ b/libnxwidgets/src/glyph_screenflipup.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_shift.cxx b/libnxwidgets/src/glyph_shift.cxx index 193fd1719..48515b13c 100644 --- a/libnxwidgets/src/glyph_shift.cxx +++ b/libnxwidgets/src/glyph_shift.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_windowclose.cxx b/libnxwidgets/src/glyph_windowclose.cxx index 3a60aa137..0600d2537 100644 --- a/libnxwidgets/src/glyph_windowclose.cxx +++ b/libnxwidgets/src/glyph_windowclose.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_windowdepthdown.cxx b/libnxwidgets/src/glyph_windowdepthdown.cxx index d75b7d676..195002630 100644 --- a/libnxwidgets/src/glyph_windowdepthdown.cxx +++ b/libnxwidgets/src/glyph_windowdepthdown.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/src/glyph_windowdepthup.cxx b/libnxwidgets/src/glyph_windowdepthup.cxx index f5d67e968..b182a861c 100644 --- a/libnxwidgets/src/glyph_windowdepthup.cxx +++ b/libnxwidgets/src/glyph_windowdepthup.cxx @@ -78,7 +78,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/nxwm/src/glyph_calculator.cxx b/nxwm/src/glyph_calculator.cxx index 3d8bb97bd..e10bce74f 100644 --- a/nxwm/src/glyph_calculator.cxx +++ b/nxwm/src/glyph_calculator.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration.cxx index fab2902fe..be9d8de0a 100644 --- a/nxwm/src/glyph_calibration.cxx +++ b/nxwm/src/glyph_calibration.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_cmd.cxx b/nxwm/src/glyph_cmd.cxx index 816c888c5..a424fe6f3 100644 --- a/nxwm/src/glyph_cmd.cxx +++ b/nxwm/src/glyph_cmd.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_mediaplayer.cxx b/nxwm/src/glyph_mediaplayer.cxx index e7b55a74e..77e933915 100644 --- a/nxwm/src/glyph_mediaplayer.cxx +++ b/nxwm/src/glyph_mediaplayer.cxx @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 4dd95f9f2..0c45a2f77 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_mplayer_controls.cxx b/nxwm/src/glyph_mplayer_controls.cxx index 4f6a387c1..505d87733 100644 --- a/nxwm/src/glyph_mplayer_controls.cxx +++ b/nxwm/src/glyph_mplayer_controls.cxx @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 69bccd344..5fa464854 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_play24x24.cxx b/nxwm/src/glyph_play24x24.cxx index 7ccce5e89..e16e3b505 100644 --- a/nxwm/src/glyph_play24x24.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index e7937faea..db2ffaf94 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index a60b75ce8..df7e02268 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "crlepalettebitmap.hxx" From 0a37711b4096e758ae64c8b9ee6304a74a147cb8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 10 Dec 2013 09:29:20 -0600 Subject: [PATCH 153/390] Move rgbcolors.h to include/nuttx/video --- libnxwidgets/include/cscaledbitmap.hxx | 2 +- libnxwidgets/include/nxconfig.hxx | 2 +- libnxwidgets/src/cgraphicsport.cxx | 2 +- libnxwidgets/src/glyph_arrowdown.cxx | 2 +- libnxwidgets/src/glyph_arrowleft.cxx | 2 +- libnxwidgets/src/glyph_arrowright.cxx | 2 +- libnxwidgets/src/glyph_arrowup.cxx | 2 +- libnxwidgets/src/glyph_backspace.cxx | 2 +- libnxwidgets/src/glyph_capslock.cxx | 2 +- libnxwidgets/src/glyph_checkboxmu.cxx | 2 +- libnxwidgets/src/glyph_checkboxon.cxx | 2 +- libnxwidgets/src/glyph_control.cxx | 2 +- libnxwidgets/src/glyph_cycle.cxx | 2 +- libnxwidgets/src/glyph_nxlogo160x160.cxx | 2 +- libnxwidgets/src/glyph_nxlogo320x320.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonmu.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonoff.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonon.cxx | 2 +- libnxwidgets/src/glyph_return.cxx | 2 +- libnxwidgets/src/glyph_screendepthdown.cxx | 2 +- libnxwidgets/src/glyph_screendepthup.cxx | 2 +- libnxwidgets/src/glyph_screenflipdown.cxx | 2 +- libnxwidgets/src/glyph_screenflipup.cxx | 2 +- libnxwidgets/src/glyph_shift.cxx | 2 +- libnxwidgets/src/glyph_windowclose.cxx | 2 +- libnxwidgets/src/glyph_windowdepthdown.cxx | 2 +- libnxwidgets/src/glyph_windowdepthup.cxx | 2 +- nxwm/src/glyph_calculator.cxx | 2 +- nxwm/src/glyph_calibration.cxx | 2 +- nxwm/src/glyph_cmd.cxx | 2 +- nxwm/src/glyph_mediaplayer.cxx | 2 +- nxwm/src/glyph_minimize.cxx | 2 +- nxwm/src/glyph_mplayer_controls.cxx | 2 +- nxwm/src/glyph_nsh.cxx | 2 +- nxwm/src/glyph_play24x24.cxx | 2 +- nxwm/src/glyph_start.cxx | 2 +- nxwm/src/glyph_stop.cxx | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libnxwidgets/include/cscaledbitmap.hxx b/libnxwidgets/include/cscaledbitmap.hxx index 3c0594a1d..48afd5306 100644 --- a/libnxwidgets/include/cscaledbitmap.hxx +++ b/libnxwidgets/include/cscaledbitmap.hxx @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include "nxconfig.hxx" diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index cd51229c2..1336ad5e7 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index f295483a9..85548a381 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -80,7 +80,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "inxwindow.hxx" diff --git a/libnxwidgets/src/glyph_arrowdown.cxx b/libnxwidgets/src/glyph_arrowdown.cxx index acff11f6a..c304e9281 100644 --- a/libnxwidgets/src/glyph_arrowdown.cxx +++ b/libnxwidgets/src/glyph_arrowdown.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_arrowleft.cxx b/libnxwidgets/src/glyph_arrowleft.cxx index 5a00ecca9..ae322dcc2 100644 --- a/libnxwidgets/src/glyph_arrowleft.cxx +++ b/libnxwidgets/src/glyph_arrowleft.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_arrowright.cxx b/libnxwidgets/src/glyph_arrowright.cxx index e80966ab7..5969527d9 100644 --- a/libnxwidgets/src/glyph_arrowright.cxx +++ b/libnxwidgets/src/glyph_arrowright.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_arrowup.cxx b/libnxwidgets/src/glyph_arrowup.cxx index ee9add5b2..9ea10bde2 100644 --- a/libnxwidgets/src/glyph_arrowup.cxx +++ b/libnxwidgets/src/glyph_arrowup.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_backspace.cxx b/libnxwidgets/src/glyph_backspace.cxx index e7cabef29..86c1fb93a 100644 --- a/libnxwidgets/src/glyph_backspace.cxx +++ b/libnxwidgets/src/glyph_backspace.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_capslock.cxx b/libnxwidgets/src/glyph_capslock.cxx index 29281e9df..d9e00bc78 100644 --- a/libnxwidgets/src/glyph_capslock.cxx +++ b/libnxwidgets/src/glyph_capslock.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_checkboxmu.cxx b/libnxwidgets/src/glyph_checkboxmu.cxx index 1068b7e45..96dbec9c1 100644 --- a/libnxwidgets/src/glyph_checkboxmu.cxx +++ b/libnxwidgets/src/glyph_checkboxmu.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_checkboxon.cxx b/libnxwidgets/src/glyph_checkboxon.cxx index bbf37ddcd..b598e60ce 100644 --- a/libnxwidgets/src/glyph_checkboxon.cxx +++ b/libnxwidgets/src/glyph_checkboxon.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_control.cxx b/libnxwidgets/src/glyph_control.cxx index 028a7197c..cd2e373e6 100644 --- a/libnxwidgets/src/glyph_control.cxx +++ b/libnxwidgets/src/glyph_control.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx index 4b0adac84..7983d4566 100644 --- a/libnxwidgets/src/glyph_cycle.cxx +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_nxlogo160x160.cxx b/libnxwidgets/src/glyph_nxlogo160x160.cxx index e4f043936..6a38b45cb 100644 --- a/libnxwidgets/src/glyph_nxlogo160x160.cxx +++ b/libnxwidgets/src/glyph_nxlogo160x160.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" diff --git a/libnxwidgets/src/glyph_nxlogo320x320.cxx b/libnxwidgets/src/glyph_nxlogo320x320.cxx index 68c081a28..c83ab7159 100644 --- a/libnxwidgets/src/glyph_nxlogo320x320.cxx +++ b/libnxwidgets/src/glyph_nxlogo320x320.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "crlepalettebitmap.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonmu.cxx b/libnxwidgets/src/glyph_radiobuttonmu.cxx index 58888194d..1359c5b96 100644 --- a/libnxwidgets/src/glyph_radiobuttonmu.cxx +++ b/libnxwidgets/src/glyph_radiobuttonmu.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonoff.cxx b/libnxwidgets/src/glyph_radiobuttonoff.cxx index 4fc90a333..422db01a9 100644 --- a/libnxwidgets/src/glyph_radiobuttonoff.cxx +++ b/libnxwidgets/src/glyph_radiobuttonoff.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_radiobuttonon.cxx b/libnxwidgets/src/glyph_radiobuttonon.cxx index b634af053..04ca63757 100644 --- a/libnxwidgets/src/glyph_radiobuttonon.cxx +++ b/libnxwidgets/src/glyph_radiobuttonon.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_return.cxx b/libnxwidgets/src/glyph_return.cxx index 7a8eba024..3989ff89a 100644 --- a/libnxwidgets/src/glyph_return.cxx +++ b/libnxwidgets/src/glyph_return.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_screendepthdown.cxx b/libnxwidgets/src/glyph_screendepthdown.cxx index 495c68cda..e55e0686a 100644 --- a/libnxwidgets/src/glyph_screendepthdown.cxx +++ b/libnxwidgets/src/glyph_screendepthdown.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_screendepthup.cxx b/libnxwidgets/src/glyph_screendepthup.cxx index b5c389f9c..e693b7488 100644 --- a/libnxwidgets/src/glyph_screendepthup.cxx +++ b/libnxwidgets/src/glyph_screendepthup.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_screenflipdown.cxx b/libnxwidgets/src/glyph_screenflipdown.cxx index d775d0e50..488315d7a 100644 --- a/libnxwidgets/src/glyph_screenflipdown.cxx +++ b/libnxwidgets/src/glyph_screenflipdown.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_screenflipup.cxx b/libnxwidgets/src/glyph_screenflipup.cxx index 7f412345f..7d45dbf93 100644 --- a/libnxwidgets/src/glyph_screenflipup.cxx +++ b/libnxwidgets/src/glyph_screenflipup.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_shift.cxx b/libnxwidgets/src/glyph_shift.cxx index 48515b13c..c1cce8686 100644 --- a/libnxwidgets/src/glyph_shift.cxx +++ b/libnxwidgets/src/glyph_shift.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_windowclose.cxx b/libnxwidgets/src/glyph_windowclose.cxx index 0600d2537..62d6ee718 100644 --- a/libnxwidgets/src/glyph_windowclose.cxx +++ b/libnxwidgets/src/glyph_windowclose.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_windowdepthdown.cxx b/libnxwidgets/src/glyph_windowdepthdown.cxx index 195002630..b85ed053a 100644 --- a/libnxwidgets/src/glyph_windowdepthdown.cxx +++ b/libnxwidgets/src/glyph_windowdepthdown.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/libnxwidgets/src/glyph_windowdepthup.cxx b/libnxwidgets/src/glyph_windowdepthup.cxx index b182a861c..056e27c1c 100644 --- a/libnxwidgets/src/glyph_windowdepthup.cxx +++ b/libnxwidgets/src/glyph_windowdepthup.cxx @@ -79,7 +79,7 @@ #include #include -#include +#include #include "nxconfig.hxx" #include "cbitmap.hxx" diff --git a/nxwm/src/glyph_calculator.cxx b/nxwm/src/glyph_calculator.cxx index e10bce74f..9bb3f690d 100644 --- a/nxwm/src/glyph_calculator.cxx +++ b/nxwm/src/glyph_calculator.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration.cxx index be9d8de0a..df169f556 100644 --- a/nxwm/src/glyph_calibration.cxx +++ b/nxwm/src/glyph_calibration.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_cmd.cxx b/nxwm/src/glyph_cmd.cxx index a424fe6f3..373d8ad5e 100644 --- a/nxwm/src/glyph_cmd.cxx +++ b/nxwm/src/glyph_cmd.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_mediaplayer.cxx b/nxwm/src/glyph_mediaplayer.cxx index 77e933915..ee8c1a873 100644 --- a/nxwm/src/glyph_mediaplayer.cxx +++ b/nxwm/src/glyph_mediaplayer.cxx @@ -48,7 +48,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 0c45a2f77..31feb268f 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_mplayer_controls.cxx b/nxwm/src/glyph_mplayer_controls.cxx index 505d87733..011f892a2 100644 --- a/nxwm/src/glyph_mplayer_controls.cxx +++ b/nxwm/src/glyph_mplayer_controls.cxx @@ -48,7 +48,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 5fa464854..213db54dd 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_play24x24.cxx b/nxwm/src/glyph_play24x24.cxx index e16e3b505..ffe389fc5 100644 --- a/nxwm/src/glyph_play24x24.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index db2ffaf94..ce1bf6a2c 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index df7e02268..74836e01d 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include "crlepalettebitmap.hxx" From da660d1c6cd1525e1288f58fbbebc33590abe572 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 29 Dec 2013 09:46:57 -0600 Subject: [PATCH 154/390] NxWidgets server initialization must be performed in the kernel when NxWdigets is built in kernel mode --- ChangeLog.txt | 6 ++++++ Kconfig | 31 +++++++++++++++++++++++++++---- libnxwidgets/src/cnxserver.cxx | 31 +++++++++++++++++++------------ 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f45fde705..d29b815aa 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -411,3 +411,9 @@ the one-time, start-up initialization logic (2013-10-30). 1.11 2014-xx-xx Gregory Nutt + +* NxWidgets/Kconfig and NxWidgets::CNxServer: Server initialization can + now be disabled in the configuration (in fact, it is disabled by default). + This is because in the kernel build mode, the NX server must be initialized + in kernel mode by the RTOS before applications using the server run in + user mode. diff --git a/Kconfig b/Kconfig index 0ee006aba..b6ac4fb7d 100644 --- a/Kconfig +++ b/Kconfig @@ -26,9 +26,17 @@ config NXWIDGETS_FLICKERFREE lower-performance flicker-reductions measures where-ever thay may be available. +config NXWIDGETS_EXTERNINIT + bool "External display Initialization" + default 0 + depends on NXWIDGET_SERVERINIT + ---help--- + Define to support external display initialization. + config NXWIDGETS_DEVNO int "LCD Device Number" default 0 + depends on NXWIDGETS_EXTERNINIT || NX_LCDDRIVER ---help--- LCD device number (in case there are more than one LCDs connected). Default: 0 @@ -39,6 +47,22 @@ config NXWIDGETS_VPLANE ---help--- Only a single video plane is supported. Default: 0 +if NX_MULTIUSER + +config NXWIDGET_SERVERINIT + bool "Start server" + default y + depends on !NUTTX_KERNEL + ---help--- + If this option is selected, then the NxWidgets::CNxServer class will + bring up the NX server when it is initialized. If this option is + not selected then the NxWidgets::CNxServer constructor + initialization logic will assume that the NX server has been started + by other, external logic and will simply attempt to connect to the + server. + +if NXWIDGET_SERVERINIT + config NXWIDGETS_SERVERPRIO int "NX Server priority" default 110 @@ -57,6 +81,8 @@ config NXWIDGETS_SERVERSTACK ---help--- NX server thread stack size (in multi-user mode). Default 2048 +endif # NXWIDGET_SERVERINIT + config NXWIDGETS_CLIENTPRIO int "NX Client Priority" default 100 @@ -78,10 +104,7 @@ config NXWIDGETS_LISTENERSTACK ---help--- NX listener thread stack size (in multi-user mode). Default 2048 -config NXWIDGETS_EXTERNINIT - bool "Extern LCD Initialization" - ---help--- - Define to support external display initialization. +endif # NX_MULTIUSER config NXWIDGET_EVENTWAIT bool "Event Waiting" diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 15f9bce5a..84f6701da 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxserver.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -156,7 +156,8 @@ bool CNxServer::connect(void) // Turn the LCD on at 75% power (void)m_hDevice->setpower(m_hDevice, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); -#else + +#else // CONFIG_NX_LCDDRIVER int ret; // Initialize the frame buffer device @@ -175,7 +176,8 @@ bool CNxServer::connect(void) CONFIG_NXWIDGETS_VPLANE); return false; } -#endif + +#endif // CONFIG_NX_LCDDRIVER // Then open NX @@ -188,7 +190,7 @@ bool CNxServer::connect(void) return true; } -#endif +#endif // CONFIG_NX_MULTIUSER /** * Connect to the NX Server -- Multi user version @@ -212,6 +214,7 @@ bool CNxServer::connect(void) return false; } +#ifdef CONFIG_NXWIDGET_SERVERINIT // Start the server task gvdbg("CNxServer::connect: Starting server task\n"); @@ -227,6 +230,8 @@ bool CNxServer::connect(void) usleep(50*1000); +#endif // CONFIG_NXWIDGET_SERVERINIT + // Connect to the server m_hNxServer = nx_connect(); @@ -286,7 +291,7 @@ bool CNxServer::connect(void) return true; } -#endif +#endif // CONFIG_NX_MULTIUSER /** * Disconnect to the NX Server -- Single user version @@ -303,7 +308,7 @@ void CNxServer::disconnect(void) m_hNxServer = NULL; } } -#endif +#endif // CONFIG_NX_MULTIUSER /** * Disconnect to the NX Server -- Single user version @@ -336,14 +341,14 @@ void CNxServer::disconnect(void) m_hNxServer = NULL; } } -#endif +#endif // CONFIG_NX_MULTIUSER /** * NX server thread. This is the entry point into the server thread that * serializes the multi-threaded accesses to the display. */ -#ifdef CONFIG_NX_MULTIUSER +#if defined(CONFIG_NX_MULTIUSER) && defined(CONFIG_NXWIDGET_SERVERINIT) int CNxServer::server(int argc, char *argv[]) { FAR NX_DRIVERTYPE *dev; @@ -381,7 +386,8 @@ int CNxServer::server(int argc, char *argv[]) // Turn the LCD on at 75% power (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); -#else + +#else // CONFIG_NX_LCDDRIVER // Initialize the frame buffer device ret = up_fbinitialize(); @@ -397,7 +403,8 @@ int CNxServer::server(int argc, char *argv[]) gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return 2; } -#endif + +#endif // CONFIG_NX_LCDDRIVER // Then start the server @@ -405,7 +412,7 @@ int CNxServer::server(int argc, char *argv[]) gvdbg("nx_run returned: %d\n", errno); return EXIT_FAILURE; } -#endif +#endif // CONFIG_NX_MULTIUSER && CONFIG_NXWIDGET_SERVERINIT /** * This is the entry point of a thread that listeners for and dispatches @@ -458,4 +465,4 @@ FAR void *CNxServer::listener(FAR void *arg) sem_post(&This->m_connsem); return NULL; } -#endif +#endif // CONFIG_NX_MULTIUSER From c0e26ad24c140bf200149f30a05d0fa75abbf327 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 29 Dec 2013 11:11:48 -0600 Subject: [PATCH 155/390] Add nx_start() to simplify starting the NX server from within the RTOS --- Kconfig | 4 ++-- libnxwidgets/include/cnxserver.hxx | 2 +- libnxwidgets/src/cnxserver.cxx | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kconfig b/Kconfig index b6ac4fb7d..2d1467425 100644 --- a/Kconfig +++ b/Kconfig @@ -28,8 +28,7 @@ config NXWIDGETS_FLICKERFREE config NXWIDGETS_EXTERNINIT bool "External display Initialization" - default 0 - depends on NXWIDGET_SERVERINIT + default n ---help--- Define to support external display initialization. @@ -44,6 +43,7 @@ config NXWIDGETS_DEVNO config NXWIDGETS_VPLANE int "Plane Number" default 0 + depends on !NX_LCDDRIVER && !NXWIDGETS_EXTERNINIT ---help--- Only a single video plane is supported. Default: 0 diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index c6ca21bfc..f70dbdbdb 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -95,7 +95,7 @@ namespace NXWidgets * serializes the multi-threaded accesses to the display. */ -#ifdef CONFIG_NX_MULTIUSER +#if defined(CONFIG_NX_MULTIUSER) && defined(CONFIG_NXWIDGET_SERVERINIT) static int server(int argc, char *argv[]); #endif diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 84f6701da..6adbc20a5 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -201,7 +201,6 @@ bool CNxServer::connect(void) { struct sched_param param; pthread_t thread; - pid_t serverId; int ret; // Set the client task priority @@ -218,8 +217,9 @@ bool CNxServer::connect(void) // Start the server task gvdbg("CNxServer::connect: Starting server task\n"); - serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, - CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR char * const *)0); + pid_t serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, + CONFIG_NXWIDGETS_SERVERSTACK, server, + (FAR char * const *)0); if (serverId < 0) { gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); From bd7cb3d58a5067b4cd183c5cec893edb702a8eb2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 29 Dec 2013 13:15:08 -0600 Subject: [PATCH 156/390] STM3240G-EVAL: Add kernel build mode support and an NxWM kernel mode configuration --- libnxwidgets/src/cnxserver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 6adbc20a5..8dd448b87 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -76,7 +76,7 @@ CNxServer::CNxServer(void) { // Initialize server instance state data - m_hDevice = (FAR NX_DRIVERTYPE *)NULL; // LCD/Framebuffer device handle + m_hDevice = (FAR NX_DRIVERTYPE *)NULL; // LCD/Framebuffer device handle m_hNxServer = (NXHANDLE)NULL; // NX server handle #ifdef CONFIG_NX_MULTIUSER m_connected = false; // True: Connected to the server @@ -89,7 +89,7 @@ CNxServer::CNxServer(void) m_nServers++; - // Create miscellaneous singleton instances. Why is this done here? + // Create miscellaneous singleton instances. Why is this done here? // Because this needs to be done once before any widgets are created and we // don't want to rely on static constructors. @@ -426,7 +426,7 @@ FAR void *CNxServer::listener(FAR void *arg) CNxServer *This = (CNxServer*)arg; - // Process events forever + // Process events forever while (!This->m_stop) { From 39f42b1cf862df8b6012243d010a8b66047a6f51 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 30 Dec 2013 10:04:34 -0600 Subject: [PATCH 157/390] NxWM: Can now disable the NxConsole window. STM3240G-EVAL knxwm: Disabled the NxConsole for now because there are issues with the kernel build. --- Kconfig | 14 +++++-- UnitTests/nxwm/nxwm_main.cxx | 19 +++++++-- libnxwidgets/include/ccallback.hxx | 10 ++--- libnxwidgets/src/ccallback.cxx | 6 +-- nxwm/Makefile | 6 ++- nxwm/include/nxwmconfig.hxx | 63 ++++++++++++++++-------------- 6 files changed, 71 insertions(+), 47 deletions(-) diff --git a/Kconfig b/Kconfig index 2d1467425..8399e23c4 100644 --- a/Kconfig +++ b/Kconfig @@ -640,7 +640,14 @@ config NXWM_STARTWINDOW_STACKSIZE endmenu # Start Window Configuration -menu "NxConsole Window Configuration" +menuconfig NXWM_NXCONSOLE + bool "NxConsole Window" + default y + ---help--- + Enable support for the NxConsole window which provides a text window + in which you can interact with NSH. + +if NXWM_NXCONSOLE config NXWM_NXCONSOLE_PRIO int "NxConsole Task Priority" @@ -716,8 +723,7 @@ config NXWM_NXCONSOLE_ICON The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap endif # NXWM_NXCONSOLE_ICON - -endmenu # NxConsole Window Configuration +endif # NXWM_NXCONSOLE menu "NxWM Touchscreen Configuration" @@ -1049,7 +1055,7 @@ endif # NXWM_HEXCALCULATOR_FONTID endmenu # NxWM Hex Calculator display settings config NXWM_MEDIAPLAYER - bool "Enable NxWM Media Player" + bool "NxWM Media Player" default n ---help--- Enable support for the MP3 Media Player. This features requires diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 167984b14..1fddfeb28 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -50,7 +50,11 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" -#include "cnxconsole.hxx" + +#ifdef CONFIG_NXWM_NXCONSOLE +# include "cnxconsole.hxx" +#endif + #include "chexcalculator.hxx" #ifdef CONFIG_NXWM_MEDIAPLAYER @@ -544,6 +548,7 @@ static bool createCalibration(void) // Name: createNxConsole ///////////////////////////////////////////////////////////////////////////// +#ifdef CONFIG_NXWM_NXCONSOLE static bool createNxConsole(void) { // Add the NxConsole application to the start window @@ -568,6 +573,7 @@ static bool createNxConsole(void) showTestCaseMemory("createNxConsole: After adding the NxConsole application"); return true; } +#endif ///////////////////////////////////////////////////////////////////////////// // Name: createHexCalculator @@ -589,7 +595,7 @@ static bool createHexCalculator(void) printf("createHexCalculator: Adding the hex calculator application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(calculator)) { - printf("createHexCalculator: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + printf("createHexCalculator: ERROR: Failed to add CHexCalculatorFactory to the start window\n"); delete calculator; return false; } @@ -619,7 +625,7 @@ static bool createMediaPlayer(void) printf("createMediaPlayer: Adding the hex calculator application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(mediaplayer)) { - printf("createMediaPlayer: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + printf("createMediaPlayer: ERROR: Failed to add CMediaPlayerFactory to the start window\n"); delete mediaplayer; return false; } @@ -672,6 +678,7 @@ int nxwm_main(int argc, char *argv[]) // Initialize the NSH library +#ifdef CONFIG_NXWM_NXCONSOLE printf("nxwm_main: Initialize the NSH library\n"); if (!NxWM::nshlibInitialize()) { @@ -679,6 +686,7 @@ int nxwm_main(int argc, char *argv[]) return EXIT_FAILURE; } showTestCaseMemory("nxwm_main: After initializing the NSH library"); +#endif // Create the task bar. @@ -728,11 +736,13 @@ int nxwm_main(int argc, char *argv[]) // Create the NxConsole application and add it to the start window +#ifdef CONFIG_NXWM_NXCONSOLE if (!createNxConsole()) { printf("nxwm_main: ERROR: Failed to create the NxConsole application\n"); testCleanUpAndExit(EXIT_FAILURE); } +#endif // Create the hex calculator application and add it to the start window @@ -822,7 +832,8 @@ int nxwm_main(int argc, char *argv[]) showTestCaseMemory("nxwm_main: After clicking the start window icon"); // Wait bit to see the result of the button press. Then press the first icon - // in the start menu. That should be the NxConsole icon. + // in the start menu. That should be the NxConsole icon (if the NXCONSOLE + // is not disabled). sleep(2); g_nxwmtest.startwindow->clickIcon(0, true); diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 714ed1a7f..bef4a2ca9 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -58,11 +58,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -98,7 +98,7 @@ namespace NXWidgets #endif // Methods in the callback vtable - + /** * Re-Draw Callback. The redraw event is handled by CWidgetControl::redrawEvent. * @@ -113,7 +113,7 @@ namespace NXWidgets * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - + static void redraw(NXHANDLE hwnd, FAR const struct nxgl_rect_s *rect, bool bMore, FAR void *arg); @@ -157,7 +157,7 @@ namespace NXWidgets * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - + #ifdef CONFIG_NX_MOUSE static void newMouseEvent(NXHANDLE hwnd, FAR const struct nxgl_point_s *pos, diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 269a5cdb1..b7cd31161 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/ccallback.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ CCallback::CCallback(CWidgetControl *widgetControl) * @param arg User provided argument (see nx_openwindow, nx_requestbg, * nxtk_openwindow, or nxtk_opentoolbar). */ - + void CCallback::redraw(NXHANDLE hwnd, FAR const struct nxgl_rect_s *rect, bool bMore, FAR void *arg) @@ -171,7 +171,7 @@ void CCallback::newMouseEvent(NXHANDLE hwnd, FAR const struct nxgl_point_s *pos, uint8_t buttons, FAR void *arg) { - gvdbg("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", + gvdbg("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", hwnd, pos->x, pos->y, buttons, arg); // The argument must be the CCallback instance diff --git a/nxwm/Makefile b/nxwm/Makefile index 6efb464cf..87a277504 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -64,12 +64,16 @@ endif # Applications -CXXSRCS += cstartwindow.cxx cnxconsole.cxx chexcalculator.cxx +CXXSRCS += cstartwindow.cxx chexcalculator.cxx ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) CXXSRCS += ccalibration.cxx endif +ifeq ($(CONFIG_NXWM_NXCONSOLE),y) +CXXSRCS += cnxconsole.cxx +endif + # Images CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play24x24.cxx glyph_start.cxx diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 5b42e3a70..e1feedcf0 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -85,10 +85,11 @@ #endif /** - * NxConsole support is (probably) required + * NxConsole support is (probably) required if CONFIG_NXWM_NXCONSOLE is + * selected */ -#ifndef CONFIG_NXCONSOLE +#if defined(CONFIG_NXWM_NXCONSOLE) && !defined(CONFIG_NXCONSOLE) # warning "NxConsole support may be needed (CONFIG_NXCONSOLE)" #endif @@ -122,7 +123,7 @@ * 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: + * CONFIG_NXWM_DEFAULT_FONTCOLOR - Default font color. Default: * MKRGB(0,0,0) * CONFIG_NXWM_TRANSPARENT_COLOR - The "transparent" color. Default: * MKRGB(0,0,0) @@ -172,7 +173,7 @@ # define CONFIG_NXWM_TRANSPARENT_COLOR MKRGB(0,0,0) #endif -/* Task Bar Configuation ***************************************************/ +/* Task Bar Configuration **************************************************/ /** * Horizontal and vertical spacing of icons in the task bar. * @@ -288,7 +289,7 @@ * Used to communicated from CWindowMessenger to the start window thread. * Default: "/dev/nxwm" * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue - * before blocking. Defualt 32 + * before blocking. Default 32 * CONFIG_NXWM_STARTWINDOW_MXMPRIO - The message priority. Default: 42. * CONFIG_NXWM_STARTWINDOW_PRIO - Priority of the StartWindoW task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than @@ -368,37 +369,39 @@ * CONFIG_NXWM_NXCONSOLE_ICON - The glyph to use as the NxConsole icon */ -#ifndef CONFIG_NXWM_NXCONSOLE_PRIO -# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT -#endif +#ifdef CONFIG_NXWM_NXCONSOLE +# ifndef CONFIG_NXWM_NXCONSOLE_PRIO +# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT +# endif -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO" -# warning" -- This can result in data overrun errors" -#endif +# if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO" +# warning" -- This can result in data overrun errors" +# endif -#ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE -# define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 -#endif +# ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE +# define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 +# endif -#ifndef CONFIG_NXWM_NXCONSOLE_WCOLOR -# define CONFIG_NXWM_NXCONSOLE_WCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR -#endif +# ifndef CONFIG_NXWM_NXCONSOLE_WCOLOR +# define CONFIG_NXWM_NXCONSOLE_WCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +# endif -#ifndef CONFIG_NXWM_NXCONSOLE_FONTCOLOR -# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR CONFIG_NXWM_DEFAULT_FONTCOLOR -#endif +# ifndef CONFIG_NXWM_NXCONSOLE_FONTCOLOR +# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR CONFIG_NXWM_DEFAULT_FONTCOLOR +# endif -#ifndef CONFIG_NXWM_NXCONSOLE_FONTID -# define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID -#endif +# ifndef CONFIG_NXWM_NXCONSOLE_FONTID +# define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID +# endif -/** - * The NxConsole window glyph - */ + /** + * The NxConsole window glyph + */ -#ifndef CONFIG_NXWM_NXCONSOLE_ICON -# define CONFIG_NXWM_NXCONSOLE_ICON NxWM::g_cmdBitmap +# ifndef CONFIG_NXWM_NXCONSOLE_ICON +# define CONFIG_NXWM_NXCONSOLE_ICON NxWM::g_cmdBitmap +# endif #endif /* Touchscreen device *******************************************************/ @@ -500,7 +503,7 @@ * CONFIG_NXWM_CALIBRATION_MARGIN * The Calbration display consists of a target press offset from the edges * of the display by this number of pixels (in the horizontal direction) - * or rows (in the vertical). The closer that you can comfortabley + * or rows (in the vertical). The closer that you can comfortably * position the press positions to the edge, the more accurate will be the * linear interpolation (provide that the hardware provides equally good * measurements near the edges). From 80495b7ae5d8b3e0a7d9008f0e7ac8486f435f78 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 30 Dec 2013 12:39:23 -0600 Subject: [PATCH 158/390] NxWM::CTouchscreen: Add CONFIG_NXWM_TOUCHSCREEN_DEVINIT to suppress attempts to initialize the touchscreen from NxWM in the kernel build --- ChangeLog.txt | 7 +++++++ Kconfig | 16 ++++++++++++++++ libnxwidgets/src/cimage.cxx | 2 ++ nxwm/src/ctouchscreen.cxx | 2 ++ 4 files changed, 27 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index d29b815aa..81504c194 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -417,3 +417,10 @@ This is because in the kernel build mode, the NX server must be initialized in kernel mode by the RTOS before applications using the server run in user mode. +* NxWm: Added CONFIG_NXWM_NXCONSOLE that can be used to disable the NxConsole + window (2013-12-30). +* NxWm::CTouchscreen: Added CONFIG_NXWM_TOUCHSCREEN_DEVINIT that can be used + to suppress calls to initialize the touchscreen device from the listener + thread. This is necessary if the kernel mode build is used: In that case, + the touchscreen must be initialized in kernel space before NxWM is started + (2013-12-30). diff --git a/Kconfig b/Kconfig index 8399e23c4..5f956df54 100644 --- a/Kconfig +++ b/Kconfig @@ -738,6 +738,22 @@ if NXWM_TOUCHSCREEN comment "Touchscreen device settings" +config NXWM_TOUCHSCREEN_DEVINIT + bool "Touchscreen Device Initialization" + default y + depends on !NUTTX_KERNEL + ---help--- + It this option is selected, then the NxWM:CTouchscreen listener + thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO) + in order to instantiate the touchscreen driver at path + NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not + selected, then the NxWM:CTouchscreen listener thread will assume + that the driver has already been initialized at + NXWM_TOUCHSCREEN_DEVPATH. + + NOTE that in the kernel build, all touchscreen initialize must be + performed in kernel logic prior to the execution of NxWM. + config NXWM_TOUCHSCREEN_DEVNO int "Touchscreen Device Number" default 0 diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index b9b93ebb6..eaf4e3005 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -235,6 +235,7 @@ void CImage::drawContents(CGraphicsPort *port) // This is the number of rows that we have to pad on the right if the display // width is wider than the image width +#if 0 // Not used nxgl_coord_t nRightPad; if (nLeftPixels >= rect.getWidth()) { @@ -244,6 +245,7 @@ void CImage::drawContents(CGraphicsPort *port) { nRightPad = rect.getWidth() - nLeftPixels; } +#endif // Apply the padding to the right hand side diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 853132008..8bf570f74 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -278,6 +278,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) vdbg("Listener started\n"); +#ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT // Initialize the touchscreen device int ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO); @@ -288,6 +289,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) sem_post(&This->m_waitSem); return (FAR void *)0; } +#endif // Open the touchscreen device that we just created. From 31f053187a304970485fa017ed5de763242c2f52 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Dec 2013 12:48:11 -0600 Subject: [PATCH 159/390] The user-mode work queue was not being started --- libnxwidgets/src/ccallback.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index b7cd31161..488016162 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -145,7 +145,6 @@ void CCallback::position(NXHANDLE hwnd, bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y, arg); - // The argument must be the CCallback instance CCallback *This = (CCallback *)arg; From b7a4546de2fa78862890dfea045ecfc533a92402 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 29 Jan 2014 14:41:18 -0600 Subject: [PATCH 160/390] Preparation for NuttX-6.33 release (maybe tomorrow) --- ChangeLog.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 81504c194..4de525ea4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -403,14 +403,14 @@ * Kconfig and UnitTests/nxwm: Add logic to enable saving and recovering touchscreen calibration data. This depends upon having platform-dependent - support for storate of configuration data. Portions suggested by + support for storage of configuration data. Portions suggested by Ken Pettit (2013-10-30). * NxWM:Calibration: Saving of calibration data must be performed in CCalibration, not in UnitTests/nxwm. Why? Because the touchscreen calibration could also be initiated from other ways other than through the one-time, start-up initialization logic (2013-10-30). -1.11 2014-xx-xx Gregory Nutt +1.11 2014-01-30 Gregory Nutt * NxWidgets/Kconfig and NxWidgets::CNxServer: Server initialization can now be disabled in the configuration (in fact, it is disabled by default). @@ -424,3 +424,5 @@ thread. This is necessary if the kernel mode build is used: In that case, the touchscreen must be initialized in kernel space before NxWM is started (2013-12-30). + +1.12 2014-xx-xx Gregory Nutt From 2527f728f4efb60125d509e244be404bc74085bc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Jan 2014 09:45:01 -0600 Subject: [PATCH 161/390] Final prep for 6.33 release --- ReleaseNotes.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 316949e0f..69d240ad7 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -351,8 +351,8 @@ Bugfixes: (There are no bugfixes recorded for this release). -NxWidgets-1.9 -============= +NxWidgets-1.10 +============== The 11th release of the NxWidgets package was made on December 7, 2013. This release depends on NuttX-6.26 or above and should not be used with older @@ -364,3 +364,17 @@ Additional new features and extended functionality in Version 1.10: recovering touchscreen calibration data. This depends upon having platform-dependent support for storage of configuration data. Portions suggested by Ken Pettit. + +NxWidgets-1.11 +============== + +The 12th release of the NxWidgets package was made on January 20, 2014. This +release depends on NuttX-6.33 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.11: + +* Primarily changes associated with the NuttX kernel build where the + graphics application lies in user space and the graphics server lies in + protected kernel space. This change is mostly a matter of repartitioning + functionality and should not cause in any functional differences. From 5cef1de5a2396704add7062a003604438bf8cca2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 7 Mar 2014 14:17:59 -0600 Subject: [PATCH 162/390] Update README.txt, remove references to appconfig and apps/.config --- UnitTests/README.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 9952af012..3e5a21e7c 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -11,8 +11,9 @@ Contents a) Configure NuttX b) Enable C++ Support c) Enable Debug Options - d) Other Possible nuttx/.config changes - e) Other Possible apps/.config changes + d) NxWM + e) Other Possible .config file changes + f) Other Possible .config file changes 2. Configure in the Selected Unit Test o Work-Arounds 1. Build Issues @@ -65,7 +66,7 @@ Installing and Building the Unit Tests b) Enable C++ Support If you are not using the sim/nsh2 or stm3210e-eval, you will need to add - the following definitions to the nuttx configuration at nuttx/.config to + the following definitions to the NuttX configuration at nuttx/.config to enable C++ support: CONFIG_HAVE_CXX=y @@ -74,7 +75,7 @@ Installing and Building the Unit Tests writing *ONLY* the sim/nsh2 and stm321-e-eval configurations have C++ support pre-enabled). - d) Enable Debug Options + c) Enable Debug Options If you are running on a simulated target, then you might also want to enable debug symbols: @@ -84,12 +85,12 @@ Installing and Building the Unit Tests Then you can run the simulation using GDB or DDD which is a very powerful debugging environment! - e) Special configuration requirements for the nxwm unit test: + d) Special configuration requirements for the nxwm unit test: CONFIG_NXCONSOLE=y CONFIG_NX_MULTIUSER=y - f) Other nuttx/.config changes -- NSH configurations only. + e) Other .config file changes -- NSH configurations only. If the configuration that you are using supports NSH and NSH built-in tasks then all is well. If it is an NSH configuration, then you will have to define @@ -101,7 +102,7 @@ Installing and Building the Unit Tests to change anything further in the nuttx/.config file if you are using either of these configurations. - g) Other apps/.config changes -- NON-NSH configurations only. + f) Other .config file changes -- NON-NSH configurations only. Entry Point. You will need to set the entry point in the .config file. For NSH configurations, the entry point will always be "nsh_main" and you @@ -123,24 +124,23 @@ Installing and Building the Unit Tests etc. For non-NSH configurations (such as the sim/touchscreen) you will have to - remove the CONFIGURED_APPS seting that contains the user_start function so - that you use the user_start in the unit test code instead. So, for example, + remove the configuration setting that provided the "main" function so + that you use the "main" in the unit test code instead. So, for example, with the sim/touchscreen configuration you need to remove the following from - the apps/.config file: + the NuttX configuration file (.config): - CONFIGURED_APPS += examples/ ## REMOVE + CONFIG_EXAMPLES_TOUSCHCREEN=y ## REMOVE (provided "tc_main") The following step will then install the new, correct directory containing the user_start function for the selected unit test. If you see that NSH is configured: - CONFIGURED_APPS += examples/nsh ## DO NOT REMOVE + CONFIG_EXAMPLES_NSH=y ## DO NOT REMOVE - Then DO NOT REMOVE the CONFIGURED_APPS setting. Go back and re-read c) - above. Do either c) or d). Don't do both! + Then go back and re-read e) above. - sim/nsh2 and stm3210e-eval/nsh2 both NSH configurations. You do not need - to change anything further in the apps/.config file for any NSH configuration. + sim/nsh2 and stm3210e-eval/nsh2 are both NSH configurations. You do not need + to change anything further in the .config file for any NSH configuration. 2. Configure/Install the Selected Unit Test @@ -321,7 +321,7 @@ Example $ ./configure.sh sim/nsh2 $ cd - -2. Edit nuttx/.config to enable C++ support +2. Edit the NuttX .config file to enable C++ support Do nothing... sim/nsh2 already has C++ support enabled. From 183012b6b4a68650798561774e4ac53d87d21a91 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 15 Mar 2014 10:05:18 -0600 Subject: [PATCH 163/390] Prep for NuttX 7.1 release --- ChangeLog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4de525ea4..6f2259867 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -426,3 +426,4 @@ (2013-12-30). 1.12 2014-xx-xx Gregory Nutt + From df6e0bd33a87e97c0151e709d30f0fe982d25adc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Apr 2014 16:26:44 -0600 Subject: [PATCH 164/390] More trailing whilespace removal --- Doxygen/gendoc.sh | 2 +- README.txt | 2 +- TODO.txt | 6 +- UnitTests/CButton/Makefile | 2 +- UnitTests/CButtonArray/Makefile | 2 +- UnitTests/CButtonArray/cbuttonarray_main.cxx | 8 +- UnitTests/CCheckBox/Makefile | 2 +- UnitTests/CGlyphButton/Makefile | 2 +- UnitTests/CImage/Makefile | 2 +- UnitTests/CKeypad/Makefile | 2 +- UnitTests/CKeypad/ckeypad_main.cxx | 6 +- UnitTests/CKeypad/ckeypadtest.cxx | 4 +- UnitTests/CLabel/Makefile | 2 +- UnitTests/CLatchButton/Makefile | 2 +- UnitTests/CLatchButtonArray/Makefile | 2 +- .../clatchbuttonarray_main.cxx | 8 +- UnitTests/CListBox/Makefile | 2 +- UnitTests/CListBox/clistbox_main.cxx | 2 +- UnitTests/CProgressBar/Makefile | 2 +- UnitTests/CRadioButton/Makefile | 2 +- UnitTests/CRadioButton/cradiobuttontest.cxx | 2 +- UnitTests/CScrollbarHorizontal/Makefile | 2 +- UnitTests/CScrollbarVertical/Makefile | 2 +- UnitTests/CSliderHorizonal/Makefile | 2 +- UnitTests/CSliderVertical/Makefile | 2 +- UnitTests/CTextBox/Makefile | 2 +- UnitTests/CTextBox/ctextbox_main.cxx | 2 +- UnitTests/README.txt | 22 +- UnitTests/TestStatus.txt | 118 +-- UnitTests/nxwm/Makefile | 2 +- libnxwidgets/COPYING | 2 +- libnxwidgets/include/cbgwindow.hxx | 16 +- libnxwidgets/include/cbitmap.hxx | 8 +- libnxwidgets/include/cbutton.hxx | 8 +- libnxwidgets/include/cbuttonarray.hxx | 10 +- libnxwidgets/include/ccheckbox.hxx | 6 +- libnxwidgets/include/ccyclebutton.hxx | 12 +- .../include/cglyphsliderhorizontal.hxx | 10 +- .../include/cglyphsliderhorizontalgrip.hxx | 10 +- libnxwidgets/include/cgraphicsport.hxx | 10 +- libnxwidgets/include/ckeypad.hxx | 8 +- libnxwidgets/include/clatchbutton.hxx | 6 +- libnxwidgets/include/clatchbuttonarray.hxx | 6 +- libnxwidgets/include/clistbox.hxx | 12 +- libnxwidgets/include/clistboxdataitem.hxx | 360 +++---- libnxwidgets/include/clistdata.hxx | 702 ++++++------- libnxwidgets/include/clistdataeventargs.hxx | 242 ++--- libnxwidgets/include/clistdataitem.hxx | 378 +++---- libnxwidgets/include/cmultilinetextbox.hxx | 10 +- libnxwidgets/include/cnumericedit.hxx | 24 +- libnxwidgets/include/cnxfont.hxx | 16 +- libnxwidgets/include/cnxserver.hxx | 4 +- libnxwidgets/include/cnxtkwindow.hxx | 12 +- libnxwidgets/include/cnxtoolbar.hxx | 12 +- libnxwidgets/include/cnxwidget.hxx | 34 +- libnxwidgets/include/cnxwindow.hxx | 12 +- libnxwidgets/include/cprogressbar.hxx | 10 +- libnxwidgets/include/cradiobutton.hxx | 8 +- libnxwidgets/include/cradiobuttongroup.hxx | 6 +- libnxwidgets/include/crect.hxx | 4 +- libnxwidgets/include/crlepalettebitmap.hxx | 8 +- libnxwidgets/include/cscaledbitmap.hxx | 2 +- libnxwidgets/include/cscrollbarhorizontal.hxx | 8 +- libnxwidgets/include/cscrollbarvertical.hxx | 10 +- libnxwidgets/include/cscrollinglistbox.hxx | 10 +- libnxwidgets/include/cscrollingpanel.hxx | 16 +- libnxwidgets/include/cscrollingtextbox.hxx | 20 +- libnxwidgets/include/csliderhorizontal.hxx | 10 +- .../include/csliderhorizontalgrip.hxx | 16 +- libnxwidgets/include/cslidervertical.hxx | 8 +- libnxwidgets/include/csliderverticalgrip.hxx | 12 +- libnxwidgets/include/cstickybutton.hxx | 8 +- libnxwidgets/include/cstickybuttonarray.hxx | 6 +- libnxwidgets/include/cstringiterator.hxx | 6 +- libnxwidgets/include/ctabpanel.hxx | 20 +- libnxwidgets/include/ctext.hxx | 14 +- libnxwidgets/include/ctextbox.hxx | 8 +- libnxwidgets/include/cwidgeteventargs.hxx | 4 +- libnxwidgets/include/cwidgeteventhandler.hxx | 12 +- .../include/cwidgeteventhandlerlist.hxx | 12 +- libnxwidgets/include/cwidgetstyle.hxx | 270 ++--- libnxwidgets/include/cwindoweventhandler.hxx | 14 +- .../include/cwindoweventhandlerlist.hxx | 12 +- libnxwidgets/include/glyphs.hxx | 2 +- libnxwidgets/include/ilistbox.hxx | 8 +- .../include/ilistdataeventhandler.hxx | 8 +- libnxwidgets/include/inxwindow.hxx | 8 +- libnxwidgets/include/iscrollable.hxx | 14 +- libnxwidgets/include/islider.hxx | 6 +- libnxwidgets/include/itextbox.hxx | 8 +- libnxwidgets/include/nxconfig.hxx | 2 +- libnxwidgets/include/singletons.hxx | 6 +- libnxwidgets/include/teventargs.hxx | 10 +- libnxwidgets/include/tnxarray.hxx | 10 +- libnxwidgets/src/cbgwindow.cxx | 12 +- libnxwidgets/src/cbitmap.cxx | 4 +- libnxwidgets/src/cbutton.cxx | 8 +- libnxwidgets/src/cbuttonarray.cxx | 12 +- libnxwidgets/src/ccheckbox.cxx | 2 +- libnxwidgets/src/ccyclebutton.cxx | 12 +- libnxwidgets/src/cglyphsliderhorizontal.cxx | 18 +- .../src/cglyphsliderhorizontalgrip.cxx | 4 +- libnxwidgets/src/cgraphicsport.cxx | 20 +- libnxwidgets/src/ckeypad.cxx | 8 +- libnxwidgets/src/clatchbutton.cxx | 2 +- libnxwidgets/src/clatchbuttonarray.cxx | 2 +- libnxwidgets/src/clistbox.cxx | 20 +- libnxwidgets/src/clistboxdataitem.cxx | 228 ++--- libnxwidgets/src/clistdata.cxx | 924 +++++++++--------- libnxwidgets/src/clistdataitem.cxx | 256 ++--- libnxwidgets/src/cmultilinetextbox.cxx | 8 +- libnxwidgets/src/cnxfont.cxx | 8 +- libnxwidgets/src/cnxstring.cxx | 8 +- libnxwidgets/src/cnxtimer.cxx | 2 +- libnxwidgets/src/cnxtoolbar.cxx | 4 +- libnxwidgets/src/cnxwidget.cxx | 20 +- libnxwidgets/src/cnxwindow.cxx | 6 +- libnxwidgets/src/cprogressbar.cxx | 8 +- libnxwidgets/src/cradiobutton.cxx | 2 +- libnxwidgets/src/cradiobuttongroup.cxx | 2 +- libnxwidgets/src/crect.cxx | 4 +- libnxwidgets/src/crlepalettebitmap.cxx | 2 +- libnxwidgets/src/cscaledbitmap.cxx | 4 +- libnxwidgets/src/cscrollbarhorizontal.cxx | 8 +- libnxwidgets/src/cscrollbarvertical.cxx | 6 +- libnxwidgets/src/cscrollinglistbox.cxx | 2 +- libnxwidgets/src/cscrollingpanel.cxx | 14 +- libnxwidgets/src/cscrollingtextbox.cxx | 4 +- libnxwidgets/src/csliderhorizontal.cxx | 12 +- libnxwidgets/src/csliderhorizontalgrip.cxx | 2 +- libnxwidgets/src/cslidervertical.cxx | 12 +- libnxwidgets/src/csliderverticalgrip.cxx | 2 +- libnxwidgets/src/cstickybutton.cxx | 2 +- libnxwidgets/src/cstickybuttonarray.cxx | 6 +- libnxwidgets/src/cstringiterator.cxx | 6 +- libnxwidgets/src/ctabpanel.cxx | 10 +- libnxwidgets/src/ctext.cxx | 52 +- libnxwidgets/src/ctextbox.cxx | 22 +- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 6 +- libnxwidgets/src/cwindoweventhandlerlist.cxx | 4 +- libnxwidgets/src/glyph_arrowdown.cxx | 2 +- libnxwidgets/src/glyph_arrowleft.cxx | 2 +- libnxwidgets/src/glyph_arrowright.cxx | 2 +- libnxwidgets/src/glyph_arrowup.cxx | 2 +- libnxwidgets/src/glyph_backspace.cxx | 2 +- libnxwidgets/src/glyph_capslock.cxx | 2 +- libnxwidgets/src/glyph_checkboxmu.cxx | 2 +- libnxwidgets/src/glyph_checkboxoff.cxx | 2 +- libnxwidgets/src/glyph_checkboxon.cxx | 2 +- libnxwidgets/src/glyph_control.cxx | 2 +- libnxwidgets/src/glyph_cycle.cxx | 2 +- libnxwidgets/src/glyph_nxlogo160x160.cxx | 6 +- libnxwidgets/src/glyph_nxlogo320x320.cxx | 4 +- libnxwidgets/src/glyph_radiobuttonmu.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonoff.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonon.cxx | 2 +- libnxwidgets/src/glyph_return.cxx | 2 +- libnxwidgets/src/glyph_screendepthdown.cxx | 2 +- libnxwidgets/src/glyph_screendepthup.cxx | 2 +- libnxwidgets/src/glyph_screenflipdown.cxx | 2 +- libnxwidgets/src/glyph_screenflipup.cxx | 2 +- libnxwidgets/src/glyph_shift.cxx | 2 +- libnxwidgets/src/glyph_windowclose.cxx | 2 +- libnxwidgets/src/glyph_windowdepthdown.cxx | 2 +- libnxwidgets/src/glyph_windowdepthup.cxx | 2 +- libnxwidgets/src/singletons.cxx | 4 +- nxwm/COPYING | 10 +- nxwm/include/capplicationwindow.hxx | 2 +- nxwm/include/cfullscreenwindow.hxx | 2 +- nxwm/include/chexcalculator.hxx | 2 +- nxwm/include/ckeyboard.hxx | 2 +- nxwm/include/cmediaplayer.hxx | 2 +- nxwm/include/cnxconsole.hxx | 2 +- nxwm/include/cstartwindow.hxx | 6 +- nxwm/include/ctouchscreen.hxx | 4 +- nxwm/include/iapplication.hxx | 2 +- nxwm/include/iapplicationwindow.hxx | 4 +- nxwm/include/nxwmglyphs.hxx | 2 +- nxwm/src/chexcalculator.cxx | 12 +- nxwm/src/cnxconsole.cxx | 4 +- nxwm/src/ctouchscreen.cxx | 8 +- nxwm/src/glyph_calculator.cxx | 4 +- nxwm/src/glyph_calibration.cxx | 4 +- nxwm/src/glyph_cmd.cxx | 4 +- nxwm/src/glyph_minimize.cxx | 4 +- nxwm/src/glyph_mplayer_controls.cxx | 174 ++-- nxwm/src/glyph_nsh.cxx | 4 +- nxwm/src/glyph_play24x24.cxx | 4 +- nxwm/src/glyph_start.cxx | 4 +- nxwm/src/glyph_stop.cxx | 4 +- tools/bitmap_converter.py | 42 +- 191 files changed, 2458 insertions(+), 2458 deletions(-) diff --git a/Doxygen/gendoc.sh b/Doxygen/gendoc.sh index 0132f8162..8d6b6ec28 100755 --- a/Doxygen/gendoc.sh +++ b/Doxygen/gendoc.sh @@ -75,7 +75,7 @@ doxygen "${DOXYFILE}" || \ { echo "Failed to run doxygen"; \ exit 1; - + } cp -rf html "${DOXYGENOUTPUT_DIR}" || \ diff --git a/README.txt b/README.txt index 81f100d3d..635bbbea6 100644 --- a/README.txt +++ b/README.txt @@ -62,7 +62,7 @@ Kconfig libnxwidgets The source code, header files, and build environment for NxWidgets is - provided in this directory. + provided in this directory. UnitTests diff --git a/TODO.txt b/TODO.txt index b767f3536..1c4632d27 100644 --- a/TODO.txt +++ b/TODO.txt @@ -82,7 +82,7 @@ o NxConsole Issues will go to one NxConsole instance and the next character goes to a different instance. That is correct behavior within the current design, but not very usable. We need a mechanism to - assure that the top window is the one that receives all + assure that the top window is the one that receives all eyboard input. NX already provides this capability with its nx_kbdin interface(), but that is not currently used. At present, NxConsoles get their input from /dev/console which is the serial @@ -92,10 +92,10 @@ o NxConsole Issues SVN version 4755). The fixed version is available in SVN but won't be in a released version until NxWidgets-1.2 is released. Priority: Medium high, basically prohibits the use of multiple NSH windows. - + Title: CLOSING AN NxCONSOLE Description: If you open multiple NxConsole applications, they all receive - serial input (as noted in the previous bug). However, if + serial input (as noted in the previous bug). However, if you close one of the NxConsoles, then the others no longer received input (or no long generate output -- that cannot be distinguished). diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 1547c705e..4b31857a1 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 535ceb948..22d2390c3 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CButtonArray/cbuttonarray_main.cxx b/UnitTests/CButtonArray/cbuttonarray_main.cxx index 824ae22c4..b9bb47a4b 100644 --- a/UnitTests/CButtonArray/cbuttonarray_main.cxx +++ b/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -67,7 +67,7 @@ static unsigned int g_mmPrevious; static unsigned int g_mmPeak; static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { - "=>", "A", "B", "", "A", "B", "isButtonClicked(clickColumn, clickRow)) { - printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } @@ -304,10 +304,10 @@ int cbuttonarray_main(int argc, char *argv[]) test->poll(buttonArray); if (buttonArray->isButtonClicked(clickColumn, clickRow)) { - printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } - + usleep(500*1000); } } diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index e2f6a051a..bc7c2da6d 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index f0ebfa8b6..4e0975e9b 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index f6416372f..7fc9cd9af 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index ea5b0fb15..28571f2b2 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CKeypad/ckeypad_main.cxx b/UnitTests/CKeypad/ckeypad_main.cxx index 0b246683a..c103da9ed 100644 --- a/UnitTests/CKeypad/ckeypad_main.cxx +++ b/UnitTests/CKeypad/ckeypad_main.cxx @@ -155,7 +155,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) int clickRow; if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf("clickButtons: %s: Button (%d, %d) is clicked\n", + printf("clickButtons: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } @@ -174,10 +174,10 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) test->poll(keypad); if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf("clickButtons: ERROR: Button (%d, %d) is clicked\n", + printf("clickButtons: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } - + usleep(500*1000); } } diff --git a/UnitTests/CKeypad/ckeypadtest.cxx b/UnitTests/CKeypad/ckeypadtest.cxx index 300148cc3..62e01a93c 100644 --- a/UnitTests/CKeypad/ckeypadtest.cxx +++ b/UnitTests/CKeypad/ckeypadtest.cxx @@ -221,7 +221,7 @@ void CKeypadTest::setDisplaySize(void) m_buttonWidth = windowSize.w >> 2; } - + // Lets aim for a height of 7*32 = 224. But lets bump up the number of rows // to allow one for the text box. @@ -340,7 +340,7 @@ void CKeypadTest::showKeypad(CKeypad *keypad) keypad->redraw(); // Then redraw the text box - + m_textbox->enable(); // Un-necessary, the widget is enabled by default m_textbox->enableDrawing(); m_textbox->redraw(); diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 906e4754d..44c21b801 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 131a96f7a..5dde0324c 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index c712142e3..1280727e9 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index 7ffb9cadc..1b038412c 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -67,7 +67,7 @@ static unsigned int g_mmPrevious; static unsigned int g_mmPeak; static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { - "=>", "A", "B", "", "A", "B", "poll(buttonArray); - + // Now it should be un-clicked and latched clicked = false; diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index 5647002d6..b30278cc3 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CListBox/clistbox_main.cxx b/UnitTests/CListBox/clistbox_main.cxx index e97bb8b50..5bbcb1da5 100644 --- a/UnitTests/CListBox/clistbox_main.cxx +++ b/UnitTests/CListBox/clistbox_main.cxx @@ -297,7 +297,7 @@ int clistbox_main(int argc, char *argv[]) message("clistbox_main: %s: %d options de-selected\n", count == 5 ? "OK" : "ERROR", count); updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options"); - + message("clistbox_main: Removing the selected options\n"); for (int i = 0; i < 5; i++) { diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 90e09db72..d05b7311a 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index c64cf008c..a977b4e95 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CRadioButton/cradiobuttontest.cxx b/UnitTests/CRadioButton/cradiobuttontest.cxx index 09b5af8c2..5c1d2966e 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.cxx +++ b/UnitTests/CRadioButton/cradiobuttontest.cxx @@ -212,7 +212,7 @@ CRadioButton *CRadioButtonTest::newRadioButton(void) { // Start the radio button group in the center of the upper, left // quadrant. The initial size is 0,0 and the default style is used. - + nxgl_coord_t groupX = windowSize.w >> 2; nxgl_coord_t groupY = windowSize.h >> 2; diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index cf7bf3724..5a7038790 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 39a5d8528..290e9736c 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index d824ffe93..3d4881d03 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index a0b33a3ac..1fc39d29a 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index 94cddcc9f..3d96662a6 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -87,7 +87,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: .built .PHONY: clean depend context disclean chkcxx chklib diff --git a/UnitTests/CTextBox/ctextbox_main.cxx b/UnitTests/CTextBox/ctextbox_main.cxx index c4f8c65b8..aaa96aff6 100644 --- a/UnitTests/CTextBox/ctextbox_main.cxx +++ b/UnitTests/CTextBox/ctextbox_main.cxx @@ -129,7 +129,7 @@ int ctextbox_main(int argc, char *argv[]) usleep(500*1000); test->injectChars(textbox, sizeof(string2), (FAR const uint8_t*)string2); - + // Clean up and exit sleep(2); diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 3e5a21e7c..97f3eec7c 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -54,7 +54,7 @@ Installing and Building the Unit Tests Where: is the full, absolute path to the NuttX build directory - + If you are using the sim/nsh2 or stm3210e-eval configurations, then skip to step 2 (Hmmm.. better check 1d) too). @@ -64,7 +64,7 @@ Installing and Building the Unit Tests "Unit Test Directories" b) Enable C++ Support - + If you are not using the sim/nsh2 or stm3210e-eval, you will need to add the following definitions to the NuttX configuration at nuttx/.config to enable C++ support: @@ -81,17 +81,17 @@ Installing and Building the Unit Tests enable debug symbols: CONFIG_DEBUG_SYMBOLS=y - + Then you can run the simulation using GDB or DDD which is a very powerful debugging environment! d) Special configuration requirements for the nxwm unit test: - + CONFIG_NXCONSOLE=y CONFIG_NX_MULTIUSER=y e) Other .config file changes -- NSH configurations only. - + If the configuration that you are using supports NSH and NSH built-in tasks then all is well. If it is an NSH configuration, then you will have to define the following in your nuttx/.config file as well (if it is not already defined): @@ -134,7 +134,7 @@ Installing and Building the Unit Tests The following step will then install the new, correct directory containing the user_start function for the selected unit test. If you see that NSH is configured: - + CONFIG_EXAMPLES_NSH=y ## DO NOT REMOVE Then go back and re-read e) above. @@ -148,7 +148,7 @@ Installing and Building the Unit Tests cd /tools ./install.sh - + Where: is the full, absolute path to the NuttX apps/ directory @@ -209,7 +209,7 @@ Build Issues $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe 2. Stack Size Issues with the X11 Simulation - + When you run the NuttX simulation, it uses stacks allocated by NuttX from the NuttX heap. The memory management model is exactly the same in the simulation as it is real, target system. This is good because this produces a higher @@ -375,7 +375,7 @@ Example ./nuttx NuttShell (NSH) NuttX-6.9 - nsh> + nsh> b. Execute NuttX Where: NSH command prompt @@ -401,7 +401,7 @@ Example The I/O with the Linux/Cygwin simulation is blocking. So while NSH is waiting for input nothing can run (see configs/sim/README.txt for more info). One way to make NSH stop asking for input is to sleep. - + nsh> sleep 10 sleep 10 @@ -433,7 +433,7 @@ Example In order to debug, you have to have build with CONFIG_DEBUG_SYMBOLS=y. This setting is preselected in the sim/nsh2 configuration so that you don't have to do anything. - + Then under Linux or in a Cygwin X11 window, you can start the graphic debugger like: diff --git a/UnitTests/TestStatus.txt b/UnitTests/TestStatus.txt index 965f83ef7..25b3feba4 100644 --- a/UnitTests/TestStatus.txt +++ b/UnitTests/TestStatus.txt @@ -1,59 +1,59 @@ -NxWidgets Test Status -===================== - -At this point, the NXWidgets GUI toolkit code complete but still not -completely tested. This is a list of testing issues that still need to be -addressed. - -The following Widgets have been have completed unit testing. The level of -unit testing is, however, superficial. Many features have not yet been -tested: - - - CLabel - - CTextBox - - CButton - - CButtonArray - - CKeypad - - CRadioButton (and CRadioButtonGoup) - - CGlyphButton - - CLatchButton (and CStickyButton) - - CLatchButtonArray (and CStickyButtonArray) - - CCheckBox - - CProgressBar - - CImage - - CSliderHorizontal (and CSliderHorizontalGrip) - - CSliderVertical (and CSliderVerticalGrip) - - CScrollBarHorizontal (except paging buttons) - - CScrollBarVertical (except paging buttons) - -The following components have unit test in place, but do not successfully -pass the test: - - - CListBox (and CListBoxDataItem) which also tests: - o CText - o CList and CListDataItem - o CScrollingPanel - -The following no unit tests (and, hence, are probably non-functional): - - Infrastructure (won't have their own unit tests) - - CScrollBarPanel - - Widgets that need unit tests: - - CCycleButton - - CScrollingTextBox - - CMultiLineTextBox - - CScrollingListBox - -There are things that require testing after all widgets complete their unit -tests as well. As examples: - - - Need to verify that a screen with many widgets works correctly. That - focus is correctly handled when widgets are removed. etc. - - Need to verify that widget with many children work correctly together. - - Need to verfiy that a display with many windows with multiple wigets - per window works okay. - -Most unit-level testing was performed in a simulated environment driven by -simulated mouse and keyboard input. So many features are not tested that -require human interaction ... such grabbing and dragging scrollbars. +NxWidgets Test Status +===================== + +At this point, the NXWidgets GUI toolkit code complete but still not +completely tested. This is a list of testing issues that still need to be +addressed. + +The following Widgets have been have completed unit testing. The level of +unit testing is, however, superficial. Many features have not yet been +tested: + + - CLabel + - CTextBox + - CButton + - CButtonArray + - CKeypad + - CRadioButton (and CRadioButtonGoup) + - CGlyphButton + - CLatchButton (and CStickyButton) + - CLatchButtonArray (and CStickyButtonArray) + - CCheckBox + - CProgressBar + - CImage + - CSliderHorizontal (and CSliderHorizontalGrip) + - CSliderVertical (and CSliderVerticalGrip) + - CScrollBarHorizontal (except paging buttons) + - CScrollBarVertical (except paging buttons) + +The following components have unit test in place, but do not successfully +pass the test: + + - CListBox (and CListBoxDataItem) which also tests: + o CText + o CList and CListDataItem + o CScrollingPanel + +The following no unit tests (and, hence, are probably non-functional): + + Infrastructure (won't have their own unit tests) + - CScrollBarPanel + + Widgets that need unit tests: + - CCycleButton + - CScrollingTextBox + - CMultiLineTextBox + - CScrollingListBox + +There are things that require testing after all widgets complete their unit +tests as well. As examples: + + - Need to verify that a screen with many widgets works correctly. That + focus is correctly handled when widgets are removed. etc. + - Need to verify that widget with many children work correctly together. + - Need to verfiy that a display with many windows with multiple wigets + per window works okay. + +Most unit-level testing was performed in a simulated environment driven by +simulated mouse and keyboard input. So many features are not tested that +require human interaction ... such grabbing and dragging scrollbars. diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 1fa22348e..22fab3194 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -101,7 +101,7 @@ STACKSIZE = 2048 # Common build -VPATH = +VPATH = all: chkcxx chklibnxwidgets chklibnxwm .built .PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm diff --git a/libnxwidgets/COPYING b/libnxwidgets/COPYING index f12e7b82e..58b7b1eb1 100644 --- a/libnxwidgets/COPYING +++ b/libnxwidgets/COPYING @@ -67,4 +67,4 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ********************************************************************************/ - + diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 21b75799d..0b73a01de 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -55,7 +55,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -89,7 +89,7 @@ namespace NXWidgets CWidgetControl *m_widgetControl; /**< The controlling widget for the window */ public: - + /** * Constructor. Obtains the background window from server and wraps * the window as CBgWindow. Creates an uninitialized instance of the @@ -112,13 +112,13 @@ namespace NXWidgets * @param hNxServer Handle to the NX server. * @param widgetControl Controlling widget for this window. */ - + CBgWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl); /** * Destructor. Returns the background window to the server. */ - + virtual ~CBgWindow(void); /** @@ -147,7 +147,7 @@ namespace NXWidgets * * @return True on success, false on any failure. */ - + bool requestPosition(void); /** @@ -174,7 +174,7 @@ namespace NXWidgets * @param pPos The new position of the window. * @return True on success, false on any failure. */ - + bool setPosition(FAR const struct nxgl_point_s *pPos); /** @@ -185,7 +185,7 @@ namespace NXWidgets * @param pSize The new size of the window. * @return True on success, false on any failure. */ - + bool setSize(FAR const struct nxgl_size_s *pSize); /** diff --git a/libnxwidgets/include/cbitmap.hxx b/libnxwidgets/include/cbitmap.hxx index 0fd133303..7e479d8ce 100644 --- a/libnxwidgets/include/cbitmap.hxx +++ b/libnxwidgets/include/cbitmap.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -118,7 +118,7 @@ namespace NXWidgets { protected: const struct SBitmap *m_bitmap; /**< The bitmap that is being managed */ - + /** * Copy constructor is protected to prevent usage. */ diff --git a/libnxwidgets/include/cbutton.hxx b/libnxwidgets/include/cbutton.hxx index 45481387f..f2f192b3e 100644 --- a/libnxwidgets/include/cbutton.hxx +++ b/libnxwidgets/include/cbutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -195,7 +195,7 @@ namespace NXWidgets */ virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the button. * diff --git a/libnxwidgets/include/cbuttonarray.hxx b/libnxwidgets/include/cbuttonarray.hxx index 435fa1080..b45e1ece1 100644 --- a/libnxwidgets/include/cbuttonarray.hxx +++ b/libnxwidgets/include/cbuttonarray.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -53,11 +53,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -140,7 +140,7 @@ namespace NXWidgets */ virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the button. * @@ -149,7 +149,7 @@ namespace NXWidgets */ virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the button. * diff --git a/libnxwidgets/include/ccheckbox.hxx b/libnxwidgets/include/ccheckbox.hxx index 109e7839e..f766108d3 100644 --- a/libnxwidgets/include/ccheckbox.hxx +++ b/libnxwidgets/include/ccheckbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/ccyclebutton.hxx b/libnxwidgets/include/ccyclebutton.hxx index d8a32175e..90bcd8b37 100644 --- a/libnxwidgets/include/ccyclebutton.hxx +++ b/libnxwidgets/include/ccyclebutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -91,11 +91,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -111,7 +111,7 @@ namespace NXWidgets * through its available options. */ - class CCycleButton : public CButton, public IListDataEventHandler + class CCycleButton : public CButton, public IListDataEventHandler { protected: @@ -153,7 +153,7 @@ namespace NXWidgets */ virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the button. * @@ -211,7 +211,7 @@ namespace NXWidgets */ virtual ~CCycleButton(void) { } - + /** * Add a new option to the widget. * diff --git a/libnxwidgets/include/cglyphsliderhorizontal.hxx b/libnxwidgets/include/cglyphsliderhorizontal.hxx index 0540708ea..7f5ea5445 100644 --- a/libnxwidgets/include/cglyphsliderhorizontal.hxx +++ b/libnxwidgets/include/cglyphsliderhorizontal.hxx @@ -73,18 +73,18 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include "csliderhorizontal.hxx" #include "cglyphsliderhorizontalgrip.hxx" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -111,7 +111,7 @@ namespace NXWidgets nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */ bool m_fill; /**< Set true if fill is active */ uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */ - + /** * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full @@ -159,7 +159,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Moves the grip towards the mouse. * diff --git a/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx b/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx index 89e4fb3b9..69d3e1b56 100644 --- a/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx +++ b/libnxwidgets/include/cglyphsliderhorizontalgrip.hxx @@ -73,18 +73,18 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include "csliderhorizontalgrip.hxx" #include "cimage.hxx" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -134,7 +134,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Starts dragging the grip and redraws it. * @@ -175,7 +175,7 @@ namespace NXWidgets nxgl_coord_t vX, nxgl_coord_t vY); public: - + /** * Constructor. * diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index 006a56d51..c5148c8bc 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -98,7 +98,7 @@ namespace NXWidgets class CNxString; class CRect; struct SBitmap; - + /** * CGraphicsPort is the interface between a NXwidget and NX layer. */ @@ -158,7 +158,7 @@ namespace NXWidgets */ const nxgl_coord_t getX(void) const; - + /** * Return the absolute y coordinate of the upper left hand corner of the * underlying window. @@ -363,7 +363,7 @@ namespace NXWidgets void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font, const CNxString &string, int startIndex, int length, nxgl_mxpixel_t color, nxgl_mxpixel_t background); - + /** * Draw an opaque bitmap to the window. * @@ -436,7 +436,7 @@ namespace NXWidgets void copy(nxgl_coord_t sourceX, nxgl_coord_t sourceY, nxgl_coord_t destX, nxgl_coord_t destY, nxgl_coord_t width, nxgl_coord_t height); - + /** * Move a region by a specified distance in two dimensions. * diff --git a/libnxwidgets/include/ckeypad.hxx b/libnxwidgets/include/ckeypad.hxx index 2f2a754d4..2cf51cfb4 100644 --- a/libnxwidgets/include/ckeypad.hxx +++ b/libnxwidgets/include/ckeypad.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -52,11 +52,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -83,7 +83,7 @@ namespace NXWidgets */ void configureKeypadMode(void); - + /** * Copy constructor is protected to prevent usage. */ diff --git a/libnxwidgets/include/clatchbutton.hxx b/libnxwidgets/include/clatchbutton.hxx index c0b37d64b..e7759efa5 100644 --- a/libnxwidgets/include/clatchbutton.hxx +++ b/libnxwidgets/include/clatchbutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/clatchbuttonarray.hxx b/libnxwidgets/include/clatchbuttonarray.hxx index bffeb58a1..27bef1fd7 100644 --- a/libnxwidgets/include/clatchbuttonarray.hxx +++ b/libnxwidgets/include/clatchbuttonarray.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -53,11 +53,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/clistbox.hxx b/libnxwidgets/include/clistbox.hxx index 7afa76920..d4861af8c 100644 --- a/libnxwidgets/include/clistbox.hxx +++ b/libnxwidgets/include/clistbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -92,11 +92,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -147,7 +147,7 @@ namespace NXWidgets */ virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); - + /** * Selects the clicked item and deselects all others. * @@ -175,7 +175,7 @@ namespace NXWidgets inline CListBox(const CListBox &listBox) : CScrollingPanel(listBox) { } public: - + /** * Constructor. * @@ -309,7 +309,7 @@ namespace NXWidgets */ virtual const CListBoxDataItem *getSelectedOption(void) const; - + /** * Sets whether multiple selections are possible or not. * diff --git a/libnxwidgets/include/clistboxdataitem.hxx b/libnxwidgets/include/clistboxdataitem.hxx index 9a1358d39..fdd667d92 100644 --- a/libnxwidgets/include/clistboxdataitem.hxx +++ b/libnxwidgets/include/clistboxdataitem.hxx @@ -1,180 +1,180 @@ -/**************************************************************************** - * include/clistboxdataitem.hxx - * NxWidgets/libnxwidgets/ - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTBOXDATAITEM_HXX -#define __INCLUDE_CLISTBOXDATAITEM_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "clistdataitem.hxx" -#include "cnxstring.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - /** - * Class representing a data item within a ListBox. - */ - - class CListBoxDataItem : public CListDataItem - { - private: - nxwidget_pixel_t m_normalTextColor; /**< Color used for text when not selected. */ - nxwidget_pixel_t m_normalBackColor; /**< Color used for background when not selected. */ - nxwidget_pixel_t m_selectedTextColor; /**< Color used for text when selected. */ - nxwidget_pixel_t m_selectedBackColor; /**< Color used for background when selected. */ - - public: - - /** - * Constructor. - * - * @param text The text to display in the item. - * @param value The value of the item. - * @param normalTextColor Color to draw the text with when not selected. - * @param normalBackColor Color to draw the background with when not selected. - * @param selectedTextColor Color to draw the text with when selected. - * @param selectedBackColor Color to draw the background with when selected. - */ - - CListBoxDataItem(const CNxString &text, const uint32_t value, - const nxwidget_pixel_t normalTextColor, - const nxwidget_pixel_t normalBackColor, - const nxwidget_pixel_t selectedTextColor, - const nxwidget_pixel_t selectedBackColor); - - /** - * Get the color used for text when the item is unselected. - * - * @return The text color when the item is unselected. - */ - - inline nxwidget_pixel_t getNormalTextColor(void) const - { - return m_normalTextColor; - } - - /** - * Get the color used for the background when the item is unselected. - * - * @return The background color when the item is unselected. - */ - - inline nxwidget_pixel_t getNormalBackColor(void) const - { - return m_normalBackColor; - } - - /** - * Get the color used for text when the item is selected. - * - * @return The text color when the item is selected. - */ - - inline nxwidget_pixel_t getSelectedTextColor(void) const - { - return m_selectedTextColor; - } - - /** - * Get the color used for the background when the item is selected. - * - * @return The background color when the item is selected. - */ - - inline nxwidget_pixel_t getSelectedBackColor(void) const - { - return m_selectedBackColor; - } - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CLISTBOXDATAITEM_HXX - +/**************************************************************************** + * include/clistboxdataitem.hxx + * NxWidgets/libnxwidgets/ + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTBOXDATAITEM_HXX +#define __INCLUDE_CLISTBOXDATAITEM_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "clistdataitem.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a data item within a ListBox. + */ + + class CListBoxDataItem : public CListDataItem + { + private: + nxwidget_pixel_t m_normalTextColor; /**< Color used for text when not selected. */ + nxwidget_pixel_t m_normalBackColor; /**< Color used for background when not selected. */ + nxwidget_pixel_t m_selectedTextColor; /**< Color used for text when selected. */ + nxwidget_pixel_t m_selectedBackColor; /**< Color used for background when selected. */ + + public: + + /** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + + CListBoxDataItem(const CNxString &text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor); + + /** + * Get the color used for text when the item is unselected. + * + * @return The text color when the item is unselected. + */ + + inline nxwidget_pixel_t getNormalTextColor(void) const + { + return m_normalTextColor; + } + + /** + * Get the color used for the background when the item is unselected. + * + * @return The background color when the item is unselected. + */ + + inline nxwidget_pixel_t getNormalBackColor(void) const + { + return m_normalBackColor; + } + + /** + * Get the color used for text when the item is selected. + * + * @return The text color when the item is selected. + */ + + inline nxwidget_pixel_t getSelectedTextColor(void) const + { + return m_selectedTextColor; + } + + /** + * Get the color used for the background when the item is selected. + * + * @return The background color when the item is selected. + */ + + inline nxwidget_pixel_t getSelectedBackColor(void) const + { + return m_selectedBackColor; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTBOXDATAITEM_HXX + diff --git a/libnxwidgets/include/clistdata.hxx b/libnxwidgets/include/clistdata.hxx index d88abd9fc..81aa1f3f6 100644 --- a/libnxwidgets/include/clistdata.hxx +++ b/libnxwidgets/include/clistdata.hxx @@ -1,351 +1,351 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/clistdata.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATA_HXX -#define __INCLUDE_CLISTDATA_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "tnxarray.hxx" -#include "ilistdataeventhandler.hxx" -#include "clistdataitem.hxx" -#include "cnxstring.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - /** - * Class representing a list of items. Designed to be used by the - * CListBox class, etc, to store its data. Fires events to notify - * listeners when the list changes or a new selection is made. - */ - - class CListData - { - protected: - TNxArray m_items; /**< Collection of list data items. */ - TNxArray m_listDataEventhandlers; /**< Collection of event handlers. */ - bool m_allowMultipleSelections; /**< If true, multiple options can - be selected. */ - bool m_sortInsertedItems; /**< Automatically sorts items on - insertion if true. */ - - /** - * Quick sort the items using their compareTo() methods. - * - * @param start The index to start sorting at. - * @param end The index to stop sorting at. - */ - - virtual void quickSort(const int start, const int end); - - /** - * Swap the locations of two items in the array. - * - * @param index1 The index of the first item to swap. - * @param index2 The index of the second item to swap. - */ - - virtual void swapItems(const int index1, const int index2); - - /** - * Return the index that an item should be inserted at to maintain a sorted list of data. - * - * @param item The item to insert. - * @return The index that the item should be imserted into at. - */ - - const int getSortedInsertionIndex(const CListDataItem *item) const; - - /** - * Raise a data changed event. - */ - - void raiseDataChangedEvent(void); - - /** - * Raise a selection changed event. - */ - - void raiseSelectionChangedEvent(void); - - public: - - /** - * Constructor. - */ - CListData(void); - - /** - * Destructor. - */ - virtual ~CListData(void); - - /** - * Add a new item. - * - * @param text Text to show in the option. - * @param value The value of the option. - */ - - virtual void addItem(const CNxString &text, const uint32_t value); - - /** - * Add an existing item. CListData becomes the owner of the option and will delete it - * when the list is deleted. - * - * @param item The item to add. - */ - - virtual void addItem(CListDataItem *item); - - /** - * Remove an item by its index. - * - * @param index The index of the option to remove. - */ - - virtual void removeItem(const int index); - - /** - * Select an item by its index. - * - * @param index The index of the item to select. - */ - - virtual void selectItem(const int index); - - /** - * Deselect an item by its index. - * - * @param index The index of the item to select. - */ - - virtual void deselectItem(const int index); - - /** - * Remove all items. - */ - - virtual void removeAllItems(void); - - /** - * Get the selected index. Returns -1 if nothing is selected. If more than one - * item is selected, the index of the first selected item is returned. - * - * @return The selected index. - */ - - virtual const int getSelectedIndex(void) const; - - /** - * Sets the selected index. Specify -1 to select nothing. Resets any - * other selected items to deselected. - * - * @param index The selected index. - */ - - virtual void setSelectedIndex(const int index); - - /** - * Get the selected item. Returns NULL if nothing is selected. - * - * @return The selected option. - */ - - virtual const CListDataItem *getSelectedItem(void) const; - - /** - * Sets whether multiple selections are possible or not. - * - * @param allowMultipleSelections True to allow multiple selections. - */ - - virtual inline void - setAllowMultipleSelections(const bool allowMultipleSelections) - { - m_allowMultipleSelections = allowMultipleSelections; - } - - /** - * Get the specified item. - * - * @return The specified item. - */ - - virtual inline const CListDataItem *getItem(const int index) const - { - return m_items[index]; - } - - /** - * Sort the items using their compareTo() methods. - */ - - virtual void sort(void); - - /** - * Get the total number of items. - * - * @return The number of items. - */ - - virtual inline const int getItemCount(void) const - { - return m_items.size(); - } - - /** - * Select all items. Does nothing if the list does not allow - * multiple selections. - */ - - virtual void selectAllItems(void); - - /** - * Deselect all items. - */ - - virtual void deselectAllItems(void); - - /** - * Select or deselect an item by its index. Does not deselect any - * other selected items. Set index to -1 to select nothing. - * - * @param index The index of the item to select. - * @param selected True to select the item, false to deselect it. - */ - - virtual void setItemSelected(const int index, const bool selected); - - /** - * Returns whether multiple selections are possible or not. - * - * @return True if multiple selections are allowed. - */ - - virtual inline const bool allowsMultipleSelections(void) const - { - return m_allowMultipleSelections; - } - - /** - * Sets whether or not items added to the list are automatically - * sorted on insert or not. - * - * @param sortInsertedItems True to enable sort on insertion. - */ - - virtual inline void setSortInsertedItems(const bool sortInsertedItems) - { - m_sortInsertedItems = sortInsertedItems; - } - - /** - * Add an event handler. - * - * @param eventHandler The event handler to add. - */ - - inline void addListDataEventHandler(IListDataEventHandler *eventHandler) - { - m_listDataEventhandlers.push_back(eventHandler); - } - - /** - * Remove an event handler. - * - * @param eventHandler The event handler to remove. - */ - - void removeListDataEventHandler(IListDataEventHandler *eventHandler); - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CLISTDATA_HXX +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdata.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATA_HXX +#define __INCLUDE_CLISTDATA_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "tnxarray.hxx" +#include "ilistdataeventhandler.hxx" +#include "clistdataitem.hxx" +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a list of items. Designed to be used by the + * CListBox class, etc, to store its data. Fires events to notify + * listeners when the list changes or a new selection is made. + */ + + class CListData + { + protected: + TNxArray m_items; /**< Collection of list data items. */ + TNxArray m_listDataEventhandlers; /**< Collection of event handlers. */ + bool m_allowMultipleSelections; /**< If true, multiple options can + be selected. */ + bool m_sortInsertedItems; /**< Automatically sorts items on + insertion if true. */ + + /** + * Quick sort the items using their compareTo() methods. + * + * @param start The index to start sorting at. + * @param end The index to stop sorting at. + */ + + virtual void quickSort(const int start, const int end); + + /** + * Swap the locations of two items in the array. + * + * @param index1 The index of the first item to swap. + * @param index2 The index of the second item to swap. + */ + + virtual void swapItems(const int index1, const int index2); + + /** + * Return the index that an item should be inserted at to maintain a sorted list of data. + * + * @param item The item to insert. + * @return The index that the item should be imserted into at. + */ + + const int getSortedInsertionIndex(const CListDataItem *item) const; + + /** + * Raise a data changed event. + */ + + void raiseDataChangedEvent(void); + + /** + * Raise a selection changed event. + */ + + void raiseSelectionChangedEvent(void); + + public: + + /** + * Constructor. + */ + CListData(void); + + /** + * Destructor. + */ + virtual ~CListData(void); + + /** + * Add a new item. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + + virtual void addItem(const CNxString &text, const uint32_t value); + + /** + * Add an existing item. CListData becomes the owner of the option and will delete it + * when the list is deleted. + * + * @param item The item to add. + */ + + virtual void addItem(CListDataItem *item); + + /** + * Remove an item by its index. + * + * @param index The index of the option to remove. + */ + + virtual void removeItem(const int index); + + /** + * Select an item by its index. + * + * @param index The index of the item to select. + */ + + virtual void selectItem(const int index); + + /** + * Deselect an item by its index. + * + * @param index The index of the item to select. + */ + + virtual void deselectItem(const int index); + + /** + * Remove all items. + */ + + virtual void removeAllItems(void); + + /** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * item is selected, the index of the first selected item is returned. + * + * @return The selected index. + */ + + virtual const int getSelectedIndex(void) const; + + /** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected items to deselected. + * + * @param index The selected index. + */ + + virtual void setSelectedIndex(const int index); + + /** + * Get the selected item. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + + virtual const CListDataItem *getSelectedItem(void) const; + + /** + * Sets whether multiple selections are possible or not. + * + * @param allowMultipleSelections True to allow multiple selections. + */ + + virtual inline void + setAllowMultipleSelections(const bool allowMultipleSelections) + { + m_allowMultipleSelections = allowMultipleSelections; + } + + /** + * Get the specified item. + * + * @return The specified item. + */ + + virtual inline const CListDataItem *getItem(const int index) const + { + return m_items[index]; + } + + /** + * Sort the items using their compareTo() methods. + */ + + virtual void sort(void); + + /** + * Get the total number of items. + * + * @return The number of items. + */ + + virtual inline const int getItemCount(void) const + { + return m_items.size(); + } + + /** + * Select all items. Does nothing if the list does not allow + * multiple selections. + */ + + virtual void selectAllItems(void); + + /** + * Deselect all items. + */ + + virtual void deselectAllItems(void); + + /** + * Select or deselect an item by its index. Does not deselect any + * other selected items. Set index to -1 to select nothing. + * + * @param index The index of the item to select. + * @param selected True to select the item, false to deselect it. + */ + + virtual void setItemSelected(const int index, const bool selected); + + /** + * Returns whether multiple selections are possible or not. + * + * @return True if multiple selections are allowed. + */ + + virtual inline const bool allowsMultipleSelections(void) const + { + return m_allowMultipleSelections; + } + + /** + * Sets whether or not items added to the list are automatically + * sorted on insert or not. + * + * @param sortInsertedItems True to enable sort on insertion. + */ + + virtual inline void setSortInsertedItems(const bool sortInsertedItems) + { + m_sortInsertedItems = sortInsertedItems; + } + + /** + * Add an event handler. + * + * @param eventHandler The event handler to add. + */ + + inline void addListDataEventHandler(IListDataEventHandler *eventHandler) + { + m_listDataEventhandlers.push_back(eventHandler); + } + + /** + * Remove an event handler. + * + * @param eventHandler The event handler to remove. + */ + + void removeListDataEventHandler(IListDataEventHandler *eventHandler); + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATA_HXX diff --git a/libnxwidgets/include/clistdataeventargs.hxx b/libnxwidgets/include/clistdataeventargs.hxx index 57118e238..533694bc2 100644 --- a/libnxwidgets/include/clistdataeventargs.hxx +++ b/libnxwidgets/include/clistdataeventargs.hxx @@ -1,121 +1,121 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/clistdataeventargs.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAEVENTARGS_HXX -#define __INCLUDE_CLISTDATAEVENTARGS_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "teventargs.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - class CListData; - - /** - * Event arguments passed to listeners when a CListData object raises an - * event. - */ - - class CListDataEventArgs : public TEventArgs - { - public: - - /** - * Constructor. - * - * @param source Pointer to the CListData object that raised the event. - */ - - inline CListDataEventArgs(CListData *source) : TEventArgs(source) - { - } - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CLISTDATAEVENTARGS_HXX +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdataeventargs.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAEVENTARGS_HXX +#define __INCLUDE_CLISTDATAEVENTARGS_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "teventargs.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CListData; + + /** + * Event arguments passed to listeners when a CListData object raises an + * event. + */ + + class CListDataEventArgs : public TEventArgs + { + public: + + /** + * Constructor. + * + * @param source Pointer to the CListData object that raised the event. + */ + + inline CListDataEventArgs(CListData *source) : TEventArgs(source) + { + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATAEVENTARGS_HXX diff --git a/libnxwidgets/include/clistdataitem.hxx b/libnxwidgets/include/clistdataitem.hxx index db3bb20a2..5cb60f3e7 100644 --- a/libnxwidgets/include/clistdataitem.hxx +++ b/libnxwidgets/include/clistdataitem.hxx @@ -1,189 +1,189 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/clistdataitem.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAITEM_HXX -#define __INCLUDE_CLISTDATAITEM_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -#include "cnxstring.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - /** - * Class representing a data item within a list. Intended for use within - * the CListData class. - */ - - class CListDataItem - { - private: - CNxString m_text; /**< Text to display for option. */ - uint32_t m_value; /**< Option value. */ - bool m_isSelected; /**< True if the option is selected. */ - - public: - - /** - * Constructor. - * - * @param text The text to display in the item. - * @param value The value of the item. - */ - - CListDataItem(const CNxString &text, const uint32_t value); - - /** - * Destructor. - */ - - virtual ~CListDataItem(void); - - /** - * Get the item's text. - * - * @return The item's text. - */ - - inline const CNxString &getText(void) const - { - return m_text; - } - - /** - * Get the item's value. - * - * @return The item's value. - */ - - inline const uint32_t getValue(void) const - { - return m_value; - } - - /** - * Get the item's selection state. - * - * @return True if the item is selected; false if not. - */ - - inline const bool isSelected(void) const - { - return m_isSelected; - } - - /** - * Set the item's selection state. - * - * @param selected True to select the item; false to deselect it. - */ - - inline void setSelected(bool selected) - { - m_isSelected = selected; - } - - /** - * Compare the item with another. Comparison is based on the text of - * the item. Returns 0 if the text in the two items is the same, - * a value less than 0 if this item is less than the argument, and - * a value greater than 0 if this item is greater than the argument. - * - * @param item An item to compare this object with. - * @return 0 if the text in the two items is the same, - * a value less than 0 if this item is less than the argument, and - * a value greater than 0 if this item is greater than the argument. - */ - - virtual int compareTo(const CListDataItem *item) const; - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CLISTDATAITEM_HXX +/**************************************************************************** + * NxWidgets/libnxwidgets/include/clistdataitem.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CLISTDATAITEM_HXX +#define __INCLUDE_CLISTDATAITEM_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cnxstring.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + /** + * Class representing a data item within a list. Intended for use within + * the CListData class. + */ + + class CListDataItem + { + private: + CNxString m_text; /**< Text to display for option. */ + uint32_t m_value; /**< Option value. */ + bool m_isSelected; /**< True if the option is selected. */ + + public: + + /** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + */ + + CListDataItem(const CNxString &text, const uint32_t value); + + /** + * Destructor. + */ + + virtual ~CListDataItem(void); + + /** + * Get the item's text. + * + * @return The item's text. + */ + + inline const CNxString &getText(void) const + { + return m_text; + } + + /** + * Get the item's value. + * + * @return The item's value. + */ + + inline const uint32_t getValue(void) const + { + return m_value; + } + + /** + * Get the item's selection state. + * + * @return True if the item is selected; false if not. + */ + + inline const bool isSelected(void) const + { + return m_isSelected; + } + + /** + * Set the item's selection state. + * + * @param selected True to select the item; false to deselect it. + */ + + inline void setSelected(bool selected) + { + m_isSelected = selected; + } + + /** + * Compare the item with another. Comparison is based on the text of + * the item. Returns 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + * + * @param item An item to compare this object with. + * @return 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + */ + + virtual int compareTo(const CListDataItem *item) const; + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CLISTDATAITEM_HXX diff --git a/libnxwidgets/include/cmultilinetextbox.hxx b/libnxwidgets/include/cmultilinetextbox.hxx index 5ed41740b..e10440cb5 100644 --- a/libnxwidgets/include/cmultilinetextbox.hxx +++ b/libnxwidgets/include/cmultilinetextbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -92,7 +92,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -100,7 +100,7 @@ #if defined(__cplusplus) namespace NXWidgets -{ +{ class CNxTimer; /** @@ -112,7 +112,7 @@ namespace NXWidgets */ class CMultiLineTextBox : public ITextBox, public CScrollingPanel, - public CWidgetEventHandler + public CWidgetEventHandler { public: @@ -281,7 +281,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Starts the dragging system. * diff --git a/libnxwidgets/include/cnumericedit.hxx b/libnxwidgets/include/cnumericedit.hxx index 3de01a4c1..49e378da5 100644 --- a/libnxwidgets/include/cnumericedit.hxx +++ b/libnxwidgets/include/cnumericedit.hxx @@ -74,7 +74,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -89,11 +89,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -135,15 +135,15 @@ namespace NXWidgets virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); virtual void handleClickEvent(const CWidgetEventArgs &e); - + virtual void handleReleaseEvent(const CWidgetEventArgs &e); virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e); - + virtual void handleActionEvent(const CWidgetEventArgs &e); - + virtual void handleDragEvent(const CWidgetEventArgs &e); - + /** * Copy constructor is protected to prevent usage. */ @@ -192,19 +192,19 @@ namespace NXWidgets */ virtual void setFont(CNxFont *font); - + inline int getValue() const { return m_value; } void setValue(int value); - + inline int getMaximum() const { return m_maximum; } inline void setMaximum(int value) { m_maximum = value; setValue(m_value); } - + inline int getMinimum() const { return m_minimum; } inline void setMinimum(int value) { m_minimum = value; setValue(m_value); } - + inline int getIncrement() const { return m_increment; } inline void setIncrement(int value) { m_increment = value; setValue(m_value); } - + }; } diff --git a/libnxwidgets/include/cnxfont.hxx b/libnxwidgets/include/cnxfont.hxx index 33e712291..8f9d7e18c 100644 --- a/libnxwidgets/include/cnxfont.hxx +++ b/libnxwidgets/include/cnxfont.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -111,7 +111,7 @@ namespace NXWidgets * * @return The current drawing color. */ - + inline const nxgl_mxpixel_t getColor() const { return m_fontColor; @@ -133,17 +133,17 @@ namespace NXWidgets * color. * @return The transparent background color. */ - + inline const nxgl_mxpixel_t getTransparentColor() const { return m_transparentColor; } - + /** * Sets the transparent background color to a new value. * @param color The new background color. */ - + inline void setTransparentColor(const nxgl_mxpixel_t color) { m_transparentColor = color; @@ -157,7 +157,7 @@ namespace NXWidgets */ void drawChar(FAR SBitmap *bitmap, nxwidget_char_t letter); - + /** * Get the width of a string in pixels when drawn with this font. * @@ -176,7 +176,7 @@ namespace NXWidgets * @param length The length of the substring in chars. * @return The width of the substring in pixels. */ - + nxgl_coord_t getStringWidth(const CNxString& text, int startIndex, int length) const; @@ -206,7 +206,7 @@ namespace NXWidgets * @param letter The letter to get the height of. * @return The height of the character in pixels. */ - + inline nxgl_coord_t getCharHeight(nxwidget_char_t letter) const; /** diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index f70dbdbdb..380594190 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -59,7 +59,7 @@ /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 16a0bee92..ea18595de 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -55,7 +55,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -118,7 +118,7 @@ namespace NXWidgets /** * Destructor. */ - + ~CNxTkWindow(void); /** @@ -141,7 +141,7 @@ namespace NXWidgets /** * Open a toolbar on the framed window. This method both instantiates - * the toolbar object AND calls the INxWindow::open() method to + * the toolbar object AND calls the INxWindow::open() method to * create the toolbar. The toolbar is ready for use upon return. * * @param height. The height in rows of the tool bar @@ -199,7 +199,7 @@ namespace NXWidgets * @param pos The new position of the window. * @return True on success, false on any failure. */ - + bool setPosition(FAR const struct nxgl_point_s *pos); /** @@ -208,7 +208,7 @@ namespace NXWidgets * @param size The new size of the window. * @return True on success, false on any failure. */ - + bool setSize(FAR const struct nxgl_size_s *size); /** diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index 69a004da5..501067f0d 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -56,7 +56,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -101,14 +101,14 @@ namespace NXWidgets * @param widgetControl Controlling widget for this toolbar. * @param height The height of the toolbar. */ - + CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow, CWidgetControl *pWidgetControl, nxgl_coord_t height); /** * Destructor. */ - + ~CNxToolbar(void); /** @@ -163,7 +163,7 @@ namespace NXWidgets * @param pPos The new position of the toolbar. * @return Always returns false. */ - + bool setPosition(FAR const struct nxgl_point_s *pPos); /** @@ -173,7 +173,7 @@ namespace NXWidgets * @param pPos The new position of the toolbar. * @return Always returns false. */ - + bool setSize(FAR const struct nxgl_size_s *pSize); /** diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index f8c472e75..dd1880cc2 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -74,7 +74,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -95,11 +95,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -192,7 +192,7 @@ namespace NXWidgets CWidgetEventHandlerList *m_widgetEventHandlers; /**< List of event handlers. */ // Double-clicking - + struct timespec m_lastClickTime; /**< System timer when last clicked. */ nxgl_coord_t m_lastClickX; /**< X coordinate of last click. */ nxgl_coord_t m_lastClickY; /**< Y coordinate of last click. */ @@ -281,7 +281,7 @@ namespace NXWidgets */ virtual inline void onClick(nxgl_coord_t x, nxgl_coord_t y) { } - + /** * Called when the widget is double-clicked. Override this when * creating new widgets if the widget should exhibit additional @@ -305,7 +305,7 @@ namespace NXWidgets */ virtual inline void onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { } - + /** * Called just after the widget is released; the widget will be in the * released stated. Override this when creating new widgets if the @@ -316,7 +316,7 @@ namespace NXWidgets */ virtual inline void onRelease(nxgl_coord_t x, nxgl_coord_t y) { } - + /** * Called when the widget is released outside of its boundaries. * Override this when creating new widgets if the widget should exhibit @@ -327,7 +327,7 @@ namespace NXWidgets */ virtual inline void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { } - + /** * Called when the widget is dragged. Override this when creating new * widgets if the widget should exhibit additional behaviour when it is @@ -341,7 +341,7 @@ namespace NXWidgets virtual inline void onDrag(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) { } - + /** * Called when the widget starts being dragged. Override this when * creating new widgets if the widget should exhibit additional @@ -349,7 +349,7 @@ namespace NXWidgets */ virtual inline void onDragStart(void) { } - + /** * Called when the widget stops being dragged. Override this when * creating new widgets if the widget should exhibit additional @@ -357,7 +357,7 @@ namespace NXWidgets */ virtual inline void onDragStop(void) { } - + /** * Called when the widget gains focus. Override this when creating new * widgets if the widget should exhibit additional behaviour when @@ -365,7 +365,7 @@ namespace NXWidgets */ virtual inline void onFocus(void) { } - + /** * Called when the widget loses focus. Override this when creating new * widgets if the widget should exhibit additional behaviour when @@ -381,7 +381,7 @@ namespace NXWidgets */ virtual inline void onEnable(void) { } - + /** * Called when the widget is disabled. Override this when creating new * widgets if the widget should exhibit additional behaviour when @@ -389,7 +389,7 @@ namespace NXWidgets */ virtual inline void onDisable(void) { } - + /** * Called when the widget is resized. Override this when creating new * widgets if the widget should exhibit additional behaviour when @@ -478,7 +478,7 @@ namespace NXWidgets /** * Has the widget been marked for deletion? This function recurses up the widget * hierarchy and only returns true if all of the widgets in the ancestor - * chain are not deleted. + * chain are not deleted. * * Widgets marked for deletion are automatically deleted and should not be * interacted with. @@ -798,11 +798,11 @@ namespace NXWidgets /** * Get the style used by this widget - * + * * @return Const pointer to CWidgetStyle stored inside this widget. */ inline const CWidgetStyle *getWidgetStyle() const { return &m_style; } - + /** * Sets this widget's border state. * diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 50822cc83..780276a5f 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -55,7 +55,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -112,13 +112,13 @@ namespace NXWidgets * @param hNxServer Handle to the NX server. * @param widgetControl Controlling widget for this window. */ - + CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl); /** * Destructor. */ - + ~CNxWindow(void); /** @@ -172,7 +172,7 @@ namespace NXWidgets * @param pPos The new position of the window. * @return True on success, false on any failure. */ - + bool setPosition(FAR const struct nxgl_point_s *pPos); /** @@ -181,7 +181,7 @@ namespace NXWidgets * @param pSize The new size of the window. * @return True on success, false on any failure. */ - + bool setSize(FAR const struct nxgl_size_s *pSize); /** diff --git a/libnxwidgets/include/cprogressbar.hxx b/libnxwidgets/include/cprogressbar.hxx index c75d1eee6..43e2a65bf 100644 --- a/libnxwidgets/include/cprogressbar.hxx +++ b/libnxwidgets/include/cprogressbar.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -86,11 +86,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -191,7 +191,7 @@ namespace NXWidgets inline const int16_t getValue(void) const { - return m_value; + return m_value; } /** @@ -217,7 +217,7 @@ namespace NXWidgets } /** - * Set the value that of the progress bar. + * Set the value that of the progress bar. * * @param value The new value. */ diff --git a/libnxwidgets/include/cradiobutton.hxx b/libnxwidgets/include/cradiobutton.hxx index 4186b8eea..465325ee8 100644 --- a/libnxwidgets/include/cradiobutton.hxx +++ b/libnxwidgets/include/cradiobutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,7 +88,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -107,7 +107,7 @@ namespace NXWidgets * The mu state cannot be enabled by a user - it can only be set by the * developer. */ - + class CRadioButton : public CButton { public: @@ -149,7 +149,7 @@ namespace NXWidgets /** * Destructor. */ - + virtual inline ~CRadioButton() { } /** diff --git a/libnxwidgets/include/cradiobuttongroup.hxx b/libnxwidgets/include/cradiobuttongroup.hxx index c37630c61..52f6aae36 100644 --- a/libnxwidgets/include/cradiobuttongroup.hxx +++ b/libnxwidgets/include/cradiobuttongroup.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -90,7 +90,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -109,7 +109,7 @@ namespace NXWidgets * it is necessary to set the state via the radio button, not the group. */ - class CRadioButtonGroup : public CNxWidget, public CWidgetEventHandler + class CRadioButtonGroup : public CNxWidget, public CWidgetEventHandler { protected: CWidgetControl *m_pWidgetControl; /**< The controlling widget */ diff --git a/libnxwidgets/include/crect.hxx b/libnxwidgets/include/crect.hxx index 7ce233fed..fcfc4136d 100644 --- a/libnxwidgets/include/crect.hxx +++ b/libnxwidgets/include/crect.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -85,7 +85,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ diff --git a/libnxwidgets/include/crlepalettebitmap.hxx b/libnxwidgets/include/crlepalettebitmap.hxx index 1235c80fb..5bf899a09 100644 --- a/libnxwidgets/include/crlepalettebitmap.hxx +++ b/libnxwidgets/include/crlepalettebitmap.hxx @@ -54,11 +54,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -92,7 +92,7 @@ namespace NXWidgets FAR const struct SRlePaletteBitmapEntry *data; }; - + /** * Class providing bitmap accessor for a bitmap represented by SRlePaletteBitmap. */ @@ -141,7 +141,7 @@ namespace NXWidgets */ bool skipPixels(nxgl_coord_t npixels); - + /** Seek to the beginning of the next row * * @return False if this was the last row of the image diff --git a/libnxwidgets/include/cscaledbitmap.hxx b/libnxwidgets/include/cscaledbitmap.hxx index 48afd5306..8cb25ae75 100644 --- a/libnxwidgets/include/cscaledbitmap.hxx +++ b/libnxwidgets/include/cscaledbitmap.hxx @@ -108,7 +108,7 @@ namespace NXWidgets * @param row - The pointer to the row in the row cache to use * @param column - The non-integer column offset * @param outcolor - The returned, interpolated color - * + * */ bool rowColor(FAR uint8_t *row, b16_t column, diff --git a/libnxwidgets/include/cscrollbarhorizontal.hxx b/libnxwidgets/include/cscrollbarhorizontal.hxx index 20ba149fa..f6c3be3c3 100644 --- a/libnxwidgets/include/cscrollbarhorizontal.hxx +++ b/libnxwidgets/include/cscrollbarhorizontal.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -89,11 +89,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -245,7 +245,7 @@ namespace NXWidgets void setPageSize(const nxgl_coord_t pageSize); - /** + /** * Process events fired by the grip. * * @param e The event details. diff --git a/libnxwidgets/include/cscrollbarvertical.hxx b/libnxwidgets/include/cscrollbarvertical.hxx index 974da3378..37649e970 100644 --- a/libnxwidgets/include/cscrollbarvertical.hxx +++ b/libnxwidgets/include/cscrollbarvertical.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -89,11 +89,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -223,7 +223,7 @@ namespace NXWidgets */ void setValue(const nxgl_coord_t value); - + /** * Set the value that of the slider. This will reposition and redraw * the grip. The supplied value should be bitshifted left 16 places. @@ -244,7 +244,7 @@ namespace NXWidgets void setPageSize(const nxgl_coord_t pageSize); - /** + /** * Process events fired by the grip. * * @param e The event details. diff --git a/libnxwidgets/include/cscrollinglistbox.hxx b/libnxwidgets/include/cscrollinglistbox.hxx index ba7090b4b..127dd2015 100644 --- a/libnxwidgets/include/cscrollinglistbox.hxx +++ b/libnxwidgets/include/cscrollinglistbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -92,11 +92,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -136,7 +136,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Destructor. */ @@ -298,7 +298,7 @@ namespace NXWidgets { return m_listbox->getSelectedOption(); } - + /** * Sets whether multiple selections are possible or not. * diff --git a/libnxwidgets/include/cscrollingpanel.hxx b/libnxwidgets/include/cscrollingpanel.hxx index b27176e2f..fc987bbc1 100644 --- a/libnxwidgets/include/cscrollingpanel.hxx +++ b/libnxwidgets/include/cscrollingpanel.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,11 +88,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -152,7 +152,7 @@ namespace NXWidgets virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY); - + /** * Starts the dragging system. * @@ -217,7 +217,7 @@ namespace NXWidgets */ virtual void scroll(int32_t dx, int32_t dy); - + /** * Reposition the panel's scrolling region to the specified coordinates. * @@ -259,7 +259,7 @@ namespace NXWidgets { return m_canvasX; } - + /** * Gets the y coordinate of the virtual canvas. * @@ -281,7 +281,7 @@ namespace NXWidgets { return m_canvasWidth; } - + /** * Gets the height of the virtual canvas. * @@ -353,7 +353,7 @@ namespace NXWidgets { m_canvasWidth = width; } - + /** * Sets the height of the virtual canvas. * diff --git a/libnxwidgets/include/cscrollingtextbox.hxx b/libnxwidgets/include/cscrollingtextbox.hxx index 0d2a1a39d..8aedc09a9 100644 --- a/libnxwidgets/include/cscrollingtextbox.hxx +++ b/libnxwidgets/include/cscrollingtextbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -90,11 +90,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -134,7 +134,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Destructor. */ @@ -240,7 +240,7 @@ namespace NXWidgets */ virtual void appendText(const CNxString &text); - + /** * Remove all characters from the string from the start index onwards. * @@ -336,7 +336,7 @@ namespace NXWidgets */ virtual void insertText(const CNxString &text, const unsigned int index); - + /** * Insert text at the current cursor position. * @@ -368,7 +368,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasX(void) const; - + /** * Gets the y coordinate of the virtual canvas. * @@ -384,7 +384,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasWidth(void) const; - + /** * Gets the height of the virtual canvas. * @@ -401,7 +401,7 @@ namespace NXWidgets */ virtual void scroll(int32_t dx, int32_t dy); - + /** * Reposition the panel's scrolling region to the specified coordinates. * @@ -434,7 +434,7 @@ namespace NXWidgets */ virtual void setCanvasWidth(const int32_t width); - + /** * Sets the height of the virtual canvas. * diff --git a/libnxwidgets/include/csliderhorizontal.hxx b/libnxwidgets/include/csliderhorizontal.hxx index f732a1731..ea0c8dc18 100644 --- a/libnxwidgets/include/csliderhorizontal.hxx +++ b/libnxwidgets/include/csliderhorizontal.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,11 +88,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -119,7 +119,7 @@ namespace NXWidgets int32_t m_gutterWidth; /**< Width of the gutter, taking into account any adjustments made to the width of the grip. */ uint32_t m_contentSize; /**< Number of values in the min/max range. */ - + /** * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full @@ -167,7 +167,7 @@ namespace NXWidgets */ virtual void onResize(nxgl_coord_t width, nxgl_coord_t height); - + /** * Moves the grip towards the mouse. * diff --git a/libnxwidgets/include/csliderhorizontalgrip.hxx b/libnxwidgets/include/csliderhorizontalgrip.hxx index 71f10f62c..4543485e1 100644 --- a/libnxwidgets/include/csliderhorizontalgrip.hxx +++ b/libnxwidgets/include/csliderhorizontalgrip.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -86,11 +86,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -102,7 +102,7 @@ namespace NXWidgets * slider. */ - class CSliderHorizontalGrip : public CNxWidget + class CSliderHorizontalGrip : public CNxWidget { protected: @@ -134,7 +134,7 @@ namespace NXWidgets */ virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the grip. * @@ -143,7 +143,7 @@ namespace NXWidgets */ virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the grip. * @@ -152,7 +152,7 @@ namespace NXWidgets */ virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); - + /** * Moves the grip to follow the mouse. * @@ -173,7 +173,7 @@ namespace NXWidgets : CNxWidget(sliderHorizontalGrip) { } public: - + /** * Constructor. * diff --git a/libnxwidgets/include/cslidervertical.hxx b/libnxwidgets/include/cslidervertical.hxx index a1b8651f9..f08010f3c 100644 --- a/libnxwidgets/include/cslidervertical.hxx +++ b/libnxwidgets/include/cslidervertical.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,11 +88,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -293,7 +293,7 @@ namespace NXWidgets */ void setValue(const nxgl_coord_t value); - + /** * Set the value that of the slider. This will reposition and redraw * the grip. The supplied value should be bitshifted left 16 places. diff --git a/libnxwidgets/include/csliderverticalgrip.hxx b/libnxwidgets/include/csliderverticalgrip.hxx index 3ac7fb360..aa246d7ee 100644 --- a/libnxwidgets/include/csliderverticalgrip.hxx +++ b/libnxwidgets/include/csliderverticalgrip.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -86,11 +86,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -134,7 +134,7 @@ namespace NXWidgets */ virtual void onClick(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the grip. * @@ -143,7 +143,7 @@ namespace NXWidgets */ virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y); - + /** * Redraws the grip. * @@ -152,7 +152,7 @@ namespace NXWidgets */ virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y); - + /** * Moves the grip to follow the mouse. * diff --git a/libnxwidgets/include/cstickybutton.hxx b/libnxwidgets/include/cstickybutton.hxx index c51976ec0..46d7f1962 100644 --- a/libnxwidgets/include/cstickybutton.hxx +++ b/libnxwidgets/include/cstickybutton.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -211,7 +211,7 @@ namespace NXWidgets void setStuckDown(bool stuckDown); /** - * Toggles the key's stuck down state. + * Toggles the key's stuck down state. */ inline void toggleStuckDown(void) diff --git a/libnxwidgets/include/cstickybuttonarray.hxx b/libnxwidgets/include/cstickybuttonarray.hxx index 5854c51f0..b82873a75 100644 --- a/libnxwidgets/include/cstickybuttonarray.hxx +++ b/libnxwidgets/include/cstickybuttonarray.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -53,11 +53,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/cstringiterator.hxx b/libnxwidgets/include/cstringiterator.hxx index 648d12633..e0f119d24 100644 --- a/libnxwidgets/include/cstringiterator.hxx +++ b/libnxwidgets/include/cstringiterator.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -92,7 +92,7 @@ namespace NXWidgets { class CNxString; - + /** * Class used to efficiently iterate over the characters in a CNxString * object. The CNxString is a Unicode string that uses the fixed-width @@ -162,7 +162,7 @@ namespace NXWidgets */ bool moveTo(int index); - + /** * Get the current position of the iterator within the string. * diff --git a/libnxwidgets/include/ctabpanel.hxx b/libnxwidgets/include/ctabpanel.hxx index aa6eb20f8..887f66fc0 100644 --- a/libnxwidgets/include/ctabpanel.hxx +++ b/libnxwidgets/include/ctabpanel.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -56,11 +56,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -72,7 +72,7 @@ namespace NXWidgets class CWidgetControl; class CRect; class CStickyButtonArray; - + /** * Tab panel, with tabs at the top and a panel at the bottom. */ @@ -82,12 +82,12 @@ namespace NXWidgets protected: TNxArray m_tabpages; CLatchButtonArray *m_buttonbar; - + virtual void handleActionEvent(const CWidgetEventArgs &e); - + virtual void drawContents(CGraphicsPort* port) {} virtual void drawBorder(CGraphicsPort* port) {} - + public: CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages, nxgl_coord_t x, nxgl_coord_t y, @@ -95,11 +95,11 @@ namespace NXWidgets nxgl_coord_t buttonHeight, FAR const CWidgetStyle *style = (FAR const CWidgetStyle *)NULL ); - + inline CNxWidget &page(uint8_t index) { return *m_tabpages.at(index); } - + void setPageName(uint8_t index, const CNxString &name); - + void showPage(uint8_t index); }; } diff --git a/libnxwidgets/include/ctext.hxx b/libnxwidgets/include/ctext.hxx index a58d32eeb..8f691082d 100644 --- a/libnxwidgets/include/ctext.hxx +++ b/libnxwidgets/include/ctext.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -90,7 +90,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ @@ -105,7 +105,7 @@ namespace NXWidgets * height in pixels, calculate the width of a row, etc. */ - class CText : public CNxString + class CText : public CNxString { private: @@ -119,7 +119,7 @@ namespace NXWidgets int index; uint8_t width; } LongestLine; - + CNxFont *m_font; /**< Font to be used for output */ TNxArray m_linePositions; /**< Array containing start indexes of each wrapped line */ @@ -209,7 +209,7 @@ namespace NXWidgets */ virtual void remove(const int startIndex, const int count); - + /** * Set the vertical spacing between rows of text. * @@ -219,7 +219,7 @@ namespace NXWidgets void setLineSpacing(uint8_t lineSpacing); /** - * Sets the pixel width of the text; text wider than + * Sets the pixel width of the text; text wider than * this will automatically wrap. * * @param width Maximum pixel width of the text. @@ -344,7 +344,7 @@ namespace NXWidgets */ void stripTopLines(const int lines); - + /** * Wrap all of the text. */ diff --git a/libnxwidgets/include/ctextbox.hxx b/libnxwidgets/include/ctextbox.hxx index 32a0ab69f..b91c371a4 100644 --- a/libnxwidgets/include/ctextbox.hxx +++ b/libnxwidgets/include/ctextbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -90,11 +90,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -206,7 +206,7 @@ namespace NXWidgets */ virtual nxgl_coord_t getCursorWidth(void) const; - + /** * Calculate the horizontal position of the string based on its length * and the alignment options. Alignment options are overridden if the diff --git a/libnxwidgets/include/cwidgeteventargs.hxx b/libnxwidgets/include/cwidgeteventargs.hxx index 9aacafa74..d8058b13c 100644 --- a/libnxwidgets/include/cwidgeteventargs.hxx +++ b/libnxwidgets/include/cwidgeteventargs.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -97,7 +97,7 @@ /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/cwidgeteventhandler.hxx b/libnxwidgets/include/cwidgeteventhandler.hxx index 8883fa12d..38c2f2558 100644 --- a/libnxwidgets/include/cwidgeteventhandler.hxx +++ b/libnxwidgets/include/cwidgeteventhandler.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -108,13 +108,13 @@ namespace NXWidgets */ inline CWidgetEventHandler() { } - + /** * Destructor. */ virtual inline ~CWidgetEventHandler() { } - + /** * Handle a mouse button click event. * @@ -128,7 +128,7 @@ namespace NXWidgets * * @param e The event data. */ - + virtual void handleDragEvent(const CWidgetEventArgs &e) { } /** diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx index f0a2f1d72..7d5424365 100644 --- a/libnxwidgets/include/cwidgeteventhandlerlist.hxx +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -87,11 +87,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -116,7 +116,7 @@ namespace NXWidgets * * @param widget The owning widget. */ - + CWidgetEventHandlerList(CNxWidget *widget); /** @@ -124,7 +124,7 @@ namespace NXWidgets */ ~CWidgetEventHandlerList(void) { } - + /** * Check if the object raises events or not. * @@ -161,7 +161,7 @@ namespace NXWidgets * all events raised by this object. * @param eventHandler A pointer to the event handler. */ - + void addWidgetEventHandler(CWidgetEventHandler *eventHandler); /** diff --git a/libnxwidgets/include/cwidgetstyle.hxx b/libnxwidgets/include/cwidgetstyle.hxx index 8fe5e2c32..d4303a472 100644 --- a/libnxwidgets/include/cwidgetstyle.hxx +++ b/libnxwidgets/include/cwidgetstyle.hxx @@ -1,135 +1,135 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/include/cwidgetstyle.hxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETSTYLE_HXX -#define __INCLUDE_CWIDGETSTYLE_HXX - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Implementation Classes - ****************************************************************************/ - -#if defined(__cplusplus) - -namespace NXWidgets -{ - class CNxFont; - - /** - * Class containing all colors that a widget depends on. - */ - - class CWidgetColors - { - public: - nxgl_mxpixel_t background; /**< Color used for a normal background */ - nxgl_mxpixel_t selectedBackground; /**< Color used for a selected background */ - nxgl_mxpixel_t shineEdge; /**< Color used as light bevel edge */ - nxgl_mxpixel_t shadowEdge; /**< Color used as dark bevel edge */ - nxgl_mxpixel_t highlight; /**< Color used as highlighted elements */ - nxgl_mxpixel_t disabledText; /**< Color used for text in a disabled widget */ - nxgl_mxpixel_t enabledText; /**< Color used for text in a enabled widget */ - nxgl_mxpixel_t selectedText; /**< Color used for text in a clicked widget */ - }; - - /** - * Class providing the default colors and fonts for all widgets. This - * information is copied into the widgets when they are constructed, so you - * will need to change these values *before* creating any widgets if you - * want those widgets to use the altered colors. - * - * If the font objects are set, NXWidgets will use them in preference to the - * default system fonts. - */ - - class CWidgetStyle - { - public: - CWidgetColors colors; /**< Default widget colors */ - CNxFont *font; /**< Default font */ - }; -} - -#endif // __cplusplus - -#endif // __INCLUDE_CWIDGETSTYLE_HXX +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cwidgetstyle.hxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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 __INCLUDE_CWIDGETSTYLE_HXX +#define __INCLUDE_CWIDGETSTYLE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CNxFont; + + /** + * Class containing all colors that a widget depends on. + */ + + class CWidgetColors + { + public: + nxgl_mxpixel_t background; /**< Color used for a normal background */ + nxgl_mxpixel_t selectedBackground; /**< Color used for a selected background */ + nxgl_mxpixel_t shineEdge; /**< Color used as light bevel edge */ + nxgl_mxpixel_t shadowEdge; /**< Color used as dark bevel edge */ + nxgl_mxpixel_t highlight; /**< Color used as highlighted elements */ + nxgl_mxpixel_t disabledText; /**< Color used for text in a disabled widget */ + nxgl_mxpixel_t enabledText; /**< Color used for text in a enabled widget */ + nxgl_mxpixel_t selectedText; /**< Color used for text in a clicked widget */ + }; + + /** + * Class providing the default colors and fonts for all widgets. This + * information is copied into the widgets when they are constructed, so you + * will need to change these values *before* creating any widgets if you + * want those widgets to use the altered colors. + * + * If the font objects are set, NXWidgets will use them in preference to the + * default system fonts. + */ + + class CWidgetStyle + { + public: + CWidgetColors colors; /**< Default widget colors */ + CNxFont *font; /**< Default font */ + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CWIDGETSTYLE_HXX diff --git a/libnxwidgets/include/cwindoweventhandler.hxx b/libnxwidgets/include/cwindoweventhandler.hxx index 574c24b55..379ae4725 100644 --- a/libnxwidgets/include/cwindoweventhandler.hxx +++ b/libnxwidgets/include/cwindoweventhandler.hxx @@ -41,15 +41,15 @@ ****************************************************************************/ #include "nxconfig.hxx" - + /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -69,13 +69,13 @@ namespace NXWidgets */ inline CWindowEventHandler() { } - + /** * Destructor. */ virtual inline ~CWindowEventHandler() { } - + /** * Handle a NX window redraw request event */ @@ -85,7 +85,7 @@ namespace NXWidgets /** * Handle a NX window position/size change event */ - + virtual void handleGeometryEvent(void) { } /** @@ -111,7 +111,7 @@ namespace NXWidgets * * @param arg - User provided argument (see nx_block or nxtk_block) */ - + virtual void handleBlockedEvent(FAR void *arg) { } }; } diff --git a/libnxwidgets/include/cwindoweventhandlerlist.hxx b/libnxwidgets/include/cwindoweventhandlerlist.hxx index 035e6a7b9..a076e63cf 100644 --- a/libnxwidgets/include/cwindoweventhandlerlist.hxx +++ b/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -53,11 +53,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -75,7 +75,7 @@ namespace NXWidgets /** * Return the index to the window event handler. */ - + bool findWindowEventHandler(CWindowEventHandler *eventHandler, int &index); public: @@ -85,7 +85,7 @@ namespace NXWidgets * * @param widget The owning widget. */ - + CWindowEventHandlerList(void) { } /** @@ -93,7 +93,7 @@ namespace NXWidgets */ inline ~CWindowEventHandlerList(void) { } - + /** * Get the event handler at the specified index. * @@ -122,7 +122,7 @@ namespace NXWidgets * all events raised by this object. * @param eventHandler A pointer to the event handler. */ - + void addWindowEventHandler(CWindowEventHandler *eventHandler); /** diff --git a/libnxwidgets/include/glyphs.hxx b/libnxwidgets/include/glyphs.hxx index 230db8ff6..6d5c2d4eb 100644 --- a/libnxwidgets/include/glyphs.hxx +++ b/libnxwidgets/include/glyphs.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/include/ilistbox.hxx b/libnxwidgets/include/ilistbox.hxx index 0eb33bc3b..915789952 100644 --- a/libnxwidgets/include/ilistbox.hxx +++ b/libnxwidgets/include/ilistbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -86,11 +86,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Abstract Base Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -218,7 +218,7 @@ namespace NXWidgets */ virtual const CListBoxDataItem *getSelectedOption(void) const = 0; - + /** * Sets whether multiple selections are possible or not. * diff --git a/libnxwidgets/include/ilistdataeventhandler.hxx b/libnxwidgets/include/ilistdataeventhandler.hxx index 26bf1411b..781ce9d52 100644 --- a/libnxwidgets/include/ilistdataeventhandler.hxx +++ b/libnxwidgets/include/ilistdataeventhandler.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Abstract Base Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -99,7 +99,7 @@ namespace NXWidgets * Base IListDataEventHandler class, intended to be subclassed. Any class * that needs to listen for CListData events should inherit from this class. */ - + class IListDataEventHandler { public: diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 210a1e6ce..826d1784e 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -99,7 +99,7 @@ namespace NXWidgets * * @return True if the window was successfully created. */ - + virtual bool open(void) = 0; /** @@ -144,7 +144,7 @@ namespace NXWidgets * @param pPos The new position of the window. * @return True on success, false on failure. */ - + virtual bool setPosition(FAR const struct nxgl_point_s *pPos) = 0; /** @@ -153,7 +153,7 @@ namespace NXWidgets * @param pSize The new size of the window. * @return OK on success; ERROR on failure with errno set appropriately. */ - + virtual bool setSize(FAR const struct nxgl_size_s *pSize) = 0; /** diff --git a/libnxwidgets/include/iscrollable.hxx b/libnxwidgets/include/iscrollable.hxx index b0e65a9db..f82d4ffea 100644 --- a/libnxwidgets/include/iscrollable.hxx +++ b/libnxwidgets/include/iscrollable.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -118,7 +118,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasX(void) const = 0; - + /** * Gets the y coordinate of the virtual canvas. * @@ -134,7 +134,7 @@ namespace NXWidgets */ virtual const int32_t getCanvasWidth(void) const = 0; - + /** * Gets the height of the virtual canvas. * @@ -151,7 +151,7 @@ namespace NXWidgets */ virtual void scroll(int32_t dx, int32_t dy) = 0; - + /** * Repositions the virtual canvas to the specified coordinates. * @@ -200,7 +200,7 @@ namespace NXWidgets */ virtual void setCanvasWidth(const int32_t width) = 0; - + /** * Sets the height of the virtual canvas. * diff --git a/libnxwidgets/include/islider.hxx b/libnxwidgets/include/islider.hxx index 5a9340923..1577e9898 100644 --- a/libnxwidgets/include/islider.hxx +++ b/libnxwidgets/include/islider.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Abstract Base Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/itextbox.hxx b/libnxwidgets/include/itextbox.hxx index 0e2e7b824..291e5ce0e 100644 --- a/libnxwidgets/include/itextbox.hxx +++ b/libnxwidgets/include/itextbox.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,11 +88,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Abstract Base Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -147,7 +147,7 @@ namespace NXWidgets */ virtual void setText(const CNxString &text) = 0; - + /** * Append new text to the end of the current text displayed in the * label. diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 1336ad5e7..c2141775b 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/include/singletons.hxx b/libnxwidgets/include/singletons.hxx index 094808939..2ccbe9f90 100644 --- a/libnxwidgets/include/singletons.hxx +++ b/libnxwidgets/include/singletons.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets diff --git a/libnxwidgets/include/teventargs.hxx b/libnxwidgets/include/teventargs.hxx index c1371be92..2250eef80 100644 --- a/libnxwidgets/include/teventargs.hxx +++ b/libnxwidgets/include/teventargs.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -82,11 +82,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) namespace NXWidgets @@ -103,7 +103,7 @@ namespace NXWidgets T m_source; /**< The object that raised the event */ public: - + /** * Constructor. * @param source The object that raised the event. @@ -119,7 +119,7 @@ namespace NXWidgets */ virtual inline ~TEventArgs() { } - + /** * Get the source object that raised the event. */ diff --git a/libnxwidgets/include/tnxarray.hxx b/libnxwidgets/include/tnxarray.hxx index 44cb537ad..0cb4746f2 100644 --- a/libnxwidgets/include/tnxarray.hxx +++ b/libnxwidgets/include/tnxarray.hxx @@ -73,7 +73,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -84,11 +84,11 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Implementation Classes ****************************************************************************/ - + #if defined(__cplusplus) /** @@ -104,7 +104,7 @@ * the array with large amounts of data. Adding new data to the linked list is * very inexpensive. */ - + template class TNxArray { @@ -286,7 +286,7 @@ void TNxArray::pop_back(void) { // We can just reduce the used size of the array, as the value // will get overwritten automatically - + m_size--; } } diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx index 268bc5d80..2cb3d2389 100644 --- a/libnxwidgets/src/cbgwindow.cxx +++ b/libnxwidgets/src/cbgwindow.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -63,7 +63,7 @@ using namespace NXWidgets; * @param hNxServer Handle to the NX server. * @param widgetControl Controlling widget for this window. */ - + CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hWindow(0), m_widgetControl(pWidgetControl) @@ -76,7 +76,7 @@ CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) /** * Destructor. Returns the background window to the server. */ - + CBgWindow::~CBgWindow(void) { // Release the background. We do not release the widget control @@ -134,7 +134,7 @@ CWidgetControl *CBgWindow::getWidgetControl(void) const * * @return Always returns true. */ - + bool CBgWindow::requestPosition(void) { // The background window is always at {0,0} and the size never changes. @@ -178,7 +178,7 @@ bool CBgWindow::getSize(FAR struct nxgl_size_s *pSize) * @param pPos The new position of the window. * @return Always returns false. */ - + bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos) { // The position of the background cannot be changed @@ -194,7 +194,7 @@ bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos) * @param pSize The new size of the window. * @return Always returns false. */ - + bool CBgWindow::setSize(FAR const struct nxgl_size_s *pSize) { // The position of the background cannot be changed diff --git a/libnxwidgets/src/cbitmap.cxx b/libnxwidgets/src/cbitmap.cxx index c0cf71ea4..1a7294f38 100644 --- a/libnxwidgets/src/cbitmap.cxx +++ b/libnxwidgets/src/cbitmap.cxx @@ -84,7 +84,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Method Implementations ****************************************************************************/ @@ -180,7 +180,7 @@ bool CBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, // is an even multiple of bytes). FAR uint8_t *start = (FAR uint8_t*)m_bitmap->data + - y * m_bitmap->stride + + y * m_bitmap->stride + ((x * m_bitmap->bpp) >> 3); // Get the number of bytes to copy. diff --git a/libnxwidgets/src/cbutton.cxx b/libnxwidgets/src/cbutton.cxx index 429905759..24af6f48d 100644 --- a/libnxwidgets/src/cbutton.cxx +++ b/libnxwidgets/src/cbutton.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -140,12 +140,12 @@ void CButton::drawOutline(CGraphicsPort *port, bool useClicked) { return; } - + // Work out which colors to use nxgl_coord_t color1; nxgl_coord_t color2; - + if (useClicked) { // Bevelled into the screen @@ -160,7 +160,7 @@ void CButton::drawOutline(CGraphicsPort *port, bool useClicked) color1 = getShineEdgeColor(); color2 = getShadowEdgeColor(); } - + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } diff --git a/libnxwidgets/src/cbuttonarray.cxx b/libnxwidgets/src/cbuttonarray.cxx index 28f14062b..4efc99f13 100644 --- a/libnxwidgets/src/cbuttonarray.cxx +++ b/libnxwidgets/src/cbuttonarray.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -51,7 +51,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * CButtonArray Method Implementations ****************************************************************************/ @@ -79,7 +79,7 @@ CButtonArray::CButtonArray(CWidgetControl *pWidgetControl, nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight, CWidgetStyle *style) : CNxWidget(pWidgetControl, x, y, - buttonColumns * buttonWidth + 2, buttonRows * buttonHeight + 2, + buttonColumns * buttonWidth + 2, buttonRows * buttonHeight + 2, 0, style) { // Save configuration @@ -367,7 +367,7 @@ void CButtonArray::drawContents(CGraphicsPort *port) { int column; int row; - + // Just one. Get the row/column indices from the last click (void)posToButton(m_clickX, m_clickY, column, row); @@ -452,7 +452,7 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use if (useClicked || isCursorPosition(column, row)) { // "Selected" text color on unique "Selected" background color - + backColor = getSelectedBackgroundColor(); textColor = getSelectedTextColor(); } @@ -465,7 +465,7 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use } // Pick the border colors. Should we use the 'clicked' button style? - + if (useClicked) { // Yes.. Bevelled into the screen diff --git a/libnxwidgets/src/ccheckbox.cxx b/libnxwidgets/src/ccheckbox.cxx index a6cc9400a..d10e3b410 100644 --- a/libnxwidgets/src/ccheckbox.cxx +++ b/libnxwidgets/src/ccheckbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/ccyclebutton.cxx b/libnxwidgets/src/ccyclebutton.cxx index b4dff685b..c17571830 100644 --- a/libnxwidgets/src/ccyclebutton.cxx +++ b/libnxwidgets/src/ccyclebutton.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -305,7 +305,7 @@ void CCycleButton::getPreferredDimensions(CRect &rect) const void CCycleButton::drawContents(CGraphicsPort *port) { // Get the drawing region (excluding any border) - + CRect rect; getRect(rect); @@ -393,12 +393,12 @@ void CCycleButton::drawOutline(CGraphicsPort *port) { return; } - + // Work out which colors to use nxgl_coord_t color1; nxgl_coord_t color2; - + if (isClicked()) { // Bevelled into the screen @@ -413,7 +413,7 @@ void CCycleButton::drawOutline(CGraphicsPort *port) color1 = getShineEdgeColor(); color2 = getShadowEdgeColor(); } - + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } @@ -447,7 +447,7 @@ void CCycleButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y) } redraw(); - + CButton::onPreRelease(x, y); } diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index 93984e1bc..786cbec9f 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -105,10 +105,10 @@ using namespace NXWidgets; * @param height The height of the slider. */ -CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, - nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t width, nxgl_coord_t height, - IBitmap * pGripBitmap, +CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + IBitmap * pGripBitmap, nxwidget_pixel_t fillColor, bool fill) :CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) { @@ -389,11 +389,11 @@ void CGlyphSliderHorizontal::drawBorder(CGraphicsPort * port) nxwidget_pixel_t shadow; y1 = getY() + (getHeight() >> 1) - (m_barThickness >> 1); - y2 = getY() + (getHeight() >> 1) + m_barThickness - + y2 = getY() + (getHeight() >> 1) + m_barThickness - (m_barThickness >> 1) - 1; // To the Left of the grip. Only draw if the icon isn't covering the - // edge of the bar + // edge of the bar width = gripX - x - halfGripWidth; if (width > 0) @@ -416,7 +416,7 @@ void CGlyphSliderHorizontal::drawBorder(CGraphicsPort * port) } // To the Right of the grip - // Only draw if the icon isn't covering the edge of the bar + // Only draw if the icon isn't covering the edge of the bar width = getWidth() - (gripX - x + gripWidth) - 1 - halfGripWidth; if (width > 0) @@ -434,7 +434,7 @@ void CGlyphSliderHorizontal::drawBorder(CGraphicsPort * port) if (gripX > x + halfGripWidth) { - port->drawVertLine(x + halfGripWidth, y1, m_barThickness, + port->drawVertLine(x + halfGripWidth, y1, m_barThickness, getShineEdgeColor()); } @@ -442,7 +442,7 @@ void CGlyphSliderHorizontal::drawBorder(CGraphicsPort * port) if (gripX + gripWidth < x + getWidth() - 1 - halfGripWidth) { - port->drawVertLine(x + getWidth() - 1 - halfGripWidth, + port->drawVertLine(x + getWidth() - 1 - halfGripWidth, y1, m_barThickness, getShadowEdgeColor()); } } diff --git a/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx index 331ec8d8b..6e7be0af2 100644 --- a/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx @@ -72,7 +72,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include "cglyphsliderhorizontalgrip.hxx" #include "ibitmap.hxx" @@ -100,7 +100,7 @@ CGlyphSliderHorizontalGrip::CGlyphSliderHorizontalGrip(CWidgetControl *pWidgetCo nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, IBitmap *pGripBitmap) -: CImage(pWidgetControl, 0, (height>>1) - (pGripBitmap->getHeight() >> 1), +: CImage(pWidgetControl, 0, (height>>1) - (pGripBitmap->getHeight() >> 1), pGripBitmap->getWidth(), pGripBitmap->getHeight(), pGripBitmap, 0) { diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index 85548a381..cbda90d6e 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -401,7 +401,7 @@ void CGraphicsPort::drawBitmap(nxgl_coord_t x, nxgl_coord_t y, bitmapY * bitmap->stride + ((bitmapX * bitmap->bpp + 7) >> 3); FAR nxwidget_pixel_t *srcPtr = (nxwidget_pixel_t *)srcLine; - + // Loop until all rows have been displayed nxgl_coord_t firstX = x; @@ -552,7 +552,7 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, dest.pt2.y = y; // Convert each row to greyscale and send it to the display - + for (int row = 0; row < height; row++) { // Convert the next row @@ -571,7 +571,7 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, // A truly accurate greyscale conversion would be complex. Let's // just average. - + nxwidget_pixel_t avg = (r + g + b) / 3; *runDest++ = MKRGB(avg, avg, avg); } @@ -679,9 +679,9 @@ void CGraphicsPort::drawText(struct nxgl_point_s *pos, CRect *bound, { nxgl_mxpixel_t savedColor = font->getColor(); font->setColor(color); - + _drawText(pos, bound, font, string, startIndex, length, background, false); - + font->setColor(savedColor); } @@ -727,7 +727,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, background = m_backColor; } #endif - + // Allocate a bit of memory to hold the largest rendered font unsigned int bmWidth = ((unsigned int)font->getMaxWidth() * CONFIG_NXWIDGETS_BPP + 7) >> 3; @@ -740,7 +740,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, struct nxgl_rect_s boundingBox; bound->getNxRect(&boundingBox); - + // Loop setup struct SBitmap bitmap; @@ -796,7 +796,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, // If we have been given a background color, use it to fill the array. // Otherwise initialize the bitmap memory by reading from the display. // The font renderer always renders the fonts on a transparent background. - + if (!transparent) { // Set the glyph memory to the background color @@ -829,7 +829,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, } } - // Adjust the X position for the next character in the string + // Adjust the X position for the next character in the string pos->x += fontWidth; } diff --git a/libnxwidgets/src/ckeypad.cxx b/libnxwidgets/src/ckeypad.cxx index 898885c62..8d9089081 100644 --- a/libnxwidgets/src/ckeypad.cxx +++ b/libnxwidgets/src/ckeypad.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -65,7 +65,7 @@ using namespace NXWidgets; static FAR const char *g_alphaLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = { - "=>", "A", "B", "", "A", "B", "", "0", "1", "", "0", "1", " #include diff --git a/libnxwidgets/src/clatchbuttonarray.cxx b/libnxwidgets/src/clatchbuttonarray.cxx index d8292941b..a96e1546d 100644 --- a/libnxwidgets/src/clatchbuttonarray.cxx +++ b/libnxwidgets/src/clatchbuttonarray.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index a8d3db0a6..d37915e42 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -465,12 +465,12 @@ void CListBox::drawContents(CGraphicsPort *port) // Precalc values for option draw loop nxgl_coord_t optionHeight = getOptionHeight(); - + // Ensure that we subtract 1 from topOption to ensure that the option // above is drawn if it is partially visible int topOption = ((clipY - m_canvasY) / optionHeight) - 1; - + // Ensure that we add 2 to the bottom option to ensure that the option // below is draw if it is partially visible - subbing 1 from topOption // means we need to add an additional 1 to compensate @@ -503,7 +503,7 @@ void CListBox::drawContents(CGraphicsPort *port) while (i <= bottomOption) { item = (const CListBoxDataItem*)m_options.getItem(i); - + // Is the option selected? if (item->isSelected()) @@ -516,13 +516,13 @@ void CListBox::drawContents(CGraphicsPort *port) rect.getWidth(), optionHeight, item->getSelectedBackColor()); } - + // Draw text struct nxgl_point_s pos; pos.x = rect.getX() + m_optionPadding; pos.y = rect.getY() + y + m_optionPadding; - + if (isEnabled()) { port->drawText(&pos, &rect, getFont(), item->getText(), 0, @@ -551,7 +551,7 @@ void CListBox::drawContents(CGraphicsPort *port) struct nxgl_point_s pos; pos.x = rect.getX() + m_optionPadding; pos.y = rect.getY() + y + m_optionPadding; - + if (isEnabled()) { port->drawText(&pos, &rect, getFont(), item->getText(), 0, @@ -602,8 +602,8 @@ void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y) { // Calculate which option was clicked - m_lastSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); - + m_lastSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); + const CListBoxDataItem *item = (const CListBoxDataItem*)m_options.getItem(m_lastSelectedIndex); @@ -637,7 +637,7 @@ void CListBox::onDoubleClick(nxgl_coord_t x, nxgl_coord_t y) { // Calculate which option was clicked - int newSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); + int newSelectedIndex = (-m_canvasY + (y - getY())) / getOptionHeight(); // Double-click - select the item exclusively diff --git a/libnxwidgets/src/clistboxdataitem.cxx b/libnxwidgets/src/clistboxdataitem.cxx index 0ef1b2d25..22a9323bb 100644 --- a/libnxwidgets/src/clistboxdataitem.cxx +++ b/libnxwidgets/src/clistboxdataitem.cxx @@ -1,114 +1,114 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/src/clistboxdataitem.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "cwidgetcontrol.hxx" -#include "clistboxdataitem.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Method Implementations - ****************************************************************************/ - -using namespace NXWidgets; - -/** - * Constructor. - * - * @param text The text to display in the item. - * @param value The value of the item. - * @param normalTextColor Color to draw the text with when not selected. - * @param normalBackColor Color to draw the background with when not selected. - * @param selectedTextColor Color to draw the text with when selected. - * @param selectedBackColor Color to draw the background with when selected. - */ - -CListBoxDataItem::CListBoxDataItem(const CNxString& text, const uint32_t value, - const nxwidget_pixel_t normalTextColor, - const nxwidget_pixel_t normalBackColor, - const nxwidget_pixel_t selectedTextColor, - const nxwidget_pixel_t selectedBackColor) -: CListDataItem(text, value) -{ - m_normalTextColor = normalTextColor; - m_normalBackColor = normalBackColor; - m_selectedTextColor = selectedTextColor; - m_selectedBackColor = selectedBackColor; -} +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistboxdataitem.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "clistboxdataitem.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + * @param normalTextColor Color to draw the text with when not selected. + * @param normalBackColor Color to draw the background with when not selected. + * @param selectedTextColor Color to draw the text with when selected. + * @param selectedBackColor Color to draw the background with when selected. + */ + +CListBoxDataItem::CListBoxDataItem(const CNxString& text, const uint32_t value, + const nxwidget_pixel_t normalTextColor, + const nxwidget_pixel_t normalBackColor, + const nxwidget_pixel_t selectedTextColor, + const nxwidget_pixel_t selectedBackColor) +: CListDataItem(text, value) +{ + m_normalTextColor = normalTextColor; + m_normalBackColor = normalBackColor; + m_selectedTextColor = selectedTextColor; + m_selectedBackColor = selectedBackColor; +} diff --git a/libnxwidgets/src/clistdata.cxx b/libnxwidgets/src/clistdata.cxx index 3b9601fc0..7a02e3e37 100644 --- a/libnxwidgets/src/clistdata.cxx +++ b/libnxwidgets/src/clistdata.cxx @@ -1,462 +1,462 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/src/clistdata.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include - -#include "clistdata.hxx" -#include "ilistdataeventhandler.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Method Implementations - ****************************************************************************/ - -using namespace NXWidgets; - -/** - * Constructor. - */ - -CListData::CListData(void) -{ - m_allowMultipleSelections = true; - m_sortInsertedItems = false; -} - -/** - * Destructor. - */ - -CListData::~CListData(void) -{ - removeAllItems(); -} - -/** - * Add a new item. - * - * @param text Text to show in the option. - * @param value The value of the option. - */ - -void CListData::addItem(const CNxString &text, const uint32_t value) -{ - // Create new option - - addItem(new CListDataItem(text, value)); -} - -/** - * Add an existing item. CListData becomes the owner of the option and will delete it - * when the list is deleted. - * - * @param item The item to add. - */ - -void CListData::addItem(CListDataItem *item) -{ - // Determine insert type - - if (m_sortInsertedItems) - { - // Sorted insert - - m_items.insert(getSortedInsertionIndex(item), item); - } - else - { - // Append - - m_items.push_back(item); - } - - raiseDataChangedEvent(); -} - -/** - * Remove an item by its index. - * - * @param index The index of the option to remove. - */ - -void CListData::removeItem(const int index) -{ - // Bounds check - - if (index < m_items.size()) - { - // Delete the option - - delete m_items[index]; - - // Erase the option from the list - - m_items.erase(index); - raiseDataChangedEvent(); - } -} - -/** - * Select an item by its index. - * - * @param index The index of the item to select. - */ - -void CListData::selectItem(const int index) -{ - setItemSelected(index, true); -} - -/** - * Deselect an item by its index. - * - * @param index The index of the item to select. - */ - -void CListData::deselectItem(const int index) -{ - setItemSelected(index, false); -} - -/** - * Remove all items. - */ - -void CListData::removeAllItems(void) -{ - // Delete all option data - - for (int i = 0; i < m_items.size(); i++) - { - delete m_items[i]; - } - - m_items.clear(); - raiseDataChangedEvent(); -} - -/** - * Get the selected index. Returns -1 if nothing is selected. If more than one - * item is selected, the index of the first selected item is returned. - * - * @return The selected index. - */ - -const int CListData::getSelectedIndex(void) const -{ - // Get the first selected index - - for (int i = 0; i < m_items.size(); i++) - { - if (m_items[i]->isSelected()) - { - return i; - } - } - - return -1; -} - -/** - * Sets the selected index. Specify -1 to select nothing. Resets any - * other selected items to deselected. - * - * @param index The selected index. - */ - -void CListData::setSelectedIndex(const int index) -{ - setItemSelected(index, true); -} - -/** - * Get the selected item. Returns NULL if nothing is selected. - * - * @return The selected option. - */ - -const CListDataItem *CListData::getSelectedItem(void) const -{ - // Get the first selected option - - int index = getSelectedIndex(); - if (index > -1) - { - return m_items[index]; - } - return (CListDataItem *)NULL; -} - -/** - * Sort the items using their compareTo() methods. - */ - -void CListData::sort(void) -{ - quickSort(0, m_items.size() - 1); - raiseDataChangedEvent(); -} - -/** - * Select all items. Does nothing if the list does not allow - * multiple selections. - */ - -void CListData::selectAllItems(void) -{ - if (m_allowMultipleSelections) - { - for (int i = 0; i < m_items.size(); i++) - { - m_items[i]->setSelected(true); - } - - raiseSelectionChangedEvent(); - } -} - -/** - * Deselect all items. - */ - -void CListData::deselectAllItems(void) -{ - for (int i = 0; i < m_items.size(); i++) - { - m_items[i]->setSelected(false); - } - - raiseSelectionChangedEvent(); -} - -/** - * Select or deselect an item by its index. Does not deselect any - * other selected items. Set index to -1 to select nothing. - * - * @param index The index of the item to select. - * @param selected True to select the item, false to deselect it. - */ - -void CListData::setItemSelected(const int index, bool selected) -{ - // Deselect old options if we're making an option selected and - // we're not a multiple list - - if (((!m_allowMultipleSelections) || (index == -1)) && (selected)) - { - for (int i = 0; i < m_items.size(); i++) - { - m_items[i]->setSelected(false); - } - } - - // Select or deselect the new option - - if ((index > -1) && (index < m_items.size())) - { - m_items[index]->setSelected(selected); - } - - raiseSelectionChangedEvent(); -} - -/** - * Remove an event handler. - * - * @param eventHandler The event handler to remove. - */ - -void CListData::removeListDataEventHandler(IListDataEventHandler *eventHandler) -{ - for (int i = 0; i < m_listDataEventhandlers.size(); ++i) - { - if (m_listDataEventhandlers.at(i) == eventHandler) - { - m_listDataEventhandlers.erase(i); - return; - } - } -} - -/** - * Quick sort the items using their compareTo() methods. - * - * @param start The index to start sorting at. - * @param end The index to stop sorting at. - */ - -void CListData::quickSort(const int start, const int end) -{ - if (end > start) - { - int left = start; - int right = end; - - CListDataItem *pivot = m_items[(start + end) >> 1]; - - do - { - while ((pivot->compareTo(m_items[left]) > 0) && (left < end)) - { - left++; - } - - while ((pivot->compareTo(m_items[right]) < 0) && (right > start)) - { - right--; - } - - if (left > right) - { - break; - } - - swapItems(left, right); - left++; - right--; - } - while (left <= right); - - quickSort(start, right); - quickSort(left, end); - } -} - -/** - * Swap the locations of two items in the array. - * - * @param index1 The index of the first item to swap. - * @param index2 The index of the second item to swap. - */ - -void CListData::swapItems(const int index1, const int index2) -{ - CListDataItem *tmp = m_items[index1]; - m_items[index1] = m_items[index2]; - m_items[index2] = tmp; -} - -/** - * Return the index that an item should be inserted at to maintain a sorted list of data. - * - * @param item The item to insert. - * @return The index that the item should be imserted into at. - */ - -const int CListData::getSortedInsertionIndex(const CListDataItem *item) const -{ - int i = 0; - - // Locate slot where new option should go - - while ((i < m_items.size()) && (item->compareTo(m_items[i]) > 0)) - { - i++; - } - return i; -} - -/** - * Raise a data changed event. - */ - -void CListData::raiseDataChangedEvent(void) -{ - CListDataEventArgs eventArgs(this); - - for (int i = 0; i < m_listDataEventhandlers.size(); ++i) - { - m_listDataEventhandlers.at(i)->handleListDataChangedEvent(eventArgs); - } -} - -/** - * Raise a selection changed event. - */ - -void CListData::raiseSelectionChangedEvent(void) -{ - CListDataEventArgs eventArgs(this); - - for (int i = 0; i < m_listDataEventhandlers.size(); ++i) - { - m_listDataEventhandlers.at(i)->handleListDataSelectionChangedEvent(eventArgs); - } -} +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistdata.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "clistdata.hxx" +#include "ilistdataeventhandler.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor. + */ + +CListData::CListData(void) +{ + m_allowMultipleSelections = true; + m_sortInsertedItems = false; +} + +/** + * Destructor. + */ + +CListData::~CListData(void) +{ + removeAllItems(); +} + +/** + * Add a new item. + * + * @param text Text to show in the option. + * @param value The value of the option. + */ + +void CListData::addItem(const CNxString &text, const uint32_t value) +{ + // Create new option + + addItem(new CListDataItem(text, value)); +} + +/** + * Add an existing item. CListData becomes the owner of the option and will delete it + * when the list is deleted. + * + * @param item The item to add. + */ + +void CListData::addItem(CListDataItem *item) +{ + // Determine insert type + + if (m_sortInsertedItems) + { + // Sorted insert + + m_items.insert(getSortedInsertionIndex(item), item); + } + else + { + // Append + + m_items.push_back(item); + } + + raiseDataChangedEvent(); +} + +/** + * Remove an item by its index. + * + * @param index The index of the option to remove. + */ + +void CListData::removeItem(const int index) +{ + // Bounds check + + if (index < m_items.size()) + { + // Delete the option + + delete m_items[index]; + + // Erase the option from the list + + m_items.erase(index); + raiseDataChangedEvent(); + } +} + +/** + * Select an item by its index. + * + * @param index The index of the item to select. + */ + +void CListData::selectItem(const int index) +{ + setItemSelected(index, true); +} + +/** + * Deselect an item by its index. + * + * @param index The index of the item to select. + */ + +void CListData::deselectItem(const int index) +{ + setItemSelected(index, false); +} + +/** + * Remove all items. + */ + +void CListData::removeAllItems(void) +{ + // Delete all option data + + for (int i = 0; i < m_items.size(); i++) + { + delete m_items[i]; + } + + m_items.clear(); + raiseDataChangedEvent(); +} + +/** + * Get the selected index. Returns -1 if nothing is selected. If more than one + * item is selected, the index of the first selected item is returned. + * + * @return The selected index. + */ + +const int CListData::getSelectedIndex(void) const +{ + // Get the first selected index + + for (int i = 0; i < m_items.size(); i++) + { + if (m_items[i]->isSelected()) + { + return i; + } + } + + return -1; +} + +/** + * Sets the selected index. Specify -1 to select nothing. Resets any + * other selected items to deselected. + * + * @param index The selected index. + */ + +void CListData::setSelectedIndex(const int index) +{ + setItemSelected(index, true); +} + +/** + * Get the selected item. Returns NULL if nothing is selected. + * + * @return The selected option. + */ + +const CListDataItem *CListData::getSelectedItem(void) const +{ + // Get the first selected option + + int index = getSelectedIndex(); + if (index > -1) + { + return m_items[index]; + } + return (CListDataItem *)NULL; +} + +/** + * Sort the items using their compareTo() methods. + */ + +void CListData::sort(void) +{ + quickSort(0, m_items.size() - 1); + raiseDataChangedEvent(); +} + +/** + * Select all items. Does nothing if the list does not allow + * multiple selections. + */ + +void CListData::selectAllItems(void) +{ + if (m_allowMultipleSelections) + { + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(true); + } + + raiseSelectionChangedEvent(); + } +} + +/** + * Deselect all items. + */ + +void CListData::deselectAllItems(void) +{ + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(false); + } + + raiseSelectionChangedEvent(); +} + +/** + * Select or deselect an item by its index. Does not deselect any + * other selected items. Set index to -1 to select nothing. + * + * @param index The index of the item to select. + * @param selected True to select the item, false to deselect it. + */ + +void CListData::setItemSelected(const int index, bool selected) +{ + // Deselect old options if we're making an option selected and + // we're not a multiple list + + if (((!m_allowMultipleSelections) || (index == -1)) && (selected)) + { + for (int i = 0; i < m_items.size(); i++) + { + m_items[i]->setSelected(false); + } + } + + // Select or deselect the new option + + if ((index > -1) && (index < m_items.size())) + { + m_items[index]->setSelected(selected); + } + + raiseSelectionChangedEvent(); +} + +/** + * Remove an event handler. + * + * @param eventHandler The event handler to remove. + */ + +void CListData::removeListDataEventHandler(IListDataEventHandler *eventHandler) +{ + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + if (m_listDataEventhandlers.at(i) == eventHandler) + { + m_listDataEventhandlers.erase(i); + return; + } + } +} + +/** + * Quick sort the items using their compareTo() methods. + * + * @param start The index to start sorting at. + * @param end The index to stop sorting at. + */ + +void CListData::quickSort(const int start, const int end) +{ + if (end > start) + { + int left = start; + int right = end; + + CListDataItem *pivot = m_items[(start + end) >> 1]; + + do + { + while ((pivot->compareTo(m_items[left]) > 0) && (left < end)) + { + left++; + } + + while ((pivot->compareTo(m_items[right]) < 0) && (right > start)) + { + right--; + } + + if (left > right) + { + break; + } + + swapItems(left, right); + left++; + right--; + } + while (left <= right); + + quickSort(start, right); + quickSort(left, end); + } +} + +/** + * Swap the locations of two items in the array. + * + * @param index1 The index of the first item to swap. + * @param index2 The index of the second item to swap. + */ + +void CListData::swapItems(const int index1, const int index2) +{ + CListDataItem *tmp = m_items[index1]; + m_items[index1] = m_items[index2]; + m_items[index2] = tmp; +} + +/** + * Return the index that an item should be inserted at to maintain a sorted list of data. + * + * @param item The item to insert. + * @return The index that the item should be imserted into at. + */ + +const int CListData::getSortedInsertionIndex(const CListDataItem *item) const +{ + int i = 0; + + // Locate slot where new option should go + + while ((i < m_items.size()) && (item->compareTo(m_items[i]) > 0)) + { + i++; + } + return i; +} + +/** + * Raise a data changed event. + */ + +void CListData::raiseDataChangedEvent(void) +{ + CListDataEventArgs eventArgs(this); + + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + m_listDataEventhandlers.at(i)->handleListDataChangedEvent(eventArgs); + } +} + +/** + * Raise a selection changed event. + */ + +void CListData::raiseSelectionChangedEvent(void) +{ + CListDataEventArgs eventArgs(this); + + for (int i = 0; i < m_listDataEventhandlers.size(); ++i) + { + m_listDataEventhandlers.at(i)->handleListDataSelectionChangedEvent(eventArgs); + } +} diff --git a/libnxwidgets/src/clistdataitem.cxx b/libnxwidgets/src/clistdataitem.cxx index 036cea61e..4be7d3005 100644 --- a/libnxwidgets/src/clistdataitem.cxx +++ b/libnxwidgets/src/clistdataitem.cxx @@ -1,128 +1,128 @@ -/**************************************************************************** - * NxWidgets/libnxwidgets/src/clistdataitem.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - **************************************************************************** - * - * Portions of this package derive from Woopsi (http://woopsi.org/) and - * portions are original efforts. It is difficult to determine at this - * point what parts are original efforts and which parts derive from Woopsi. - * However, in any event, the work of Antony Dzeryn will be acknowledged - * in most NxWidget files. Thanks Antony! - * - * Copyright (c) 2007-2011, Antony Dzeryn - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include "cwidgetcontrol.hxx" -#include "clistdataitem.hxx" - -/**************************************************************************** - * Pre-Processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Method Implementations - ****************************************************************************/ - -using namespace NXWidgets; -/** - * Constructor. - * - * @param text The text to display in the item. - * @param value The value of the item. - */ - -CListDataItem::CListDataItem(const CNxString &text, const uint32_t value) -{ - m_text = text; - m_value = value; - m_isSelected = false; -} - -/** - * Destructor. - */ - -CListDataItem::~CListDataItem(void) -{ -} - -/** - * Compare the item with another. Comparison is based on the text of - * the item. Returns 0 if the text in the two items is the same, - * a value less than 0 if this item is less than the argument, and - * a value greater than 0 if this item is greater than the argument. - * - * @param item An item to compare this object with. - * @return 0 if the text in the two items is the same, - * a value less than 0 if this item is less than the argument, and - * a value greater than 0 if this item is greater than the argument. - */ - -int CListDataItem::compareTo(const CListDataItem *item) const -{ - return m_text.compareTo(item->getText()); -} +/**************************************************************************** + * NxWidgets/libnxwidgets/src/clistdataitem.cxx + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + **************************************************************************** + * + * Portions of this package derive from Woopsi (http://woopsi.org/) and + * portions are original efforts. It is difficult to determine at this + * point what parts are original efforts and which parts derive from Woopsi. + * However, in any event, the work of Antony Dzeryn will be acknowledged + * in most NxWidget files. Thanks Antony! + * + * Copyright (c) 2007-2011, Antony Dzeryn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the names "Woopsi", "Simian Zombie" 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 Antony Dzeryn ``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 Antony Dzeryn 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "cwidgetcontrol.hxx" +#include "clistdataitem.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; +/** + * Constructor. + * + * @param text The text to display in the item. + * @param value The value of the item. + */ + +CListDataItem::CListDataItem(const CNxString &text, const uint32_t value) +{ + m_text = text; + m_value = value; + m_isSelected = false; +} + +/** + * Destructor. + */ + +CListDataItem::~CListDataItem(void) +{ +} + +/** + * Compare the item with another. Comparison is based on the text of + * the item. Returns 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + * + * @param item An item to compare this object with. + * @return 0 if the text in the two items is the same, + * a value less than 0 if this item is less than the argument, and + * a value greater than 0 if this item is greater than the argument. + */ + +int CListDataItem::compareTo(const CListDataItem *item) const +{ + return m_text.compareTo(item->getText()); +} diff --git a/libnxwidgets/src/cmultilinetextbox.cxx b/libnxwidgets/src/cmultilinetextbox.cxx index df060f037..e7af8f23d 100644 --- a/libnxwidgets/src/cmultilinetextbox.cxx +++ b/libnxwidgets/src/cmultilinetextbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -472,7 +472,7 @@ void CMultiLineTextBox::handleKeyPressEvent(const CWidgetEventArgs &e) // Not modifier; append value insertTextAtCursor(key); - } + } } /** @@ -502,10 +502,10 @@ void CMultiLineTextBox::getCursorCoordinates(nxgl_coord_t &x, nxgl_coord_t &y) c // start of the line uint8_t cursorLineOffset = m_cursorPos - m_text->getLineStartIndex(cursorRow); - + CStringIterator *iterator = m_text->newStringIterator(); iterator->moveTo(m_text->getLineStartIndex(cursorRow)); - + // Sum the width of each char in the row to find the x coordinate for (int i = 0; i < cursorLineOffset; ++i) diff --git a/libnxwidgets/src/cnxfont.cxx b/libnxwidgets/src/cnxfont.cxx index 189cfb9e0..326dd5619 100644 --- a/libnxwidgets/src/cnxfont.cxx +++ b/libnxwidgets/src/cnxfont.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -150,14 +150,14 @@ nxgl_coord_t CNxFont::getStringWidth(const CNxString &text) const if (iter->moveToFirst()) { // moveToFirst returns true if there is at least one character - + do { // Add the width of the font bitmap for this character and // move the the next character nxwidget_char_t ch = iter->getChar(); - + width += getCharWidth(ch); } while (iter->moveToNext()); @@ -178,7 +178,7 @@ nxgl_coord_t CNxFont::getStringWidth(const CNxString &text) const * @param length The length of the substring in chars. * @return The width of the substring in pixels. */ - + nxgl_coord_t CNxFont::getStringWidth(const CNxString &text, int startIndex, int length) const { diff --git a/libnxwidgets/src/cnxstring.cxx b/libnxwidgets/src/cnxstring.cxx index 3ad3855b9..8548de636 100644 --- a/libnxwidgets/src/cnxstring.cxx +++ b/libnxwidgets/src/cnxstring.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -355,7 +355,7 @@ void CNxString::insert(const CNxString &text, int index) delete[] m_text; - // Swap pointers + // Swap pointers m_stringLength = newLength; m_text = newText; @@ -374,7 +374,7 @@ void CNxString::insert(const CNxString &text, int index) // Insert the additional text into the new string dest = &m_text[index]; - src = text.getCharArray(); + src = text.getCharArray(); for (int i = 0; i < text.getLength(); i++) { *dest++ = *src++; @@ -741,7 +741,7 @@ void CNxString::allocateMemory(int nChars, bool preserve) // Do we already have enough memory allocated to contain this new size? // If so, we can avoid deallocating and allocating new memory by re-using the old - + if (nBytesNeeded > m_allocatedSize) { // Not enough space in existing memory; allocate new memory diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index d67cee6e8..d54981570 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -199,7 +199,7 @@ void CNxTimer::workQueueCallback(FAR void *arg) { This->start(); } - + // Raise the action event. This->m_widgetEventHandlers->raiseActionEvent(); diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 725a368fa..3c336f06a 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -184,7 +184,7 @@ bool CNxToolbar::getSize(FAR struct nxgl_size_s *pSize) * @param pPos The new position of the toolbar. * @return Always returns false. */ - + bool CNxToolbar::setPosition(FAR const struct nxgl_point_s *pPos) { return false; @@ -198,7 +198,7 @@ bool CNxToolbar::setPosition(FAR const struct nxgl_point_s *pPos) * @param pSize The new size of the toolbar. * @return Always returns false. */ - + bool CNxToolbar::setSize(FAR const struct nxgl_size_s *pSize) { return false; diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 15ed501e6..4cf7b9b28 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -188,7 +188,7 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, m_doubleClickBounds = DOUBLE_CLICK_BOUNDS; // Set border size to 1 line - + m_borderSize.top = 1; m_borderSize.right = 1; m_borderSize.bottom = 1; @@ -294,7 +294,7 @@ nxgl_coord_t CNxWidget::getRelativeY(void) const /** * Has the widget been marked for deletion? This function recurses up the widget * hierarchy and only returns true if all of the widgets in the ancestor - * chain are not deleted. + * chain are not deleted. * * Widgets marked for deletion are automatically deleted and should not be * interacted with. @@ -495,7 +495,7 @@ void CNxWidget::redraw(void) m_flags.erased = false; // Draw the children of the widget - + drawChildren(); } } @@ -555,7 +555,7 @@ void CNxWidget::close(void) m_flags.deleted = true; m_flags.drawingEnabled = false; - + // Unset clicked widget if necessary CNxWidget *clickedWidget = m_widgetControl->getClickedWidget(); @@ -680,7 +680,7 @@ bool CNxWidget::click(nxgl_coord_t x, nxgl_coord_t y) * @param y Y coordinate of the click. * @return True if the click is a double-click. */ - + bool CNxWidget::isDoubleClick(nxgl_coord_t x, nxgl_coord_t y) { // Check for a double-click @@ -858,7 +858,7 @@ bool CNxWidget::keyPress(nxwidget_char_t key) { return false; } - + // Raise keypress for this widget m_widgetEventHandlers->raiseKeyPressEvent(key); @@ -886,7 +886,7 @@ bool CNxWidget::cursorControl(ECursorControl control) { return false; } - + // Raise cursor control for this widget m_widgetEventHandlers->raiseCursorControlEvent(control); @@ -931,7 +931,7 @@ bool CNxWidget::focus(void) if (!hadFocus) { onFocus(); - + m_widgetEventHandlers->raiseFocusEvent(); return true; } @@ -967,7 +967,7 @@ bool CNxWidget::blur(void) if (hadFocus) { onBlur(); - + m_widgetEventHandlers->raiseBlurEvent(); return true; } @@ -1046,7 +1046,7 @@ bool CNxWidget::moveTo(nxgl_coord_t x, nxgl_coord_t y) } } } - + // Perform move if necessary if ((m_rect.getX() != x) || (m_rect.getY() != y)) diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index b38667d8d..046660774 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -61,7 +61,7 @@ using namespace NXWidgets; * * @param hNxServer Handle to the NX server. */ - + CNxWindow::CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) : CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hNxWindow(0), m_widgetControl(pWidgetControl) @@ -161,7 +161,7 @@ bool CNxWindow::getSize(FAR struct nxgl_size_s *pSize) * @param pPos The new position of the window. * @return True on success, false on any failure. */ - + bool CNxWindow::setPosition(FAR const struct nxgl_point_s *pPos) { // Set the window size and position @@ -175,7 +175,7 @@ bool CNxWindow::setPosition(FAR const struct nxgl_point_s *pPos) * @param pSize The new size of the window. * @return True on success, false on any failure. */ - + bool CNxWindow::setSize(FAR const struct nxgl_size_s *pSize) { // Set the window size diff --git a/libnxwidgets/src/cprogressbar.cxx b/libnxwidgets/src/cprogressbar.cxx index 5f29a3f7e..d76d42903 100644 --- a/libnxwidgets/src/cprogressbar.cxx +++ b/libnxwidgets/src/cprogressbar.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -117,7 +117,7 @@ CProgressBar::CProgressBar(CWidgetControl *pWidgetControl, } /** - * Set the value that of the progress bar. + * Set the value that of the progress bar. * * @param value The new value. */ @@ -159,7 +159,7 @@ void CProgressBar::drawContents(CGraphicsPort *port) // Calculate ratio of pixels to value range (max fractional value of 255) uint32_t ratio = ((uint32_t)rect.getWidth() << 8) / (uint32_t)(m_maximumValue - m_minimumValue); - + // Convert value using ratio, rounding up and shifting down int16_t barWidth = ((m_value * ratio) + 128) >> 8; @@ -167,7 +167,7 @@ void CProgressBar::drawContents(CGraphicsPort *port) // Draw filled region port->drawFilledRect(rect.getX(), rect.getY(), barWidth, rect.getHeight(), getHighlightColor()); - + // Draw unfilled background if (barWidth < rect.getWidth()) diff --git a/libnxwidgets/src/cradiobutton.cxx b/libnxwidgets/src/cradiobutton.cxx index 86ad4118f..a5680d5c6 100644 --- a/libnxwidgets/src/cradiobutton.cxx +++ b/libnxwidgets/src/cradiobutton.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cradiobuttongroup.cxx b/libnxwidgets/src/cradiobuttongroup.cxx index b1d75f625..62c4f9aad 100644 --- a/libnxwidgets/src/cradiobuttongroup.cxx +++ b/libnxwidgets/src/cradiobuttongroup.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/crect.cxx b/libnxwidgets/src/crect.cxx index 8e0ed2cd4..9ed2df830 100644 --- a/libnxwidgets/src/crect.cxx +++ b/libnxwidgets/src/crect.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -188,7 +188,7 @@ CRect fromCoordinates(nxgl_coord_t x1, nxgl_coord_t y1, * * @param x2 The x coordinate of the rect's bottom-right corner. */ - + void CRect::setX2(nxgl_coord_t x2) { // Ensure that x contains the smaller value diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index 1fb2518a5..a648f0533 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -304,7 +304,7 @@ bool CRlePaletteBitmap::skipPixels(nxgl_coord_t npixels) return true; } - + /** Seek to the beginning of the next row * * @return False if this was the last row of the image diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index 1ebf60324..083868f70 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -375,7 +375,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) FAR uint8_t *saveRow = m_rowCache[0]; m_rowCache[0] = m_rowCache[1]; m_rowCache[1] = saveRow; - + // Save number of the first row that we have in the cache m_row = row; @@ -484,7 +484,7 @@ bool CScaledBitmap::scaleColor(FAR const struct rgbcolor_s &incolor1, * @param row - The pointer to the row in the row cache to use * @param column - The non-integer column offset * @param outcolor - The returned, interpolated color - * + * */ bool CScaledBitmap::rowColor(FAR uint8_t *row, b16_t column, diff --git a/libnxwidgets/src/cscrollbarhorizontal.cxx b/libnxwidgets/src/cscrollbarhorizontal.cxx index 13e33815d..236ab4594 100644 --- a/libnxwidgets/src/cscrollbarhorizontal.cxx +++ b/libnxwidgets/src/cscrollbarhorizontal.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -91,7 +91,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Method Implementation ****************************************************************************/ @@ -115,7 +115,7 @@ using namespace NXWidgets; CScrollbarHorizontal::CScrollbarHorizontal(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, - CWidgetStyle* style) + CWidgetStyle* style) : CNxWidget(pWidgetControl, x, y, width, height, WIDGET_BORDERLESS, style) { m_buttonWidth = 10; @@ -263,7 +263,7 @@ void CScrollbarHorizontal::setPageSize(nxgl_coord_t pageSize) m_slider->setPageSize(pageSize); } -/** +/** * Process events fired by the grip. * * @param e The event details. diff --git a/libnxwidgets/src/cscrollbarvertical.cxx b/libnxwidgets/src/cscrollbarvertical.cxx index 76b5c5dec..e287b14f2 100644 --- a/libnxwidgets/src/cscrollbarvertical.cxx +++ b/libnxwidgets/src/cscrollbarvertical.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -88,7 +88,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * Method Implementation ****************************************************************************/ @@ -261,7 +261,7 @@ void CScrollbarVertical::setPageSize(nxgl_coord_t pageSize) m_slider->setPageSize(pageSize); } -/** +/** * Process events fired by the grip. * * @param e The event details. diff --git a/libnxwidgets/src/cscrollinglistbox.cxx b/libnxwidgets/src/cscrollinglistbox.cxx index e0d041d34..d397a98db 100644 --- a/libnxwidgets/src/cscrollinglistbox.cxx +++ b/libnxwidgets/src/cscrollinglistbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cscrollingpanel.cxx b/libnxwidgets/src/cscrollingpanel.cxx index 2541bb572..c93d113a6 100644 --- a/libnxwidgets/src/cscrollingpanel.cxx +++ b/libnxwidgets/src/cscrollingpanel.cxx @@ -216,9 +216,9 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) m_canvasX += dx; // Move children but do not redraw. - + scrollChildren(dx, dy, false); - + if (revealedRects.size() > 0) { // Draw background to revealed sections @@ -234,7 +234,7 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) port->drawFilledRect(rrect.getX(), rrect.getY(), rrect.getWidth(), rrect.getHeight(), getBackgroundColor()); - + // Check if any children intersect this region. // If it does, it should be redrawn. @@ -255,7 +255,7 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) m_canvasY += dy; m_canvasX += dx; - + // Scroll all child widgets and redraw them scrollChildren(dx, dy, true); @@ -362,16 +362,16 @@ void CScrollingPanel::scrollChildren(int32_t dx, int32_t dy, bool do_redraw) { widget = m_children[i]; bool oldstate = widget->isDrawingEnabled(); - + if (!do_redraw) { widget->disableDrawing(); } - + widgetX = (widget->getX() - thisX) + dx; widgetY = (widget->getY() - thisY) + dy; widget->moveTo(widgetX, widgetY); - + if (!do_redraw && oldstate) { widget->enableDrawing(); diff --git a/libnxwidgets/src/cscrollingtextbox.cxx b/libnxwidgets/src/cscrollingtextbox.cxx index 4de63fdf6..f9f9beadc 100644 --- a/libnxwidgets/src/cscrollingtextbox.cxx +++ b/libnxwidgets/src/cscrollingtextbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -125,7 +125,7 @@ CScrollingTextBox::CScrollingTextBox(CWidgetControl *pWidgetControl, 0, 0, width - m_scrollbarWidth, height, text, flags, maxRows, &m_style); m_texbox->addWidgetEventHandler(this); - + // Create scrollbar CRect rect; diff --git a/libnxwidgets/src/csliderhorizontal.cxx b/libnxwidgets/src/csliderhorizontal.cxx index 2fe47556c..4462d6e74 100644 --- a/libnxwidgets/src/csliderhorizontal.cxx +++ b/libnxwidgets/src/csliderhorizontal.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -155,14 +155,14 @@ void CSliderHorizontal::setValueWithBitshift(const int32_t value) { CRect rect; getClientRect(rect); - + // Can the grip move? if ((rect.getWidth() > m_grip->getWidth()) && (m_maximumValue != m_minimumValue)) { int32_t newValue = value; int32_t maxValue = getPhysicalMaximumValueWithBitshift(); - + // Limit to max/min values if (newValue > maxValue) @@ -174,13 +174,13 @@ void CSliderHorizontal::setValueWithBitshift(const int32_t value) { newValue = m_minimumValue << 16; } - + uint32_t scrollRatio = newValue / m_contentSize; int32_t newGripX = m_gutterWidth * scrollRatio; newGripX += newGripX & 0x8000; newGripX >>= 16; newGripX += rect.getX(); - + m_grip->moveTo(newGripX, rect.getY()); // Update stored value if necessary @@ -395,7 +395,7 @@ void CSliderHorizontal::resizeGrip(void) // height) of the gutter. Each position in the gutter needs to be // reduced in value. } - + m_grip->resize(gripSize, rect.getHeight()); } diff --git a/libnxwidgets/src/csliderhorizontalgrip.cxx b/libnxwidgets/src/csliderhorizontalgrip.cxx index aebdbf51d..25feaed78 100644 --- a/libnxwidgets/src/csliderhorizontalgrip.cxx +++ b/libnxwidgets/src/csliderhorizontalgrip.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cslidervertical.cxx b/libnxwidgets/src/cslidervertical.cxx index 74d2d956b..9b9b0f91a 100644 --- a/libnxwidgets/src/cslidervertical.cxx +++ b/libnxwidgets/src/cslidervertical.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -156,14 +156,14 @@ void CSliderVertical::setValueWithBitshift(const int32_t value) { CRect rect; getClientRect(rect); - + // Can the grip move? if ((rect.getHeight() > m_grip->getHeight()) && (m_maximumValue != m_minimumValue)) { int32_t newValue = value; int32_t maxValue = getPhysicalMaximumValueWithBitshift(); - + // Limit to max/min values if (newValue > maxValue) @@ -175,13 +175,13 @@ void CSliderVertical::setValueWithBitshift(const int32_t value) { newValue = m_minimumValue << 16; } - + uint32_t scrollRatio = newValue / m_contentSize; int32_t newGripY = m_gutterHeight * scrollRatio; newGripY += newGripY & 0x8000; newGripY >>= 16; newGripY += rect.getY(); - + m_grip->moveTo(rect.getX(), newGripY); // Update stored value if necessary @@ -397,6 +397,6 @@ void CSliderVertical::resizeGrip(void) // height) of the gutter. Each position in the gutter needs to be // reduced in value. } - + m_grip->resize(rect.getWidth(), gripSize); } diff --git a/libnxwidgets/src/csliderverticalgrip.cxx b/libnxwidgets/src/csliderverticalgrip.cxx index 2ddf364e8..d1eb0177a 100644 --- a/libnxwidgets/src/csliderverticalgrip.cxx +++ b/libnxwidgets/src/csliderverticalgrip.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cstickybutton.cxx b/libnxwidgets/src/cstickybutton.cxx index 76852eaf7..d9c2b0883 100644 --- a/libnxwidgets/src/cstickybutton.cxx +++ b/libnxwidgets/src/cstickybutton.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/cstickybuttonarray.cxx b/libnxwidgets/src/cstickybuttonarray.cxx index 05c9d8928..69dbd01f6 100644 --- a/libnxwidgets/src/cstickybuttonarray.cxx +++ b/libnxwidgets/src/cstickybuttonarray.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -51,7 +51,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * CStickyButtonArray Method Implementations ****************************************************************************/ @@ -221,7 +221,7 @@ void CStickyButtonArray::drawContents(CGraphicsPort *port) drawButton(port, m_stickyColumn, m_stickyRow, useClicked); } - // Do we draw just one button (due to click or release)? + // Do we draw just one button (due to click or release)? else if (m_redrawButton) { diff --git a/libnxwidgets/src/cstringiterator.cxx b/libnxwidgets/src/cstringiterator.cxx index 2327af38f..ed7cad704 100644 --- a/libnxwidgets/src/cstringiterator.cxx +++ b/libnxwidgets/src/cstringiterator.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -132,7 +132,7 @@ bool CStringIterator::moveToLast(void) int length = m_pString->getLength(); if (length > 0) { - m_pCurrentChar = m_pString->getCharArray() + length - 1; + m_pCurrentChar = m_pString->getCharArray() + length - 1; m_currentIndex = length - 1; return true; } @@ -154,7 +154,7 @@ bool CStringIterator::moveToNext(void) m_currentIndex++; return true; } - + return false; } diff --git a/libnxwidgets/src/ctabpanel.cxx b/libnxwidgets/src/ctabpanel.cxx index f1723fdba..1f1769e00 100644 --- a/libnxwidgets/src/ctabpanel.cxx +++ b/libnxwidgets/src/ctabpanel.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -51,7 +51,7 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ - + /**************************************************************************** * CTabPanel Method Implementations ****************************************************************************/ @@ -73,7 +73,7 @@ CTabPanel::CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages, 0); m_buttonbar->addWidgetEventHandler(this); this->addWidget(m_buttonbar); - + for (int i = 0; i < numPages; i++) { CNxWidget *tabpage = new CNxWidget(pWidgetControl, x, y + buttonHeight, @@ -83,7 +83,7 @@ CTabPanel::CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages, m_tabpages.push_back(tabpage); this->addWidget(tabpage); } - + // Activate the first page showPage(0); @@ -100,7 +100,7 @@ void CTabPanel::showPage(uint8_t index) { m_buttonbar->stickDown(index, 0); } - + for (int i = 0; i < m_tabpages.size(); i++) { if (i == index) diff --git a/libnxwidgets/src/ctext.cxx b/libnxwidgets/src/ctext.cxx index caa0c02e8..60b726ca3 100644 --- a/libnxwidgets/src/ctext.cxx +++ b/libnxwidgets/src/ctext.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -206,7 +206,7 @@ void CText::setLineSpacing(uint8_t lineSpacing) } /** - * Sets the pixel width of the text; text wider than + * Sets the pixel width of the text; text wider than * this will automatically wrap. * * @param width Maximum pixel width of the text. @@ -243,7 +243,7 @@ const int CText::getLineLength(const int lineNumber) const { return m_linePositions[lineNumber + 1] - m_linePositions[lineNumber]; } - + return getLength() - m_linePositions[lineNumber]; } @@ -258,11 +258,11 @@ const int CText::getLineLength(const int lineNumber) const const int CText::getLineTrimmedLength(const int lineNumber) const { nxgl_coord_t length = getLineLength(lineNumber); - + // Loop through string until the end CStringIterator *iterator = newStringIterator(); - + // Get char at the end of the line if (iterator->moveTo(m_linePositions[lineNumber] + length - 1)) @@ -280,7 +280,7 @@ const int CText::getLineTrimmedLength(const int lineNumber) const delete iterator; return length; } - + // May occur if data has been horribly corrupted somewhere delete iterator; @@ -336,7 +336,7 @@ void CText::stripTopLines(const int lines) // Get the start point of the text we want to keep nxgl_coord_t textStart = 0; - + for (int i = 0; i < lines; i++) { textStart += getLineLength(i); @@ -345,7 +345,7 @@ void CText::stripTopLines(const int lines) // Remove the characters from the start of the string to the found location remove(0, textStart); - + // Rewrap the text wrap(); @@ -375,12 +375,12 @@ void CText::wrap(int charIndex) int lineWidth; int breakIndex; bool endReached = false; - + if (m_linePositions.size() == 0) { charIndex = 0; } - + // If we're wrapping from an offset in the text, ensure that any existing data // after the offset gets removed @@ -399,7 +399,7 @@ void CText::wrap(int charIndex) { m_longestLines.pop_back(); } - + // If there are any longest line records remaining, update the text pixel width // The last longest line record will always be the last valid longest line as // the vector is sorted by length @@ -432,33 +432,33 @@ void CText::wrap(int charIndex) else { // Remove all wrapping data - + // Wipe the width variable m_textPixelWidth = 0; - + // Empty existing longest lines m_longestLines.clear(); - + // Empty existing line positions m_linePositions.clear(); - + // Push first line start into vector m_linePositions.push_back(0); } - + // Loop through string until the end CStringIterator *iterator = newStringIterator(); - + while (!endReached) { breakIndex = 0; lineWidth = 0; - + if (iterator->moveTo(pos)) { // Search for line breaks and valid breakpoints until we @@ -541,9 +541,9 @@ void CText::wrap(int charIndex) } } } - + delete breakIterator; - + // Add the start of the next line to the vector pos = breakIndex + 1; @@ -574,7 +574,7 @@ void CText::wrap(int charIndex) m_linePositions.push_back(pos); } } - + // Add marker indicating end of text // If we reached the end of the text, append the stopping point @@ -584,11 +584,11 @@ void CText::wrap(int charIndex) } delete iterator; - + // Calculate the total height of the text m_textPixelHeight = getLineCount() * (m_font->getHeight() + m_lineSpacing); - + // Ensure height is always at least one row if (m_textPixelHeight == 0) @@ -627,13 +627,13 @@ const int CText::getLineContainingCharIndex(const int index) const int bottom = 0; int top = m_linePositions.size() - 1; int mid; - + while (bottom <= top) { // Standard binary search mid = (bottom + top) >> 1; - + if (index < m_linePositions[mid]) { // Index is somewhere in the lower search space @@ -652,7 +652,7 @@ const int CText::getLineContainingCharIndex(const int index) const return mid; } - + // Check to see if we've moved past the line that contains the index // We have to do this because the index we're looking for can be within // a line; it isn't necessarily the start of a line (which is what is diff --git a/libnxwidgets/src/ctextbox.cxx b/libnxwidgets/src/ctextbox.cxx index 9c22a2bfa..d40776170 100644 --- a/libnxwidgets/src/ctextbox.cxx +++ b/libnxwidgets/src/ctextbox.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -280,7 +280,7 @@ void CTextBox::handleKeyPressEvent(const CWidgetEventArgs &e) // Not modifier; append value insertTextAtCursor(key); - } + } } /** @@ -389,7 +389,7 @@ void CTextBox::drawContents(CGraphicsPort *port) pos.y = m_align.y; // Calculate the cursor width - + struct nxgl_size_s size; size.w = getCursorWidth(); size.h = getFont()->getHeight(); @@ -402,7 +402,7 @@ void CTextBox::drawContents(CGraphicsPort *port) pos.x += rect.getX(); pos.y += rect.getY(); - + port->invert(pos.x, pos.y, size.w, size.h); } } @@ -454,13 +454,13 @@ void CTextBox::moveCursorToClickLocation(nxgl_coord_t x, nxgl_coord_t y) while (charX < clickX) { charX += getFont()->getCharWidth(iterator->getChar()); - + if (!iterator->moveToNext()) { break; } } - + int index = iterator->getIndex(); // Move back to the clicked character if we've moved past it @@ -553,13 +553,13 @@ const nxgl_coord_t CTextBox::getCursorXPos(void) const nxgl_coord_t cursorX = 0; CStringIterator *iterator = m_text.newStringIterator(); - + for (nxgl_coord_t i = 0; i < m_cursorPos; i++) { cursorX += getFont()->getCharWidth(iterator->getChar()); iterator->moveToNext(); } - + delete iterator; return cursorX; } @@ -598,7 +598,7 @@ void CTextBox::calculateTextPositionHorizontal(void) // ignore alignment and align left nxgl_coord_t stringWidth = getFont()->getStringWidth(m_text); - + // Add the width of a blank space to the width to ensure that we can // see the cursor @@ -606,10 +606,10 @@ void CTextBox::calculateTextPositionHorizontal(void) { stringWidth += getFont()->getCharWidth(' '); } - + CRect rect; getClientRect(rect); - + // Use alignment options if cursor is hidden or string is smaller // than textbox diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index bebab89aa..840778bac 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -97,7 +97,7 @@ using namespace NXWidgets; * * @param widget The owning widget. */ - + CWidgetEventHandlerList::CWidgetEventHandlerList(CNxWidget *widget) { m_widget = widget; @@ -120,7 +120,7 @@ bool CWidgetEventHandlerList::isEnabled(void) const * all events raised by this object. * @param eventHandler A pointer to the event handler. */ - + void CWidgetEventHandlerList::addWidgetEventHandler(CWidgetEventHandler *eventHandler) { // Prevent insertion if the handler already exists @@ -529,7 +529,7 @@ void CWidgetEventHandlerList::raiseScrollEvent(nxgl_coord_t vX, nxgl_coord_t vY) if (isEnabled()) { CWidgetEventArgs e(m_widget, 0, 0, vX, vY, KEY_CODE_NONE); - + for (int i = 0; i < m_widgetEventHandlers.size(); i++) { m_widgetEventHandlers.at(i)->handleScrollEvent(e); diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index dfdabcf08..79dd97d7f 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -57,7 +57,7 @@ using namespace NXWidgets; * all events raised by this object. * @param eventHandler A pointer to the event handler. */ - + void CWindowEventHandlerList::addWindowEventHandler(CWindowEventHandler *eventHandler) { // Make sure that the event handler does not already exist @@ -93,7 +93,7 @@ void CWindowEventHandlerList::removeWindowEventHandler(CWindowEventHandler *even /** * Return the index to the window event handler. */ - + bool CWindowEventHandlerList::findWindowEventHandler(CWindowEventHandler *eventHandler, int &index) { for (int i = 0; i < m_eventHandlers.size(); ++i) diff --git a/libnxwidgets/src/glyph_arrowdown.cxx b/libnxwidgets/src/glyph_arrowdown.cxx index c304e9281..fc200e099 100644 --- a/libnxwidgets/src/glyph_arrowdown.cxx +++ b/libnxwidgets/src/glyph_arrowdown.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_arrowleft.cxx b/libnxwidgets/src/glyph_arrowleft.cxx index ae322dcc2..143a1c3c1 100644 --- a/libnxwidgets/src/glyph_arrowleft.cxx +++ b/libnxwidgets/src/glyph_arrowleft.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_arrowright.cxx b/libnxwidgets/src/glyph_arrowright.cxx index 5969527d9..3f8b833f2 100644 --- a/libnxwidgets/src/glyph_arrowright.cxx +++ b/libnxwidgets/src/glyph_arrowright.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_arrowup.cxx b/libnxwidgets/src/glyph_arrowup.cxx index 9ea10bde2..b1543266c 100644 --- a/libnxwidgets/src/glyph_arrowup.cxx +++ b/libnxwidgets/src/glyph_arrowup.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_backspace.cxx b/libnxwidgets/src/glyph_backspace.cxx index 86c1fb93a..5271b0f66 100644 --- a/libnxwidgets/src/glyph_backspace.cxx +++ b/libnxwidgets/src/glyph_backspace.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_capslock.cxx b/libnxwidgets/src/glyph_capslock.cxx index d9e00bc78..b61d4dbdb 100644 --- a/libnxwidgets/src/glyph_capslock.cxx +++ b/libnxwidgets/src/glyph_capslock.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_checkboxmu.cxx b/libnxwidgets/src/glyph_checkboxmu.cxx index 96dbec9c1..48011b1c8 100644 --- a/libnxwidgets/src/glyph_checkboxmu.cxx +++ b/libnxwidgets/src/glyph_checkboxmu.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_checkboxoff.cxx b/libnxwidgets/src/glyph_checkboxoff.cxx index 7be6a50b2..8222bee84 100644 --- a/libnxwidgets/src/glyph_checkboxoff.cxx +++ b/libnxwidgets/src/glyph_checkboxoff.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_checkboxon.cxx b/libnxwidgets/src/glyph_checkboxon.cxx index b598e60ce..255c88449 100644 --- a/libnxwidgets/src/glyph_checkboxon.cxx +++ b/libnxwidgets/src/glyph_checkboxon.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_control.cxx b/libnxwidgets/src/glyph_control.cxx index cd2e373e6..4cb8432c1 100644 --- a/libnxwidgets/src/glyph_control.cxx +++ b/libnxwidgets/src/glyph_control.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx index 7983d4566..ff3476ff4 100644 --- a/libnxwidgets/src/glyph_cycle.cxx +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_nxlogo160x160.cxx b/libnxwidgets/src/glyph_nxlogo160x160.cxx index 6a38b45cb..9eb5746e3 100644 --- a/libnxwidgets/src/glyph_nxlogo160x160.cxx +++ b/libnxwidgets/src/glyph_nxlogo160x160.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -1048,7 +1048,7 @@ static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = { 77, 0}, { 76, 0}, { 1, 5}, { 4, 4}, { 1, 5}, { 78, 0} /* Row 159 */ }; - + #elif CONFIG_NXWIDGETS_BPP == 16 static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = @@ -3443,7 +3443,7 @@ const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap160x160 = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - 160, // width - Width in pixels + 160, // width - Width in pixels 160, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_nuttxLut, // Index 0: Unselected LUT diff --git a/libnxwidgets/src/glyph_nxlogo320x320.cxx b/libnxwidgets/src/glyph_nxlogo320x320.cxx index c83ab7159..b2e1eaad5 100644 --- a/libnxwidgets/src/glyph_nxlogo320x320.cxx +++ b/libnxwidgets/src/glyph_nxlogo320x320.cxx @@ -36,7 +36,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -1033,7 +1033,7 @@ const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap320x320 = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_nuttxLut, // Index 0: Unselected LUT diff --git a/libnxwidgets/src/glyph_radiobuttonmu.cxx b/libnxwidgets/src/glyph_radiobuttonmu.cxx index 1359c5b96..896129ffc 100644 --- a/libnxwidgets/src/glyph_radiobuttonmu.cxx +++ b/libnxwidgets/src/glyph_radiobuttonmu.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_radiobuttonoff.cxx b/libnxwidgets/src/glyph_radiobuttonoff.cxx index 422db01a9..7b832a15a 100644 --- a/libnxwidgets/src/glyph_radiobuttonoff.cxx +++ b/libnxwidgets/src/glyph_radiobuttonoff.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_radiobuttonon.cxx b/libnxwidgets/src/glyph_radiobuttonon.cxx index 04ca63757..919d11c75 100644 --- a/libnxwidgets/src/glyph_radiobuttonon.cxx +++ b/libnxwidgets/src/glyph_radiobuttonon.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_return.cxx b/libnxwidgets/src/glyph_return.cxx index 3989ff89a..951d3a9d0 100644 --- a/libnxwidgets/src/glyph_return.cxx +++ b/libnxwidgets/src/glyph_return.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_screendepthdown.cxx b/libnxwidgets/src/glyph_screendepthdown.cxx index e55e0686a..dab46122f 100644 --- a/libnxwidgets/src/glyph_screendepthdown.cxx +++ b/libnxwidgets/src/glyph_screendepthdown.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_screendepthup.cxx b/libnxwidgets/src/glyph_screendepthup.cxx index e693b7488..9826bc4ce 100644 --- a/libnxwidgets/src/glyph_screendepthup.cxx +++ b/libnxwidgets/src/glyph_screendepthup.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_screenflipdown.cxx b/libnxwidgets/src/glyph_screenflipdown.cxx index 488315d7a..d3e45504d 100644 --- a/libnxwidgets/src/glyph_screenflipdown.cxx +++ b/libnxwidgets/src/glyph_screenflipdown.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_screenflipup.cxx b/libnxwidgets/src/glyph_screenflipup.cxx index 7d45dbf93..bb928e262 100644 --- a/libnxwidgets/src/glyph_screenflipup.cxx +++ b/libnxwidgets/src/glyph_screenflipup.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_shift.cxx b/libnxwidgets/src/glyph_shift.cxx index c1cce8686..77b0d186b 100644 --- a/libnxwidgets/src/glyph_shift.cxx +++ b/libnxwidgets/src/glyph_shift.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_windowclose.cxx b/libnxwidgets/src/glyph_windowclose.cxx index 62d6ee718..bd176f412 100644 --- a/libnxwidgets/src/glyph_windowclose.cxx +++ b/libnxwidgets/src/glyph_windowclose.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_windowdepthdown.cxx b/libnxwidgets/src/glyph_windowdepthdown.cxx index b85ed053a..5bf616047 100644 --- a/libnxwidgets/src/glyph_windowdepthdown.cxx +++ b/libnxwidgets/src/glyph_windowdepthdown.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/glyph_windowdepthup.cxx b/libnxwidgets/src/glyph_windowdepthup.cxx index 056e27c1c..584b51b21 100644 --- a/libnxwidgets/src/glyph_windowdepthup.cxx +++ b/libnxwidgets/src/glyph_windowdepthup.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/libnxwidgets/src/singletons.cxx b/libnxwidgets/src/singletons.cxx index fc5d919e6..7af47eb92 100644 --- a/libnxwidgets/src/singletons.cxx +++ b/libnxwidgets/src/singletons.cxx @@ -70,7 +70,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -131,7 +131,7 @@ void NXWidgets::instantiateSingletons(void) if (!g_defaultWidgetStyle) { // Create the singleton - + g_defaultWidgetStyle = new CWidgetStyle(); // Default colors diff --git a/nxwm/COPYING b/nxwm/COPYING index 4273aec03..0f9a9db15 100644 --- a/nxwm/COPYING +++ b/nxwm/COPYING @@ -7,14 +7,14 @@ described in license (below). Please feel free to contact me if you have any licensing concerns. /************************************************************************* - * + * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * 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 @@ -28,13 +28,13 @@ have any licensing concerns. * 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 + * 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 + * 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. * diff --git a/nxwm/include/capplicationwindow.hxx b/nxwm/include/capplicationwindow.hxx index 46e4e90d2..64e9e907c 100644 --- a/nxwm/include/capplicationwindow.hxx +++ b/nxwm/include/capplicationwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include "cnxtkwindow.hxx" diff --git a/nxwm/include/cfullscreenwindow.hxx b/nxwm/include/cfullscreenwindow.hxx index 70da9fee5..992d49789 100644 --- a/nxwm/include/cfullscreenwindow.hxx +++ b/nxwm/include/cfullscreenwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include "cnxwindow.hxx" diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx index 69ee37624..fc5de07b6 100644 --- a/nxwm/include/chexcalculator.hxx +++ b/nxwm/include/chexcalculator.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/include/ckeyboard.hxx b/nxwm/include/ckeyboard.hxx index 8f16bd506..7036472fb 100644 --- a/nxwm/include/ckeyboard.hxx +++ b/nxwm/include/ckeyboard.hxx @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ - + #ifndef __INCLUDE_CKEYBOARD_HXX #define __INCLUDE_CKEYBOARD_HXX diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 81656c761..11ed3a0c1 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxconsole.hxx index f33f1182d..52fee386a 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxconsole.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include diff --git a/nxwm/include/cstartwindow.hxx b/nxwm/include/cstartwindow.hxx index 250d5068c..e7337ead6 100644 --- a/nxwm/include/cstartwindow.hxx +++ b/nxwm/include/cstartwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include @@ -91,7 +91,7 @@ namespace NxWM */ extern FAR const char *g_startWindowMqName; - + /** * This class is the the start window application. */ @@ -104,7 +104,7 @@ namespace NxWM /** * This structure represents an application and its associated icon image */ - + struct SStartWindowSlot { IApplicationFactory *app; /**< A reference to the icon */ diff --git a/nxwm/include/ctouchscreen.hxx b/nxwm/include/ctouchscreen.hxx index 396400204..c40fcb12c 100644 --- a/nxwm/include/ctouchscreen.hxx +++ b/nxwm/include/ctouchscreen.hxx @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ - + #ifndef __INCLUDE_CTOUCHSCREEN_HXX #define __INCLUDE_CTOUCHSCREEN_HXX @@ -162,7 +162,7 @@ namespace NxWM { // Set the capture flag. m_calibrated must also be set to get to normal // mode where touchscreen data is forwarded to NX. - + m_enabled = enable; } diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 456202c6d..882c5e6ea 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include "cnxstring.hxx" diff --git a/nxwm/include/iapplicationwindow.hxx b/nxwm/include/iapplicationwindow.hxx index 60f1b332c..733cb72b2 100644 --- a/nxwm/include/iapplicationwindow.hxx +++ b/nxwm/include/iapplicationwindow.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include "inxwindow.hxx" @@ -92,7 +92,7 @@ namespace NxWM * may be a contained, framed window or and unframed, fullscreen window. */ - class IApplicationWindow + class IApplicationWindow { public: /** diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 799ca61b6..523130349 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -39,7 +39,7 @@ /**************************************************************************** * Included Files ****************************************************************************/ - + #include #include "nxconfig.hxx" diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index eeb0b1d1d..dc42de0c0 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -92,9 +92,9 @@ namespace NxWM KEY_PLUS, // Additions // Special operations - + KEY_EQUAL, // Equal/Enter key - + KEY_DECIMAL, // Decimal mode KEY_HEXADECIMAL, // Hexadecimal mode @@ -247,7 +247,7 @@ CHexCalculator::CHexCalculator(CTaskbar *taskbar, CApplicationWindow *window) CHexCalculator::~CHexCalculator(void) { - // Destroy widgets + // Destroy widgets if (m_text) { @@ -598,7 +598,7 @@ void CHexCalculator::labelKeypad(void) { label = ""; } - + // Set the text in the label m_keypad->setText(i, j, label); @@ -848,7 +848,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) break; // Special operations - + case KEY_EQUAL: // Equal/Enter key { // Is there a high precedence operation? @@ -877,7 +877,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) result = true; } break; - + case KEY_DECIMAL: // Decimal mode { if (m_hexMode) diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index 3a506cb4b..e78e91631 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -311,7 +311,7 @@ void CNxConsole::stop(void) // Calling task_delete() will also invoke the on_exit() handler. We se // m_pid = -1 before calling task_delete() to let the on_exit() handler, // CNxConsole::exitHandler(), know that it should not do anything - + pid_t pid = m_pid; m_pid = -1; @@ -319,7 +319,7 @@ void CNxConsole::stop(void) task_delete(pid); } - + // Destroy the NX console device if (m_nxcon) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 8bf570f74..f05f29ebd 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -108,7 +108,7 @@ CTouchscreen::CTouchscreen(NXWidgets::CNxServer *server, struct nxgl_size_s *win // Use the default touch data buffer m_touch = &m_sample; - + // Initialize the m_waitSem semaphore so that any waits for data will block sem_init(&m_waitSem, 0, 0); @@ -138,7 +138,7 @@ CTouchscreen::~CTouchscreen(void) } // Destroy the semaphores that we created. - + sem_destroy(&m_waitSem); } @@ -209,10 +209,10 @@ void CTouchscreen::setCalibrationData(const struct SCalibrationData &caldata) // Save a copy of the calibration data m_calibData = caldata; - + // Note that we have calibration data. Data will now be scaled and forwarded // to NX (unless we are still in cpature mode) - + m_calibrated = true; // Wake up the listener thread so that it will use our buffer diff --git a/nxwm/src/glyph_calculator.cxx b/nxwm/src/glyph_calculator.cxx index 9bb3f690d..e8f5376d3 100644 --- a/nxwm/src/glyph_calculator.cxx +++ b/nxwm/src/glyph_calculator.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -181,7 +181,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_calculatorNormalLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration.cxx index df169f556..3a9a30806 100644 --- a/nxwm/src/glyph_calibration.cxx +++ b/nxwm/src/glyph_calibration.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -188,7 +188,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_calibrationNormalLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_cmd.cxx b/nxwm/src/glyph_cmd.cxx index 373d8ad5e..cc8b8dca3 100644 --- a/nxwm/src/glyph_cmd.cxx +++ b/nxwm/src/glyph_cmd.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -171,7 +171,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_cmdNormalLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize.cxx index 31feb268f..bf228e0b2 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -169,7 +169,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_minimizeNormalLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_mplayer_controls.cxx b/nxwm/src/glyph_mplayer_controls.cxx index 011f892a2..38da35844 100644 --- a/nxwm/src/glyph_mplayer_controls.cxx +++ b/nxwm/src/glyph_mplayer_controls.cxx @@ -70,14 +70,14 @@ using namespace NxWM; static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 11, 24,108), MKRGB( 63, 90,192), MKRGB(121,136,250), - MKRGB(224,234,244), MKRGB( 69, 80,149), MKRGB(127,169,239), MKRGB(152,174,207), + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 11, 24,108), MKRGB( 63, 90,192), MKRGB(121,136,250), + MKRGB(224,234,244), MKRGB( 69, 80,149), MKRGB(127,169,239), MKRGB(152,174,207), }; static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 61, 74,158), MKRGB(113,140,242), MKRGB(171,186,255), - MKRGB(255,255,255), MKRGB(119,130,199), MKRGB(177,219,255), MKRGB(202,224,255), + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, MKRGB( 61, 74,158), MKRGB(113,140,242), MKRGB(171,186,255), + MKRGB(255,255,255), MKRGB(119,130,199), MKRGB(177,219,255), MKRGB(202,224,255), }; /* Bitmap definition for the "Play" button */ @@ -93,35 +93,35 @@ static const NXWidgets::SRlePaletteBitmapEntry play_bitmap[] = { 5, 0}, { 6, 3}, { 9, 6}, { 7, 3}, { 5, 0}, /* Row 6 */ { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ - { 3, 0}, { 3, 2}, { 5, 3}, { 1, 6}, { 13, 3}, { 4, 2}, + { 3, 0}, { 3, 2}, { 5, 3}, { 1, 6}, { 13, 3}, { 4, 2}, { 3, 0}, /* Row 9 */ - { 2, 0}, { 1, 5}, { 6, 2}, { 2, 3}, { 2, 4}, { 1, 6}, + { 2, 0}, { 1, 5}, { 6, 2}, { 2, 3}, { 2, 4}, { 1, 6}, { 9, 3}, { 6, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ - { 2, 0}, { 1, 5}, { 8, 2}, { 1, 7}, { 3, 4}, { 1, 6}, + { 2, 0}, { 1, 5}, { 8, 2}, { 1, 7}, { 3, 4}, { 1, 6}, { 2, 2}, { 1, 3}, { 10, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ - { 1, 0}, { 4, 5}, { 6, 2}, { 1, 7}, { 4, 4}, { 1, 7}, + { 1, 0}, { 4, 5}, { 6, 2}, { 1, 7}, { 4, 4}, { 1, 7}, { 1, 3}, { 8, 2}, { 4, 5}, { 2, 0}, /* Row 12 */ - { 1, 0}, { 7, 5}, { 3, 2}, { 1, 7}, { 6, 4}, { 1, 7}, + { 1, 0}, { 7, 5}, { 3, 2}, { 1, 7}, { 6, 4}, { 1, 7}, { 3, 2}, { 8, 5}, { 2, 0}, /* Row 13 */ - { 1, 0}, { 9, 5}, { 1, 2}, { 1, 7}, { 8, 4}, { 1, 7}, + { 1, 0}, { 9, 5}, { 1, 2}, { 1, 7}, { 8, 4}, { 1, 7}, { 8, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ - { 1, 0}, { 4, 1}, { 6, 5}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 0}, { 4, 1}, { 6, 5}, { 1, 7}, { 10, 4}, { 1, 7}, { 3, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ - { 1, 0}, { 8, 1}, { 2, 5}, { 1, 7}, { 10, 4}, { 1, 7}, + { 1, 0}, { 8, 1}, { 2, 5}, { 1, 7}, { 10, 4}, { 1, 7}, { 7, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ - { 1, 0}, { 10, 1}, { 1, 7}, { 9, 4}, { 1, 5}, { 8, 1}, + { 1, 0}, { 10, 1}, { 1, 7}, { 9, 4}, { 1, 5}, { 8, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ - { 1, 0}, { 10, 1}, { 1, 7}, { 7, 4}, { 1, 5}, { 10, 1}, + { 1, 0}, { 10, 1}, { 1, 7}, { 7, 4}, { 1, 5}, { 10, 1}, { 2, 0}, /* Row 18 */ - { 1, 0}, { 1, 5}, { 9, 1}, { 1, 7}, { 5, 4}, { 1, 7}, + { 1, 0}, { 1, 5}, { 9, 1}, { 1, 7}, { 5, 4}, { 1, 7}, { 12, 1}, { 2, 0}, /* Row 19 */ - { 2, 0}, { 9, 1}, { 1, 7}, { 4, 4}, { 1, 5}, { 13, 1}, + { 2, 0}, { 9, 1}, { 1, 7}, { 4, 4}, { 1, 5}, { 13, 1}, { 2, 0}, /* Row 20 */ - { 2, 0}, { 9, 1}, { 1, 7}, { 2, 4}, { 1, 7}, { 1, 2}, + { 2, 0}, { 9, 1}, { 1, 7}, { 2, 4}, { 1, 7}, { 1, 2}, { 13, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ - { 2, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 1, 4}, { 1, 5}, + { 2, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 1, 4}, { 1, 5}, { 6, 2}, { 9, 1}, { 3, 0}, /* Row 22 */ - { 3, 0}, { 7, 1}, { 1, 2}, { 1, 5}, { 10, 2}, { 6, 1}, + { 3, 0}, { 7, 1}, { 1, 2}, { 1, 5}, { 10, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ { 4, 0}, { 4, 1}, { 16, 2}, { 4, 1}, { 4, 0}, /* Row 24 */ { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ @@ -158,45 +158,45 @@ static const NXWidgets::SRlePaletteBitmapEntry pause_bitmap[] = { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ { 3, 0}, { 3, 2}, { 19, 3}, { 4, 2}, { 3, 0}, /* Row 9 */ - { 2, 0}, { 1, 5}, { 5, 2}, { 2, 3}, { 1, 6}, { 3, 4}, - { 3, 3}, { 1, 7}, { 2, 4}, { 1, 7}, { 2, 3}, { 6, 2}, + { 2, 0}, { 1, 5}, { 5, 2}, { 2, 3}, { 1, 6}, { 3, 4}, + { 3, 3}, { 1, 7}, { 2, 4}, { 1, 7}, { 2, 3}, { 6, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ - { 2, 0}, { 1, 5}, { 7, 2}, { 1, 7}, { 3, 4}, { 1, 7}, - { 1, 2}, { 1, 3}, { 4, 4}, { 1, 3}, { 7, 2}, { 1, 5}, + { 2, 0}, { 1, 5}, { 7, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 3}, { 4, 4}, { 1, 3}, { 7, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ - { 1, 0}, { 4, 5}, { 5, 2}, { 1, 7}, { 3, 4}, { 1, 7}, - { 1, 2}, { 1, 3}, { 4, 4}, { 1, 6}, { 4, 2}, { 4, 5}, + { 1, 0}, { 4, 5}, { 5, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 3}, { 4, 4}, { 1, 6}, { 4, 2}, { 4, 5}, { 2, 0}, /* Row 12 */ - { 1, 0}, { 8, 5}, { 1, 2}, { 1, 7}, { 3, 4}, { 1, 7}, - { 1, 2}, { 1, 5}, { 4, 4}, { 1, 5}, { 1, 2}, { 7, 5}, + { 1, 0}, { 8, 5}, { 1, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 2}, { 1, 5}, { 4, 4}, { 1, 5}, { 1, 2}, { 7, 5}, { 2, 0}, /* Row 13 */ - { 1, 0}, { 9, 5}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 2}, + { 1, 0}, { 9, 5}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 2}, { 1, 5}, { 4, 4}, { 8, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ - { 1, 0}, { 4, 1}, { 5, 5}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 0}, { 4, 1}, { 5, 5}, { 1, 7}, { 3, 4}, { 1, 7}, { 2, 5}, { 4, 4}, { 5, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ - { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 2, 5}, + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 2, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ - { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ - { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 1, 0}, { 9, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 18 */ - { 1, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, + { 1, 0}, { 1, 5}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 19 */ - { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 20 */ - { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, + { 2, 0}, { 8, 1}, { 1, 7}, { 3, 4}, { 1, 7}, { 1, 1}, { 1, 2}, { 4, 4}, { 1, 5}, { 7, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ - { 2, 0}, { 1, 5}, { 7, 1}, { 1, 7}, { 3, 4}, { 1, 6}, + { 2, 0}, { 1, 5}, { 7, 1}, { 1, 7}, { 3, 4}, { 1, 6}, { 1, 1}, { 1, 2}, { 4, 4}, { 1, 2}, { 7, 1}, { 3, 0}, /* Row 22 */ - { 3, 0}, { 7, 1}, { 1, 2}, { 3, 6}, { 4, 2}, { 2, 6}, + { 3, 0}, { 7, 1}, { 1, 2}, { 3, 6}, { 4, 2}, { 2, 6}, { 2, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ { 4, 0}, { 4, 1}, { 16, 2}, { 4, 1}, { 4, 0}, /* Row 24 */ { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ - { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, { 1, 5}, { 5, 0}, /* Row 26 */ - { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, { 4, 2}, { 7, 0}, /* Row 27 */ - { 8, 0}, { 3, 2}, { 4, 2}, { 2, 2}, { 4, 2}, { 2, 2}, + { 8, 0}, { 3, 2}, { 4, 2}, { 2, 2}, { 4, 2}, { 2, 2}, { 1, 5}, { 8, 0}, /* Row 28 */ { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 3, 2}, { 10, 0}, /* Row 29 */ { 12, 0}, { 8, 2}, { 12, 0}, /* Row 30 */ @@ -222,7 +222,7 @@ static const NXWidgets::SRlePaletteBitmapEntry rew_bitmap[] = // { 14, 0}, { 3, 4}, { 1, 7}, { 14, 0}, /* Row 1 */ { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ - { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, + { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, { 3, 6}, { 1, 7}, { 8, 0}, /* Row 3 */ { 7, 0}, { 7, 6}, { 3, 7}, { 8, 6}, { 7, 0}, /* Row 4 */ { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ @@ -230,46 +230,46 @@ static const NXWidgets::SRlePaletteBitmapEntry rew_bitmap[] = { 4, 0}, { 23, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ { 3, 0}, { 3, 2}, { 18, 3}, { 5, 2}, { 3, 0}, /* Row 9 */ - { 2, 0}, { 1, 5}, { 5, 2}, { 6, 3}, { 1, 6}, { 7, 3}, + { 2, 0}, { 1, 5}, { 5, 2}, { 6, 3}, { 1, 6}, { 7, 3}, { 2, 2}, { 2, 6}, { 3, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ - { 2, 0}, { 1, 5}, { 9, 2}, { 1, 6}, { 2, 4}, { 1, 3}, - { 1, 2}, { 2, 3}, { 3, 2}, { 1, 6}, { 2, 4}, { 1, 6}, + { 2, 0}, { 1, 5}, { 9, 2}, { 1, 6}, { 2, 4}, { 1, 3}, + { 1, 2}, { 2, 3}, { 3, 2}, { 1, 6}, { 2, 4}, { 1, 6}, { 3, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ - { 1, 0}, { 2, 5}, { 7, 2}, { 1, 6}, { 4, 4}, { 1, 3}, - { 4, 2}, { 1, 3}, { 1, 7}, { 3, 4}, { 1, 7}, { 3, 2}, + { 1, 0}, { 2, 5}, { 7, 2}, { 1, 6}, { 4, 4}, { 1, 3}, + { 4, 2}, { 1, 3}, { 1, 7}, { 3, 4}, { 1, 7}, { 3, 2}, { 1, 5}, { 2, 0}, /* Row 12 */ - { 1, 0}, { 5, 5}, { 2, 2}, { 1, 5}, { 1, 7}, { 5, 4}, - { 1, 5}, { 3, 2}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 2}, + { 1, 0}, { 5, 5}, { 2, 2}, { 1, 5}, { 1, 7}, { 5, 4}, + { 1, 5}, { 3, 2}, { 1, 7}, { 5, 4}, { 1, 7}, { 1, 2}, { 3, 5}, { 2, 0}, /* Row 13 */ - { 1, 0}, { 6, 5}, { 1, 7}, { 7, 4}, { 1, 5}, { 1, 2}, - { 1, 7}, { 7, 4}, { 1, 7}, { 3, 5}, { 1, 1}, { 1, 5}, + { 1, 0}, { 6, 5}, { 1, 7}, { 7, 4}, { 1, 5}, { 1, 2}, + { 1, 7}, { 7, 4}, { 1, 7}, { 3, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ - { 1, 0}, { 4, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 0}, { 4, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, { 1, 7}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ - { 1, 0}, { 4, 1}, { 1, 5}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 0}, { 4, 1}, { 1, 5}, { 9, 4}, { 1, 7}, { 9, 4}, { 1, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ - { 1, 0}, { 6, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, + { 1, 0}, { 6, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ - { 1, 0}, { 8, 1}, { 1, 7}, { 5, 4}, { 1, 5}, { 3, 1}, + { 1, 0}, { 8, 1}, { 1, 7}, { 5, 4}, { 1, 5}, { 3, 1}, { 1, 7}, { 5, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 18 */ - { 1, 0}, { 1, 5}, { 8, 1}, { 1, 5}, { 4, 4}, { 1, 5}, + { 1, 0}, { 1, 5}, { 8, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 4, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 19 */ - { 2, 0}, { 10, 1}, { 1, 7}, { 2, 4}, { 1, 2}, { 6, 1}, + { 2, 0}, { 10, 1}, { 1, 7}, { 2, 4}, { 1, 2}, { 6, 1}, { 1, 7}, { 2, 4}, { 1, 5}, { 4, 1}, { 2, 0}, /* Row 20 */ - { 2, 0}, { 11, 1}, { 1, 5}, { 1, 4}, { 1, 2}, { 7, 1}, + { 2, 0}, { 11, 1}, { 1, 5}, { 1, 4}, { 1, 2}, { 7, 1}, { 1, 5}, { 1, 7}, { 1, 5}, { 3, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ - { 2, 0}, { 1, 5}, { 9, 1}, { 1, 2}, { 1, 1}, { 6, 2}, + { 2, 0}, { 1, 5}, { 9, 1}, { 1, 2}, { 1, 1}, { 6, 2}, { 9, 1}, { 3, 0}, /* Row 22 */ { 3, 0}, { 7, 1}, { 12, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ { 4, 0}, { 5, 1}, { 14, 2}, { 5, 1}, { 4, 0}, /* Row 24 */ { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ - { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, { 1, 5}, { 5, 0}, /* Row 26 */ - { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, { 4, 2}, { 7, 0}, /* Row 27 */ - { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, + { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, { 1, 5}, { 8, 0}, /* Row 28 */ - { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, + { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, { 10, 0}, /* Row 29 */ { 12, 0}, { 3, 2}, { 2, 2}, { 3, 2}, { 12, 0}, /* Row 30 */ { 32, 0}, /* Row 31 */ @@ -293,7 +293,7 @@ static const NXWidgets::SRlePaletteBitmapEntry fwd_bitmap[] = { 32, 0}, /* Row 0 */ { 14, 0}, { 4, 7}, { 14, 0}, /* Row 1 */ { 10, 0}, { 12, 7}, { 10, 0}, /* Row 2 */ - { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, + { 8, 0}, { 1, 7}, { 3, 6}, { 8, 7}, { 3, 6}, { 1, 7}, { 8, 0}, /* Row 3 */ { 7, 0}, { 7, 6}, { 3, 7}, { 8, 6}, { 7, 0}, /* Row 4 */ { 6, 0}, { 3, 3}, { 13, 6}, { 4, 3}, { 6, 0}, /* Row 5 */ @@ -301,47 +301,47 @@ static const NXWidgets::SRlePaletteBitmapEntry fwd_bitmap[] = { 4, 0}, { 1, 2}, { 22, 3}, { 1, 2}, { 4, 0}, /* Row 7 */ { 3, 0}, { 1, 5}, { 23, 3}, { 1, 2}, { 1, 5}, { 3, 0}, /* Row 8 */ { 3, 0}, { 3, 2}, { 19, 3}, { 4, 2}, { 3, 0}, /* Row 9 */ - { 2, 0}, { 1, 5}, { 3, 2}, { 2, 6}, { 2, 2}, { 7, 3}, + { 2, 0}, { 1, 5}, { 3, 2}, { 2, 6}, { 2, 2}, { 7, 3}, { 1, 6}, { 5, 3}, { 6, 2}, { 1, 5}, { 2, 0}, /* Row 10 */ - { 2, 0}, { 1, 5}, { 3, 2}, { 1, 7}, { 2, 4}, { 1, 3}, - { 2, 2}, { 3, 3}, { 1, 2}, { 1, 6}, { 2, 4}, { 1, 6}, + { 2, 0}, { 1, 5}, { 3, 2}, { 1, 7}, { 2, 4}, { 1, 3}, + { 2, 2}, { 3, 3}, { 1, 2}, { 1, 6}, { 2, 4}, { 1, 6}, { 9, 2}, { 1, 5}, { 2, 0}, /* Row 11 */ - { 1, 0}, { 2, 5}, { 3, 2}, { 1, 7}, { 3, 4}, { 1, 7}, - { 5, 2}, { 1, 6}, { 4, 4}, { 1, 5}, { 7, 2}, { 1, 5}, + { 1, 0}, { 2, 5}, { 3, 2}, { 1, 7}, { 3, 4}, { 1, 7}, + { 5, 2}, { 1, 6}, { 4, 4}, { 1, 5}, { 7, 2}, { 1, 5}, { 2, 0}, /* Row 12 */ - { 1, 0}, { 4, 5}, { 1, 2}, { 1, 7}, { 5, 4}, { 1, 7}, - { 3, 2}, { 1, 6}, { 5, 4}, { 1, 7}, { 1, 5}, { 2, 2}, + { 1, 0}, { 4, 5}, { 1, 2}, { 1, 7}, { 5, 4}, { 1, 7}, + { 3, 2}, { 1, 6}, { 5, 4}, { 1, 7}, { 1, 5}, { 2, 2}, { 4, 5}, { 2, 0}, /* Row 13 */ - { 1, 0}, { 1, 5}, { 1, 1}, { 2, 5}, { 1, 1}, { 1, 7}, - { 7, 4}, { 1, 7}, { 1, 2}, { 1, 5}, { 7, 4}, { 1, 7}, + { 1, 0}, { 1, 5}, { 1, 1}, { 2, 5}, { 1, 1}, { 1, 7}, + { 7, 4}, { 1, 7}, { 1, 2}, { 1, 5}, { 7, 4}, { 1, 7}, { 4, 5}, { 1, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ - { 1, 0}, { 5, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, + { 1, 0}, { 5, 1}, { 1, 7}, { 9, 4}, { 1, 7}, { 9, 4}, { 1, 5}, { 3, 1}, { 1, 5}, { 1, 0}, /* Row 15 */ - { 1, 0}, { 5, 1}, { 1, 7}, { 8, 4}, { 2, 7}, { 8, 4}, + { 1, 0}, { 5, 1}, { 1, 7}, { 8, 4}, { 2, 7}, { 8, 4}, { 1, 7}, { 4, 1}, { 1, 5}, { 1, 0}, /* Row 16 */ - { 1, 0}, { 5, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, + { 1, 0}, { 5, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 1, 1}, { 1, 5}, { 7, 4}, { 1, 5}, { 5, 1}, { 1, 5}, { 1, 0}, /* Row 17 */ - { 1, 0}, { 5, 1}, { 1, 5}, { 5, 4}, { 1, 7}, { 3, 1}, + { 1, 0}, { 5, 1}, { 1, 5}, { 5, 4}, { 1, 7}, { 3, 1}, { 1, 5}, { 5, 4}, { 1, 7}, { 7, 1}, { 2, 0}, /* Row 18 */ - { 1, 0}, { 1, 5}, { 4, 1}, { 1, 5}, { 3, 4}, { 1, 7}, - { 1, 2}, { 4, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, + { 1, 0}, { 1, 5}, { 4, 1}, { 1, 5}, { 3, 4}, { 1, 7}, + { 1, 2}, { 4, 1}, { 1, 5}, { 4, 4}, { 1, 5}, { 8, 1}, { 2, 0}, /* Row 19 */ - { 2, 0}, { 4, 1}, { 1, 5}, { 2, 4}, { 1, 5}, { 6, 1}, + { 2, 0}, { 4, 1}, { 1, 5}, { 2, 4}, { 1, 5}, { 6, 1}, { 1, 5}, { 2, 4}, { 1, 7}, { 10, 1}, { 2, 0}, /* Row 20 */ - { 2, 0}, { 4, 1}, { 2, 7}, { 8, 1}, { 1, 5}, { 1, 4}, + { 2, 0}, { 4, 1}, { 2, 7}, { 8, 1}, { 1, 5}, { 1, 4}, { 1, 2}, { 10, 1}, { 1, 5}, { 2, 0}, /* Row 21 */ - { 2, 0}, { 1, 5}, { 9, 1}, { 6, 2}, { 1, 1}, { 1, 2}, + { 2, 0}, { 1, 5}, { 9, 1}, { 6, 2}, { 1, 1}, { 1, 2}, { 9, 1}, { 3, 0}, /* Row 22 */ { 3, 0}, { 7, 1}, { 12, 2}, { 6, 1}, { 1, 5}, { 3, 0}, /* Row 23 */ { 4, 0}, { 5, 1}, { 14, 2}, { 5, 1}, { 4, 0}, /* Row 24 */ { 4, 0}, { 1, 5}, { 2, 1}, { 18, 2}, { 2, 1}, { 5, 0}, /* Row 25 */ - { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, + { 5, 0}, { 1, 5}, { 1, 1}, { 6, 2}, { 6, 2}, { 7, 2}, { 1, 5}, { 5, 0}, /* Row 26 */ - { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, + { 6, 0}, { 1, 5}, { 4, 2}, { 1, 5}, { 8, 2}, { 1, 5}, { 4, 2}, { 7, 0}, /* Row 27 */ - { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, + { 8, 0}, { 3, 2}, { 3, 2}, { 4, 2}, { 3, 2}, { 2, 2}, { 1, 5}, { 8, 0}, /* Row 28 */ - { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, + { 9, 0}, { 1, 5}, { 3, 2}, { 6, 2}, { 2, 2}, { 1, 5}, { 10, 0}, /* Row 29 */ { 12, 0}, { 3, 2}, { 2, 2}, { 3, 2}, { 12, 0}, /* Row 30 */ { 32, 0}, /* Row 31 */ @@ -367,7 +367,7 @@ static const NXWidgets::SRlePaletteBitmapEntry vol_bitmap[] = { 3, 0}, { 5, 3}, { 6, 6}, { 5, 3}, { 3, 0}, /* Row 4 */ { 3, 0}, { 16, 3}, { 3, 0}, /* Row 5 */ { 2, 0}, { 2, 2}, { 13, 3}, { 3, 2}, { 2, 0}, /* Row 6 */ - { 1, 0}, { 1, 5}, { 4, 2}, { 10, 3}, { 4, 2}, { 1, 5}, + { 1, 0}, { 1, 5}, { 4, 2}, { 10, 3}, { 4, 2}, { 1, 5}, { 1, 0}, /* Row 7 */ { 1, 0}, { 2, 5}, { 15, 2}, { 3, 5}, { 1, 0}, /* Row 8 */ { 1, 0}, { 5, 5}, { 10, 2}, { 5, 5}, { 1, 0}, /* Row 9 */ @@ -376,7 +376,7 @@ static const NXWidgets::SRlePaletteBitmapEntry vol_bitmap[] = { 1, 0}, { 20, 1}, { 1, 0}, /* Row 12 */ { 1, 0}, { 20, 1}, { 1, 0}, /* Row 13 */ { 1, 0}, { 19, 1}, { 1, 5}, { 1, 0}, /* Row 14 */ - { 1, 0}, { 1, 5}, { 7, 1}, { 1, 5}, { 4, 2}, { 6, 1}, + { 1, 0}, { 1, 5}, { 7, 1}, { 1, 5}, { 4, 2}, { 6, 1}, { 2, 0}, /* Row 15 */ { 2, 0}, { 5, 1}, { 8, 2}, { 4, 1}, { 1, 5}, { 2, 0}, /* Row 16 */ { 3, 0}, { 2, 1}, { 12, 2}, { 2, 1}, { 3, 0}, /* Row 17 */ diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh.cxx index 213db54dd..efa83f7ed 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -205,7 +205,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_nshBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_nshLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_play24x24.cxx b/nxwm/src/glyph_play24x24.cxx index ffe389fc5..c96ef0b03 100644 --- a/nxwm/src/glyph_play24x24.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -248,7 +248,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap24x24 = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_playNormalLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start.cxx index ce1bf6a2c..2fd7b3cd1 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -206,7 +206,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_startBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_startLut, // Index 0: Unselected LUT diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop.cxx index 74836e01d..d9436b5d8 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop.cxx @@ -36,7 +36,7 @@ /******************************************************************************************** * Included Files ********************************************************************************************/ - + #include #include @@ -184,7 +184,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap = CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_stopNormalLut, // Index 0: Unselected LUT diff --git a/tools/bitmap_converter.py b/tools/bitmap_converter.py index 714be3ae6..425ee048b 100755 --- a/tools/bitmap_converter.py +++ b/tools/bitmap_converter.py @@ -18,21 +18,21 @@ def get_palette(img, maxcolors = 255): def write_palette(outfile, palette): '''Write the palette (normal and hilight) to the output file.''' - + outfile.write('static const NXWidgets::nxwidget_pixel_t palette[BITMAP_PALETTESIZE] =\n'); outfile.write('{\n') - + for i in range(0, len(palette), 4): outfile.write(' '); for r, g, b in palette[i:i+4]: outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) outfile.write('\n'); - + outfile.write('};\n\n') - + outfile.write('static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] =\n'); outfile.write('{\n') - + for i in range(0, len(palette), 4): outfile.write(' '); for r, g, b in palette[i:i+4]: @@ -41,9 +41,9 @@ def write_palette(outfile, palette): b = min(255, b + 50) outfile.write('MKRGB(%3d,%3d,%3d), ' % (r, g, b)) outfile.write('\n'); - + outfile.write('};\n\n') - + def quantize(color, palette): '''Return the color index to closest match in the palette.''' @@ -53,7 +53,7 @@ def quantize(color, palette): # No exact match, search for the closest def distance(color2): return sum([(a - b)**2 for a, b in zip(color, color2)]) - + return palette.index(min(palette, key = distance)); def encode_row(img, palette, y): @@ -61,7 +61,7 @@ def encode_row(img, palette, y): entries = [] color = None repeats = 0 - + for x in range(0, img.size[0]): c = quantize(img.getpixel((x, y)), palette) if c == color and repeats < 255: @@ -69,13 +69,13 @@ def encode_row(img, palette, y): else: if color is not None: entries.append((repeats, color)) - + repeats = 1 color = c if color is not None: entries.append((repeats, color)) - + return entries def write_image(outfile, img, palette): @@ -83,7 +83,7 @@ def write_image(outfile, img, palette): outfile.write('static const NXWidgets::SRlePaletteBitmapEntry bitmap[] =\n'); outfile.write('{\n'); - + for y in range(0, img.size[1]): entries = encode_row(img, palette, y) row = "" @@ -91,17 +91,17 @@ def write_image(outfile, img, palette): if len(row) > 60: outfile.write(' ' + row + '\n') row = "" - + row += '{%3d, %3d}, ' % (r, c) - + row += ' ' * (73 - len(row)) outfile.write(' ' + row + '/* Row %d */\n' % y) - + outfile.write('};\n\n'); def write_descriptor(outfile, name): '''Write the public descriptor structure for the image.''' - + outfile.write('extern const struct NXWidgets::SRlePaletteBitmap g_%s =\n' % name) outfile.write('{\n') outfile.write(' CONFIG_NXWIDGETS_BPP,\n') @@ -112,19 +112,19 @@ def write_descriptor(outfile, name): outfile.write(' {palette, hilight_palette},\n') outfile.write(' bitmap\n') outfile.write('};\n') - + if __name__ == '__main__': import sys import os.path - + if len(sys.argv) != 3: print "Usage: bitmap_converter.py source.png output.cxx" sys.exit(1) - + img = Image.open(sys.argv[1]).convert("RGB") outfile = open(sys.argv[2], 'w') palette = get_palette(img) - + outfile.write( ''' /* Automatically NuttX bitmap file. */ @@ -142,7 +142,7 @@ if __name__ == '__main__': ) name = os.path.splitext(os.path.basename(sys.argv[1]))[0] - + write_palette(outfile, palette) write_image(outfile, img, palette) write_descriptor(outfile, name) From ba9e38f79a92c00c29da8f4fe48a73713d5cd0ec Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 12 May 2014 13:00:48 -0600 Subject: [PATCH 165/390] Fix typo RBG -> RGB in several macros --- ChangeLog.txt | 3 +++ libnxwidgets/include/nxconfig.hxx | 24 ++++++++++---------- libnxwidgets/src/cscaledbitmap.cxx | 36 +++++++++++++++--------------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6f2259867..deff82bde 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -427,3 +427,6 @@ 1.12 2014-xx-xx Gregory Nutt +* libnxwidgets/include/nxconfig.hxx and libnxwidgets/src/cscaledbitmap.cxx: + Fix typo RBG -> RGB. This makes NxWidgets incompatible with versions of + NuttX 7.2 and below. diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index c2141775b..05c6d8422 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -284,9 +284,9 @@ # endif # define CONFIG_NXWIDGETS_FMT FB_FMT_RGB8_332 # define MKRGB RGBTO8 -# define RGB2RED RBG8RED -# define RGB2GREEN RBG8GREEN -# define RGB2BLUE RBG8BLUE +# define RGB2RED RGB8RED +# define RGB2GREEN RGB8GREEN +# define RGB2BLUE RGB8BLUE # define FONT_RENDERER nxf_convert_8bpp #elif CONFIG_NXWIDGETS_BPP == 16 # ifdef CONFIG_NX_DISABLE_16BPP @@ -294,9 +294,9 @@ # endif # define CONFIG_NXWIDGETS_FMT FB_FMT_RGB16_565 # define MKRGB RGBTO16 -# define RGB2RED RBG16RED -# define RGB2GREEN RBG16GREEN -# define RGB2BLUE RBG16BLUE +# define RGB2RED RGB16RED +# define RGB2GREEN RGB16GREEN +# define RGB2BLUE RGB16BLUE # define FONT_RENDERER nxf_convert_16bpp #elif CONFIG_NXWIDGETS_BPP == 24 # ifdef CONFIG_NX_DISABLE_24BPP @@ -304,9 +304,9 @@ # endif # define CONFIG_NXWIDGETS_FMT FB_FMT_RGB24 # define MKRGB RGBTO24 -# define RGB2RED RBG24RED -# define RGB2GREEN RBG24GREEN -# define RGB2BLUE RBG24BLUE +# define RGB2RED RGB24RED +# define RGB2GREEN RGB24GREEN +# define RGB2BLUE RGB24BLUE # define FONT_RENDERER nxf_convert_24bpp #elif CONFIG_NXWIDGETS_BPP == 32 # ifdef CONFIG_NX_DISABLE_32BPP @@ -314,9 +314,9 @@ # endif # define CONFIG_NXWIDGETS_FMT FB_FMT_RGB32 # define MKRGB RGBTO24 -# define RGB2RED RBG24RED -# define RGB2GREEN RBG24GREEN -# define RGB2BLUE RBG24BLUE +# define RGB2RED RGB24RED +# define RGB2GREEN RGB24GREEN +# define RGB2BLUE RGB24BLUE # define FONT_RENDERER nxf_convert_32bpp #else # error "Pixel depth not supported (CONFIG_NXWIDGETS_BPP)" diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index 083868f70..ad0bd1953 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -511,32 +511,32 @@ bool CScaledBitmap::rowColor(FAR uint8_t *row, b16_t column, #if CONFIG_NXWIDGETS_FMT == FB_FMT_RGB8_332 uint8_t color = row[col1]; - color1.r = RBG8RED(color); - color1.g = RBG8GREEN(color); - color1.b = RBG8BLUE(color); + color1.r = RGB8RED(color); + color1.g = RGB8GREEN(color); + color1.b = RGB8BLUE(color); transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); color = row[col2]; - color2.r = RBG8RED(color); - color2.g = RBG8GREEN(color); - color2.b = RBG8BLUE(color); + color2.r = RGB8RED(color); + color2.g = RGB8GREEN(color); + color2.b = RGB8BLUE(color); transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); #elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB16_565 FAR uint16_t *row16 = (FAR uint16_t*)row; uint16_t color = row16[col1]; - color1.r = RBG16RED(color); - color1.g = RBG16GREEN(color); - color1.b = RBG16BLUE(color); + color1.r = RGB16RED(color); + color1.g = RGB16GREEN(color); + color1.b = RGB16BLUE(color); transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); color = row16[col2]; - color2.r = RBG16RED(color); - color2.g = RBG16GREEN(color); - color2.b = RBG16BLUE(color); + color2.r = RGB16RED(color); + color2.g = RGB16GREEN(color); + color2.b = RGB16BLUE(color); transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); @@ -560,16 +560,16 @@ bool CScaledBitmap::rowColor(FAR uint8_t *row, b16_t column, #elif CONFIG_NXWIDGETS_FMT == FB_FMT_RGB32 FAR uint32_t *row32 = (FAR uint32_t*)row; uint32_t color = row32[col1]; - color1.r = RBG24RED(color); - color1.g = RBG24GREEN(color); - color1.b = RBG24BLUE(color); + color1.r = RGB24RED(color); + color1.g = RGB24GREEN(color); + color1.b = RGB24BLUE(color); transparent1 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); color = row32[col2]; - color2.r = RBG24RED(color); - color2.g = RBG24GREEN(color); - color2.b = RBG24BLUE(color); + color2.r = RGB24RED(color); + color2.g = RGB24GREEN(color); + color2.b = RGB24BLUE(color); transparent2 = (color == CONFIG_NXWIDGETS_TRANSPARENT_COLOR); From a49bca71b16057e033240f00dfb8c6a3d9f16872 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 8 Jul 2014 13:12:36 -0600 Subject: [PATCH 166/390] Fix some recurring typos: postion->position, *atino->*ation --- Kconfig | 2 +- libnxwidgets/include/cbuttonarray.hxx | 2 +- libnxwidgets/src/cbuttonarray.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index 5f956df54..a0f95ad82 100644 --- a/Kconfig +++ b/Kconfig @@ -901,7 +901,7 @@ config NXWM_CALIBRATION_MESSAGES default n ---help--- By default, the calibration screen is clear excecpt for the - calibratino touchpoints. If this options are enabled, then + calibration touchpoints. If this options are enabled, then instructions when to touch and when to release the touch will be added in the center of the display, diff --git a/libnxwidgets/include/cbuttonarray.hxx b/libnxwidgets/include/cbuttonarray.hxx index b45e1ece1..9ff669de5 100644 --- a/libnxwidgets/include/cbuttonarray.hxx +++ b/libnxwidgets/include/cbuttonarray.hxx @@ -296,7 +296,7 @@ namespace NXWidgets * * @param column The column of the button to check. * @param row The row of the button to check. - * @return True if this button is at the cursor postion and highlighted. + * @return True if this button is at the cursor position and highlighted. */ virtual bool isCursorPosition(int column, int row) const; diff --git a/libnxwidgets/src/cbuttonarray.cxx b/libnxwidgets/src/cbuttonarray.cxx index 4efc99f13..0c1df9f08 100644 --- a/libnxwidgets/src/cbuttonarray.cxx +++ b/libnxwidgets/src/cbuttonarray.cxx @@ -313,7 +313,7 @@ bool CButtonArray::setCursorPosition(int column, int row) * * @param column The column of the button to check. * @param row The row of the button to check. - * @return True if this button is at the cursor postion and highlighted. + * @return True if this button is at the cursor position and highlighted. */ bool CButtonArray::isCursorPosition(int column, int row) const From 52c4f8c58e306067ec88db458547733ea826747b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 10 Jul 2014 14:00:56 -0600 Subject: [PATCH 167/390] SAMA5D4-EK: Add an NxWM configuration --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index a0f95ad82..7a903c335 100644 --- a/Kconfig +++ b/Kconfig @@ -277,7 +277,7 @@ config NXWIDGETS_DOUBLECLICK_TIME Default: 350 config NXWIDGETS_KBDBUFFER_SIZE - int "Keybard Buffer Size" + int "Keyboard Buffer Size" default 16 ---help--- Size of incoming character buffer, i.e., the maximum number of From 6e0be1184f36d60f5b58713e196d17b8eb3b400a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 10 Jul 2014 15:29:41 -0600 Subject: [PATCH 168/390] Fixes for clean NxWM build; Updated README files --- libnxwidgets/src/cgraphicsport.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index cbda90d6e..f128c3293 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -192,12 +192,9 @@ void CGraphicsPort::drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_mxpixel_t color) { FAR struct nxgl_rect_s dest; - nxgl_coord_t halfwidth; // Express the line as a rectangle - halfwidth = width >> 1; - dest.pt1.x = x; dest.pt1.y = y; dest.pt2.x = x + width - 1; From b876b1c95d43c496ffa7e9acfcddc794644f3d19 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 14:40:15 -0600 Subject: [PATCH 169/390] NxWM: Rename all glyphs to include the size of the glyph as part of the filename --- nxwm/Makefile | 8 ++++---- .../{glyph_calculator.cxx => glyph_calculator24x25.cxx} | 2 +- .../{glyph_calibration.cxx => glyph_calibration24x21.cxx} | 2 +- nxwm/src/{glyph_cmd.cxx => glyph_cmd25x22.cxx} | 2 +- .../{glyph_mediaplayer.cxx => glyph_mediaplayer24x24.cxx} | 2 +- nxwm/src/{glyph_minimize.cxx => glyph_minimize21x21.cxx} | 2 +- ...layer_controls.cxx => glyph_mplayer_controls32x32.cxx} | 2 +- nxwm/src/{glyph_nsh.cxx => glyph_nsh25x25.cxx} | 2 +- nxwm/src/{glyph_start.cxx => glyph_start25x25.cxx} | 2 +- nxwm/src/{glyph_stop.cxx => glyph_stop21x21.cxx} | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) rename nxwm/src/{glyph_calculator.cxx => glyph_calculator24x25.cxx} (99%) rename nxwm/src/{glyph_calibration.cxx => glyph_calibration24x21.cxx} (99%) rename nxwm/src/{glyph_cmd.cxx => glyph_cmd25x22.cxx} (99%) rename nxwm/src/{glyph_mediaplayer.cxx => glyph_mediaplayer24x24.cxx} (99%) rename nxwm/src/{glyph_minimize.cxx => glyph_minimize21x21.cxx} (99%) rename nxwm/src/{glyph_mplayer_controls.cxx => glyph_mplayer_controls32x32.cxx} (99%) rename nxwm/src/{glyph_nsh.cxx => glyph_nsh25x25.cxx} (99%) rename nxwm/src/{glyph_start.cxx => glyph_start25x25.cxx} (99%) rename nxwm/src/{glyph_stop.cxx => glyph_stop21x21.cxx} (99%) diff --git a/nxwm/Makefile b/nxwm/Makefile index 87a277504..a26bf73cc 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -75,12 +75,12 @@ CXXSRCS += cnxconsole.cxx endif # Images -CXXSRCS += glyph_calculator.cxx glyph_calibration.cxx glyph_cmd.cxx -CXXSRCS += glyph_minimize.cxx glyph_nsh.cxx glyph_play24x24.cxx glyph_start.cxx -CXXSRCS += glyph_stop.cxx +CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.cxx +CXXSRCS += glyph_minimize21x21.cxx glyph_nsh25x25.cxx glyph_play24x24.cxx +CXXSRCS += glyph_start25x25.cxx glyph_stop21x21.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) -CXXSRCS += glyph_mediaplayer.cxx cmediaplayer.cxx glyph_mplayer_controls.cxx +CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx endif SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/src/glyph_calculator.cxx b/nxwm/src/glyph_calculator24x25.cxx similarity index 99% rename from nxwm/src/glyph_calculator.cxx rename to nxwm/src/glyph_calculator24x25.cxx index e8f5376d3..6184212f8 100644 --- a/nxwm/src/glyph_calculator.cxx +++ b/nxwm/src/glyph_calculator24x25.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_calculator.cxx + * NxWidgets/nxwm/src/glyph_calculator24x25.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_calibration.cxx b/nxwm/src/glyph_calibration24x21.cxx similarity index 99% rename from nxwm/src/glyph_calibration.cxx rename to nxwm/src/glyph_calibration24x21.cxx index 3a9a30806..2d01edadf 100644 --- a/nxwm/src/glyph_calibration.cxx +++ b/nxwm/src/glyph_calibration24x21.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_calibration.cxx + * NxWidgets/nxwm/src/glyph_calibration24x21.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_cmd.cxx b/nxwm/src/glyph_cmd25x22.cxx similarity index 99% rename from nxwm/src/glyph_cmd.cxx rename to nxwm/src/glyph_cmd25x22.cxx index cc8b8dca3..4cd66c571 100644 --- a/nxwm/src/glyph_cmd.cxx +++ b/nxwm/src/glyph_cmd25x22.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_cmd.cxx + * NxWidgets/nxwm/src/glyph_cmd24x22.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_mediaplayer.cxx b/nxwm/src/glyph_mediaplayer24x24.cxx similarity index 99% rename from nxwm/src/glyph_mediaplayer.cxx rename to nxwm/src/glyph_mediaplayer24x24.cxx index ee8c1a873..5e8899c38 100644 --- a/nxwm/src/glyph_mediaplayer.cxx +++ b/nxwm/src/glyph_mediaplayer24x24.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_mediaplayer.cxx + * NxWidgets/nxwm/src/glyph_mediaplayer24x24.cxx * * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit diff --git a/nxwm/src/glyph_minimize.cxx b/nxwm/src/glyph_minimize21x21.cxx similarity index 99% rename from nxwm/src/glyph_minimize.cxx rename to nxwm/src/glyph_minimize21x21.cxx index bf228e0b2..275f66862 100644 --- a/nxwm/src/glyph_minimize.cxx +++ b/nxwm/src/glyph_minimize21x21.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_minimize.cxx + * NxWidgets/nxwm/src/glyph_minimize21x21.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_mplayer_controls.cxx b/nxwm/src/glyph_mplayer_controls32x32.cxx similarity index 99% rename from nxwm/src/glyph_mplayer_controls.cxx rename to nxwm/src/glyph_mplayer_controls32x32.cxx index 38da35844..f4cd222b0 100644 --- a/nxwm/src/glyph_mplayer_controls.cxx +++ b/nxwm/src/glyph_mplayer_controls32x32.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_mediaplayer.cxx + * NxWidgets/nxwm/src/glyph_mediaplayer32x32.cxx * * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit diff --git a/nxwm/src/glyph_nsh.cxx b/nxwm/src/glyph_nsh25x25.cxx similarity index 99% rename from nxwm/src/glyph_nsh.cxx rename to nxwm/src/glyph_nsh25x25.cxx index efa83f7ed..23e1507ab 100644 --- a/nxwm/src/glyph_nsh.cxx +++ b/nxwm/src/glyph_nsh25x25.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_nsh.cxx + * NxWidgets/nxwm/src/glyph_nsh25x25.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_start.cxx b/nxwm/src/glyph_start25x25.cxx similarity index 99% rename from nxwm/src/glyph_start.cxx rename to nxwm/src/glyph_start25x25.cxx index 2fd7b3cd1..8bb73e7aa 100644 --- a/nxwm/src/glyph_start.cxx +++ b/nxwm/src/glyph_start25x25.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_start.cxx + * NxWidgets/nxwm/src/glyph_start25x25.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/nxwm/src/glyph_stop.cxx b/nxwm/src/glyph_stop21x21.cxx similarity index 99% rename from nxwm/src/glyph_stop.cxx rename to nxwm/src/glyph_stop21x21.cxx index d9436b5d8..e4142d736 100644 --- a/nxwm/src/glyph_stop.cxx +++ b/nxwm/src/glyph_stop21x21.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/glyph_stop.cxx + * NxWidgets/nxwm/src/glyph_stop21x21.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt From b407d97f524abc6ddedeaf1196b16c041c4a2c10 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 14:41:43 -0600 Subject: [PATCH 170/390] Update ChangeLog --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index deff82bde..46050425c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -430,3 +430,7 @@ * libnxwidgets/include/nxconfig.hxx and libnxwidgets/src/cscaledbitmap.cxx: Fix typo RBG -> RGB. This makes NxWidgets incompatible with versions of NuttX 7.2 and below. +* nxwm/src/glyph_*.c: Rename all ICON glyph files to include the size of the + ICON as part of the file name. This is in preparation for supporting a + set of larger ICONs (2014-7-12). + From 45b1b0629d6d3776d0f37bc9f8d35ce9fdf666a2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 16:35:47 -0600 Subject: [PATCH 171/390] NxWM: Add a 48x48 play icon --- nxwm/src/glyph_play48x48.cxx | 284 +++++++++++++++++++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 nxwm/src/glyph_play48x48.cxx diff --git a/nxwm/src/glyph_play48x48.cxx b/nxwm/src/glyph_play48x48.cxx new file mode 100644 index 000000000..47d188885 --- /dev/null +++ b/nxwm/src/glyph_play48x48.cxx @@ -0,0 +1,284 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_play24x24.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 48 +#define BITMAP_NCOLUMNS 48 +#define BITMAP_NLUTCODES 7 + +#define DARK_PLAY_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_PLAY_ICON + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00bd00, 0xbdbdbd, 0x008400, 0x006600, 0x004e00, 0x003600, /* Codes 1-6 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00fc00, 0xfcfcfc, 0x00b000, 0x008800, 0x006800, 0x004800, /* Codes 1-6 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00fc00, 0xfcfcfc, 0x00b000, 0x008800, 0x006800, 0x004800, /* Codes 1-6 */ +}; + +static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x00ff00, 0xffffff, 0x00dc00, 0x00aa00, 0x008200, 0x005a00, /* Codes 1-6 */ +}; + +# endif /* DARK_PLAY_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_PLAY_ICON + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x05e0, 0xbdf7, 0x0420, 0x0320, 0x0260, 0x01a0, /* Codes 1-6 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0xffff, 0x0580, 0x0440, 0x0340, 0x0240, /* Codes 1-6 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0xffff, 0x0580, 0x0440, 0x0340, 0x0240, /* Codes 1-6 */ +}; + +static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07e0, 0xffff, 0x06e0, 0x0540, 0x0400, 0x02c0, /* Codes 1-6 */ +}; + +# endif /* DARK_PLAY_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_PLAY_ICON + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x6e, 0xbd, 0x4d, 0x3b, 0x2d, 0x1f, /* Codes 1-6 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x93, 0xfc, 0x67, 0x4f, 0x3d, 0x2a, /* Codes 1-6 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x93, 0xfc, 0x67, 0x4f, 0x3d, 0x2a, /* Codes 1-6 */ +}; + +static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x95, 0xff, 0x81, 0x63, 0x4c, 0x34, /* Codes 1-6 */ +}; + +# endif /* DARK_PLAY_ICON */ +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_PLAY_ICON + +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x14, 0xb6, 0x10, 0x0c, 0x08, 0x04, /* Codes 1-6 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0xff, 0x14, 0x10, 0x0c, 0x08, /* Codes 1-6 */ +}; + +# else /* DARK_PLAY_ICON */ + +static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0xff, 0x14, 0x10, 0x0c, 0x08, /* Codes 0-6 */ +}; + +static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x1c, 0xff, 0x18, 0x14, 0x10, 0x08, /* Codes 0-6 */ +}; + +# endif /* DARK_PLAY_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error "Unsupport pixel format" +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = +{ + { 1, 0}, { 2, 1}, { 45, 2}, /* Row 0 */ + { 2, 3}, { 1, 0}, { 2, 1}, { 43, 2}, /* Row 1 */ + { 4, 3}, { 1, 0}, { 2, 1}, { 41, 2}, /* Row 2 */ + { 6, 3}, { 1, 0}, { 2, 1}, { 39, 2}, /* Row 3 */ + { 8, 3}, { 1, 0}, { 2, 1}, { 37, 2}, /* Row 4 */ + { 10, 3}, { 1, 0}, { 2, 1}, { 35, 2}, /* Row 5 */ + { 12, 3}, { 1, 0}, { 2, 1}, { 33, 2}, /* Row 6 */ + { 14, 3}, { 1, 0}, { 2, 1}, { 31, 2}, /* Row 7 */ + { 16, 3}, { 1, 0}, { 2, 1}, { 29, 2}, /* Row 8 */ + { 18, 3}, { 1, 0}, { 2, 1}, { 27, 2}, /* Row 9 */ + { 20, 3}, { 1, 0}, { 2, 1}, { 25, 2}, /* Row 10 */ + { 22, 3}, { 1, 0}, { 2, 1}, { 23, 2}, /* Row 11 */ + { 24, 3}, { 1, 0}, { 2, 1}, { 21, 2}, /* Row 12 */ + { 26, 3}, { 1, 0}, { 2, 1}, { 19, 2}, /* Row 13 */ + { 28, 3}, { 1, 0}, { 2, 1}, { 17, 2}, /* Row 14 */ + { 30, 3}, { 1, 0}, { 2, 1}, { 15, 2}, /* Row 15 */ + { 32, 3}, { 1, 0}, { 2, 1}, { 13, 2}, /* Row 16 */ + { 34, 3}, { 1, 0}, { 2, 1}, { 11, 2}, /* Row 17 */ + { 36, 3}, { 1, 0}, { 2, 1}, { 9, 2}, /* Row 18 */ + { 38, 3}, { 1, 0}, { 2, 1}, { 7, 2}, /* Row 19 */ + { 40, 3}, { 1, 0}, { 2, 1}, { 5, 2}, /* Row 20 */ + { 42, 3}, { 1, 0}, { 2, 1}, { 3, 2}, /* Row 21 */ + { 44, 3}, { 1, 0}, { 2, 1}, { 1, 2}, /* Row 22 */ + { 46, 3}, { 1, 0}, { 1, 1}, /* Row 23 */ + { 46, 4}, { 1, 5}, { 1, 6}, /* Row 24 */ + { 44, 4}, { 1, 5}, { 2, 6}, { 1, 2}, /* Row 25 */ + { 42, 4}, { 3, 6}, { 3, 2}, /* Row 26 */ + { 40, 4}, { 1, 5}, { 2, 6}, { 5, 2}, /* Row 27 */ + { 38, 4}, { 3, 6}, { 7, 2}, /* Row 28 */ + { 36, 4}, { 1, 5}, { 2, 6}, { 9, 2}, /* Row 29 */ + { 34, 4}, { 3, 6}, { 11, 2}, /* Row 30 */ + { 32, 4}, { 1, 5}, { 2, 6}, { 13, 2}, /* Row 31 */ + { 30, 4}, { 3, 6}, { 15, 2}, /* Row 32 */ + { 28, 4}, { 1, 5}, { 2, 6}, { 17, 2}, /* Row 33 */ + { 26, 4}, { 3, 6}, { 19, 2}, /* Row 34 */ + { 24, 4}, { 1, 5}, { 2, 6}, { 21, 2}, /* Row 35 */ + { 22, 4}, { 3, 6}, { 23, 2}, /* Row 36 */ + { 20, 4}, { 1, 5}, { 2, 6}, { 25, 2}, /* Row 37 */ + { 18, 4}, { 3, 6}, { 27, 2}, /* Row 38 */ + { 16, 4}, { 1, 5}, { 2, 6}, { 29, 2}, /* Row 39 */ + { 14, 4}, { 3, 6}, { 31, 2}, /* Row 40 */ + { 12, 4}, { 1, 5}, { 2, 6}, { 33, 2}, /* Row 41 */ + { 10, 4}, { 3, 6}, { 35, 2}, /* Row 42 */ + { 8, 4}, { 1, 5}, { 2, 6}, { 37, 2}, /* Row 43 */ + { 6, 4}, { 3, 6}, { 39, 2}, /* Row 44 */ + { 4, 4}, { 1, 5}, { 2, 6}, { 41, 2}, /* Row 45 */ + { 2, 4}, { 3, 6}, { 43, 2}, /* Row 46 */ + { 1, 5}, { 2, 6}, { 45, 2}, /* Row 47 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_playNormalLut, // Index 0: Unselected LUT + g_playBrightlLut, // Index 1: Selected LUT + }, + g_playRleEntries // data - Pointer to the beginning of the RLE data +}; From 20c811ddebd98c9d9f13693b7497308f422ee30f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 16:36:24 -0600 Subject: [PATCH 172/390] NxWidgets: Fix repeated misspelling of Definitions --- libnxwidgets/src/glyph_arrowdown.cxx | 2 +- libnxwidgets/src/glyph_arrowleft.cxx | 2 +- libnxwidgets/src/glyph_arrowright.cxx | 2 +- libnxwidgets/src/glyph_arrowup.cxx | 2 +- libnxwidgets/src/glyph_backspace.cxx | 2 +- libnxwidgets/src/glyph_capslock.cxx | 2 +- libnxwidgets/src/glyph_checkboxmu.cxx | 2 +- libnxwidgets/src/glyph_checkboxoff.cxx | 2 +- libnxwidgets/src/glyph_checkboxon.cxx | 2 +- libnxwidgets/src/glyph_control.cxx | 2 +- libnxwidgets/src/glyph_cycle.cxx | 2 +- libnxwidgets/src/glyph_nxlogo160x160.cxx | 2 +- libnxwidgets/src/glyph_nxlogo320x320.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonmu.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonoff.cxx | 2 +- libnxwidgets/src/glyph_radiobuttonon.cxx | 2 +- libnxwidgets/src/glyph_return.cxx | 2 +- libnxwidgets/src/glyph_screendepthdown.cxx | 2 +- libnxwidgets/src/glyph_screendepthup.cxx | 2 +- libnxwidgets/src/glyph_screenflipdown.cxx | 2 +- libnxwidgets/src/glyph_screenflipup.cxx | 2 +- libnxwidgets/src/glyph_shift.cxx | 2 +- libnxwidgets/src/glyph_windowclose.cxx | 2 +- libnxwidgets/src/glyph_windowdepthdown.cxx | 2 +- libnxwidgets/src/glyph_windowdepthup.cxx | 2 +- nxwm/include/nxwmconfig.hxx | 2 +- nxwm/include/nxwmglyphs.hxx | 2 +- nxwm/src/glyph_calculator24x25.cxx | 2 +- nxwm/src/glyph_calibration24x21.cxx | 2 +- nxwm/src/glyph_cmd25x22.cxx | 2 +- nxwm/src/glyph_minimize21x21.cxx | 2 +- nxwm/src/glyph_nsh25x25.cxx | 2 +- nxwm/src/glyph_play24x24.cxx | 4 ++-- nxwm/src/glyph_start25x25.cxx | 2 +- nxwm/src/glyph_stop21x21.cxx | 2 +- 35 files changed, 36 insertions(+), 36 deletions(-) diff --git a/libnxwidgets/src/glyph_arrowdown.cxx b/libnxwidgets/src/glyph_arrowdown.cxx index fc200e099..663e0d8d7 100644 --- a/libnxwidgets/src/glyph_arrowdown.cxx +++ b/libnxwidgets/src/glyph_arrowdown.cxx @@ -138,7 +138,7 @@ static const uint32_t g_arrowDownGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_arrowDown = diff --git a/libnxwidgets/src/glyph_arrowleft.cxx b/libnxwidgets/src/glyph_arrowleft.cxx index 143a1c3c1..94773abe0 100644 --- a/libnxwidgets/src/glyph_arrowleft.cxx +++ b/libnxwidgets/src/glyph_arrowleft.cxx @@ -138,7 +138,7 @@ static const uint32_t g_arrowLeftGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_arrowLeft = diff --git a/libnxwidgets/src/glyph_arrowright.cxx b/libnxwidgets/src/glyph_arrowright.cxx index 3f8b833f2..e1b226734 100644 --- a/libnxwidgets/src/glyph_arrowright.cxx +++ b/libnxwidgets/src/glyph_arrowright.cxx @@ -138,7 +138,7 @@ static const uint32_t g_arrowRightGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_arrowRight = diff --git a/libnxwidgets/src/glyph_arrowup.cxx b/libnxwidgets/src/glyph_arrowup.cxx index b1543266c..95e795e1b 100644 --- a/libnxwidgets/src/glyph_arrowup.cxx +++ b/libnxwidgets/src/glyph_arrowup.cxx @@ -138,7 +138,7 @@ static const uint32_t g_arrowUpGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_arrowUp = diff --git a/libnxwidgets/src/glyph_backspace.cxx b/libnxwidgets/src/glyph_backspace.cxx index 5271b0f66..019bd6987 100644 --- a/libnxwidgets/src/glyph_backspace.cxx +++ b/libnxwidgets/src/glyph_backspace.cxx @@ -138,7 +138,7 @@ static const uint32_t g_backspaceGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_backspace = diff --git a/libnxwidgets/src/glyph_capslock.cxx b/libnxwidgets/src/glyph_capslock.cxx index b61d4dbdb..b153e3610 100644 --- a/libnxwidgets/src/glyph_capslock.cxx +++ b/libnxwidgets/src/glyph_capslock.cxx @@ -138,7 +138,7 @@ static const uint32_t g_capslockGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_capslock = diff --git a/libnxwidgets/src/glyph_checkboxmu.cxx b/libnxwidgets/src/glyph_checkboxmu.cxx index 48011b1c8..4a5ade5a5 100644 --- a/libnxwidgets/src/glyph_checkboxmu.cxx +++ b/libnxwidgets/src/glyph_checkboxmu.cxx @@ -138,7 +138,7 @@ static const uint32_t g_checkBoxMuGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_checkBoxMu = diff --git a/libnxwidgets/src/glyph_checkboxoff.cxx b/libnxwidgets/src/glyph_checkboxoff.cxx index 8222bee84..3da0d6f0b 100644 --- a/libnxwidgets/src/glyph_checkboxoff.cxx +++ b/libnxwidgets/src/glyph_checkboxoff.cxx @@ -105,7 +105,7 @@ using namespace NXWidgets; #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_checkBoxOff = diff --git a/libnxwidgets/src/glyph_checkboxon.cxx b/libnxwidgets/src/glyph_checkboxon.cxx index 255c88449..e3395523d 100644 --- a/libnxwidgets/src/glyph_checkboxon.cxx +++ b/libnxwidgets/src/glyph_checkboxon.cxx @@ -138,7 +138,7 @@ static const uint32_t g_checkBoxOnGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_checkBoxOn = diff --git a/libnxwidgets/src/glyph_control.cxx b/libnxwidgets/src/glyph_control.cxx index 4cb8432c1..4867b9f82 100644 --- a/libnxwidgets/src/glyph_control.cxx +++ b/libnxwidgets/src/glyph_control.cxx @@ -138,7 +138,7 @@ static const uint32_t g_controlGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_control = diff --git a/libnxwidgets/src/glyph_cycle.cxx b/libnxwidgets/src/glyph_cycle.cxx index ff3476ff4..445d4da6a 100644 --- a/libnxwidgets/src/glyph_cycle.cxx +++ b/libnxwidgets/src/glyph_cycle.cxx @@ -138,7 +138,7 @@ static const uint32_t g_cycleGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_cycle = diff --git a/libnxwidgets/src/glyph_nxlogo160x160.cxx b/libnxwidgets/src/glyph_nxlogo160x160.cxx index 9eb5746e3..1568bad3f 100644 --- a/libnxwidgets/src/glyph_nxlogo160x160.cxx +++ b/libnxwidgets/src/glyph_nxlogo160x160.cxx @@ -3435,7 +3435,7 @@ static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap160x160 = diff --git a/libnxwidgets/src/glyph_nxlogo320x320.cxx b/libnxwidgets/src/glyph_nxlogo320x320.cxx index b2e1eaad5..dc3f77f95 100644 --- a/libnxwidgets/src/glyph_nxlogo320x320.cxx +++ b/libnxwidgets/src/glyph_nxlogo320x320.cxx @@ -1025,7 +1025,7 @@ static const struct SRlePaletteBitmapEntry g_nuttxRleEntries[] = }; /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SRlePaletteBitmap NXWidgets::g_nuttxBitmap320x320 = diff --git a/libnxwidgets/src/glyph_radiobuttonmu.cxx b/libnxwidgets/src/glyph_radiobuttonmu.cxx index 896129ffc..13250f034 100644 --- a/libnxwidgets/src/glyph_radiobuttonmu.cxx +++ b/libnxwidgets/src/glyph_radiobuttonmu.cxx @@ -138,7 +138,7 @@ static const uint32_t g_radioButtonMuGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_radioButtonMu = diff --git a/libnxwidgets/src/glyph_radiobuttonoff.cxx b/libnxwidgets/src/glyph_radiobuttonoff.cxx index 7b832a15a..6fccbf194 100644 --- a/libnxwidgets/src/glyph_radiobuttonoff.cxx +++ b/libnxwidgets/src/glyph_radiobuttonoff.cxx @@ -138,7 +138,7 @@ static const uint32_t g_radioButtonOffGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_radioButtonOff = diff --git a/libnxwidgets/src/glyph_radiobuttonon.cxx b/libnxwidgets/src/glyph_radiobuttonon.cxx index 919d11c75..6d328a799 100644 --- a/libnxwidgets/src/glyph_radiobuttonon.cxx +++ b/libnxwidgets/src/glyph_radiobuttonon.cxx @@ -140,7 +140,7 @@ static const uint32_t g_radioButtonOnGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_radioButtonOn = diff --git a/libnxwidgets/src/glyph_return.cxx b/libnxwidgets/src/glyph_return.cxx index 951d3a9d0..ea1dbdddc 100644 --- a/libnxwidgets/src/glyph_return.cxx +++ b/libnxwidgets/src/glyph_return.cxx @@ -138,7 +138,7 @@ static const uint32_t g_returnGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_return = diff --git a/libnxwidgets/src/glyph_screendepthdown.cxx b/libnxwidgets/src/glyph_screendepthdown.cxx index dab46122f..d3efc2a97 100644 --- a/libnxwidgets/src/glyph_screendepthdown.cxx +++ b/libnxwidgets/src/glyph_screendepthdown.cxx @@ -138,7 +138,7 @@ static const uint32_t g_screenDepthDownGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_screenDepthDown = diff --git a/libnxwidgets/src/glyph_screendepthup.cxx b/libnxwidgets/src/glyph_screendepthup.cxx index 9826bc4ce..974035058 100644 --- a/libnxwidgets/src/glyph_screendepthup.cxx +++ b/libnxwidgets/src/glyph_screendepthup.cxx @@ -138,7 +138,7 @@ static const uint32_t g_screenDepthUpGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_screenDepthUp = diff --git a/libnxwidgets/src/glyph_screenflipdown.cxx b/libnxwidgets/src/glyph_screenflipdown.cxx index d3e45504d..20e2280f1 100644 --- a/libnxwidgets/src/glyph_screenflipdown.cxx +++ b/libnxwidgets/src/glyph_screenflipdown.cxx @@ -138,7 +138,7 @@ static const uint32_t g_screenFlipDownGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_screenFlipDown = diff --git a/libnxwidgets/src/glyph_screenflipup.cxx b/libnxwidgets/src/glyph_screenflipup.cxx index bb928e262..8fbf3d740 100644 --- a/libnxwidgets/src/glyph_screenflipup.cxx +++ b/libnxwidgets/src/glyph_screenflipup.cxx @@ -138,7 +138,7 @@ static const uint32_t g_screenFlipUpGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_screenFlipUp = diff --git a/libnxwidgets/src/glyph_shift.cxx b/libnxwidgets/src/glyph_shift.cxx index 77b0d186b..486b1ef8c 100644 --- a/libnxwidgets/src/glyph_shift.cxx +++ b/libnxwidgets/src/glyph_shift.cxx @@ -138,7 +138,7 @@ static const uint32_t g_shiftGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_shift = diff --git a/libnxwidgets/src/glyph_windowclose.cxx b/libnxwidgets/src/glyph_windowclose.cxx index bd176f412..7f2ac4a7f 100644 --- a/libnxwidgets/src/glyph_windowclose.cxx +++ b/libnxwidgets/src/glyph_windowclose.cxx @@ -138,7 +138,7 @@ static const uint32_t g_windowCloseGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_windowClose = diff --git a/libnxwidgets/src/glyph_windowdepthdown.cxx b/libnxwidgets/src/glyph_windowdepthdown.cxx index 5bf616047..f1971937f 100644 --- a/libnxwidgets/src/glyph_windowdepthdown.cxx +++ b/libnxwidgets/src/glyph_windowdepthdown.cxx @@ -138,7 +138,7 @@ static const uint32_t g_windowDepthDownGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_windowDepthDown = diff --git a/libnxwidgets/src/glyph_windowdepthup.cxx b/libnxwidgets/src/glyph_windowdepthup.cxx index 584b51b21..9663e18ab 100644 --- a/libnxwidgets/src/glyph_windowdepthup.cxx +++ b/libnxwidgets/src/glyph_windowdepthup.cxx @@ -138,7 +138,7 @@ static const uint32_t g_windowDepthUpGlyph[] = #endif /**************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ****************************************************************************/ const struct SBitmap NXWidgets::g_windowDepthUp = diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index e1feedcf0..b6c4d6da4 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -313,7 +313,7 @@ */ #ifndef CONFIG_NXWM_STARTWINDOW_ICON -# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap24x24 +# define CONFIG_NXWM_STARTWINDOW_ICON NxWM::g_playBitmap #endif /** diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 523130349..0e8e9545b 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -70,7 +70,7 @@ namespace NxWM #endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; - extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap24x24; + extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } diff --git a/nxwm/src/glyph_calculator24x25.cxx b/nxwm/src/glyph_calculator24x25.cxx index 6184212f8..8575e90f7 100644 --- a/nxwm/src/glyph_calculator24x25.cxx +++ b/nxwm/src/glyph_calculator24x25.cxx @@ -173,7 +173,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calculatorRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = diff --git a/nxwm/src/glyph_calibration24x21.cxx b/nxwm/src/glyph_calibration24x21.cxx index 2d01edadf..fb1c5e6bc 100644 --- a/nxwm/src/glyph_calibration24x21.cxx +++ b/nxwm/src/glyph_calibration24x21.cxx @@ -180,7 +180,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = diff --git a/nxwm/src/glyph_cmd25x22.cxx b/nxwm/src/glyph_cmd25x22.cxx index 4cd66c571..891be86dd 100644 --- a/nxwm/src/glyph_cmd25x22.cxx +++ b/nxwm/src/glyph_cmd25x22.cxx @@ -163,7 +163,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_cmdRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = diff --git a/nxwm/src/glyph_minimize21x21.cxx b/nxwm/src/glyph_minimize21x21.cxx index 275f66862..977f13864 100644 --- a/nxwm/src/glyph_minimize21x21.cxx +++ b/nxwm/src/glyph_minimize21x21.cxx @@ -161,7 +161,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = diff --git a/nxwm/src/glyph_nsh25x25.cxx b/nxwm/src/glyph_nsh25x25.cxx index 23e1507ab..9dec2b35f 100644 --- a/nxwm/src/glyph_nsh25x25.cxx +++ b/nxwm/src/glyph_nsh25x25.cxx @@ -197,7 +197,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_nshRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_nshBitmap = diff --git a/nxwm/src/glyph_play24x24.cxx b/nxwm/src/glyph_play24x24.cxx index c96ef0b03..4fa1e8d3a 100644 --- a/nxwm/src/glyph_play24x24.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -240,10 +240,10 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ -const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap24x24 = +const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = { CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel CONFIG_NXWIDGETS_FMT, // fmt - Color format diff --git a/nxwm/src/glyph_start25x25.cxx b/nxwm/src/glyph_start25x25.cxx index 8bb73e7aa..0a02f0692 100644 --- a/nxwm/src/glyph_start25x25.cxx +++ b/nxwm/src/glyph_start25x25.cxx @@ -198,7 +198,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_startRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_startBitmap = diff --git a/nxwm/src/glyph_stop21x21.cxx b/nxwm/src/glyph_stop21x21.cxx index e4142d736..9b85913e5 100644 --- a/nxwm/src/glyph_stop21x21.cxx +++ b/nxwm/src/glyph_stop21x21.cxx @@ -176,7 +176,7 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] = }; /******************************************************************************************** - * Public Bitmap Structure Defintions + * Public Bitmap Structure Definitions ********************************************************************************************/ const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap = From 19894fb4bd18469e8b810bf29d2488707205c00a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 16:37:59 -0600 Subject: [PATCH 173/390] Update ChangeLog --- ChangeLog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 46050425c..8544fc92b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -430,7 +430,8 @@ * libnxwidgets/include/nxconfig.hxx and libnxwidgets/src/cscaledbitmap.cxx: Fix typo RBG -> RGB. This makes NxWidgets incompatible with versions of NuttX 7.2 and below. -* nxwm/src/glyph_*.c: Rename all ICON glyph files to include the size of the +* nxwm/src/glyph_*.cxx: Rename all ICON glyph files to include the size of the ICON as part of the file name. This is in preparation for supporting a set of larger ICONs (2014-7-12). +* nxwm/src/glyph_play48x48.cxx: Add a larger NxWM play icon (2014-7-12). From 053b3b20f489f0a19bb24d375e276d09cfc6a353 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 16:55:00 -0600 Subject: [PATCH 174/390] NxWM: Fix background color in 48x48 play glyph --- nxwm/src/glyph_play48x48.cxx | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/nxwm/src/glyph_play48x48.cxx b/nxwm/src/glyph_play48x48.cxx index 47d188885..526606e62 100644 --- a/nxwm/src/glyph_play48x48.cxx +++ b/nxwm/src/glyph_play48x48.cxx @@ -75,28 +75,28 @@ using namespace NxWM; static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00bd00, 0xbdbdbd, 0x008400, 0x006600, 0x004e00, 0x003600, /* Codes 1-6 */ + 0x00a200, 0x00bd00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x008400, 0x006600, 0x004e00, 0x003600 /* Codes 3-6 */ }; static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00fc00, 0xfcfcfc, 0x00b000, 0x008800, 0x006800, 0x004800, /* Codes 1-6 */ + 0x00d800, 0x00fc00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x00b000, 0x008800, 0x006800, 0x004800 /* Codes 3-6 */ }; # else /* DARK_PLAY_ICON */ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00fc00, 0xfcfcfc, 0x00b000, 0x008800, 0x006800, 0x004800, /* Codes 1-6 */ + 0x00d800, 0x00fc00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x00b000, 0x008800, 0x006800, 0x004800 /* Codes 3-6 */ }; static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x00ff00, 0xffffff, 0x00dc00, 0x00aa00, 0x008200, 0x005a00, /* Codes 1-6 */ + 0x00ff00, 0x00ff00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x00dc00, 0x00aa00, 0x008200, 0x005a00 /* Codes 3-6 */ }; # endif /* DARK_PLAY_ICON */ @@ -108,28 +108,28 @@ static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x05e0, 0xbdf7, 0x0420, 0x0320, 0x0260, 0x01a0, /* Codes 1-6 */ + 0x0500, 0x05e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x0420, 0x0320, 0x0260, 0x01a0 /* Codes 3-6 */ }; static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0xffff, 0x0580, 0x0440, 0x0340, 0x0240, /* Codes 1-6 */ + 0x06c0, 0x07e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x0580, 0x0440, 0x0340, 0x0240 /* Codes 3-6 */ }; # else /* DARK_PLAY_ICON */ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0xffff, 0x0580, 0x0440, 0x0340, 0x0240, /* Codes 1-6 */ + 0x06c0, 0x07e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x0580, 0x0440, 0x0340, 0x0240 /* Codes 3-6 */ }; static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x07e0, 0xffff, 0x06e0, 0x0540, 0x0400, 0x02c0, /* Codes 1-6 */ + 0x07e0, 0x07e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x06e0, 0x0540, 0x0400, 0x02c0 /* Codes 3-6 */ }; # endif /* DARK_PLAY_ICON */ @@ -150,28 +150,28 @@ static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x6e, 0xbd, 0x4d, 0x3b, 0x2d, 0x1f, /* Codes 1-6 */ + 0x5f, 0x6e, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x4d, 0x3b, 0x2d, 0x1f /* Codes 3-6 */ }; static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x93, 0xfc, 0x67, 0x4f, 0x3d, 0x2a, /* Codes 1-6 */ + 0x7e, 0x93, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x67, 0x4f, 0x3d, 0x2a /* Codes 3-6 */ }; # else /* DARK_PLAY_ICON */ static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x93, 0xfc, 0x67, 0x4f, 0x3d, 0x2a, /* Codes 1-6 */ + 0x7e, 0x93, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x67, 0x4f, 0x3d, 0x2a /* Codes 3-6 */ }; static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x95, 0xff, 0x81, 0x63, 0x4c, 0x34, /* Codes 1-6 */ + 0x95, 0x95, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x81, 0x63, 0x4c, 0x34 /* Codes 3-6 */ }; # endif /* DARK_PLAY_ICON */ @@ -183,28 +183,28 @@ static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x14, 0xb6, 0x10, 0x0c, 0x08, 0x04, /* Codes 1-6 */ + 0x14, 0x14, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x10, 0x0c, 0x08, 0x04 /* Codes 3-6 */ }; static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0xff, 0x14, 0x10, 0x0c, 0x08, /* Codes 1-6 */ + 0x18, 0x1c, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x14, 0x10, 0x0c, 0x08 /* Codes 3-6 */ }; # else /* DARK_PLAY_ICON */ static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0xff, 0x14, 0x10, 0x0c, 0x08, /* Codes 0-6 */ + 0x18, 0x1c, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x14, 0x10, 0x0c, 0x08 /* Codes 3-6 */ }; static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x1c, 0xff, 0x18, 0x14, 0x10, 0x08, /* Codes 0-6 */ + 0x1c, 0x1c, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ + 0x18, 0x14, 0x10, 0x08 /* Codes 3-6 */ }; # endif /* DARK_PLAY_ICON */ From b310bba248db239729d19acfad875a5c683561e8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 09:58:50 -0600 Subject: [PATCH 175/390] NxWM: Add 47x49 calculator icon --- nxwm/images/calculator47x49.png | Bin 0 -> 476 bytes nxwm/src/glyph_calculator47x49.cxx | 395 +++++++++++++++++++++++++++++ 2 files changed, 395 insertions(+) create mode 100755 nxwm/images/calculator47x49.png create mode 100644 nxwm/src/glyph_calculator47x49.cxx diff --git a/nxwm/images/calculator47x49.png b/nxwm/images/calculator47x49.png new file mode 100755 index 0000000000000000000000000000000000000000..ce1a0fd05a77339505639cea162a54904203ccc4 GIT binary patch literal 476 zcmV<20VDp2P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RZ2MrG<28Bzq9smFVZb?KzRA}Dq zmrZWMFc3yxQ;@psqSE*j&MCr)aymGLeG1QtJ&I@-6>Wh0BAVE$XNf*LFOHdKzl0Dz zNwA!AYyds}Gqm@9)!ZPwF$QaG=ROk=R22~!%}t$e?sG@aHmZtq z?rx&n!9%(B!=90w)@@o~?N22los+DU8|?G#0aLGuOXrH%fac_isS{Xhqswi&+R|n4 z?ZEaO_mb<{lYf~THEf@bW5|tmo0#``Htf`JOlJW ST=Iti0000 + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 49 +#define BITMAP_NCOLUMNS 47 +#define BITMAP_NLUTCODES 22 + +#define DARK_CALCULATOR_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_CALCULATOR_ICON + +static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xaeaeae, 0x8a8a8a, 0xbdbdbd, 0x575757, 0x57698a, 0x57788a, 0x577b8a, 0x577b9c, /* Codes 0-7 */ + 0x364569, 0x4b6c96, 0x48699c, 0x486c99, 0x45699c, 0x45698a, 0x243669, 0x57699c, /* Codes 8-15 */ + 0x36577b, 0x9c9c9c, 0x7b7b7b, 0x454545, 0x696969, 0x000000 /* Codes 16-21 */ +}; + +static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xe8e8e8, 0xb8b8b8, 0xfcfcfc, 0x747474, 0x748cb8, 0x74a0b8, 0x74a4b8, 0x74a4d0, /* Codes 0-7 */ + 0x485c8c, 0x6490c8, 0x608cd0, 0x6090cc, 0x5c8cd0, 0x5c8cb8, 0x30488c, 0x748cd0, /* Codes 8-15 */ + 0x4874a4, 0xd0d0d0, 0xa4a4a4, 0x5c5c5c, 0x8c8c8c, 0x000000 /* Codes 16-21 */ +}; + +# else /* DARK_CALCULATOR_ICON */ + +static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xe8e8e8, 0xb8b8b8, 0xfcfcfc, 0x747474, 0x748cb8, 0x74a0b8, 0x74a4b8, 0x74a4d0, /* Codes 0-7 */ + 0x485c8c, 0x6490c8, 0x608cd0, 0x6090cc, 0x5c8cd0, 0x5c8cb8, 0x30488c, 0x748cd0, /* Codes 8-15 */ + 0x4874a4, 0xd0d0d0, 0xa4a4a4, 0x5c5c5c, 0x8c8c8c, 0x000000 /* Codes 16-21 */ +}; + +static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffffff, 0xe6e6e6, 0xffffff, 0x919191, 0x91afe6, 0x91c8e6, 0x91cde6, 0x91cdff, /* Codes 0-7 */ + 0x5a73af, 0x7db4fa, 0x78afff, 0x78b4ff, 0x73afff, 0x73afe6, 0x3c5aaf, 0x91afff, /* Codes 8-15 */ + 0x5a91cd, 0xffffff, 0xcdcdcd, 0x737373, 0xafafaf, 0x000000 /* Codes 16-21 */ +}; +# endif /* DARK_CALCULATOR_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_CALCULATOR_ICON + +static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xad75, 0x8c51, 0xbdf7, 0x52aa, 0x5351, 0x53d1, 0x53d1, 0x53d3, 0x322d, 0x4b72, /* Codes 0-9 */ + 0x4b53, 0x4b73, 0x4353, 0x4351, 0x21ad, 0x5353, 0x32af, 0x9cf3, 0x7bcf, 0x4228, /* Codes 10-19 */ + 0x6b4d, 0x0000 /* Codes 20-21 */ +}; + +static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xef5d, 0xbdd7, 0xffff, 0x73ae, 0x7477, 0x7517, 0x7537, 0x753a, 0x4af1, 0x6499, /* Codes 0-9 */ + 0x647a, 0x6499, 0x5c7a, 0x5c77, 0x3251, 0x747a, 0x4bb4, 0xd69a, 0xa534, 0x5aeb, /* Codes 10-19 */ + 0x8c71, 0x0000 /* Codes 20-21 */ +}; + +# else /* DARK_CALCULATOR_ICON */ + +static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xef5d, 0xbdd7, 0xffff, 0x73ae, 0x7477, 0x7517, 0x7537, 0x753a, 0x4af1, 0x6499, /* Codes 0-9 */ + 0x647a, 0x6499, 0x5c7a, 0x5c77, 0x3251, 0x747a, 0x4bb4, 0xd69a, 0xa534, 0x5aeb, /* Codes 10-19 */ + 0x8c71, 0x0000 /* Codes 20-21 */ +}; + +static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0xe73c, 0xffff, 0x9492, 0x957c, 0x965c, 0x967c, 0x967f, 0x5b95, 0x7dbf, /* Codes 0-9 */ + 0x7d7f, 0x7dbf, 0x757f, 0x757c, 0x3ad5, 0x957f, 0x5c99, 0xffff, 0xce79, 0x738e, /* Codes 10-19 */ + 0xad75, 0x0000 /* Codes 20-21 */ +}; + +# endif /* DARK_CALCULATOR_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_CALCULATOR_ICON + +static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xae, 0x8a, 0xbd, 0x57, 0x67, 0x70, 0x71, 0x73, 0x44, 0x66, 0x64, 0x66, 0x64, 0x61, 0x36, 0x69, /* Codes 0-15 */ + 0x51, 0x9c, 0x7b, 0x45, 0x69, 0x00 /* Codes 16-21 */ +}; + +static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xe8, 0xb8, 0xfc, 0x74, 0x89, 0x95, 0x97, 0x9a, 0x5b, 0x89, 0x86, 0x88, 0x85, 0x82, 0x48, 0x8c, /* Codes 0-15 */ + 0x6c, 0xd0, 0xa4, 0x5c, 0x8c, 0x00 /* Codes 16-21 */ +}; + +# else /* DARK_CALCULATOR_ICON */ + +static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xe8, 0xb8, 0xfc, 0x74, 0x89, 0x95, 0x97, 0x9a, 0x5b, 0x89, 0x86, 0x88, 0x85, 0x82, 0x48, 0x8c, /* Codes 0-15 */ + 0x6c, 0xd0, 0xa4, 0x5c, 0x8c, 0x00 /* Codes 16-21 */ +}; + +static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xe6, 0xff, 0x91, 0xac, 0xba, 0xbd, 0xc0, 0x72, 0xab, 0xa7, 0xaa, 0xa6, 0xa3, 0x5a, 0xaf, /* Codes 0-15 */ + 0x87, 0xff, 0xcd, 0x73, 0xaf, 0x00 /* Codes 16-21 */ +}; + +# endif /* DARK_CALCULATOR_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_CALCULATOR_ICON + +static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xb6, 0x92, 0xb6, 0x49, 0x4e, 0x4e, 0x4e, 0x4e, 0x29, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x25, 0x4e, /* Codes 0-15 */ + 0x29, 0x92, 0x6d, 0x49, 0x6d, 0x00 /* Codes 16-21 */ +}; + +static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xb6, 0xff, 0x6d, 0x72, 0x76, 0x76, 0x77, 0x4a, 0x73, 0x73, 0x73, 0x53, 0x52, 0x2a, 0x73, /* Codes 0-15 */ + 0x4e, 0xdb, 0xb6, 0x49, 0x92, 0x00 /* Codes 16-21 */ +}; + +# else /* DARK_CALCULATOR_ICON */ + +static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xb6, 0xff, 0x6d, 0x72, 0x76, 0x76, 0x77, 0x4a, 0x73, 0x73, 0x73, 0x53, 0x52, 0x2a, 0x73, /* Codes 0-15 */ + 0x4e, 0xdb, 0xb6, 0x49, 0x92, 0x00 /* Codes 16-21 */ +}; + +static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xff, 0xff, 0x92, 0x97, 0x9b, 0x9b, 0x9b, 0x4e, 0x77, 0x77, 0x77, 0x77, 0x77, 0x2a, 0x97, /* Codes 0-15 */ + 0x53, 0xff, 0xdb, 0x6d, 0xb6, 0x00 /* Codes 16-21 */ +}; + +# endif /* DARK_CALCULATOR_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_calculatorRleEntries[] = +{ + { 46, 0}, { 1, 1}, { 1, 0}, /* Row 0 */ + { 45, 2}, { 1, 1}, { 1, 0}, { 1, 2}, /* Row 1 */ + { 43, 1}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, /* Row 2 */ + { 41, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, /* Row 3 */ + { 1, 4}, { 1, 5}, { 34, 6}, { 1, 7}, { 1, 4}, { 1, 8}, { 1, 3}, { 1, 0}, /* Row 4 */ + { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, + { 1, 9}, { 1, 10}, { 2, 11}, { 32, 12}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, /* Row 5 */ + { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, + { 35, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 6 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 1, 15}, + { 34, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 7 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 2, 15}, + { 33, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 8 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 3, 15}, + { 32, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 9 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 4, 15}, + { 31, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 10 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 5, 15}, + { 30, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 11 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 6}, { 1, 12}, { 6, 15}, + { 29, 15}, { 1, 13}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 12 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 4}, { 8, 13}, + { 28, 13}, { 1, 16}, { 1, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 13 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 8}, { 9, 14}, + { 29, 14}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, /* Row 14 */ + { 12, 3}, + { 29, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, /* Row 15 */ + { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 1, 17}, + { 5, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 1}, /* Row 16 */ + { 6, 17}, { 1, 18}, { 2, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, + { 1, 17}, { 1, 2}, { 1, 0}, + { 4, 0}, { 1, 1}, { 2, 3}, { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 2, 3}, /* Row 17 */ + { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, + { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, + { 4, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 1, 18}, + { 3, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, /* Row 18 */ + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, + { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, { 1, 1}, { 1, 19}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, /* Row 19 */ + { 3, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, + { 3, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, + { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 20}, + { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, /* Row 20 */ + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, /* Row 21 */ + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 3, 20}, { 2, 1}, { 1, 19}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, /* Row 22 */ + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, { 1, 3}, + { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 18}, + { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, + { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, /* Row 23 */ + { 1, 3}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, + { 1, 1}, { 2, 3}, { 8, 19}, { 2, 3}, { 8, 19}, { 1, 3}, + { 1, 3}, { 8, 19}, { 2, 3}, { 8, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, /* Row 24 */ + { 1, 0}, { 1, 2}, { 1, 1}, { 22, 3}, + { 19, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, /* Row 25 */ + { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, + { 1, 1}, { 1, 17}, + { 5, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 0}, /* Row 26 */ + { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 2}, + { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 2}, { 1, 0}, + { 4, 0}, { 1, 1}, { 2, 3}, { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 1, 19}, /* Row 27 */ + { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, + { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, + { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, + { 1, 1}, { 1, 18}, + { 3, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, /* Row 28 */ + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, { 1, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, { 1, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, /* Row 29 */ + { 3, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, + { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 20}, + { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, /* Row 30 */ + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, /* Row 31 */ + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, { 1, 3}, + { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, /* Row 32 */ + { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, + { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, + { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, + { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, /* Row 33 */ + { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 2, 3}, { 8, 19}, { 2, 3}, { 8, 19}, + { 3, 3}, { 7, 19}, { 1, 3}, + { 1, 3}, { 8, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, /* Row 34 */ + { 1, 1}, { 32, 3}, + { 9, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, /* Row 35 */ + { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, + { 1, 1}, { 6, 17}, { 1, 18}, { 2, 3}, { 1, 1}, { 1, 17}, + { 5, 17}, { 1, 18}, { 2, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, /* Row 36 */ + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, + { 1, 17}, { 1, 2}, { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 2}, + { 5, 0}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 2}, { 1, 0}, + { 4, 0}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 37 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, + { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, { 1, 19}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 1}, { 4, 18}, { 1, 1}, { 1, 19}, { 1, 3}, + { 1, 17}, { 1, 0}, { 1, 1}, { 1, 18}, + { 3, 18}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 38 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 3}, { 1, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 3}, { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, /* Row 39 */ + { 1, 0}, { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 2, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 2, 3}, + { 1, 20}, + { 1, 20}, { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, /* Row 40 */ + { 1, 2}, { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 1, 3}, { 3, 20}, + { 1, 1}, { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, /* Row 41 */ + { 1, 1}, { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, + { 1, 3}, { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, { 1, 3}, + { 1, 17}, { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, { 1, 19}, { 1, 3}, { 1, 17}, + { 1, 0}, { 1, 18}, { 3, 20}, { 2, 1}, + { 1, 19}, { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, /* Row 42 */ + { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, + { 1, 3}, { 1, 19}, { 1, 3}, { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, { 1, 3}, + { 1, 18}, { 6, 1}, { 1, 3}, { 1, 19}, + { 1, 3}, { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 2, 3}, /* Row 43 */ + { 8, 19}, { 2, 3}, { 8, 19}, { 2, 3}, { 8, 19}, { 2, 3}, { 8, 19}, { 1, 3}, + { 1, 0}, { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 1, 1}, { 41, 3}, { 1, 0}, /* Row 44 */ + { 1, 2}, { 1, 1}, { 1, 0}, { 1, 2}, { 43, 0}, { 1, 2}, /* Row 45 */ + { 1, 1}, { 1, 0}, { 45, 2}, { 1, 1}, /* Row 46 */ + { 47, 1}, { 1, 21} /* Row 47 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calculatorNormalLut, // Index 0: Unselected LUT + g_calculatorBrightlLut, // Index 1: Selected LUT + }, + g_calculatorRleEntries // data - Pointer to the beginning of the RLE data +}; From f2585810fa46924106c7255fbb4954767e909533 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 10:00:01 -0600 Subject: [PATCH 176/390] Update changelog --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8544fc92b..0579388f5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -434,4 +434,6 @@ ICON as part of the file name. This is in preparation for supporting a set of larger ICONs (2014-7-12). * nxwm/src/glyph_play48x48.cxx: Add a larger NxWM play icon (2014-7-12). +* nxwm/src/glyph_caclulator47x49.cxx: Add a larger NxWM calculator icon + (2014-7-13). From 8288004f520cd1161b4765e41414de9df23cf84f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 10:48:29 -0600 Subject: [PATCH 177/390] NxWM: Add 49x43 NxConsole icon --- nxwm/images/cmd49x43.png | Bin 0 -> 358 bytes nxwm/src/glyph_cmd49x43.cxx | 306 ++++++++++++++++++++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100755 nxwm/images/cmd49x43.png create mode 100644 nxwm/src/glyph_cmd49x43.cxx diff --git a/nxwm/images/cmd49x43.png b/nxwm/images/cmd49x43.png new file mode 100755 index 0000000000000000000000000000000000000000..c90b4f967fcc8b9debb18e0000678e8997099098 GIT binary patch literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^hCr;%!3HERUQBohq!^2X+?^QKos)S9vL>4nJ za0`PlBg3pY5H=O_IvES0t%{WJPpf%LO(oR978hhy}fafw?%=6?ZLc49=3_D z5=)v(1a3M@wAj9rd*`!5W`&{n)9c?{mG%E#ikf)b#MhsR_r2{=iIwU~UYdeMB_)k7 z&ifrG{P|Pk{p!+nJLHaSls%$;)n@Pf(8+g~f4i-zvu@e9`<=B7Z34d;t>*p{{VcNT zn#OFW?<-t57_|zsb9c^7>iNN;v?x(x-Nteu!5S80XUA2SIXO33Bn2w0zR$^WLd(hJ zMCi9K0v(bGJqPbtUuB4n>YjPtT_?0*rn#(+Oypjrq_wS4+3WcfPe$h)6 + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 43 +#define BITMAP_NCOLUMNS 49 +#define BITMAP_NLUTCODES 11 + +#define __DARK_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef __DARK_ICON + +static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x969696, 0x545454, 0x2a2a2a, 0x818181, 0x001581, 0xab0000, 0x0015ab, 0xbd0000, /* Codes 0-7 */ + 0xbdbdbd, 0x3f3f3f, 0x000000 /* Codes 8-10 */ +}; + +static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xc8c8c8, 0x707070, 0x383838, 0xacacac, 0x001cac, 0xe40000, 0x001ce4, 0xfc0000, /* Codes 0-7 */ + 0xfcfcfc, 0x545454, 0x000000 /* Codes 8-10 */ +}; + +# else /* __DARK_ICON */ + +static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0xc8c8c8, 0x707070, 0x383838, 0xacacac, 0x001cac, 0xe40000, 0x001ce4, 0xfc0000, /* Codes 0-7 */ + 0xfcfcfc, 0x545454, 0x000000 /* Codes 8-10 */ +}; + +static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xfafafa, 0x8c8c8c, 0x464646, 0xd7d7d7, 0x0023d7, 0xff0000, 0x0023ff, 0xff0000, /* Codes 0-7 */ + 0xffffff, 0x696969, 0x000000 /* Codes 8-10 */ +}; +# endif /* __DARK_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef __DARK_ICON + +static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x94b2, 0x52aa, 0x2945, 0x8410, 0x00b0, 0xa800, 0x00b5, 0xb800, 0xbdf7, 0x39e7, /* Codes 0-9 */ + 0x0000 /* Codes 10-10 */ +}; + +static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xce59, 0x738e, 0x39c7, 0xad75, 0x00f5, 0xe000, 0x00fc, 0xf800, 0xffff, 0x52aa, /* Codes 0-9 */ + 0x0000 /* Codes 10-10 */ +}; + +# else /* __DARK_ICON */ + +static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0xce59, 0x738e, 0x39c7, 0xad75, 0x00f5, 0xe000, 0x00fc, 0xf800, 0xffff, 0x52aa, /* Codes 0-9 */ + 0x0000 /* Codes 10-10 */ +}; + +static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffdf, 0x8c71, 0x4228, 0xd6ba, 0x011a, 0xf800, 0x011f, 0xf800, 0xffff, 0x6b4d, /* Codes 0-9 */ + 0x0000 /* Codes 10-10 */ +}; + +# endif /* __DARK_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef __DARK_ICON + +static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x96, 0x54, 0x2a, 0x81, 0x1b, 0x33, 0x1f, 0x38, 0xbd, 0x3f, 0x00 /* Codes 0-10 */ +}; + +static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xc8, 0x70, 0x38, 0xac, 0x24, 0x44, 0x2a, 0x4b, 0xfc, 0x54, 0x00 /* Codes 0-10 */ +}; + +# else /* __DARK_ICON */ + +static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0xc8, 0x70, 0x38, 0xac, 0x24, 0x44, 0x2a, 0x4b, 0xfc, 0x54, 0x00 /* Codes 0-10 */ +}; + +static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xfa, 0x8c, 0x46, 0xd7, 0x2d, 0x4c, 0x31, 0x4c, 0xff, 0x69, 0x00 /* Codes 0-10 */ +}; + +# endif /* __DARK_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef __DARK_ICON + +static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0x92, 0x49, 0x24, 0x92, 0x02, 0xa0, 0x02, 0xa0, 0xb6, 0x24, 0x00 /* Codes 0-10 */ +}; + +static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0x6d, 0x24, 0xb6, 0x02, 0xe0, 0x03, 0xe0, 0xff, 0x49, 0x00 /* Codes 0-10 */ +}; + +# else /* __DARK_ICON */ + +static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0x6d, 0x24, 0xb6, 0x02, 0xe0, 0x03, 0xe0, 0xff, 0x49, 0x00 /* Codes 0-10 */ +}; + +static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0x92, 0x49, 0xdb, 0x07, 0xe0, 0x07, 0xe0, 0xff, 0x6d, 0x00 /* Codes 0-10 */ +}; + +# endif /* __DARK_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_cmdRleEntries[] = +{ + { 47, 0}, { 1, 1}, /* Row 0 */ + { 1, 2}, { 1, 0}, { 46, 3}, /* Row 1 */ + { 1, 1}, { 1, 2}, { 1, 0}, { 45, 3}, /* Row 2 */ + { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 6, 4}, { 2, 3}, { 5, 5}, /* Row 3 */ + { 1, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 1, 4}, { 3, 6}, /* Row 4 */ + { 2, 4}, { 2, 3}, { 1, 5}, { 3, 7}, + { 2, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 1, 4}, { 2, 6}, /* Row 5 */ + { 3, 4}, { 2, 3}, { 1, 5}, { 2, 7}, + { 3, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 1, 4}, { 1, 6}, /* Row 6 */ + { 4, 4}, { 2, 3}, { 1, 5}, { 1, 7}, + { 4, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 6, 4}, { 2, 3}, /* Row 7 */ + { 1, 5}, + { 5, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 31, 3}, { 6, 4}, { 2, 3}, /* Row 8 */ + { 6, 5}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 38, 3}, /* Row 9 */ + { 8, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 37, 3}, /* Row 10 */ + { 9, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 35, 1}, /* Row 11 */ + { 9, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 33, 2}, /* Row 12 */ + { 10, 2}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 13 */ + { 31, 1}, + { 11, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 14 */ + { 1, 1}, { 1, 8}, { 28, 1}, + { 12, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 15 */ + { 2, 1}, { 1, 8}, { 26, 1}, + { 13, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 16 */ + { 3, 1}, { 1, 8}, { 24, 1}, + { 14, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 17 */ + { 4, 1}, { 1, 8}, { 22, 1}, + { 15, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 18 */ + { 5, 1}, { 1, 8}, { 20, 1}, + { 16, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 19 */ + { 4, 1}, { 1, 8}, { 1, 9}, { 19, 1}, + { 17, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 20 */ + { 3, 1}, { 1, 8}, { 1, 9}, { 19, 1}, + { 18, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 21 */ + { 2, 1}, { 1, 8}, { 1, 9}, { 4, 1}, { 9, 8}, { 6, 1}, + { 19, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 22 */ + { 1, 1}, { 1, 8}, { 1, 9}, { 6, 1}, { 9, 9}, { 4, 1}, + { 20, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 23 */ + { 1, 1}, { 1, 9}, { 19, 1}, + { 21, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 24 */ + { 20, 1}, + { 22, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 25 */ + { 19, 1}, + { 23, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 26 */ + { 18, 1}, + { 24, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 27 */ + { 17, 1}, + { 25, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 28 */ + { 16, 1}, + { 26, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 29 */ + { 15, 1}, + { 27, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 30 */ + { 14, 1}, + { 28, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 31 */ + { 13, 1}, + { 29, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 32 */ + { 12, 1}, + { 30, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 33 */ + { 11, 1}, + { 31, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 34 */ + { 10, 1}, + { 32, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 35 */ + { 9, 1}, + { 33, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 36 */ + { 8, 1}, + { 34, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 37 */ + { 7, 1}, + { 35, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 1, 1}, { 1, 2}, /* Row 38 */ + { 6, 1}, + { 36, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 1, 3}, { 7, 1}, /* Row 39 */ + { 37, 1}, { 1, 3}, { 1, 1}, { 1, 2}, { 1, 0}, { 7, 3}, /* Row 40 */ + { 39, 3}, { 1, 1}, { 1, 2}, { 7, 1}, /* Row 41 */ + { 41, 1}, { 7, 2}, /* Row 42 */ + { 43, 2}, { 5, 10}, /* Row 43 */ + { 48, 10}, /* Row 44 */ + { 48, 10}, /* Row 45 */ + { 48, 10}, /* Row 46 */ + { 48, 10} /* Row 47 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_cmdNormalLut, // Index 0: Unselected LUT + g_cmdBrightlLut, // Index 1: Selected LUT + }, + g_cmdRleEntries // data - Pointer to the beginning of the RLE data +}; From 549f65a805e9e1907afa15dc2d2fb1eff6baaf5c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 10:49:13 -0600 Subject: [PATCH 178/390] Update ChangeLog --- ChangeLog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0579388f5..7280d7d50 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -436,4 +436,5 @@ * nxwm/src/glyph_play48x48.cxx: Add a larger NxWM play icon (2014-7-12). * nxwm/src/glyph_caclulator47x49.cxx: Add a larger NxWM calculator icon (2014-7-13). +* nxwm/src/glyph_cmd49x43.cxx: Add a larger NxWM NxConsole icon (2014-7-13). From aee922524e210b31b6d3e55bd05e78c0e8cfe1c4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 12:09:56 -0600 Subject: [PATCH 179/390] NxWM: Add a larger calibration icon --- nxwm/images/calibration48x42.png | Bin 0 -> 575 bytes nxwm/src/glyph_calculator47x49.cxx | 8 +- nxwm/src/glyph_calibration48x42.cxx | 314 ++++++++++++++++++++++++++++ nxwm/src/glyph_cmd49x43.cxx | 26 +-- 4 files changed, 331 insertions(+), 17 deletions(-) create mode 100755 nxwm/images/calibration48x42.png create mode 100644 nxwm/src/glyph_calibration48x42.cxx diff --git a/nxwm/images/calibration48x42.png b/nxwm/images/calibration48x42.png new file mode 100755 index 0000000000000000000000000000000000000000..194500bbeb958e97c9b74d472468f919f85b5da9 GIT binary patch literal 575 zcmV-F0>J%=P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RZ2MrM)E7+**s{jB2(Md!>R9M69 zSkaM#AQS|LGDsm70%cJM7D6G|2l?2UcN{(l-C3*Fogh%n_)y!YOFV+{KMwX3Oj$QB(zUA=-D*T=r^g--jR3;`n76g95X zAssZvL*wbYlqYb^?c`B_ZATBfz8 z|A2gBOs>-reGoT~#{-W?fm8)V=LkCn-Ih6W4>TCmFfrx5Z(qP$R{L7^97B>9HJRm> zbjK};o4hcYi>c}|*42GgWYw|IxJmn=(`5@!P9!aTX>p03TE9?8G9qc|ON&d@m{R=G z(U=yU?Q=i6M5^0uZ%XPsE$-r}XDx#rihdKO*?=yk#rsMY>Z#e`1zeI{2q6#B+#IiU zoo^G=F)di>p_|5-Thx8-vX-<+DLLob0ZA!`G;}E~Cb{ej=nJSPhx*c@$Qw3?{s}{> zFD<^JZr+}ffP@h1y0V`;KHOz}9~D~G8TM8G^o8?t7#iVbgr`5p&=c%XuS + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 42 +#define BITMAP_NCOLUMNS 48 +#define BITMAP_NLUTCODES 7 + +#define DARK_CALIB_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_CALIB_ICON + +static const uint32_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xbdbdbd, 0xababab, 0x818181, 0x3f3f3f, 0xab6c15, 0x813f15 /* Codes 1-6 */ +}; + +static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfcfcfc, 0xe4e4e4, 0xacacac, 0x545454, 0xe4901c, 0xac541c /* Codes 1-6 */ +}; + +# else /* DARK_CALIB_ICON */ + +static const uint32_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfcfcfc, 0xe4e4e4, 0xacacac, 0x545454, 0xe4901c, 0xac541c /* Codes 1-6 */ +}; + +static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffffff, 0xffffff, 0xd7d7d7, 0x696969, 0xffb423, 0xd76923 /* Codes 1-6 */ +}; +# endif /* DARK_CALIB_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_CALIB_ICON + +static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0000, 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2, /* Codes 1-6 */ +}; + +static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffff, 0xe73c, 0xad75, 0x52aa, 0xe483, 0xaaa3 /* Codes 1-6 */ +}; + +# else /* DARK_CALIB_ICON */ + +static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffff, 0xe73c, 0xad75, 0x52aa, 0xe483, 0xaaa3 /* Codes 1-6 */ +}; + +static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xffff, 0xffff, 0xd6ba, 0x6b4d, 0xfda4, 0xd344 /* Codes 1-6 */ +}; + +# endif /* DARK_CALIB_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_CALIB_ICON + +static const uint8_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xbd, 0xab, 0x81, 0x3f, 0x74, 0x4d /* Codes 1-6 */ +}; + +static const uint8_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfc, 0xe4, 0xac, 0x54, 0x9b, 0x67 /* Codes 1-6 */ +}; + +# else /* DARK_CALIB_ICON */ + +static const uint8_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xfc, 0xe4, 0xac, 0x54, 0x9b, 0x67 /* Codes 1-6 */ +}; + +static const uint8_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xff, 0xd7, 0x69, 0xb9, 0x81 /* Codes 1-6 */ +}; + +# endif /* DARK_CALIB_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_CALIB_ICON + +static const nxgl_mxpixel_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xb6, 0xb6, 0x92, 0x24, 0xac, 0x84 /* Codes 1-6 */ +}; + +static const nxgl_mxpixel_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xff, 0xb6, 0x49, 0xf0, 0xa8 /* Codes 1-6 */ +}; + +# else /* DARK_CALIB_ICON */ + +static const nxgl_mxpixel_t g_calibrationNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xff, 0xb6, 0x49, 0xf0, 0xa8 /* Codes 1-6 */ +}; + +static const nxgl_mxpixel_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0xff, 0xff, 0xdb, 0x6d, 0xf4, 0xcc /* Codes 1-6 */ +}; + +# endif /* DARK_CALIB_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] = +{ + { 22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 12, 0}, { 2, 1}, { 2, 0}, /* Row 0 */ + { 28, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 10, 0}, /* Row 1 */ + { 1, 0}, { 1, 2}, { 2, 1}, { 1, 3}, { 2, 0}, { 1, 2}, { 26, 0}, { 1, 1}, /* Row 2 */ + { 2, 2}, { 1, 3}, { 4, 0}, + { 6, 0}, { 2, 1}, { 2, 4}, { 4, 1}, { 26, 0}, { 1, 1}, { 1, 2}, /* Row 3 */ + { 1, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 2, 1}, { 1, 3}, { 2, 4}, { 1, 1}, /* Row 4 */ + { 3, 3}, { 22, 0}, + { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 2}, { 1, 1}, { 2, 3}, /* Row 5 */ + { 2, 4}, { 2, 2}, { 1, 3}, { 19, 0}, + { 10, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, { 1, 2}, { 2, 1}, { 1, 3}, /* Row 6 */ + { 4, 0}, { 2, 2}, { 14, 0}, + { 16, 0}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 2}, { 1, 1}, { 2, 3}, { 1, 4}, /* Row 7 */ + { 5, 0}, { 1, 1}, { 1, 2}, { 8, 0}, + { 22, 0}, { 2, 1}, { 2, 2}, { 3, 1}, { 1, 3}, { 1, 4}, { 7, 0}, { 1, 1}, /* Row 8 */ + { 1, 2}, { 2, 0}, + { 26, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 2, 3}, { 1, 4}, { 7, 0}, /* Row 9 */ + { 2, 0}, { 1, 1}, { 1, 2}, { 26, 0}, { 1, 2}, { 3, 1}, { 4, 2}, { 4, 0}, /* Row 10 */ + { 8, 0}, { 1, 1}, { 1, 2}, { 16, 0}, { 1, 1}, { 1, 3}, { 6, 0}, { 2, 1}, /* Row 11 */ + { 2, 3}, { 1, 4}, { 1, 0}, { 2, 1}, + { 1, 2}, { 1, 3}, { 11, 0}, { 1, 1}, { 2, 2}, { 1, 4}, { 11, 0}, { 1, 2}, /* Row 12 */ + { 2, 0}, { 2, 1}, { 2, 3}, { 3, 0}, { 1, 2}, { 2, 1}, { 1, 3}, + { 1, 4}, { 3, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 10, 0}, { 2, 1}, { 3, 2}, /* Row 13 */ + { 1, 4}, { 10, 0}, { 4, 1}, { 2, 4}, { 1, 3}, { 1, 1}, + { 2, 1}, { 2, 3}, { 1, 4}, { 5, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 9, 0}, /* Row 14 */ + { 1, 1}, { 2, 2}, { 2, 0}, { 2, 2}, { 1, 4}, { 9, 0}, { 2, 3}, + { 1, 3}, { 1, 1}, { 2, 4}, { 2, 1}, { 1, 3}, { 1, 4}, { 8, 0}, { 1, 1}, /* Row 15 */ + { 2, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 2}, + { 1, 4}, { 4, 0}, + { 7, 0}, { 1, 3}, { 2, 2}, { 1, 3}, { 11, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 16 */ + { 8, 0}, { 1, 1}, { 1, 2}, { 6, 0}, + { 2, 2}, { 12, 0}, { 2, 2}, { 12, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 7, 0}, /* Row 17 */ + { 1, 2}, { 1, 1}, { 1, 0}, + { 7, 0}, { 1, 2}, { 1, 4}, { 11, 0}, { 1, 1}, { 1, 2}, { 12, 0}, { 1, 1}, /* Row 18 */ + { 2, 2}, { 1, 3}, { 4, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, { 11, 0}, { 1, 1}, { 1, 2}, /* Row 19 */ + { 12, 0}, { 1, 1}, { 1, 2}, + { 1, 2}, { 1, 3}, { 6, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 8, 0}, { 1, 1}, /* Row 20 */ + { 1, 2}, { 1, 4}, { 9, 0}, { 1, 1}, { 2, 2}, { 1, 4}, { 7, 0}, + { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 2, 1}, { 10, 0}, { 1, 1}, /* Row 21 */ + { 1, 2}, { 8, 0}, { 2, 1}, { 3, 2}, { 1, 4}, + { 10, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 10, 0}, /* Row 22 */ + { 1, 1}, { 1, 2}, { 7, 0}, { 1, 1}, + { 2, 2}, { 2, 0}, { 2, 2}, { 1, 4}, { 9, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 23 */ + { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, + { 1, 2}, { 2, 0}, + { 4, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 2}, { 1, 4}, { 8, 0}, /* Row 24 */ + { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, + { 2, 6}, + { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 2, 2}, /* Row 25 */ + { 8, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, { 5, 0}, { 1, 2}, { 1, 1}, /* Row 26 */ + { 8, 0}, { 1, 2}, { 1, 4}, { 7, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 27 */ + { 1, 2}, { 5, 0}, { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, { 7, 0}, { 1, 1}, + { 1, 2}, + { 1, 2}, { 1, 3}, { 4, 0}, { 4, 1}, { 10, 2}, { 4, 3}, { 2, 0}, { 1, 2}, /* Row 28 */ + { 1, 1}, { 1, 2}, { 1, 0}, { 4, 5}, { 2, 6}, { 1, 0}, { 1, 1}, { 1, 2}, + { 1, 4}, { 2, 0}, + { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, { 4, 1}, { 10, 2}, { 4, 3}, /* Row 29 */ + { 2, 0}, { 2, 1}, { 2, 0}, { 4, 5}, { 2, 6}, + { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 24, 0}, /* Row 30 */ + { 1, 1}, { 1, 2}, { 2, 0}, + { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, /* Row 31 */ + { 1, 3}, { 22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 32 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 16, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 33 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 10, 0}, + { 14, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 34 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, + { 20, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 35 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 1, 2}, + { 1, 2}, { 1, 3}, { 22, 0}, { 4, 1}, { 10, 2}, { 4, 3}, /* Row 36 */ + { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 22, 0}, { 4, 1}, { 8, 2}, /* Row 37 */ + { 2, 2}, { 4, 3}, { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 28, 0}, /* Row 38 */ + { 16, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 22, 0}, /* Row 39 */ + { 22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 16, 0}, /* Row 40 */ + { 26, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 1, 3}, { 1, 4}, { 8, 0} /* Row 41 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationNormalLut, // Index 0: Unselected LUT + g_calibrationBrightlLut, // Index 1: Selected LUT + }, + g_calibrationRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_cmd49x43.cxx b/nxwm/src/glyph_cmd49x43.cxx index b5a44f932..62fa24673 100644 --- a/nxwm/src/glyph_cmd49x43.cxx +++ b/nxwm/src/glyph_cmd49x43.cxx @@ -60,7 +60,7 @@ #define BITMAP_NCOLUMNS 49 #define BITMAP_NLUTCODES 11 -#define __DARK_ICON 1 +#define DARK_CMD_ICON 1 /******************************************************************************************** * Private Bitmap Data @@ -71,7 +71,7 @@ using namespace NxWM; /* RGB24 (8-8-8) Colors */ #if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 -# ifdef __DARK_ICON +# ifdef DARK_CMD_ICON static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -85,7 +85,7 @@ static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xfcfcfc, 0x545454, 0x000000 /* Codes 8-10 */ }; -# else /* __DARK_ICON */ +# else /* DARK_CMD_ICON */ static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -98,12 +98,12 @@ static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xfafafa, 0x8c8c8c, 0x464646, 0xd7d7d7, 0x0023d7, 0xff0000, 0x0023ff, 0xff0000, /* Codes 0-7 */ 0xffffff, 0x696969, 0x000000 /* Codes 8-10 */ }; -# endif /* __DARK_ICON */ +# endif /* DARK_CMD_ICON */ /* RGB16 (565) Colors */ #elif CONFIG_NXWIDGETS_BPP == 16 -# ifdef __DARK_ICON +# ifdef DARK_CMD_ICON static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -117,7 +117,7 @@ static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0x0000 /* Codes 10-10 */ }; -# else /* __DARK_ICON */ +# else /* DARK_CMD_ICON */ static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -131,7 +131,7 @@ static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0x0000 /* Codes 10-10 */ }; -# endif /* __DARK_ICON */ +# endif /* DARK_CMD_ICON */ /* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used * to lookup an 8-bit value. There is no savings in that! It would be better to just put @@ -145,7 +145,7 @@ static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = /* 8-bit Greyscale */ -# ifdef __DARK_ICON +# ifdef DARK_CMD_ICON static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -157,7 +157,7 @@ static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xc8, 0x70, 0x38, 0xac, 0x24, 0x44, 0x2a, 0x4b, 0xfc, 0x54, 0x00 /* Codes 0-10 */ }; -# else /* __DARK_ICON */ +# else /* DARK_CMD_ICON */ static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -169,13 +169,13 @@ static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xfa, 0x8c, 0x46, 0xd7, 0x2d, 0x4c, 0x31, 0x4c, 0xff, 0x69, 0x00 /* Codes 0-10 */ }; -# endif /* __DARK_ICON */ +# endif /* DARK_CMD_ICON */ # else /* CONFIG_NXWIDGETS_GREYSCALE */ /* RGB8 (332) Colors */ -# ifdef __DARK_ICON +# ifdef DARK_CMD_ICON static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -187,7 +187,7 @@ static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xdb, 0x6d, 0x24, 0xb6, 0x02, 0xe0, 0x03, 0xe0, 0xff, 0x49, 0x00 /* Codes 0-10 */ }; -# else /* __DARK_ICON */ +# else /* DARK_CMD_ICON */ static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = { @@ -199,7 +199,7 @@ static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = 0xff, 0x92, 0x49, 0xdb, 0x07, 0xe0, 0x07, 0xe0, 0xff, 0x6d, 0x00 /* Codes 0-10 */ }; -# endif /* __DARK_ICON */ +# endif /* DARK_CMD_ICON */ # endif /* CONFIG_NXWIDGETS_GREYSCALE */ #else # error Unsupported pixel format From b3809bb57d5ce7c15a4723ecedadc8479a54dfd8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 12:46:55 -0600 Subject: [PATCH 180/390] NxWM: Update NxWM icons --- ChangeLog.txt | 2 + nxwm/images/calculator47x49.png | Bin 476 -> 444 bytes nxwm/src/glyph_calculator47x49.cxx | 383 +++++++++++++--------------- nxwm/src/glyph_calibration48x42.cxx | 158 ++++++------ nxwm/src/glyph_cmd49x43.cxx | 172 ++++++------- 5 files changed, 336 insertions(+), 379 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7280d7d50..29dec2946 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -437,4 +437,6 @@ * nxwm/src/glyph_caclulator47x49.cxx: Add a larger NxWM calculator icon (2014-7-13). * nxwm/src/glyph_cmd49x43.cxx: Add a larger NxWM NxConsole icon (2014-7-13). +* nxwm/src/glyph_calibration48x42.cxx: Add a larger NxWM Calibration icon + (2014-7-13). diff --git a/nxwm/images/calculator47x49.png b/nxwm/images/calculator47x49.png index ce1a0fd05a77339505639cea162a54904203ccc4..f469ba0a126d7c2750bfe7adf3eac5d3a02a7b2d 100755 GIT binary patch delta 374 zcmV-+0g3+H1H1!}Pk#~+CA!XHIsgCxPDw;TRA}Dqnc%y84du5s9*B{5M%7dcnARi{>%fwvMlP2 z&-1(;yX2~$0Bx&CfHkfdi62g<<_Qo{IOT$5Qe93<%6uQifPap|%$s>L-%+?+Uec86 zg{98?8dqJ;&&>Qttgk$%H9t*L{_%-y)#qKhm*qhS0g@?jL}aV~OS;rwvI(M|@at-%; z++Q6LC2R7Nx^JTS7-LmhyG!>n+thx?xl3n+ZAs#$gnc)O{|{k%0F@C|9bsFOQ!Qbi z%Z{!HTdOs~wj}Hoof^Vk(HUWlutr!TtnFdXoA=&7{2K2e+||2QVV;@6%;+(G0H|{M U7~4smKmY&$07*qoM6N<$f_TWg4*&oF delta 407 zcmV;I0cifb1Kb0UPk#?428Bzq9smFVZb?KzRA}DqmrZWMFc3yxQ;@psqSE*j&MCr) zaymGLeG1QtJ&I@-6>Wh0BAVE$XNf*LFOHdKzl0DzNwA!AYyd)MllnHx21pN?b5 zjdq)u_jxw#(k5Qiu+KK}|1oR|f8cD`=nT8GIioe~&?P#0!%od+!!Bvqxw)te`$#Su zHXAk@HXAnIVduk_Wl33 Date: Sun, 13 Jul 2014 12:50:34 -0600 Subject: [PATCH 181/390] NxWM: Remove unused NSH icon --- nxwm/Makefile | 4 +- nxwm/include/nxwmglyphs.hxx | 1 - nxwm/src/glyph_nsh25x25.cxx | 215 ------------------------------------ 3 files changed, 2 insertions(+), 218 deletions(-) delete mode 100644 nxwm/src/glyph_nsh25x25.cxx diff --git a/nxwm/Makefile b/nxwm/Makefile index a26bf73cc..468096f4a 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -76,8 +76,8 @@ endif # Images CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.cxx -CXXSRCS += glyph_minimize21x21.cxx glyph_nsh25x25.cxx glyph_play24x24.cxx -CXXSRCS += glyph_start25x25.cxx glyph_stop21x21.cxx +CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_start25x25.cxx +CXXSRCS += glyph_stop21x21.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 0e8e9545b..0886d48bc 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -69,7 +69,6 @@ namespace NxWM extern const struct NXWidgets::SRlePaletteBitmap g_mplayerVolBitmap; #endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; - extern const struct NXWidgets::SRlePaletteBitmap g_nshBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; diff --git a/nxwm/src/glyph_nsh25x25.cxx b/nxwm/src/glyph_nsh25x25.cxx deleted file mode 100644 index 9dec2b35f..000000000 --- a/nxwm/src/glyph_nsh25x25.cxx +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************************** - * NxWidgets/nxwm/src/glyph_nsh25x25.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - ********************************************************************************************/ - -/******************************************************************************************** - * Included Files - ********************************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "crlepalettebitmap.hxx" - -#include "nxwmconfig.hxx" -#include "nxwmglyphs.hxx" - -/******************************************************************************************** - * Pre-Processor Definitions - ********************************************************************************************/ - -#define BITMAP_NROWS 25 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 36 - -/******************************************************************************************** - * Private Bitmap Data - ********************************************************************************************/ - -using namespace NxWM; - -/* RGB24 (8-8-8) Colors */ - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 - -static const uint32_t g_nshLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0xffffdb, 0x4949db, 0x2424db, 0x4924db, 0xdbdbff, 0x6d6ddb, 0x6d92db, 0x2424b6, /* Codes 1-8 */ - 0xffdbdb, 0xdbffff, 0x4992db, 0x24246d, 0xffffff, 0x6db6db, 0x242492, 0x4924ff, /* Codes 9-16 */ - 0x49b6db, 0x6d6db6, 0x92b6db, 0xb6dbdb, 0xb6dbff, 0x2424ff, 0x9292db, 0x9292b6, /* Codes 17-24 */ - 0x00006d, 0x9292ff, 0x240092, 0x24006d, 0x4949ff, 0x494992, 0x92b6ff, 0xb6b6db, /* Codes 25-32 */ - 0x4924b6, 0x92dbdb, 0x926ddb /* Codes 33-35 */ -}; - -/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ - -#elif CONFIG_NXWIDGETS_BPP == 16 - -static const uint16_t g_nshLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0xfffb, 0x4a5b, 0x213b, 0x493b, 0xdedf, 0x6b7b, 0x6c9b, 0x2136, 0xfedb, 0xdfff, /* Codes 1-10 */ - 0x4c9b, 0x212d, 0xffff, 0x6dbb, 0x2132, 0x493f, 0x4dbb, 0x6b76, 0x95bb, 0xb6db, /* Codes 11-20 */ - 0xb6df, 0x213f, 0x949b, 0x9496, 0x000d, 0x949f, 0x2012, 0x200d, 0x4a5f, 0x4a52, /* Codes 21-30 */ - 0x95bf, 0xb5bb, 0x4936, 0x96db, 0x937b /* Codes 31-35 */ -}; - -/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used - * to lookup an 8-bit value. There is no savings in that! It would be better to just put - * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these - * pointless lookups. But these p;ointless lookups do make the logic compatible with the - * 16- and 24-bit types. - */ - -#elif CONFIG_NXWIDGETS_BPP == 8 -# ifdef CONFIG_NXWIDGETS_GREYSCALE - -/* 8-bit Greyscale */ - -static const uint8_t g_nshLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0xfa, 0x59, 0x38, 0x43, 0xdf, 0x79, 0x8f, 0x34, 0xe5, 0xf4, 0x84, 0x2c, 0xff, /* Codes 1-13 */ - 0xa4, 0x30, 0x48, 0x99, 0x75, 0xaf, 0xcf, 0xd4, 0x3c, 0x9a, 0x96, 0x0c, 0x9e, /* Codes 14-16 */ - 0x1b, 0x17, 0x5d, 0x51, 0xb3, 0xba, 0x3f, 0xc5, 0x84 /* Codes 27-35 */ -}; - -# else /* CONFIG_NXWIDGETS_GREYSCALE */ - -/* RGB8 (332) Colors */ - -static const nxgl_mxpixel_t g_nshLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0xff, 0x4b, 0x27, 0x47, 0xdb, 0x6f, 0x73, 0x26, 0xfb, 0xdf, 0x53, 0x25, 0xff, /* Codes 1-13 */ - 0x77, 0x26, 0x47, 0x57, 0x6e, 0x97, 0xbb, 0xbb, 0x27, 0x93, 0x92, 0x01, 0x93, /* Codes 14-16 */ - 0x22, 0x21, 0x4b, 0x4a, 0x97, 0xb7, 0x46, 0x9b, 0x8f /* Codes 27-35 */ -}; - -# endif -#else -# error "Unsupport pixel format" -#endif - -static const struct NXWidgets::SRlePaletteBitmapEntry g_nshRleEntries[] = -{ - { 11, 0}, { 1, 1}, { 1, 2}, { 1, 1}, { 11, 0}, /* Row 0 */ - { 11, 0}, { 3, 3}, { 11, 0}, /* Row 1 */ - { 9, 0}, { 4, 3}, { 1, 4}, { 2, 3}, { 9, 0}, /* Row 2 */ - { 4, 0}, { 1, 5}, { 4, 0}, { 2, 3}, { 1, 6}, { 1, 7}, { 1, 8}, { 1, 4}, /* Row 3 */ - { 1, 3}, { 6, 0}, { 1, 9}, { 2, 0}, - { 3, 0}, { 1, 5}, { 1, 10}, { 1, 11}, { 2, 0}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 4 */ - { 2, 10}, { 1, 12}, { 1, 3}, { 1, 4}, { 1, 3}, { 3, 0}, { 1, 13}, { 1, 5}, - { 1, 14}, { 2, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 15}, { 1, 16}, { 2, 4}, { 1, 3}, /* Row 5 */ - { 1, 10}, { 1, 13}, { 1, 10}, { 1, 12}, { 1, 3}, { 1, 4}, { 1, 3}, { 1, 2}, - { 1, 10}, { 1, 5}, { 1, 17}, { 1, 15}, { 2, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 18}, { 1, 8}, { 2, 4}, { 1, 3}, /* Row 6 */ - { 1, 10}, { 2, 13}, { 1, 19}, { 1, 12}, { 1, 4}, { 1, 3}, { 1, 19}, { 1, 13}, - { 1, 20}, { 1, 15}, { 1, 9}, { 2, 0}, - { 3, 0}, { 1, 10}, { 2, 13}, { 1, 10}, { 1, 12}, { 1, 16}, { 1, 4}, { 1, 3}, /* Row 7 */ - { 1, 10}, { 1, 5}, { 1, 13}, { 1, 10}, { 1, 12}, { 1, 4}, { 1, 2}, { 1, 10}, - { 1, 13}, { 1, 17}, { 1, 15}, { 3, 0}, - { 3, 0}, { 1, 10}, { 2, 13}, { 1, 10}, { 1, 18}, { 1, 8}, { 1, 4}, { 1, 3}, /* Row 8 */ - { 1, 10}, { 1, 21}, { 2, 13}, { 1, 19}, { 1, 22}, { 1, 23}, { 2, 13}, { 1, 15}, - { 1, 1}, { 3, 0}, - { 2, 0}, { 1, 2}, { 2, 13}, { 1, 5}, { 1, 13}, { 1, 10}, { 1, 18}, { 1, 4}, /* Row 9 */ - { 1, 3}, { 1, 10}, { 1, 5}, { 1, 24}, { 2, 13}, { 1, 24}, { 2, 13}, { 1, 19}, - { 1, 16}, { 1, 3}, { 1, 2}, { 2, 0}, - { 2, 0}, { 1, 2}, { 2, 13}, { 1, 18}, { 2, 13}, { 1, 10}, { 1, 16}, { 1, 3}, /* Row 10 */ - { 2, 10}, { 1, 12}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 12}, - { 2, 4}, { 1, 3}, { 1, 1}, { 1, 0}, - { 1, 1}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 25}, { 1, 10}, { 1, 13}, { 1, 10}, /* Row 11 */ - { 1, 15}, { 1, 3}, { 2, 10}, { 1, 25}, { 1, 26}, { 1, 13}, { 1, 10}, { 1, 13}, - { 1, 19}, { 1, 12}, { 3, 4}, { 1, 2}, { 1, 1}, - { 1, 2}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 3}, { 1, 10}, { 1, 13}, /* Row 12 */ - { 1, 18}, { 1, 27}, { 2, 10}, { 1, 28}, { 1, 22}, { 1, 23}, { 1, 13}, { 1, 20}, - { 1, 25}, { 1, 16}, { 3, 4}, { 1, 3}, { 1, 2}, - { 1, 1}, { 1, 3}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 3}, { 1, 23}, { 1, 13}, /* Row 13 */ - { 1, 10}, { 1, 25}, { 2, 10}, { 1, 25}, { 1, 29}, { 1, 10}, { 1, 13}, { 1, 10}, - { 1, 30}, { 1, 8}, { 3, 4}, { 1, 3}, { 1, 1}, - { 2, 0}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 2, 10}, { 1, 18}, /* Row 14 */ - { 1, 5}, { 1, 10}, { 1, 25}, { 1, 31}, { 1, 13}, { 1, 10}, { 1, 13}, { 1, 32}, - { 1, 28}, { 2, 4}, { 1, 3}, { 2, 0}, - { 2, 0}, { 1, 2}, { 2, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 23}, { 1, 13}, /* Row 15 */ - { 1, 5}, { 1, 21}, { 1, 10}, { 1, 12}, { 1, 10}, { 1, 13}, { 1, 5}, { 1, 13}, - { 1, 10}, { 1, 30}, { 1, 4}, { 2, 3}, { 2, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 2, 4}, { 1, 3}, { 2, 13}, { 2, 21}, /* Row 16 */ - { 1, 10}, { 1, 13}, { 1, 5}, { 1, 3}, { 1, 10}, { 1, 13}, { 1, 10}, { 1, 33}, - { 4, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 3, 4}, { 1, 10}, { 1, 13}, { 2, 21}, /* Row 17 */ - { 2, 13}, { 1, 18}, { 1, 3}, { 1, 6}, { 2, 13}, { 1, 15}, { 1, 1}, { 3, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 3, 4}, { 1, 23}, { 1, 13}, { 1, 10}, /* Row 18 */ - { 1, 5}, { 1, 13}, { 1, 5}, { 1, 28}, { 1, 4}, { 1, 3}, { 1, 5}, { 1, 13}, - { 1, 14}, { 1, 15}, { 3, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 4}, { 1, 3}, /* Row 19 */ - { 1, 10}, { 3, 13}, { 1, 18}, { 1, 15}, { 1, 4}, { 1, 3}, { 1, 6}, { 1, 10}, - { 1, 21}, { 1, 15}, { 1, 9}, { 2, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 1}, { 1, 0}, { 1, 3}, { 1, 4}, /* Row 20 */ - { 1, 3}, { 1, 10}, { 1, 13}, { 1, 18}, { 1, 15}, { 1, 4}, { 1, 2}, { 1, 1}, - { 2, 0}, { 1, 13}, { 1, 34}, { 1, 15}, { 2, 0}, - { 3, 0}, { 1, 10}, { 1, 13}, { 1, 15}, { 1, 9}, { 2, 0}, { 2, 3}, { 1, 23}, /* Row 21 */ - { 1, 20}, { 1, 25}, { 1, 4}, { 1, 3}, { 1, 1}, { 3, 0}, { 1, 5}, { 1, 14}, - { 1, 15}, { 2, 0}, - { 3, 0}, { 1, 9}, { 2, 15}, { 1, 9}, { 2, 0}, { 3, 3}, { 1, 12}, { 1, 8}, /* Row 22 */ - { 1, 3}, { 1, 2}, { 4, 0}, { 1, 14}, { 1, 15}, { 1, 20}, { 2, 0}, - { 11, 0}, { 2, 3}, { 1, 6}, { 1, 1}, { 10, 0}, /* Row 23 */ - { 11, 0}, { 1, 1}, { 1, 35}, { 1, 1}, { 11, 0}, /* Row 24 */ -}; - -/******************************************************************************************** - * Public Bitmap Structure Definitions - ********************************************************************************************/ - -const struct NXWidgets::SRlePaletteBitmap NxWM::g_nshBitmap = -{ - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_nshLut, // Index 0: Unselected LUT - g_nshLut, // Index 1: Selected LUT - }, - g_nshRleEntries // data - Pointer to the beginning of the RLE data -}; From 837381abb4ee268c1a69b3b0f89a9fd6c506fda2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 12:51:54 -0600 Subject: [PATCH 182/390] NxWM: Remove unused NX Logo icon --- nxwm/images/nxlogo25x25.png | Bin 608 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 nxwm/images/nxlogo25x25.png diff --git a/nxwm/images/nxlogo25x25.png b/nxwm/images/nxlogo25x25.png deleted file mode 100644 index 63ece46e5b6fd4a189f82c22324321248c9bffd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 608 zcmV-m0-ybfP)P000>X0ssI2ON$aT00001b5ch_0Itp) z=>Px#32;bRa{vGi!~g&e!~vBn4jTXf00(qQO+^RX1RW6oDWQ!HT>t<9@<~KNR5;6x zmC?DYKnR5Ylkb)S#b7T|4BJa628y{4tH$Ic@$6GnG7JMd{8SZRj|j`c{Z9AyKyF+e zRjN?E4CLRJZ)PXN{W0^eyyPvSIYoV9ChxEW!Sewz|Lh^Y3S^zw?NSPe*KaIAAXYI; zH__+JSpjjtxr0bIUY&dX+qLbX z{n;mSw1B(S?mU~U4WK4!dW_3FKM(&B5l|h9&7dj)rphV^bYs?8G6}k7q+a`%o(B3b zgE=wbJ>L{9@;5J>9Z=Z}qnjM5yE=e{spbV%Z7epWXYz<-w~vT!FqKdKwRgA3WV09D zT;4r1TQQU>+@ae9PgDEsIa8+zH!IEVF;cPOX^C`m-aHS#m+m9O^9_Xv5i3xA+D1{G up0WGa&*e^=V`WCf#ag@GX;t_ifPnwSIte~|43zT#0000 Date: Sun, 13 Jul 2014 13:18:47 -0600 Subject: [PATCH 183/390] NxWM: Add a larger minimize icon --- nxwm/images/minimize42x42.png | Bin 0 -> 310 bytes nxwm/src/glyph_calculator47x49.cxx | 308 ++++++++++++++-------------- nxwm/src/glyph_calibration48x42.cxx | 174 ++++++++-------- nxwm/src/glyph_cmd49x43.cxx | 126 ++++++------ nxwm/src/glyph_minimize42x42.cxx | 262 +++++++++++++++++++++++ nxwm/src/glyph_play48x48.cxx | 110 +++++----- 6 files changed, 621 insertions(+), 359 deletions(-) create mode 100755 nxwm/images/minimize42x42.png create mode 100644 nxwm/src/glyph_minimize42x42.cxx diff --git a/nxwm/images/minimize42x42.png b/nxwm/images/minimize42x42.png new file mode 100755 index 0000000000000000000000000000000000000000..0d6eeb1702cdc19fc42b7bdc14c31a23d9aca7e1 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^S|H591|*LjJ{b+97>k44ofy`glX(f`a29w(7Bet# z3xhBt!>lVoOIxg^VT1dWbiAvzw zpcU?cx^Mo?X4Q>z6RmnZGd6zr?Dd;0^ZheUYIX_DS(I^5vul#H$CX=Rui{ItuRU2Y zRn=8^tDcgi + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 42 +#define BITMAP_NCOLUMNS 42 +#define BITMAP_NLUTCODES 8 + +#define DARK_MINIMIZE_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_MINIMIZE_ICON + +static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x1b368a, 0x3651a5, 0x001b8a, 0x001ba5, 0x1b1b6f, 0x00008a, 0xbdbdbd, 0xa5bdbd /* Codes 0-7 */ +}; + +static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ +}; + +# else /* DARK_MINIMIZE_ICON */ + +static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ +}; + +static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2d5ae6, 0x5a87ff, 0x002de6, 0x002dff, 0x2d2db9, 0x0000e6, 0xffffff, 0xffffff /* Codes 0-7 */ +}; +# endif /* DARK_MINIMIZE_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_MINIMIZE_ICON + +static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x19b1, 0x3294, 0x00d1, 0x00d4, 0x18cd, 0x0011, 0xbdf7, 0xa5f7 /* Codes 0-7 */ +}; + +static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ +}; + +# else /* DARK_MINIMIZE_ICON */ + +static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ +}; + +static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2adc, 0x5c3f, 0x017c, 0x017f, 0x2977, 0x001c, 0xffff, 0xffff /* Codes 0-7 */ +}; + +# endif /* DARK_MINIMIZE_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_MINIMIZE_ICON + +static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x37, 0x52, 0x1f, 0x22, 0x24, 0x0f, 0xbd, 0xb5 /* Codes 0-7 */ +}; + +static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ +}; + +# else /* DARK_MINIMIZE_ICON */ + +static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ +}; + +static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x5c, 0x87, 0x34, 0x37, 0x3c, 0x1a, 0xff, 0xff /* Codes 0-7 */ +}; + +# endif /* DARK_MINIMIZE_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_MINIMIZE_ICON + +static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x06, 0x2a, 0x02, 0x02, 0x01, 0x02, 0xb6, 0xb6 /* Codes 0-7 */ +}; + +static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ +}; + +# else /* DARK_MINIMIZE_ICON */ + +static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = +{ + 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ +}; + +static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +{ + 0x2b, 0x53, 0x07, 0x07, 0x26, 0x03, 0xff, 0xff /* Codes 0-7 */ +}; + +# endif /* DARK_MINIMIZE_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = +{ + { 2, 0}, {40, 1}, /* Row 0 */ + { 2, 0}, {40, 1}, /* Row 1 */ + { 2, 1}, {10, 2}, {10, 3}, {16, 2}, { 2, 4}, { 2, 0}, /* Row 2 */ + { 2, 1}, {10, 2}, {10, 3}, {16, 2}, { 2, 4}, { 2, 0}, /* Row 3 */ + { 2, 1}, { 6, 2}, {16, 3}, {16, 2}, { 2, 4}, /* Row 4 */ + { 2, 1}, { 6, 2}, {16, 3}, {16, 2}, { 2, 4}, /* Row 5 */ + { 2, 1}, { 4, 2}, {20, 3}, {14, 2}, { 2, 4}, /* Row 6 */ + { 2, 1}, { 4, 2}, {20, 3}, {14, 2}, { 2, 4}, /* Row 7 */ + { 2, 1}, { 2, 2}, {20, 3}, {16, 2}, { 2, 4}, /* Row 8 */ + { 2, 1}, { 2, 2}, {20, 3}, {16, 2}, { 2, 4}, /* Row 9 */ + { 2, 1}, { 2, 2}, {18, 3}, {18, 2}, { 2, 4}, /* Row 10 */ + { 2, 1}, { 2, 2}, {18, 3}, {18, 2}, { 2, 4}, /* Row 11 */ + { 2, 1}, {18, 3}, {18, 2}, { 2, 5}, { 2, 4}, /* Row 12 */ + { 2, 1}, {18, 3}, {18, 2}, { 2, 5}, { 2, 4}, /* Row 13 */ + { 2, 1}, {16, 3}, {20, 2}, { 2, 5}, { 2, 4}, /* Row 14 */ + { 2, 1}, {16, 3}, {20, 2}, { 2, 5}, { 2, 4}, /* Row 15 */ + { 2, 1}, {14, 3}, {22, 2}, { 2, 5}, { 2, 4}, /* Row 16 */ + { 2, 1}, {14, 3}, {22, 2}, { 2, 5}, { 2, 4}, /* Row 17 */ + { 2, 1}, { 2, 2}, { 8, 3}, {24, 2}, { 4, 5}, { 2, 4}, /* Row 18 */ + { 2, 1}, { 2, 2}, { 8, 3}, {24, 2}, { 4, 5}, { 2, 4}, /* Row 19 */ + { 2, 1}, { 4, 2}, { 2, 3}, {28, 2}, { 4, 5}, { 2, 4}, /* Row 20 */ + { 2, 1}, { 4, 2}, { 2, 3}, {28, 2}, { 4, 5}, { 2, 4}, /* Row 21 */ + { 2, 1}, {32, 2}, { 6, 5}, { 2, 4}, /* Row 22 */ + { 2, 1}, {32, 2}, { 6, 5}, { 2, 4}, /* Row 23 */ + { 2, 1}, {30, 2}, { 8, 5}, { 2, 4}, /* Row 24 */ + { 2, 1}, {30, 2}, { 8, 5}, { 2, 4}, /* Row 25 */ + { 2, 1}, {26, 2}, {12, 5}, { 2, 4}, /* Row 26 */ + { 2, 1}, {26, 2}, {12, 5}, { 2, 4}, /* Row 27 */ + { 2, 1}, {22, 2}, {16, 5}, { 2, 4}, /* Row 28 */ + { 2, 1}, {22, 2}, {16, 5}, { 2, 4}, /* Row 29 */ + { 2, 1}, {16, 2}, {22, 5}, { 2, 4}, /* Row 30 */ + { 2, 1}, {16, 2}, {22, 5}, { 2, 4}, /* Row 31 */ + { 2, 1}, { 8, 2}, {30, 5}, { 2, 4}, /* Row 32 */ + { 2, 1}, { 8, 2}, {30, 5}, { 2, 4}, /* Row 33 */ + { 2, 1}, { 4, 2}, {28, 6}, { 2, 7}, { 4, 5}, { 2, 4}, /* Row 34 */ + { 2, 1}, { 4, 2}, {28, 6}, { 2, 7}, { 4, 5}, { 2, 4}, /* Row 35 */ + { 2, 1}, { 2, 2}, { 2, 5}, {30, 7}, { 4, 5}, { 2, 4}, /* Row 36 */ + { 2, 1}, { 2, 2}, { 2, 5}, {30, 7}, { 4, 5}, { 2, 4}, /* Row 37 */ + { 2, 1}, {38, 5}, { 2, 0}, /* Row 38 */ + { 2, 1}, {38, 5}, { 2, 0}, /* Row 39 */ + { 2, 1}, { 2, 0}, {34, 4}, { 2, 0}, { 2, 1}, /* Row 40 */ + { 2, 1}, { 2, 0}, {34, 4}, { 2, 0}, { 2, 1} /* Row 41 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_minimizeNormalLut, // Index 0: Unselected LUT + g_minimizeBrightLut, // Index 1: Selected LUT + }, + g_minimizeRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_play48x48.cxx b/nxwm/src/glyph_play48x48.cxx index 526606e62..d74b815ad 100644 --- a/nxwm/src/glyph_play48x48.cxx +++ b/nxwm/src/glyph_play48x48.cxx @@ -215,54 +215,54 @@ static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = { - { 1, 0}, { 2, 1}, { 45, 2}, /* Row 0 */ - { 2, 3}, { 1, 0}, { 2, 1}, { 43, 2}, /* Row 1 */ - { 4, 3}, { 1, 0}, { 2, 1}, { 41, 2}, /* Row 2 */ - { 6, 3}, { 1, 0}, { 2, 1}, { 39, 2}, /* Row 3 */ - { 8, 3}, { 1, 0}, { 2, 1}, { 37, 2}, /* Row 4 */ - { 10, 3}, { 1, 0}, { 2, 1}, { 35, 2}, /* Row 5 */ - { 12, 3}, { 1, 0}, { 2, 1}, { 33, 2}, /* Row 6 */ - { 14, 3}, { 1, 0}, { 2, 1}, { 31, 2}, /* Row 7 */ - { 16, 3}, { 1, 0}, { 2, 1}, { 29, 2}, /* Row 8 */ - { 18, 3}, { 1, 0}, { 2, 1}, { 27, 2}, /* Row 9 */ - { 20, 3}, { 1, 0}, { 2, 1}, { 25, 2}, /* Row 10 */ - { 22, 3}, { 1, 0}, { 2, 1}, { 23, 2}, /* Row 11 */ - { 24, 3}, { 1, 0}, { 2, 1}, { 21, 2}, /* Row 12 */ - { 26, 3}, { 1, 0}, { 2, 1}, { 19, 2}, /* Row 13 */ - { 28, 3}, { 1, 0}, { 2, 1}, { 17, 2}, /* Row 14 */ - { 30, 3}, { 1, 0}, { 2, 1}, { 15, 2}, /* Row 15 */ - { 32, 3}, { 1, 0}, { 2, 1}, { 13, 2}, /* Row 16 */ - { 34, 3}, { 1, 0}, { 2, 1}, { 11, 2}, /* Row 17 */ - { 36, 3}, { 1, 0}, { 2, 1}, { 9, 2}, /* Row 18 */ - { 38, 3}, { 1, 0}, { 2, 1}, { 7, 2}, /* Row 19 */ - { 40, 3}, { 1, 0}, { 2, 1}, { 5, 2}, /* Row 20 */ - { 42, 3}, { 1, 0}, { 2, 1}, { 3, 2}, /* Row 21 */ - { 44, 3}, { 1, 0}, { 2, 1}, { 1, 2}, /* Row 22 */ - { 46, 3}, { 1, 0}, { 1, 1}, /* Row 23 */ - { 46, 4}, { 1, 5}, { 1, 6}, /* Row 24 */ - { 44, 4}, { 1, 5}, { 2, 6}, { 1, 2}, /* Row 25 */ - { 42, 4}, { 3, 6}, { 3, 2}, /* Row 26 */ - { 40, 4}, { 1, 5}, { 2, 6}, { 5, 2}, /* Row 27 */ - { 38, 4}, { 3, 6}, { 7, 2}, /* Row 28 */ - { 36, 4}, { 1, 5}, { 2, 6}, { 9, 2}, /* Row 29 */ - { 34, 4}, { 3, 6}, { 11, 2}, /* Row 30 */ - { 32, 4}, { 1, 5}, { 2, 6}, { 13, 2}, /* Row 31 */ - { 30, 4}, { 3, 6}, { 15, 2}, /* Row 32 */ - { 28, 4}, { 1, 5}, { 2, 6}, { 17, 2}, /* Row 33 */ - { 26, 4}, { 3, 6}, { 19, 2}, /* Row 34 */ - { 24, 4}, { 1, 5}, { 2, 6}, { 21, 2}, /* Row 35 */ - { 22, 4}, { 3, 6}, { 23, 2}, /* Row 36 */ - { 20, 4}, { 1, 5}, { 2, 6}, { 25, 2}, /* Row 37 */ - { 18, 4}, { 3, 6}, { 27, 2}, /* Row 38 */ - { 16, 4}, { 1, 5}, { 2, 6}, { 29, 2}, /* Row 39 */ - { 14, 4}, { 3, 6}, { 31, 2}, /* Row 40 */ - { 12, 4}, { 1, 5}, { 2, 6}, { 33, 2}, /* Row 41 */ - { 10, 4}, { 3, 6}, { 35, 2}, /* Row 42 */ - { 8, 4}, { 1, 5}, { 2, 6}, { 37, 2}, /* Row 43 */ - { 6, 4}, { 3, 6}, { 39, 2}, /* Row 44 */ - { 4, 4}, { 1, 5}, { 2, 6}, { 41, 2}, /* Row 45 */ - { 2, 4}, { 3, 6}, { 43, 2}, /* Row 46 */ - { 1, 5}, { 2, 6}, { 45, 2}, /* Row 47 */ + { 1, 0}, { 2, 1}, { 45, 2}, /* Row 0 */ + { 2, 3}, { 1, 0}, { 2, 1}, { 43, 2}, /* Row 1 */ + { 4, 3}, { 1, 0}, { 2, 1}, { 41, 2}, /* Row 2 */ + { 6, 3}, { 1, 0}, { 2, 1}, { 39, 2}, /* Row 3 */ + { 8, 3}, { 1, 0}, { 2, 1}, { 37, 2}, /* Row 4 */ + { 10, 3}, { 1, 0}, { 2, 1}, { 35, 2}, /* Row 5 */ + { 12, 3}, { 1, 0}, { 2, 1}, { 33, 2}, /* Row 6 */ + { 14, 3}, { 1, 0}, { 2, 1}, { 31, 2}, /* Row 7 */ + { 16, 3}, { 1, 0}, { 2, 1}, { 29, 2}, /* Row 8 */ + { 18, 3}, { 1, 0}, { 2, 1}, { 27, 2}, /* Row 9 */ + { 20, 3}, { 1, 0}, { 2, 1}, { 25, 2}, /* Row 10 */ + { 22, 3}, { 1, 0}, { 2, 1}, { 23, 2}, /* Row 11 */ + { 24, 3}, { 1, 0}, { 2, 1}, { 21, 2}, /* Row 12 */ + { 26, 3}, { 1, 0}, { 2, 1}, { 19, 2}, /* Row 13 */ + { 28, 3}, { 1, 0}, { 2, 1}, { 17, 2}, /* Row 14 */ + { 30, 3}, { 1, 0}, { 2, 1}, { 15, 2}, /* Row 15 */ + { 32, 3}, { 1, 0}, { 2, 1}, { 13, 2}, /* Row 16 */ + { 34, 3}, { 1, 0}, { 2, 1}, { 11, 2}, /* Row 17 */ + { 36, 3}, { 1, 0}, { 2, 1}, { 9, 2}, /* Row 18 */ + { 38, 3}, { 1, 0}, { 2, 1}, { 7, 2}, /* Row 19 */ + { 40, 3}, { 1, 0}, { 2, 1}, { 5, 2}, /* Row 20 */ + { 42, 3}, { 1, 0}, { 2, 1}, { 3, 2}, /* Row 21 */ + { 44, 3}, { 1, 0}, { 2, 1}, { 1, 2}, /* Row 22 */ + { 46, 3}, { 1, 0}, { 1, 1}, /* Row 23 */ + { 46, 4}, { 1, 5}, { 1, 6}, /* Row 24 */ + { 44, 4}, { 1, 5}, { 2, 6}, { 1, 2}, /* Row 25 */ + { 42, 4}, { 3, 6}, { 3, 2}, /* Row 26 */ + { 40, 4}, { 1, 5}, { 2, 6}, { 5, 2}, /* Row 27 */ + { 38, 4}, { 3, 6}, { 7, 2}, /* Row 28 */ + { 36, 4}, { 1, 5}, { 2, 6}, { 9, 2}, /* Row 29 */ + { 34, 4}, { 3, 6}, { 11, 2}, /* Row 30 */ + { 32, 4}, { 1, 5}, { 2, 6}, { 13, 2}, /* Row 31 */ + { 30, 4}, { 3, 6}, { 15, 2}, /* Row 32 */ + { 28, 4}, { 1, 5}, { 2, 6}, { 17, 2}, /* Row 33 */ + { 26, 4}, { 3, 6}, { 19, 2}, /* Row 34 */ + { 24, 4}, { 1, 5}, { 2, 6}, { 21, 2}, /* Row 35 */ + { 22, 4}, { 3, 6}, { 23, 2}, /* Row 36 */ + { 20, 4}, { 1, 5}, { 2, 6}, { 25, 2}, /* Row 37 */ + { 18, 4}, { 3, 6}, { 27, 2}, /* Row 38 */ + { 16, 4}, { 1, 5}, { 2, 6}, { 29, 2}, /* Row 39 */ + { 14, 4}, { 3, 6}, { 31, 2}, /* Row 40 */ + { 12, 4}, { 1, 5}, { 2, 6}, { 33, 2}, /* Row 41 */ + { 10, 4}, { 3, 6}, { 35, 2}, /* Row 42 */ + { 8, 4}, { 1, 5}, { 2, 6}, { 37, 2}, /* Row 43 */ + { 6, 4}, { 3, 6}, { 39, 2}, /* Row 44 */ + { 4, 4}, { 1, 5}, { 2, 6}, { 41, 2}, /* Row 45 */ + { 2, 4}, { 3, 6}, { 43, 2}, /* Row 46 */ + { 1, 5}, { 2, 6}, { 45, 2}, /* Row 47 */ }; /******************************************************************************************** @@ -271,14 +271,14 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_playNormalLut, // Index 0: Unselected LUT - g_playBrightlLut, // Index 1: Selected LUT + g_playNormalLut, // Index 0: Unselected LUT + g_playBrightlLut, // Index 1: Selected LUT }, g_playRleEntries // data - Pointer to the beginning of the RLE data }; From ad0553e51df30204b2e66c244fa3af9fc5fd5bf7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 13:20:18 -0600 Subject: [PATCH 184/390] Update ChangeLog --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 29dec2946..a5428d754 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -439,4 +439,6 @@ * nxwm/src/glyph_cmd49x43.cxx: Add a larger NxWM NxConsole icon (2014-7-13). * nxwm/src/glyph_calibration48x42.cxx: Add a larger NxWM Calibration icon (2014-7-13). +* nxwm/src/glyph_minimize42x42.cxx: Add a larger NxWM minimize icon + (2014-8-13). From 13984630ecf3a73b6bbe83e3bbe007d7ecb7f8ed Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 13:52:35 -0600 Subject: [PATCH 185/390] Remove unused start icon --- nxwm/Makefile | 3 +- nxwm/include/nxwmglyphs.hxx | 1 - nxwm/src/glyph_start25x25.cxx | 216 ---------------------------------- 3 files changed, 1 insertion(+), 219 deletions(-) delete mode 100644 nxwm/src/glyph_start25x25.cxx diff --git a/nxwm/Makefile b/nxwm/Makefile index 468096f4a..69f2a1ac8 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -76,8 +76,7 @@ endif # Images CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.cxx -CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_start25x25.cxx -CXXSRCS += glyph_stop21x21.cxx +CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_stop21x21.cxx ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx diff --git a/nxwm/include/nxwmglyphs.hxx b/nxwm/include/nxwmglyphs.hxx index 0886d48bc..b0e3a9c7d 100644 --- a/nxwm/include/nxwmglyphs.hxx +++ b/nxwm/include/nxwmglyphs.hxx @@ -70,7 +70,6 @@ namespace NxWM #endif extern const struct NXWidgets::SRlePaletteBitmap g_minimizeBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_playBitmap; - extern const struct NXWidgets::SRlePaletteBitmap g_startBitmap; extern const struct NXWidgets::SRlePaletteBitmap g_stopBitmap; } diff --git a/nxwm/src/glyph_start25x25.cxx b/nxwm/src/glyph_start25x25.cxx deleted file mode 100644 index 0a02f0692..000000000 --- a/nxwm/src/glyph_start25x25.cxx +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************************** - * NxWidgets/nxwm/src/glyph_start25x25.cxx - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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, NxWidgets, nor the names of its contributors - * me 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. - * - ********************************************************************************************/ - -/******************************************************************************************** - * Included Files - ********************************************************************************************/ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "crlepalettebitmap.hxx" - -#include "nxwmconfig.hxx" -#include "nxwmglyphs.hxx" - -/******************************************************************************************** - * Pre-Processor Definitions - ********************************************************************************************/ - -#define BITMAP_NROWS 25 -#define BITMAP_NCOLUMNS 25 -#define BITMAP_NLUTCODES 34 - -/******************************************************************************************** - * Private Bitmap Data - ********************************************************************************************/ - -using namespace NxWM; - -/* RGB24 (8-8-8) Colors */ - -#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 - -static const uint32_t g_startLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x6db66d, 0x006d00, 0x246d00, 0x6d9249, 0xdbffb6, 0xb6b692, 0x246d24, 0x249224, /* Codes 1-8 */ - 0x49b649, 0x6db649, 0x499249, 0xdbffdb, 0x92b692, 0xb6dbb6, 0x6ddb6d, 0x92b66d, /* Codes 9-16 */ - 0x6d926d, 0x92db92, 0x49926d, 0x49b624, 0x92db6d, 0xb6ffb6, 0xffffff, 0x496d49, /* Codes 17-24 */ - 0x92ff92, 0x24b624, 0x496d24, 0xb6db92, 0x499224, 0x249200, 0x92dbb6, 0x004900, /* Codes 25-32 */ - 0x009200 /* Code 33 */ -}; - -/* RGB16 (565) Colors (four of the colors in this map are duplicates) */ - -#elif CONFIG_NXWIDGETS_BPP == 16 - -static const uint16_t g_startLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x6dad, 0x0360, 0x2360, 0x6c89, 0xdff6, 0xb5b2, 0x2364, 0x2484, 0x4da9, 0x6da9, /* Codes 0-10 */ - 0x4c89, 0xdffb, 0x95b2, 0xb6d6, 0x6ecd, 0x95ad, 0x6c8d, 0x96d2, 0x4c8d, 0x4da4, /* Codes 11-20 */ - 0x96cd, 0xb7f6, 0xffff, 0x4b69, 0x97f2, 0x25a4, 0x4b64, 0xb6d2, 0x4c84, 0x2480, /* Codes 21-30 */ - 0x96d6, 0x0240, 0x0480 /* Codes 31-33 */ -}; - -/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used - * to lookup an 8-bit value. There is no savings in that! It would be better to just put - * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these - * pointless lookups. But these p;ointless lookups do make the logic compatible with the - * 16- and 24-bit types. - */ - -#elif CONFIG_NXWIDGETS_BPP == 8 -# ifdef CONFIG_NXWIDGETS_GREYSCALE - -/* 8-bit Greyscale */ - -static const uint8_t g_startLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x97, 0x3f, 0x4a, 0x7e, 0xeb, 0xb1, 0x4e, 0x64, 0x88, 0x93, 0x73, 0xf0, 0xa7, /* Codes 1-13 */ - 0xcb, 0xad, 0xa2, 0x82, 0xbc, 0x77, 0x84, 0xb8, 0xe0, 0xff, 0x5e, 0xd1, 0x79, /* Codes 14-26 */ - 0x59, 0xc7, 0x6f, 0x60, 0xc0, 0x2a, 0x55 /* Codes 27-33 */ -}; - -# else /* CONFIG_NXWIDGETS_GREYSCALE */ - -/* RGB8 (332) Colors */ - -static const nxgl_mxpixel_t g_startLut[BITMAP_NLUTCODES] = -{ - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x75, 0x0c, 0x2c, 0x71, 0xde, 0xb6, 0x2c, 0x30, 0x55, 0x75, 0x51, 0xdf, 0x96, /* Codes 1-13 */ - 0xba, 0x79, 0x95, 0x71, 0x9a, 0x51, 0x54, 0x99, 0xbe, 0xff, 0x4d, 0x9e, 0x34, /* Codes 14-26 */ - 0x4c, 0xba, 0x50, 0x30, 0x9a, 0x08, 0x10 /* Codes 27-33 */ -}; - -# endif -#else -# error "Unsupport pixel format" -#endif - -static const struct NXWidgets::SRlePaletteBitmapEntry g_startRleEntries[] = -{ - { 7, 0}, { 1, 1}, { 3, 2}, { 1, 3}, { 4, 2}, { 1, 4}, { 1, 5}, { 7, 0}, /* Row 0 */ - { 5, 0}, { 1, 6}, { 2, 7}, { 1, 8}, { 1, 9}, { 2, 1}, { 1, 10}, { 2, 9}, /* Row 1 */ - { 1, 11}, { 2, 7}, { 1, 1}, { 1, 12}, { 5, 0}, - { 4, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 1, 9}, { 8, 1}, { 1, 9}, { 1, 3}, /* Row 2 */ - { 1, 7}, { 1, 11}, { 1, 14}, { 4, 0}, - { 3, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 1, 9}, { 1, 15}, { 4, 1}, { 1, 16}, /* Row 3 */ - { 3, 1}, { 1, 15}, { 1, 9}, { 1, 8}, { 1, 7}, { 1, 17}, { 4, 0}, - { 2, 0}, { 1, 14}, { 1, 11}, { 1, 3}, { 1, 9}, { 1, 15}, { 4, 1}, { 1, 18}, /* Row 4 */ - { 1, 14}, { 1, 13}, { 1, 1}, { 1, 15}, { 1, 10}, { 1, 1}, { 1, 10}, { 2, 7}, - { 1, 13}, { 3, 0}, - { 2, 0}, { 1, 19}, { 1, 7}, { 1, 20}, { 1, 10}, { 2, 1}, { 1, 21}, { 1, 1}, /* Row 5 */ - { 1, 18}, { 1, 22}, { 1, 23}, { 1, 14}, { 1, 1}, { 2, 15}, { 1, 1}, { 1, 10}, - { 1, 9}, { 1, 2}, { 1, 11}, { 1, 14}, { 2, 0}, - { 1, 0}, { 1, 14}, { 1, 7}, { 1, 8}, { 1, 9}, { 1, 10}, { 1, 1}, { 1, 18}, /* Row 6 */ - { 1, 23}, { 1, 1}, { 1, 15}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 1}, { 2, 23}, - { 1, 1}, { 2, 9}, { 1, 8}, { 1, 2}, { 1, 4}, { 2, 0}, - { 1, 0}, { 1, 24}, { 1, 2}, { 1, 8}, { 1, 9}, { 1, 1}, { 1, 13}, { 2, 23}, /* Row 7 */ - { 1, 1}, { 1, 21}, { 1, 22}, { 1, 23}, { 1, 14}, { 1, 1}, { 1, 25}, { 1, 23}, - { 1, 14}, { 1, 1}, { 1, 9}, { 1, 26}, { 1, 2}, { 1, 7}, { 1, 14}, { 1, 0}, - { 1, 22}, { 1, 7}, { 1, 8}, { 2, 9}, { 1, 1}, { 1, 5}, { 1, 23}, { 1, 18}, /* Row 8 */ - { 1, 9}, { 1, 1}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 1}, { 1, 22}, - { 1, 23}, { 1, 21}, { 1, 9}, { 1, 26}, { 1, 8}, { 1, 7}, { 1, 1}, { 1, 0}, - { 1, 13}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 18}, { 1, 23}, { 1, 14}, { 2, 9}, /* Row 9 */ - { 1, 1}, { 1, 14}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 9}, { 1, 1}, { 1, 23}, - { 1, 14}, { 1, 10}, { 2, 8}, { 1, 2}, { 1, 24}, { 1, 0}, - { 1, 1}, { 1, 7}, { 2, 8}, { 1, 9}, { 1, 14}, { 1, 23}, { 1, 1}, { 2, 9}, /* Row 10 */ - { 1, 1}, { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 22}, { 1, 23}, - { 1, 1}, { 2, 8}, { 1, 3}, { 1, 27}, { 1, 14}, - { 1, 11}, { 1, 2}, { 2, 8}, { 1, 10}, { 2, 23}, { 1, 9}, { 2, 20}, { 1, 1}, /* Row 11 */ - { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 18}, { 1, 23}, { 1, 1}, - { 2, 8}, { 2, 7}, { 1, 14}, - { 1, 11}, { 1, 2}, { 2, 8}, { 1, 10}, { 1, 23}, { 1, 22}, { 1, 9}, { 2, 26}, /* Row 12 */ - { 1, 1}, { 1, 14}, { 1, 23}, { 1, 18}, { 1, 11}, { 2, 9}, { 1, 18}, { 1, 23}, - { 1, 1}, { 2, 8}, { 2, 7}, { 1, 13}, - { 1, 1}, { 1, 3}, { 2, 8}, { 1, 9}, { 1, 23}, { 1, 22}, { 1, 9}, { 2, 8}, /* Row 13 */ - { 1, 1}, { 1, 22}, { 1, 23}, { 1, 18}, { 2, 8}, { 1, 11}, { 1, 18}, { 1, 23}, - { 1, 1}, { 2, 8}, { 2, 7}, { 1, 14}, - { 1, 13}, { 1, 7}, { 2, 8}, { 1, 11}, { 1, 18}, { 1, 23}, { 1, 1}, { 2, 8}, /* Row 14 */ - { 1, 10}, { 1, 28}, { 1, 22}, { 1, 21}, { 2, 8}, { 1, 11}, { 1, 22}, { 1, 23}, - { 1, 9}, { 2, 8}, { 1, 7}, { 1, 24}, { 1, 0}, - { 1, 14}, { 1, 7}, { 3, 8}, { 1, 1}, { 1, 23}, { 1, 14}, { 1, 11}, { 1, 8}, /* Row 15 */ - { 1, 11}, { 1, 10}, { 1, 1}, { 1, 9}, { 1, 8}, { 1, 29}, { 1, 1}, { 1, 12}, - { 1, 23}, { 1, 11}, { 2, 8}, { 1, 7}, { 1, 11}, { 1, 0}, - { 1, 0}, { 1, 7}, { 1, 3}, { 2, 8}, { 1, 9}, { 1, 28}, { 1, 23}, { 1, 18}, /* Row 16 */ - { 1, 11}, { 5, 8}, { 1, 9}, { 1, 22}, { 1, 23}, { 1, 10}, { 2, 8}, { 1, 30}, - { 1, 7}, { 1, 13}, { 1, 0}, - { 1, 0}, { 1, 17}, { 1, 7}, { 3, 8}, { 1, 1}, { 2, 23}, { 1, 31}, { 1, 15}, /* Row 17 */ - { 2, 26}, { 1, 9}, { 1, 21}, { 1, 22}, { 1, 23}, { 1, 13}, { 1, 29}, { 2, 8}, - { 1, 2}, { 1, 8}, { 2, 0}, - { 2, 0}, { 1, 24}, { 1, 2}, { 3, 8}, { 1, 9}, { 1, 22}, { 4, 23}, { 1, 14}, /* Row 18 */ - { 2, 23}, { 1, 1}, { 1, 29}, { 2, 8}, { 2, 7}, { 1, 13}, { 2, 0}, - { 2, 0}, { 1, 13}, { 1, 7}, { 1, 3}, { 3, 8}, { 1, 9}, { 1, 1}, { 1, 18}, /* Row 19 */ - { 1, 14}, { 2, 23}, { 1, 18}, { 1, 10}, { 4, 8}, { 1, 2}, { 1, 17}, { 3, 0}, - { 3, 0}, { 1, 17}, { 1, 2}, { 1, 7}, { 3, 8}, { 1, 29}, { 1, 11}, { 1, 10}, /* Row 20 */ - { 1, 1}, { 1, 9}, { 1, 11}, { 4, 8}, { 1, 2}, { 1, 27}, { 1, 14}, { 3, 0}, - { 3, 0}, { 1, 14}, { 1, 11}, { 2, 3}, { 10, 8}, { 1, 30}, { 1, 32}, { 1, 7}, /* Row 21 */ - { 1, 13}, { 4, 0}, - { 4, 0}, { 1, 14}, { 1, 24}, { 1, 7}, { 1, 3}, { 8, 8}, { 1, 7}, { 1, 32}, /* Row 22 */ - { 1, 27}, { 1, 13}, { 5, 0}, - { 5, 0}, { 1, 14}, { 1, 17}, { 2, 7}, { 2, 2}, { 2, 33}, { 1, 3}, { 3, 7}, /* Row 23 */ - { 1, 24}, { 1, 6}, { 6, 0}, - { 6, 0}, { 1, 14}, { 1, 13}, { 1, 4}, { 1, 7}, { 4, 2}, { 1, 7}, { 1, 11}, /* Row 24 */ - { 1, 13}, { 1, 14}, { 7, 0}, -}; - -/******************************************************************************************** - * Public Bitmap Structure Definitions - ********************************************************************************************/ - -const struct NXWidgets::SRlePaletteBitmap NxWM::g_startBitmap = -{ - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_startLut, // Index 0: Unselected LUT - g_startLut, // Index 1: Selected LUT - }, - g_startRleEntries // data - Pointer to the beginning of the RLE data -}; From 5d96aae7148f583f469e1ec3e0fc54834cdb6c8a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 13:53:35 -0600 Subject: [PATCH 186/390] Remove unused start image --- nxwm/images/start25x25.png | Bin 719 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 nxwm/images/start25x25.png diff --git a/nxwm/images/start25x25.png b/nxwm/images/start25x25.png deleted file mode 100644 index 8cad1875684b48e7161366c93c2e893c333bcf59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 719 zcmV;=0xP000>X0ssI2ON$aT00001b5ch_0Itp) z=>Px#32;bRa{vGh*8l(w*8xH(n|J^K00(qQO+^RX1RW6+4_z)?^#A|@VM#!0=`_$iZ;)%USEAYVO3?z1pow51OWiv;EWL;5iQz7k|(UJTyg=dh#lqmGhCSf zCCxDlXMxjuAUyzG`=O`^2vwDt*RTz%Q0Y8@E`3X)V#_a}OfaaCJ}aNGdS+EANMHa- zI}jPXRJtD&GMvuZGf$(as)WvNB+XpL)s^6d%fbcwWGQB4?h~H?^ricJK|wR;lc@`J z9UVYup9}}lHAUXr4pksLA#bM<5vc%L3}XT>YqbaKznSLle0R;~VY2 zO;Dal@@(Xxt9|k~^jxkd4_^H+2|B}#?jE?B(XbPF?RR9q$OwW2-6$f@%q)Tkh3!Jw zNF<8mr2vwfpZx6D+jdbN<}jS@!P#Nt=nH32R74PL`Fj_D0gj2?hK>&rlqNJb!fcDr`UK_L|9{%T80a>AIeXVjA-w7v@rH}07Us)fft+z@}TMa{}3v3o86{H z9hT!IYv>W^jUNReAgY{M8%djr07+wC3vd39{{hN7c5#w3=UxB+002ovPDHLkV1jck BIzs>e From 10b617d434e6d5a4c7994b2ee616fdc49f6b8952 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 14:21:42 -0600 Subject: [PATCH 187/390] NxWM: Add a larger stop icon --- nxwm/images/stop42x42.png | Bin 0 -> 486 bytes nxwm/src/glyph_stop42x42.cxx | 285 +++++++++++++++++++++++++++++++++++ 2 files changed, 285 insertions(+) create mode 100755 nxwm/images/stop42x42.png create mode 100644 nxwm/src/glyph_stop42x42.cxx diff --git a/nxwm/images/stop42x42.png b/nxwm/images/stop42x42.png new file mode 100755 index 0000000000000000000000000000000000000000..d2928d081a1de9ebff414866fa5fccee3b16daaf GIT binary patch literal 486 zcmV@P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RZ2MrVp4!g-LQUCw}cu7P-R9M5+ z*TJ#EFbo7x*+VH#F{$qtlVYS^#03ud!HHI0Gr==lV8D-!Ez3n!U4CFZL_}m+;4ik5 z&y1~9eL(>P@+Vl}ZC#JhMhv16Q?9d+>;URFkc>G#u2FICZje?A2kqY9h#%&t@CI?8 zh77OK*;uPf7AW2xfFf$ zjK0#qWHqx!SrCW(Yy@nbjZ_l0egnx! z7AjB3T}KC&LHJ~{WDgpxi(4sBY3d)LVE?Fs51oFw8^Dc>#~o1+^bWW#^lrEVw5iJ9 cy2_o$69lTY*$VN&iU0rr07*qoM6N<$f@;Ia!2kdN literal 0 HcmV?d00001 diff --git a/nxwm/src/glyph_stop42x42.cxx b/nxwm/src/glyph_stop42x42.cxx new file mode 100644 index 000000000..91f7dbe60 --- /dev/null +++ b/nxwm/src/glyph_stop42x42.cxx @@ -0,0 +1,285 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_stop42x42.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 42 +#define BITMAP_NCOLUMNS 42 +#define BITMAP_NLUTCODES 8 + +#define DARK_STOP_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_STOP_ICON + +static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xa5a5a5, 0xa50000, 0xbd0000, 0x6f1b1b, 0xbdbdbd, 0xa5bdbd, 0x8a0000, 0xbda5a5 /* Codes 0-7 */ +}; + +static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ +}; + +# else /* DARK_STOP_ICON */ + +static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ +}; + +static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffffff, 0xff0000, 0xff0000, 0xb92d2d, 0xffffff, 0xffffff, 0xe60000, 0xffffff /* Codes 0-7 */ +}; +# endif /* DARK_STOP_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_STOP_ICON + +static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xa534, 0xa000, 0xb800, 0x68c3, 0xbdf7, 0xa5f7, 0x8800, 0xbd34 /* Codes 0-7 */ +}; + +static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ +}; + +# else /* DARK_STOP_ICON */ + +static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ +}; + +static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xffff, 0xf800, 0xf800, 0xb965, 0xffff, 0xffff, 0xe000, 0xffff /* Codes 0-7 */ +}; + +# endif /* DARK_STOP_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_STOP_ICON + +static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xa5, 0x31, 0x38, 0x34, 0xbd, 0xb5, 0x29, 0xac /* Codes 0-7 */ +}; + +static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ +}; + +# else /* DARK_STOP_ICON */ + +static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ +}; + +static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0x4c, 0x4c, 0x56, 0xff, 0xff, 0x44, 0xff /* Codes 0-7 */ +}; + +# endif /* DARK_STOP_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_STOP_ICON + +static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xb6, 0xa0, 0xa0, 0x60, 0xb6, 0xb6, 0x80, 0xb6 /* Codes 0-7 */ +}; + +static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ +}; + +# else /* DARK_STOP_ICON */ + +static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = +{ + 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ +}; + +static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +{ + 0xff, 0xe0, 0xe0, 0xa4, 0xff, 0xff, 0xe0, 0xff /* Codes 0-7 */ +}; + +# endif /* DARK_STOP_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_stopRleEntries[] = +{ + {42, 0}, /* Row 0 */ + { 1, 0}, {13, 1}, { 7, 2}, {20, 1}, { 1, 0}, /* Row 1 */ + { 1, 0}, { 4, 1}, {18, 2}, {18, 1}, { 1, 3}, /* Row 2 */ + { 1, 0}, { 3, 1}, {22, 2}, {15, 1}, { 1, 3}, /* Row 3 */ + { 1, 0}, { 2, 1}, {24, 2}, {14, 1}, { 1, 3}, /* Row 4 */ + { 1, 0}, { 1, 1}, {26, 2}, {13, 1}, { 1, 3}, /* Row 5 */ + { 1, 0}, { 1, 1}, { 3, 2}, { 5, 4}, { 2, 5}, {16, 2}, { 2, 1}, { 6, 4}, /* Row 6 */ + { 1, 5}, { 4, 1}, { 1, 3}, + { 1, 0}, { 1, 1}, { 3, 2}, { 6, 4}, { 2, 5}, {15, 2}, { 1, 1}, { 7, 4}, /* Row 7 */ + { 1, 5}, { 4, 1}, { 1, 3}, + { 1, 0}, { 1, 1}, { 3, 2}, { 7, 4}, { 2, 5}, {13, 2}, { 1, 1}, { 7, 4}, /* Row 8 */ + { 2, 5}, { 4, 1}, { 1, 3}, + { 1, 0}, { 1, 1}, { 4, 2}, { 8, 4}, { 1, 5}, {11, 2}, { 1, 1}, { 7, 4}, /* Row 9 */ + { 2, 5}, { 5, 1}, { 1, 3}, + { 1, 0}, { 1, 1}, { 5, 2}, { 7, 4}, { 2, 5}, {10, 2}, { 7, 4}, { 2, 5}, /* Row 10 */ + { 5, 1}, { 1, 6}, { 1, 3}, + { 1, 0}, { 1, 1}, { 6, 2}, { 7, 4}, { 2, 5}, { 8, 2}, { 7, 4}, { 2, 5}, /* Row 11 */ + { 6, 1}, { 1, 6}, { 1, 3}, + { 1, 0}, { 8, 2}, { 7, 4}, { 2, 5}, { 6, 2}, { 7, 4}, { 2, 5}, { 7, 1}, /* Row 12 */ + { 1, 6}, { 1, 3}, + { 1, 0}, { 9, 2}, { 7, 4}, { 2, 5}, { 4, 2}, { 7, 4}, { 2, 5}, { 8, 1}, /* Row 13 */ + { 1, 6}, { 1, 3}, + { 1, 0}, {10, 2}, { 7, 4}, { 2, 5}, { 2, 2}, { 7, 4}, { 2, 5}, { 8, 1}, /* Row 14 */ + { 2, 6}, { 1, 3}, + { 1, 0}, {11, 2}, { 7, 4}, { 2, 5}, { 7, 4}, { 2, 5}, { 9, 1}, { 2, 6}, /* Row 15 */ + { 1, 3}, + { 1, 0}, {12, 2}, {14, 4}, { 2, 5}, {10, 1}, { 2, 6}, { 1, 3}, /* Row 16 */ + { 1, 0}, {13, 2}, {12, 4}, { 2, 5}, {10, 1}, { 3, 6}, { 1, 3}, /* Row 17 */ + { 1, 0}, {14, 2}, {10, 4}, { 2, 5}, {11, 1}, { 3, 6}, { 1, 3}, /* Row 18 */ + { 1, 0}, {15, 2}, { 8, 4}, { 2, 5}, {11, 1}, { 4, 6}, { 1, 3}, /* Row 19 */ + { 1, 0}, {15, 2}, { 1, 1}, { 6, 4}, { 2, 5}, {12, 1}, { 4, 6}, { 1, 3}, /* Row 20 */ + { 1, 0}, { 1, 1}, {13, 2}, { 2, 1}, { 6, 4}, { 2, 5}, {11, 1}, { 5, 6}, /* Row 21 */ + { 1, 3}, + { 1, 0}, { 2, 1}, {11, 2}, { 2, 1}, { 8, 4}, { 2, 5}, {10, 1}, { 5, 6}, /* Row 22 */ + { 1, 3}, + { 1, 0}, { 3, 1}, { 8, 2}, { 3, 1}, {10, 4}, { 2, 5}, { 8, 1}, { 6, 6}, /* Row 23 */ + { 1, 3}, + { 1, 0}, { 5, 1}, { 4, 2}, { 4, 1}, {12, 4}, { 2, 5}, { 6, 1}, { 7, 6}, /* Row 24 */ + { 1, 3}, + { 1, 0}, {12, 1}, {14, 4}, { 2, 5}, { 4, 1}, { 8, 6}, { 1, 3}, /* Row 25 */ + { 1, 0}, {11, 1}, { 7, 4}, { 2, 5}, { 7, 4}, { 2, 5}, { 2, 1}, { 9, 6}, /* Row 26 */ + { 1, 3}, + { 1, 0}, {10, 1}, { 7, 4}, { 2, 5}, { 2, 1}, { 7, 4}, { 2, 5}, {10, 6}, /* Row 27 */ + { 1, 3}, + { 1, 0}, { 9, 1}, { 7, 4}, { 2, 5}, { 4, 1}, { 7, 4}, { 2, 5}, { 9, 6}, /* Row 28 */ + { 1, 3}, + { 1, 0}, { 8, 1}, { 7, 4}, { 2, 5}, { 6, 1}, { 7, 4}, { 2, 5}, { 8, 6}, /* Row 29 */ + { 1, 3}, + { 1, 0}, { 7, 1}, { 7, 4}, { 2, 5}, { 8, 1}, { 7, 4}, { 2, 5}, { 7, 6}, /* Row 30 */ + { 1, 3}, + { 1, 0}, { 6, 1}, { 7, 4}, { 2, 5}, { 9, 1}, { 1, 6}, { 7, 4}, { 2, 5}, /* Row 31 */ + { 6, 6}, { 1, 3}, + { 1, 0}, { 5, 1}, { 7, 4}, { 2, 5}, { 9, 1}, { 3, 6}, { 7, 4}, { 2, 5}, /* Row 32 */ + { 5, 6}, { 1, 3}, + { 1, 0}, { 4, 1}, { 7, 4}, { 2, 5}, { 9, 1}, { 5, 6}, { 7, 4}, { 2, 5}, /* Row 33 */ + { 4, 6}, { 1, 3}, + { 1, 0}, { 4, 1}, { 6, 4}, { 2, 5}, { 8, 1}, { 8, 6}, { 7, 4}, { 1, 5}, /* Row 34 */ + { 4, 6}, { 1, 3}, + { 1, 0}, { 4, 1}, { 7, 5}, { 7, 1}, {11, 6}, { 7, 5}, { 4, 6}, { 1, 3}, /* Row 35 */ + { 1, 0}, {16, 1}, {24, 6}, { 1, 3}, /* Row 36 */ + { 1, 0}, {13, 1}, {27, 6}, { 1, 3}, /* Row 37 */ + { 1, 0}, { 8, 1}, {32, 6}, { 1, 3}, /* Row 38 */ + { 1, 0}, { 5, 1}, {35, 6}, { 1, 3}, /* Row 39 */ + { 1, 0}, { 2, 1}, {38, 6}, { 1, 3}, /* Row 40 */ + { 1, 0}, { 1, 7}, {40, 3} /* Row 41 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_stopBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_stopNormalLut, // Index 0: Unselected LUT + g_stopBrightLut, // Index 1: Selected LUT + }, + g_stopRleEntries // data - Pointer to the beginning of the RLE data +}; From 499c473c197d2d290565f4e09e371b3571450ee3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 14:23:07 -0600 Subject: [PATCH 188/390] Update changelog --- ChangeLog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a5428d754..2e7f9124b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -439,6 +439,6 @@ * nxwm/src/glyph_cmd49x43.cxx: Add a larger NxWM NxConsole icon (2014-7-13). * nxwm/src/glyph_calibration48x42.cxx: Add a larger NxWM Calibration icon (2014-7-13). -* nxwm/src/glyph_minimize42x42.cxx: Add a larger NxWM minimize icon +* nxwm/src/glyph_minimize42x42.cxx: Add a larger NxWM minimize icon (2014-8-13). - +* nxwm/src/glyph_stop42x42.cxx: Add a larger NxWM close icon (2014-8-13). From 758a6ee58a682fc3b86bceb018b5cfb8c7450a35 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 15:58:12 -0600 Subject: [PATCH 189/390] NxWM: Can now configure to use small or large icons --- Kconfig | 30 +++++++++++++++++++++++------ nxwm/Makefile | 9 ++++++++- nxwm/include/nxwmconfig.hxx | 22 ++++++++++++++------- nxwm/src/glyph_calibration48x42.cxx | 20 +++++++++---------- nxwm/src/glyph_minimize42x42.cxx | 26 ++++++++++++------------- nxwm/src/glyph_stop42x42.cxx | 16 +++++++-------- 6 files changed, 78 insertions(+), 45 deletions(-) diff --git a/Kconfig b/Kconfig index 7a903c335..8495d0908 100644 --- a/Kconfig +++ b/Kconfig @@ -313,13 +313,27 @@ if NXWM menu "NxWM General settings" -config NXWM_SYSTEM_CUSTOM_FONTID +config NXWM_LARGE_ICONS + bool "Use large icons" + default n + ---help--- + The default icons are nominally 25x25 pixels for a small + resolution/display, this is a good selection. For example, a + 320x240 display that is 4.5cm x 3.375 would have a resolution of + about 71 dots per cm. In this case, the icon would be 0.35cm. + + If you use a larger display, these smaller icons may seem + inappropriately small. In this case, you have two options: (1) + Enable image scaling which will make the icons "fuzzy" looking, or + (2) select this option to enable use of larger icons. + +config NXWM_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- Set to override the system default font id (NXFONT_DEFAULT). -if NXWM_SYSTEM_CUSTOM_FONTID +if NXWM_CUSTOM_FONTID config NXWM_DEFAULT_FONTID int "Font ID" @@ -328,7 +342,7 @@ config NXWM_DEFAULT_FONTID Use this NxWM default font ID instead of the system font ID (NXFONT_DEFAULT). Default: 0 -endif # NXWM_SYSTEM_CUSTOM_FONTID +endif # NXWM_CUSTOM_FONTID config NXWM_UNITTEST bool "NxWM Unit Test" @@ -480,7 +494,8 @@ if NXWM_CUSTOM_TASKBAR_WIDTH config NXWM_TASKBAR_WIDTH int "Taskbar Width" - default 29 + default 29 if !NXWM_LARGE_ICONS + default 54 if !NXWM_LARGE_ICONS ---help--- Task bar thickness (either vertical or horizontal). Default: 25 + 2*2 @@ -532,16 +547,19 @@ config NXWM_CUSTOM_TOOLBAR_HEIGHT ---help--- Set to override the default tooldar height The default depends on the selected horizontal or vertical spacing. Default: 21 + 2*spacing + or 42 + 2*spacing if large icons are selected if NXWM_CUSTOM_TOOLBAR_HEIGHT config NXWM_TOOLBAR_HEIGHT int "Toolbar Height" - default 25 + default 25 if !NXWM_LARGE_ICONS + default 46 if NXWM_LARGE_ICONS ---help--- The height of the tool bar in each application window. At present, all icons are 21 pixels in height and, hence, require a task bar of - at least that size. Default: 21 + 2*2 + at least that size. Default: 21 + 2*2or 42 + 2*spacing if large + icons are selected endif # NXWM_CUSTOM_TOOLBAR_HEIGHT endmenu # NxWM Toolbar Configuration diff --git a/nxwm/Makefile b/nxwm/Makefile index 69f2a1ac8..ff4b256b1 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/nxwm/Makefile # -# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -75,8 +75,15 @@ CXXSRCS += cnxconsole.cxx endif # Images + + +ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) +CXXSRCS += glyph_calculator47x49.cxx glyph_calibration48x42.cxx glyph_cmd49x43.cxx +CXXSRCS += glyph_minimize42x42.cxx glyph_play48x48.cxx glyph_stop42x42.cxx +else CXXSRCS += glyph_calculator24x25.cxx glyph_calibration24x21.cxx glyph_cmd25x22.cxx CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_stop21x21.cxx +endif ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index b6c4d6da4..0f31e8d55 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -188,7 +188,8 @@ * 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). Default: 25 + 2*spacing unless large icons are selected. + * Then the default is 50 *spacing */ /** @@ -226,7 +227,7 @@ // Taskbar ICON scaling -#ifdef CONFIG_NXWM_TASKBAR_ICONSCALE +#if defined(CONFIG_NXWM_TASKBAR_ICONSCALE) # ifndef CONFIG_NXWM_TASKBAR_ICONWIDTH # error Scaling requires CONFIG_NXWM_TASKBAR_ICONWIDTH # define CONFIG_NXWM_TASKBAR_ICONWIDTH 50 @@ -235,11 +236,16 @@ # error Scaling requires CONFIG_NXWM_TASKBAR_ICONHEIGHT # define CONFIG_NXWM_TASKBAR_ICONHEIGHT 42 # endif +#elif defined(CONFIG_NXWM_LARGE_ICONS) +# undef CONFIG_NXWM_TASKBAR_ICONWIDTH +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 50 +# undef CONFIG_NXWM_TASKBAR_ICONHEIGHT +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 42 #else # undef CONFIG_NXWM_TASKBAR_ICONWIDTH -# define CONFIG_NXWM_TASKBAR_ICONWIDTH 25 // Used below +# define CONFIG_NXWM_TASKBAR_ICONWIDTH 25 # undef CONFIG_NXWM_TASKBAR_ICONHEIGHT -# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 21 // Used below (NOT) +# define CONFIG_NXWM_TASKBAR_ICONHEIGHT 21 #endif /** @@ -260,12 +266,14 @@ /* Tool Bar Configuration ***************************************************/ /** * CONFIG_NXWM_TOOLBAR_HEIGHT. The height of the tool bar in each - * application window. At present, all icons are 21 pixels in height and, - * hence require a task bar of at least that size. + * application window. At present, all icons are 21 or 42 pixels in height + * (depending on the setting of CONFIG_NXWM_LARGE_ICONS) and, hence require + * a task bar of at least that size. */ #ifndef CONFIG_NXWM_TOOLBAR_HEIGHT -# define CONFIG_NXWM_TOOLBAR_HEIGHT (21+2*CONFIG_NXWM_TASKBAR_HSPACING) +# define CONFIG_NXWM_TOOLBAR_HEIGHT \ + (CONFIG_NXWM_TASKBAR_ICONHEIGHT + 2*CONFIG_NXWM_TASKBAR_HSPACING) #endif /* Background Image **********************************************************/ diff --git a/nxwm/src/glyph_calibration48x42.cxx b/nxwm/src/glyph_calibration48x42.cxx index 7e87f085c..3d6fe04f3 100644 --- a/nxwm/src/glyph_calibration48x42.cxx +++ b/nxwm/src/glyph_calibration48x42.cxx @@ -108,7 +108,7 @@ static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - 0x0000, 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2, /* Codes 1-6 */ + 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2 /* Codes 1-6 */ }; static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = @@ -301,14 +301,14 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_minimizeNormalLut, // Index 0: Unselected LUT - g_minimizeBrightlLut, // Index 1: Selected LUT + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationNormalLut, // Index 0: Unselected LUT + g_calibrationBrightlLut, // Index 1: Selected LUT }, - g_minimizeRleEntries // data - Pointer to the beginning of the RLE data + g_calibrationRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_minimize42x42.cxx b/nxwm/src/glyph_minimize42x42.cxx index 6ba2f23f8..0d207570f 100644 --- a/nxwm/src/glyph_minimize42x42.cxx +++ b/nxwm/src/glyph_minimize42x42.cxx @@ -78,7 +78,7 @@ static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x1b368a, 0x3651a5, 0x001b8a, 0x001ba5, 0x1b1b6f, 0x00008a, 0xbdbdbd, 0xa5bdbd /* Codes 0-7 */ }; -static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ }; @@ -90,7 +90,7 @@ static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ }; -static const uint32_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2d5ae6, 0x5a87ff, 0x002de6, 0x002dff, 0x2d2db9, 0x0000e6, 0xffffff, 0xffffff /* Codes 0-7 */ }; @@ -106,7 +106,7 @@ static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x19b1, 0x3294, 0x00d1, 0x00d4, 0x18cd, 0x0011, 0xbdf7, 0xa5f7 /* Codes 0-7 */ }; -static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ }; @@ -118,7 +118,7 @@ static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ }; -static const uint16_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2adc, 0x5c3f, 0x017c, 0x017f, 0x2977, 0x001c, 0xffff, 0xffff /* Codes 0-7 */ }; @@ -144,7 +144,7 @@ static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x37, 0x52, 0x1f, 0x22, 0x24, 0x0f, 0xbd, 0xb5 /* Codes 0-7 */ }; -static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ }; @@ -156,7 +156,7 @@ static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ }; -static const uint8_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x5c, 0x87, 0x34, 0x37, 0x3c, 0x1a, 0xff, 0xff /* Codes 0-7 */ }; @@ -174,7 +174,7 @@ static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x06, 0x2a, 0x02, 0x02, 0x01, 0x02, 0xb6, 0xb6 /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; @@ -186,7 +186,7 @@ static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_minimizeBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { 0x2b, 0x53, 0x07, 0x07, 0x26, 0x03, 0xff, 0xff /* Codes 0-7 */ }; @@ -249,11 +249,11 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_minimizeNormalLut, // Index 0: Unselected LUT g_minimizeBrightLut, // Index 1: Selected LUT diff --git a/nxwm/src/glyph_stop42x42.cxx b/nxwm/src/glyph_stop42x42.cxx index 91f7dbe60..0b8ca8fe6 100644 --- a/nxwm/src/glyph_stop42x42.cxx +++ b/nxwm/src/glyph_stop42x42.cxx @@ -78,7 +78,7 @@ static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa5a5a5, 0xa50000, 0xbd0000, 0x6f1b1b, 0xbdbdbd, 0xa5bdbd, 0x8a0000, 0xbda5a5 /* Codes 0-7 */ }; -static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ }; @@ -90,7 +90,7 @@ static const uint32_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdcdcdc, 0xdc0000, 0xfc0000, 0x942424, 0xfcfcfc, 0xdcfcfc, 0xb80000, 0xfcdcdc /* Codes 0-7 */ }; -static const uint32_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xffffff, 0xff0000, 0xff0000, 0xb92d2d, 0xffffff, 0xffffff, 0xe60000, 0xffffff /* Codes 0-7 */ }; @@ -106,7 +106,7 @@ static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa534, 0xa000, 0xb800, 0x68c3, 0xbdf7, 0xa5f7, 0x8800, 0xbd34 /* Codes 0-7 */ }; -static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ }; @@ -118,7 +118,7 @@ static const uint16_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdefb, 0xd800, 0xf800, 0x9124, 0xffff, 0xdfff, 0xb800, 0xfefb /* Codes 0-7 */ }; -static const uint16_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xffff, 0xf800, 0xf800, 0xb965, 0xffff, 0xffff, 0xe000, 0xffff /* Codes 0-7 */ }; @@ -144,7 +144,7 @@ static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xa5, 0x31, 0x38, 0x34, 0xbd, 0xb5, 0x29, 0xac /* Codes 0-7 */ }; -static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ }; @@ -156,7 +156,7 @@ static const uint8_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdc, 0x41, 0x4b, 0x45, 0xfc, 0xf2, 0x37, 0xe5 /* Codes 0-7 */ }; -static const uint8_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xff, 0x4c, 0x4c, 0x56, 0xff, 0xff, 0x44, 0xff /* Codes 0-7 */ }; @@ -174,7 +174,7 @@ static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xb6, 0xa0, 0xa0, 0x60, 0xb6, 0xb6, 0x80, 0xb6 /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ }; @@ -186,7 +186,7 @@ static const nxgl_mxpixel_t g_stopNormalLut[BITMAP_NLUTCODES] = 0xdb, 0xc0, 0xe0, 0x84, 0xff, 0xdf, 0xa0, 0xfb /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_stopBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_stopBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xe0, 0xe0, 0xa4, 0xff, 0xff, 0xe0, 0xff /* Codes 0-7 */ }; From db76c87a2267ddbcece460ac0654b2072c760d6e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 18:21:46 -0600 Subject: [PATCH 190/390] NxWM: Fix background color in 48x48 play glyph --- nxwm/src/glyph_calculator24x25.cxx | 10 +- nxwm/src/glyph_calculator47x49.cxx | 22 ++-- nxwm/src/glyph_calibration48x42.cxx | 176 ++++++++++++++-------------- nxwm/src/glyph_cmd25x22.cxx | 12 +- nxwm/src/glyph_cmd49x43.cxx | 22 ++-- nxwm/src/glyph_play24x24.cxx | 20 ++-- nxwm/src/glyph_play48x48.cxx | 22 ++-- 7 files changed, 143 insertions(+), 141 deletions(-) diff --git a/nxwm/src/glyph_calculator24x25.cxx b/nxwm/src/glyph_calculator24x25.cxx index 8575e90f7..6ffa4bc64 100644 --- a/nxwm/src/glyph_calculator24x25.cxx +++ b/nxwm/src/glyph_calculator24x25.cxx @@ -75,7 +75,7 @@ static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xfcfcfc, 0xb8bcbc, 0xf8f8f8, 0x6890c8, 0x384c80, 0xe8e8e8, 0x646464, 0x909090 /* Codes 0-7 */ }; -static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xffffff, 0xc9cccc, 0xf9f9f9, 0x8dabd5, 0x69789f, 0xededed, 0x8a8a8a, 0xababab /* Codes 0-7 */ }; @@ -89,7 +89,7 @@ static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xffff, 0xbdf7, 0xffdf, 0x6c99, 0x3a70, 0xef5d, 0x632c, 0x9492 /* Codes 0-7 */ }; -static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xffff, 0xce79, 0xffdf, 0x8d5a, 0x6bd3, 0xef7d, 0x8c51, 0xad55 /* Codes 0-7 */ }; @@ -109,7 +109,7 @@ static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xfc, 0xba, 0xf8, 0x8a, 0x4b, 0xe8, 0x64, 0x90 /* Codes 0-7 */ }; -static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xcb, 0xf9, 0xa6, 0x77, 0xed, 0x8a, 0xab /* Codes 0-7 */ }; @@ -121,7 +121,7 @@ static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xff, 0xb7, 0xff, 0x73, 0x2a, 0xff, 0x6d, 0x92 /* Codes 0-7 */ }; -static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xdb, 0xff, 0x97, 0x6e, 0xff, 0x92, 0xb6 /* Codes 0-7 */ }; @@ -185,7 +185,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_calculatorNormalLut, // Index 0: Unselected LUT - g_calculatorBrightlLut, // Index 1: Selected LUT + g_calculatorBrightLut, // Index 1: Selected LUT }, g_calculatorRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_calculator47x49.cxx b/nxwm/src/glyph_calculator47x49.cxx index 7e97e1235..91f0a8418 100644 --- a/nxwm/src/glyph_calculator47x49.cxx +++ b/nxwm/src/glyph_calculator47x49.cxx @@ -79,7 +79,7 @@ static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0x2a2a6c, 0x2a5481, 0x818181, 0x3f3f3f, 0x6c6c6c /* Codes 8-12 */ }; -static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xe4e4e4, 0xc8c8c8, 0xfcfcfc, 0x707070, 0x7090c8, 0x70acc8, 0x385490, 0x5490c8, /* Codes 0-7 */ 0x383890, 0x3870ac, 0xacacac, 0x545454, 0x909090 /* Codes 8-12 */ @@ -93,7 +93,7 @@ static const uint32_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0x383890, 0x3870ac, 0xacacac, 0x545454, 0x909090 /* Codes 8-12 */ }; -static const uint32_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xffffff, 0xfafafa, 0xffffff, 0x8c8c8c, 0x8cb4fa, 0x8cd7fa, 0x4669b4, 0x69b4fa, /* Codes 0-7 */ 0x4646b4, 0x468cd7, 0xd7d7d7, 0x696969, 0xb4b4b4 /* Codes 8-12 */ @@ -111,7 +111,7 @@ static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0x8410, 0x39e7, 0x6b6d, /* Codes 10-12 */ }; -static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xe73c, 0xce59, 0xffff, 0x738e, 0x7499, 0x7579, 0x3ab2, 0x5499, 0x39d2, 0x3b95, /* Codes 0-9 */ 0xad75, 0x52aa, 0x9492 /* Codes 10-12 */ @@ -125,7 +125,7 @@ static const uint16_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xad75, 0x52aa, 0x9492 /* Codes 10-12 */ }; -static const uint16_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xffff, 0xffdf, 0xffff, 0x8c71, 0x8dbf, 0x8ebf, 0x4356, 0x6dbf, 0x4236, 0x447a, /* Codes 0-9 */ 0xd6ba, 0x6b4d, 0xb5b6 /* Codes 10-12 */ @@ -152,7 +152,7 @@ static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xab, 0x96, 0xbd, 0x54, 0x69, 0x75, 0x3d, 0x63, 0x31, 0x4c, 0x81, 0x3f, 0x6c /* Codes 0-12 */ }; -static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xe4, 0xc8, 0xfc, 0x70, 0x8c, 0x9d, 0x52, 0x84, 0x42, 0x66, 0xac, 0x54, 0x90 /* Codes 0-12 */ }; @@ -164,7 +164,7 @@ static const uint8_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xe4, 0xc8, 0xfc, 0x70, 0x8c, 0x9d, 0x52, 0x84, 0x42, 0x66, 0xac, 0x54, 0x90 /* Codes 0-12 */ }; -static const uint8_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xfa, 0xff, 0x8c, 0xb0, 0xc4, 0x67, 0xa5, 0x52, 0x7f, 0xd7, 0x69, 0xb4 /* Codes 0-12 */ }; @@ -182,7 +182,7 @@ static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xb6, 0x92, 0xb6, 0x49, 0x4e, 0x52, 0x25, 0x2e, 0x25, 0x2a, 0x92, 0x24, 0x6d /* Codes 0-12 */ }; -static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xdb, 0xff, 0x6d, 0x73, 0x77, 0x2a, 0x53, 0x26, 0x2e, 0xb6, 0x49, 0x92 /* Codes 0-12 */ }; @@ -194,7 +194,7 @@ static const nxgl_mxpixel_t g_calculatorNormalLut[BITMAP_NLUTCODES] = 0xff, 0xdb, 0xff, 0x6d, 0x73, 0x77, 0x2a, 0x53, 0x26, 0x2e, 0xb6, 0x49, 0x92 /* Codes 0-12 */ }; -static const nxgl_mxpixel_t g_calculatorBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calculatorBrightLut[BITMAP_NLUTCODES] = { 0xff, 0xff, 0xff, 0x92, 0x97, 0x9b, 0x4e, 0x77, 0x4a, 0x53, 0xdb, 0x6d, 0xb6 /* Codes 0-12 */ }; @@ -367,10 +367,10 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calculatorBitmap = BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) + { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_calculatorNormalLut, // Index 0: Unselected LUT - g_calculatorBrightlLut, // Index 1: Selected LUT + g_calculatorBrightLut, // Index 1: Selected LUT }, - g_calculatorRleEntries // data - Pointer to the beginning of the RLE data + g_calculatorRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_calibration48x42.cxx b/nxwm/src/glyph_calibration48x42.cxx index 3d6fe04f3..09a2f29d0 100644 --- a/nxwm/src/glyph_calibration48x42.cxx +++ b/nxwm/src/glyph_calibration48x42.cxx @@ -79,7 +79,7 @@ static const uint32_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xbdbdbd, 0xababab, 0x818181, 0x3f3f3f, 0xab6c15, 0x813f15 /* Codes 1-6 */ }; -static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xfcfcfc, 0xe4e4e4, 0xacacac, 0x545454, 0xe4901c, 0xac541c /* Codes 1-6 */ @@ -93,7 +93,7 @@ static const uint32_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xfcfcfc, 0xe4e4e4, 0xacacac, 0x545454, 0xe4901c, 0xac541c /* Codes 1-6 */ }; -static const uint32_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xffffff, 0xffffff, 0xd7d7d7, 0x696969, 0xffb423, 0xd76923 /* Codes 1-6 */ @@ -111,7 +111,7 @@ static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xbdf7, 0xad55, 0x8410, 0x39e7, 0xab62, 0x81e2 /* Codes 1-6 */ }; -static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xffff, 0xe73c, 0xad75, 0x52aa, 0xe483, 0xaaa3 /* Codes 1-6 */ @@ -125,7 +125,7 @@ static const uint16_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xffff, 0xe73c, 0xad75, 0x52aa, 0xe483, 0xaaa3 /* Codes 1-6 */ }; -static const uint16_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xffff, 0xffff, 0xd6ba, 0x6b4d, 0xfda4, 0xd344 /* Codes 1-6 */ @@ -153,7 +153,7 @@ static const uint8_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xbd, 0xab, 0x81, 0x3f, 0x74, 0x4d /* Codes 1-6 */ }; -static const uint8_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xfc, 0xe4, 0xac, 0x54, 0x9b, 0x67 /* Codes 1-6 */ @@ -167,7 +167,7 @@ static const uint8_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xfc, 0xe4, 0xac, 0x54, 0x9b, 0x67 /* Codes 1-6 */ }; -static const uint8_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xff, 0xff, 0xd7, 0x69, 0xb9, 0x81 /* Codes 1-6 */ @@ -187,7 +187,7 @@ static const nxgl_mxpixel_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xb6, 0xb6, 0x92, 0x24, 0xac, 0x84 /* Codes 1-6 */ }; -static const nxgl_mxpixel_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xff, 0xff, 0xb6, 0x49, 0xf0, 0xa8 /* Codes 1-6 */ @@ -201,7 +201,7 @@ static const nxgl_mxpixel_t g_calibrationNormalLut[BITMAP_NLUTCODES] = 0xff, 0xff, 0xb6, 0x49, 0xf0, 0xa8 /* Codes 1-6 */ }; -static const nxgl_mxpixel_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_calibrationBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0xff, 0xff, 0xdb, 0x6d, 0xf4, 0xcc /* Codes 1-6 */ @@ -215,84 +215,86 @@ static const nxgl_mxpixel_t g_calibrationBrightlLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] = { - {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {12, 0}, { 2, 1}, { 2, 0}, /* Row 0 */ - {28, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {10, 0}, /* Row 1 */ - { 1, 0}, { 1, 2}, { 2, 1}, { 1, 3}, { 2, 0}, { 1, 2}, {26, 0}, { 1, 1}, /* Row 2 */ - { 2, 2}, { 1, 3}, { 4, 0}, - { 6, 0}, { 2, 1}, { 2, 4}, { 4, 1}, {26, 0}, { 1, 1}, { 1, 2}, /* Row 3 */ - { 1, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 2, 1}, { 1, 3}, { 2, 4}, { 1, 1}, /* Row 4 */ - { 3, 3}, {22, 0}, - { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 2}, { 1, 1}, { 2, 3}, /* Row 5 */ - { 2, 4}, { 2, 2}, { 1, 3}, {19, 0}, - {10, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, { 1, 2}, { 2, 1}, { 1, 3}, /* Row 6 */ - { 4, 0}, { 2, 2}, {14, 0}, - {16, 0}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 2}, { 1, 1}, { 2, 3}, { 1, 4}, /* Row 7 */ - { 5, 0}, { 1, 1}, { 1, 2}, { 8, 0}, - {22, 0}, { 2, 1}, { 2, 2}, { 3, 1}, { 1, 3}, { 1, 4}, { 7, 0}, { 1, 1}, /* Row 8 */ - { 1, 2}, { 2, 0}, - {26, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 2, 3}, { 1, 4}, { 7, 0}, /* Row 9 */ - { 2, 0}, { 1, 1}, { 1, 2}, {26, 0}, { 1, 2}, { 3, 1}, { 4, 2}, { 4, 0}, /* Row 10 */ - { 8, 0}, { 1, 1}, { 1, 2}, {16, 0}, { 1, 1}, { 1, 3}, { 6, 0}, { 2, 1}, /* Row 11 */ - { 2, 3}, { 1, 4}, { 1, 0}, { 2, 1}, - { 1, 2}, { 1, 3}, {11, 0}, { 1, 1}, { 2, 2}, { 1, 4}, {11, 0}, { 1, 2}, /* Row 12 */ - { 2, 0}, { 2, 1}, { 2, 3}, { 3, 0}, { 1, 2}, { 2, 1}, { 1, 3}, - { 1, 4}, { 3, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {10, 0}, { 2, 1}, { 3, 2}, /* Row 13 */ - { 1, 4}, {10, 0}, { 4, 1}, { 2, 4}, { 1, 3}, { 1, 1}, - { 2, 1}, { 2, 3}, { 1, 4}, { 5, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 9, 0}, /* Row 14 */ - { 1, 1}, { 2, 2}, { 2, 0}, { 2, 2}, { 1, 4}, { 9, 0}, { 2, 3}, - { 1, 3}, { 1, 1}, { 2, 4}, { 2, 1}, { 1, 3}, { 1, 4}, { 8, 0}, { 1, 1}, /* Row 15 */ - { 2, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 2}, - { 1, 4}, { 4, 0}, - { 7, 0}, { 1, 3}, { 2, 2}, { 1, 3}, {11, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 16 */ - { 8, 0}, { 1, 1}, { 1, 2}, { 6, 0}, - { 2, 2}, {12, 0}, { 2, 2}, {12, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 7, 0}, /* Row 17 */ - { 1, 2}, { 1, 1}, { 1, 0}, - { 7, 0}, { 1, 2}, { 1, 4}, {11, 0}, { 1, 1}, { 1, 2}, {12, 0}, { 1, 1}, /* Row 18 */ - { 2, 2}, { 1, 3}, { 4, 0}, - { 3, 0}, { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, {11, 0}, { 1, 1}, { 1, 2}, /* Row 19 */ - {12, 0}, { 1, 1}, { 1, 2}, - { 1, 2}, { 1, 3}, { 6, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 8, 0}, { 1, 1}, /* Row 20 */ - { 1, 2}, { 1, 4}, { 9, 0}, { 1, 1}, { 2, 2}, { 1, 4}, { 7, 0}, - { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 2, 1}, {10, 0}, { 1, 1}, /* Row 21 */ - { 1, 2}, { 8, 0}, { 2, 1}, { 3, 2}, { 1, 4}, - {10, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, {10, 0}, /* Row 22 */ - { 1, 1}, { 1, 2}, { 7, 0}, { 1, 1}, - { 2, 2}, { 2, 0}, { 2, 2}, { 1, 4}, { 9, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 23 */ - { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, - { 1, 2}, { 2, 0}, - { 4, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 2}, { 1, 4}, { 8, 0}, /* Row 24 */ - { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, - { 2, 6}, - { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 2, 2}, /* Row 25 */ - { 8, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, - { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, { 5, 0}, { 1, 2}, { 1, 1}, /* Row 26 */ - { 8, 0}, { 1, 2}, { 1, 4}, { 7, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, - { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 27 */ - { 1, 2}, { 5, 0}, { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, { 7, 0}, { 1, 1}, - { 1, 2}, - { 1, 2}, { 1, 3}, { 4, 0}, { 4, 1}, {10, 2}, { 4, 3}, { 2, 0}, { 1, 2}, /* Row 28 */ - { 1, 1}, { 1, 2}, { 1, 0}, { 4, 5}, { 2, 6}, { 1, 0}, { 1, 1}, { 1, 2}, - { 1, 4}, { 2, 0}, - { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, { 4, 1}, {10, 2}, { 4, 3}, /* Row 29 */ - { 2, 0}, { 2, 1}, { 2, 0}, { 4, 5}, { 2, 6}, - { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {24, 0}, /* Row 30 */ - { 1, 1}, { 1, 2}, { 2, 0}, - { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, /* Row 31 */ - { 1, 3}, {22, 0}, - { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 32 */ - { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {16, 0}, - { 8, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 33 */ - { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {10, 0}, - {14, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 34 */ - { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, - {20, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 35 */ - { 1, 2}, { 6, 0}, { 1, 1}, { 1, 2}, - { 1, 2}, { 1, 3}, {22, 0}, { 4, 1}, {10, 2}, { 4, 3}, /* Row 36 */ - { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, { 4, 1}, { 8, 2}, /* Row 37 */ - { 2, 2}, { 4, 3}, { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {28, 0}, /* Row 38 */ - {16, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, /* Row 39 */ - {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {16, 0}, /* Row 40 */ - {26, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 1, 3}, { 1, 4}, { 8, 0} /* Row 41 */ + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {12, 0}, { 2, 1}, { 8, 0}, /* Row 0 */ + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {11, 0}, { 1, 2}, { 2, 1}, { 1, 3}, /* Row 1 */ + { 2, 0}, { 1, 2}, { 4, 0}, + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {10, 0}, { 2, 1}, { 2, 4}, { 4, 1}, /* Row 2 */ + { 4, 0}, + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 2, 1}, { 1, 3}, /* Row 3 */ + { 2, 4}, { 1, 1}, { 3, 3}, { 4, 0}, + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 2}, { 1, 1}, { 2, 3}, /* Row 4 */ + { 2, 4}, { 2, 2}, { 1, 3}, { 7, 0}, + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, { 1, 2}, { 2, 1}, { 1, 3}, /* Row 5 */ + { 4, 0}, { 2, 2}, { 8, 0}, + {22, 0}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 2}, { 1, 1}, { 2, 3}, { 1, 4}, /* Row 6 */ + { 5, 0}, { 1, 1}, { 1, 2}, { 8, 0}, + {22, 0}, { 2, 1}, { 2, 2}, { 3, 1}, { 1, 3}, { 1, 4}, { 7, 0}, { 1, 1}, /* Row 7 */ + { 1, 2}, { 8, 0}, + {20, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 2, 3}, { 1, 4}, { 9, 0}, { 1, 1}, /* Row 8 */ + { 1, 2}, { 8, 0}, + {18, 0}, { 1, 2}, { 3, 1}, { 4, 2}, {12, 0}, { 1, 1}, { 1, 2}, { 8, 0}, /* Row 9 */ + { 8, 0}, { 1, 1}, { 1, 3}, { 6, 0}, { 2, 1}, { 2, 3}, { 1, 4}, { 1, 0}, /* Row 10 */ + { 2, 1}, { 1, 2}, { 1, 3}, {11, 0}, { 1, 1}, { 2, 2}, { 1, 4}, { 7, 0}, + { 4, 0}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 3}, { 3, 0}, { 1, 2}, { 2, 1}, /* Row 11 */ + { 1, 3}, { 1, 4}, { 3, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {10, 0}, { 2, 1}, + { 3, 2}, { 1, 4}, { 6, 0}, + { 4, 0}, { 4, 1}, { 2, 4}, { 1, 3}, { 3, 1}, { 2, 3}, { 1, 4}, { 5, 0}, /* Row 12 */ + { 1, 1}, { 2, 2}, { 1, 3}, { 9, 0}, { 1, 1}, { 2, 2}, { 2, 0}, { 2, 2}, + { 1, 4}, { 5, 0}, + { 4, 0}, { 3, 3}, { 1, 1}, { 2, 4}, { 2, 1}, { 1, 3}, { 1, 4}, { 8, 0}, /* Row 13 */ + { 1, 1}, { 2, 2}, { 1, 3}, { 8, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, + { 2, 2}, { 1, 4}, { 4, 0}, + { 7, 0}, { 1, 3}, { 2, 2}, { 1, 3}, {11, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 14 */ + { 8, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 2, 2}, { 4, 0}, + { 8, 0}, { 2, 2}, {12, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 7, 0}, { 1, 2}, /* Row 15 */ + { 1, 1}, { 8, 0}, { 1, 2}, { 1, 4}, { 3, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, {12, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 7, 0}, /* Row 16 */ + { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, { 3, 0}, + { 8, 0}, { 1, 1}, { 1, 2}, {12, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, /* Row 17 */ + { 1, 2}, { 1, 1}, { 1, 2}, { 8, 0}, { 1, 1}, { 1, 2}, { 1, 4}, { 2, 0}, + { 7, 0}, { 1, 1}, { 2, 2}, { 1, 4}, {11, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 18 */ + { 6, 0}, { 2, 1}, {10, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 6, 0}, { 2, 1}, { 3, 2}, { 1, 4}, {10, 0}, { 1, 1}, { 2, 2}, { 1, 3}, /* Row 19 */ + { 6, 0}, { 1, 1}, { 1, 2}, {10, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 5, 0}, { 1, 1}, { 2, 2}, { 2, 0}, { 2, 2}, { 1, 4}, { 9, 0}, { 1, 1}, /* Row 20 */ + { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 4, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 2}, { 1, 4}, { 8, 0}, /* Row 21 */ + { 1, 1}, { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, + { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 4, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 2, 2}, { 8, 0}, { 1, 1}, { 2, 2}, /* Row 22 */ + { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, + { 1, 1}, { 1, 2}, { 2, 0}, + { 3, 0}, { 1, 2}, { 1, 1}, { 8, 0}, { 1, 2}, { 1, 4}, { 7, 0}, { 1, 1}, /* Row 23 */ + { 2, 2}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, + { 3, 0}, { 1, 1}, { 1, 2}, { 8, 0}, { 2, 2}, { 7, 0}, { 1, 1}, { 2, 2}, /* Row 24 */ + { 1, 3}, { 4, 0}, { 4, 1}, {10, 2}, { 4, 3}, + { 2, 0}, { 1, 2}, { 1, 1}, { 1, 2}, { 1, 0}, { 4, 5}, { 2, 6}, { 1, 0}, /* Row 25 */ + { 1, 1}, { 1, 2}, { 1, 4}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, { 4, 0}, + { 4, 1}, {10, 2}, { 4, 3}, + { 2, 0}, { 2, 1}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, { 1, 2}, /* Row 26 */ + { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 27 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 28 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 29 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 30 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 2, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 4, 5}, { 2, 6}, { 2, 0}, { 1, 1}, /* Row 31 */ + { 1, 2}, { 6, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, + { 4, 1}, {10, 2}, { 4, 3}, { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, /* Row 32 */ + { 4, 1}, {10, 2}, { 4, 3}, { 4, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, /* Row 33 */ + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, /* Row 34 */ + {22, 0}, { 1, 1}, { 2, 2}, { 1, 3}, {22, 0}, /* Row 35 */ + {20, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 1, 3}, { 1, 4}, {20, 0}, /* Row 36 */ + {20, 0}, { 1, 2}, { 1, 1}, { 4, 2}, { 1, 3}, { 1, 4}, {20, 0}, /* Row 37 */ + {10, 0}, { 1, 2}, { 7, 1}, {12, 2}, { 7, 3}, { 1, 4}, {10, 0}, /* Row 38 */ + {10, 0}, { 1, 2}, { 7, 1}, {12, 2}, { 7, 3}, { 1, 4}, {10, 0}, /* Row 39 */ + { 8, 0}, { 1, 2}, { 7, 1}, {16, 2}, { 7, 3}, { 1, 4}, { 8, 0}, /* Row 40 */ + { 8, 0}, { 1, 2}, { 7, 1}, {16, 2}, { 7, 3}, { 1, 4}, { 8, 0} /* Row 41 */ }; /******************************************************************************************** @@ -308,7 +310,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_calibrationNormalLut, // Index 0: Unselected LUT - g_calibrationBrightlLut, // Index 1: Selected LUT + g_calibrationBrightLut, // Index 1: Selected LUT }, g_calibrationRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_cmd25x22.cxx b/nxwm/src/glyph_cmd25x22.cxx index 891be86dd..44d3ca437 100644 --- a/nxwm/src/glyph_cmd25x22.cxx +++ b/nxwm/src/glyph_cmd25x22.cxx @@ -75,7 +75,7 @@ static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x909090, 0x000000, 0xb4fcfc, 0xb4d8fc, 0x6cb4fc, 0x6c6c6c, 0xfcfcfc, 0x484848 }; -static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xababab, 0x3f3f3f, 0xc6fcfc, 0xc6e1fc, 0x90c6fc, 0x909090, 0xfcfcfc, 0x757575 }; @@ -88,7 +88,7 @@ static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x9492, 0x0000, 0xb7ff, 0xb6df, 0x6dbf, 0x6b6d, 0xffff, 0x4a49 }; -static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xad55, 0x39e7, 0xc7ff, 0xc71f, 0x963f, 0x9492, 0xffff, 0x73ae }; @@ -110,7 +110,7 @@ static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x90, 0x00, 0xe6, 0xd1, 0xa6, 0x6c, 0xfc, 0x48 }; -static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xab, 0x3f, 0xeb, 0xdc, 0xbc, 0x90, 0xfc, 0x75 }; @@ -124,7 +124,7 @@ static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x92, 0x00, 0xbf, 0xbb, 0x77, 0x6d, 0xff, 0x49 }; -static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xb6, 0x24, 0xdf, 0xdf, 0x9b, 0x92, 0xff, 0x6d }; @@ -175,7 +175,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_cmdNormalLut, // Index 0: Unselected LUT - g_cmdBrightlLut, // Index 1: Selected LUT + g_cmdBrightLut, // Index 1: Selected LUT }, - g_cmdRleEntries // data - Pointer to the beginning of the RLE data + g_cmdRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_cmd49x43.cxx b/nxwm/src/glyph_cmd49x43.cxx index b6031f584..480a787d1 100644 --- a/nxwm/src/glyph_cmd49x43.cxx +++ b/nxwm/src/glyph_cmd49x43.cxx @@ -79,7 +79,7 @@ static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0xbdbdbd, 0x3f3f3f /* Codes 8-9 */ }; -static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xc8c8c8, 0x707070, 0x383838, 0xacacac, 0x001cac, 0xe40000, 0x001ce4, 0xfc0000, /* Codes 0-7 */ 0xfcfcfc, 0x545454 /* Codes 8-9 */ @@ -93,7 +93,7 @@ static const uint32_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0xfcfcfc, 0x545454 /* Codes 8-9 */ }; -static const uint32_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xfafafa, 0x8c8c8c, 0x464646, 0xd7d7d7, 0x0023d7, 0xff0000, 0x0023ff, 0xff0000, /* Codes 0-7 */ 0xffffff, 0x696969 /* Codes 8-9 */ @@ -110,7 +110,7 @@ static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x94b2, 0x52aa, 0x2945, 0x8410, 0x00b0, 0xa800, 0x00b5, 0xb800, 0xbdf7, 0x39e7 /* Codes 0-9 */ }; -static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xce59, 0x738e, 0x39c7, 0xad75, 0x00f5, 0xe000, 0x00fc, 0xf800, 0xffff, 0x52aa /* Codes 0-9 */ }; @@ -122,7 +122,7 @@ static const uint16_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0xce59, 0x738e, 0x39c7, 0xad75, 0x00f5, 0xe000, 0x00fc, 0xf800, 0xffff, 0x52aa /* Codes 0-9 */ }; -static const uint16_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xffdf, 0x8c71, 0x4228, 0xd6ba, 0x011a, 0xf800, 0x011f, 0xf800, 0xffff, 0x6b4d /* Codes 0-9 */ }; @@ -148,7 +148,7 @@ static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x96, 0x54, 0x2a, 0x81, 0x1b, 0x33, 0x1f, 0x38, 0xbd, 0x3f /* Codes 0-9 */ }; -static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xc8, 0x70, 0x38, 0xac, 0x24, 0x44, 0x2a, 0x4b, 0xfc, 0x54 /* Codes 0-9 */ }; @@ -160,7 +160,7 @@ static const uint8_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0xc8, 0x70, 0x38, 0xac, 0x24, 0x44, 0x2a, 0x4b, 0xfc, 0x54 /* Codes 0-9 */ }; -static const uint8_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xfa, 0x8c, 0x46, 0xd7, 0x2d, 0x4c, 0x31, 0x4c, 0xff, 0x69 /* Codes 0-9 */ }; @@ -178,7 +178,7 @@ static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0x92, 0x49, 0x24, 0x92, 0x02, 0xa0, 0x02, 0xa0, 0xb6, 0x24 /* Codes 0-9 */ }; -static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xdb, 0x6d, 0x24, 0xb6, 0x02, 0xe0, 0x03, 0xe0, 0xff, 0x49 /* Codes 0-9 */ }; @@ -190,7 +190,7 @@ static const nxgl_mxpixel_t g_cmdNormalLut[BITMAP_NLUTCODES] = 0xdb, 0x6d, 0x24, 0xb6, 0x02, 0xe0, 0x03, 0xe0, 0xff, 0x49 /* Codes 0-9 */ }; -static const nxgl_mxpixel_t g_cmdBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_cmdBrightLut[BITMAP_NLUTCODES] = { 0xff, 0x92, 0x49, 0xdb, 0x07, 0xe0, 0x07, 0xe0, 0xff, 0x6d /* Codes 0-9 */ }; @@ -272,9 +272,9 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_cmdBitmap = BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) + { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_cmdNormalLut, // Index 0: Unselected LUT - g_cmdBrightlLut, // Index 1: Selected LUT + g_cmdBrightLut, // Index 1: Selected LUT }, - g_cmdRleEntries // data - Pointer to the beginning of the RLE data + g_cmdRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_play24x24.cxx b/nxwm/src/glyph_play24x24.cxx index 4fa1e8d3a..fa52f60df 100644 --- a/nxwm/src/glyph_play24x24.cxx +++ b/nxwm/src/glyph_play24x24.cxx @@ -79,7 +79,7 @@ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = 0x00bd00, 0x008100, 0x006300, 0x003600 /* Codes 1-4 */ }; -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ @@ -93,7 +93,7 @@ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = 0x00fc00, 0x00ac00, 0x008400, 0x004800 /* Codes 1-4 */ }; -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x00fc00, 0x00c000, 0x00a200, 0x007500 /* Codes 1-4 */ @@ -111,7 +111,7 @@ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = 0x05e0, 0x0400, 0x0300, 0x01a0 /* Codes 1-4 */ }; -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ @@ -125,7 +125,7 @@ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = 0x07e0, 0x0560, 0x0420, 0x0240 /* Codes 1-4 */ }; -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x07e0, 0x0600, 0x0500, 0x03a0 /* Codes 1-4 */ @@ -153,7 +153,7 @@ static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = 0x6e, 0x4b, 0x3a, 0x1f /* Codes 1-4 */ }; -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ @@ -167,7 +167,7 @@ static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = 0x93, 0x64, 0x4d, 0x2a /* Codes 1-4 */ }; -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x93, 0x70, 0x5f, 0x44 /* Codes 1-4 */ @@ -185,7 +185,7 @@ static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = 0x14, 0x10, 0x0c, 0x04 /* Codes 1-4 */ }; -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ @@ -199,7 +199,7 @@ static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = 0x1c, 0x14, 0x10, 0x08 /* Codes 1-4 */ }; -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_playBrightLut[BITMAP_NLUTCODES] = { CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ 0x1c, 0x18, 0x14, 0x0c /* Codes 1-4 */ @@ -252,7 +252,7 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = BITMAP_NROWS, // height - Height in rows { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_playNormalLut, // Index 0: Unselected LUT - g_playBrightlLut, // Index 1: Selected LUT + g_playBrightLut, // Index 1: Selected LUT }, - g_playRleEntries // data - Pointer to the beginning of the RLE data + g_playRleEntries // data - Pointer to the beginning of the RLE data }; diff --git a/nxwm/src/glyph_play48x48.cxx b/nxwm/src/glyph_play48x48.cxx index d74b815ad..6f0801d11 100644 --- a/nxwm/src/glyph_play48x48.cxx +++ b/nxwm/src/glyph_play48x48.cxx @@ -79,7 +79,7 @@ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = 0x008400, 0x006600, 0x004e00, 0x003600 /* Codes 3-6 */ }; -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x00d800, 0x00fc00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x00b000, 0x008800, 0x006800, 0x004800 /* Codes 3-6 */ @@ -93,7 +93,7 @@ static const uint32_t g_playNormalLut[BITMAP_NLUTCODES] = 0x00b000, 0x008800, 0x006800, 0x004800 /* Codes 3-6 */ }; -static const uint32_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint32_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x00ff00, 0x00ff00, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x00dc00, 0x00aa00, 0x008200, 0x005a00 /* Codes 3-6 */ @@ -112,7 +112,7 @@ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = 0x0420, 0x0320, 0x0260, 0x01a0 /* Codes 3-6 */ }; -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x06c0, 0x07e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x0580, 0x0440, 0x0340, 0x0240 /* Codes 3-6 */ @@ -126,7 +126,7 @@ static const uint16_t g_playNormalLut[BITMAP_NLUTCODES] = 0x0580, 0x0440, 0x0340, 0x0240 /* Codes 3-6 */ }; -static const uint16_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint16_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x07e0, 0x07e0, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x06e0, 0x0540, 0x0400, 0x02c0 /* Codes 3-6 */ @@ -154,7 +154,7 @@ static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = 0x4d, 0x3b, 0x2d, 0x1f /* Codes 3-6 */ }; -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x7e, 0x93, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x67, 0x4f, 0x3d, 0x2a /* Codes 3-6 */ @@ -168,7 +168,7 @@ static const uint8_t g_playNormalLut[BITMAP_NLUTCODES] = 0x67, 0x4f, 0x3d, 0x2a /* Codes 3-6 */ }; -static const uint8_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const uint8_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x95, 0x95, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x81, 0x63, 0x4c, 0x34 /* Codes 3-6 */ @@ -187,7 +187,7 @@ static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = 0x10, 0x0c, 0x08, 0x04 /* Codes 3-6 */ }; -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x18, 0x1c, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x14, 0x10, 0x0c, 0x08 /* Codes 3-6 */ @@ -201,7 +201,7 @@ static const nxgl_mxpixel_t g_playNormalLut[BITMAP_NLUTCODES] = 0x14, 0x10, 0x0c, 0x08 /* Codes 3-6 */ }; -static const nxgl_mxpixel_t g_playBrightlLut[BITMAP_NLUTCODES] = +static const nxgl_mxpixel_t g_playBrightLut[BITMAP_NLUTCODES] = { 0x1c, 0x1c, CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Codes 0-2 */ 0x18, 0x14, 0x10, 0x08 /* Codes 3-6 */ @@ -276,9 +276,9 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_playBitmap = BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) BITMAP_NCOLUMNS, // width - Width in pixels BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) + { // lut - Pointer to the beginning of the Look-Up Table (LUT) g_playNormalLut, // Index 0: Unselected LUT - g_playBrightlLut, // Index 1: Selected LUT + g_playBrightLut, // Index 1: Selected LUT }, - g_playRleEntries // data - Pointer to the beginning of the RLE data + g_playRleEntries // data - Pointer to the beginning of the RLE data }; From de5c7fa462debb0b33a7490ac62a44a3296c9058 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 13 Jul 2014 19:36:30 -0600 Subject: [PATCH 191/390] NxWM: Slightly improvied minimize icon --- nxwm/images/minimize42x42.png | Bin 310 -> 420 bytes nxwm/include/nxwmconfig.hxx | 2 +- nxwm/src/glyph_minimize42x42.cxx | 120 +++++++++++++++---------------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/nxwm/images/minimize42x42.png b/nxwm/images/minimize42x42.png index 0d6eeb1702cdc19fc42b7bdc14c31a23d9aca7e1..2ffb76a2d93c92e960e448573b5410f824c8f194 100755 GIT binary patch delta 352 zcmV-m0iXW10;B_wF%Je}OGiWi{{a60|De66laVeUe+~f{H;sEMy#N3KBuPX;R9M5^ z+1(9-Fc1guD`AzJ!U2dAm^g$lFbPALIDr%R=mh5u#tHDjj}QX2h5JID+w_-z@7gAW z_WI~x1z!mOaM)ckreNYYVnep4%?rv49FAWOZmJrJv;}d&GRTr@p|OZC6kRn_u?FM> zlp9GJe>LhhQHN>X?$U{pRHEn>DU>Kl)+qW!zUz}YQ4;O?(k-x;CPSjKDKaD~3>>66 z1FDzcMAwra8l?!(7CEx@)VrnZwmIWwGC)Ss^z+R7f%E}QK-xnSk+#qbq#ZO9 zX#<^s)Q8SQGClKTfjUqIU=p;Wt!ib2aLlh!Mr|Yj0CjukSE&1&=^vq!%@ptqq+F*M yX{IuEti&eTCdzp3$v_cqI!+6h@#NM30000iV{lo<*fENjqLq!)8=(X)SalQLR#_M^P>8 z{+k6YUPcvq>zQ3&yPL1FId4yB$tj8woT6yKDTR)u%t;u+mB}EgpE+QF0 t^o#H;E7h0VZ}^;>T&*j~{MW{f=nJ?RC&&o`N5KF9002ovPDHLkV1n+ga2)^u diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 0f31e8d55..453ab0421 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -189,7 +189,7 @@ * * CONFIG_NXWM_TASKBAR_WIDTH - Task bar thickness (either vertical or * horizontal). Default: 25 + 2*spacing unless large icons are selected. - * Then the default is 50 *spacing + * Then the default is 50 + 2*spacing. */ /** diff --git a/nxwm/src/glyph_minimize42x42.cxx b/nxwm/src/glyph_minimize42x42.cxx index 0d207570f..e4d57ad6c 100644 --- a/nxwm/src/glyph_minimize42x42.cxx +++ b/nxwm/src/glyph_minimize42x42.cxx @@ -58,7 +58,7 @@ #define BITMAP_NROWS 42 #define BITMAP_NCOLUMNS 42 -#define BITMAP_NLUTCODES 8 +#define BITMAP_NLUTCODES 7 #define DARK_MINIMIZE_ICON 1 @@ -75,24 +75,24 @@ using namespace NxWM; static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x1b368a, 0x3651a5, 0x001b8a, 0x001ba5, 0x1b1b6f, 0x00008a, 0xbdbdbd, 0xa5bdbd /* Codes 0-7 */ + 0x6f99b4, 0x001b8a, 0x001ba5, 0x060f4b, 0x00007b, 0xbdbdbd, 0xa5bdbd /* Codes 0-6 */ }; static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ + 0x94ccf0, 0x0024b8, 0x0024dc, 0x081464, 0x0000a4, 0xfcfcfc, 0xdcfcfc /* Codes 0-6 */ }; # else /* DARK_MINIMIZE_ICON */ static const uint32_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x2448b8, 0x486cdc, 0x0024b8, 0x0024dc, 0x242494, 0x0000b8, 0xfcfcfc, 0xdcfcfc /* Codes 0-7 */ + 0x94ccf0, 0x0024b8, 0x0024dc, 0x081464, 0x0000a4, 0xfcfcfc, 0xdcfcfc /* Codes 0-6 */ }; static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2d5ae6, 0x5a87ff, 0x002de6, 0x002dff, 0x2d2db9, 0x0000e6, 0xffffff, 0xffffff /* Codes 0-7 */ + 0xb9ffff, 0x002de6, 0x002dff, 0x0a197d, 0x0000cd, 0xffffff, 0xffffff /* Codes 0-6 */ }; # endif /* DARK_MINIMIZE_ICON */ @@ -103,24 +103,24 @@ static const uint32_t g_minimizeBrightLut[BITMAP_NLUTCODES] = static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x19b1, 0x3294, 0x00d1, 0x00d4, 0x18cd, 0x0011, 0xbdf7, 0xa5f7 /* Codes 0-7 */ + 0x6cd6, 0x00d1, 0x00d4, 0x0069, 0x000f, 0xbdf7, 0xa5f7 /* Codes 0-6 */ }; static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ + 0x967e, 0x0137, 0x013b, 0x08ac, 0x0014, 0xffff, 0xdfff /* Codes 0-6 */ }; # else /* DARK_MINIMIZE_ICON */ static const uint16_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x2257, 0x4b7b, 0x0137, 0x013b, 0x2132, 0x0017, 0xffff, 0xdfff /* Codes 0-7 */ + 0x967e, 0x0137, 0x013b, 0x08ac, 0x0014, 0xffff, 0xdfff /* Codes 0-6 */ }; static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2adc, 0x5c3f, 0x017c, 0x017f, 0x2977, 0x001c, 0xffff, 0xffff /* Codes 0-7 */ + 0xbfff, 0x017c, 0x017f, 0x08cf, 0x0019, 0xffff, 0xffff /* Codes 0-6 */ }; # endif /* DARK_MINIMIZE_ICON */ @@ -141,24 +141,24 @@ static const uint16_t g_minimizeBrightLut[BITMAP_NLUTCODES] = static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x37, 0x52, 0x1f, 0x22, 0x24, 0x0f, 0xbd, 0xb5 /* Codes 0-7 */ + 0x8f, 0x1f, 0x22, 0x13, 0x0e, 0xbd, 0xb5 /* Codes 0-6 */ }; static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ + 0xbf, 0x2a, 0x2e, 0x19, 0x12, 0xfc, 0xf2 /* Codes 0-6 */ }; # else /* DARK_MINIMIZE_ICON */ static const uint8_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x4a, 0x6e, 0x2a, 0x2e, 0x30, 0x14, 0xfc, 0xf2 /* Codes 0-7 */ + 0xbf, 0x2a, 0x2e, 0x19, 0x12, 0xfc, 0xf2 /* Codes 0-6 */ }; static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x5c, 0x87, 0x34, 0x37, 0x3c, 0x1a, 0xff, 0xff /* Codes 0-7 */ + 0xea, 0x34, 0x37, 0x1f, 0x17, 0xff, 0xff /* Codes 0-6 */ }; # endif /* DARK_MINIMIZE_ICON */ @@ -171,24 +171,24 @@ static const uint8_t g_minimizeBrightLut[BITMAP_NLUTCODES] = static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x06, 0x2a, 0x02, 0x02, 0x01, 0x02, 0xb6, 0xb6 /* Codes 0-7 */ + 0x72, 0x02, 0x02, 0x01, 0x01, 0xb6, 0xb6 /* Codes 0-6 */ }; static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ + 0x9b, 0x06, 0x07, 0x01, 0x02, 0xff, 0xdf /* Codes 0-6 */ }; # else /* DARK_MINIMIZE_ICON */ static const nxgl_mxpixel_t g_minimizeNormalLut[BITMAP_NLUTCODES] = { - 0x2a, 0x4f, 0x06, 0x07, 0x26, 0x02, 0xff, 0xdf /* Codes 0-7 */ + 0x9b, 0x06, 0x07, 0x01, 0x02, 0xff, 0xdf /* Codes 0-6 */ }; static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = { - 0x2b, 0x53, 0x07, 0x07, 0x26, 0x03, 0xff, 0xff /* Codes 0-7 */ + 0xbf, 0x07, 0x07, 0x01, 0x03, 0xff, 0xff /* Codes 0-6 */ }; # endif /* DARK_MINIMIZE_ICON */ @@ -199,48 +199,48 @@ static const nxgl_mxpixel_t g_minimizeBrightLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_minimizeRleEntries[] = { - { 2, 0}, {40, 1}, /* Row 0 */ - { 2, 0}, {40, 1}, /* Row 1 */ - { 2, 1}, {10, 2}, {10, 3}, {16, 2}, { 2, 4}, { 2, 0}, /* Row 2 */ - { 2, 1}, {10, 2}, {10, 3}, {16, 2}, { 2, 4}, { 2, 0}, /* Row 3 */ - { 2, 1}, { 6, 2}, {16, 3}, {16, 2}, { 2, 4}, /* Row 4 */ - { 2, 1}, { 6, 2}, {16, 3}, {16, 2}, { 2, 4}, /* Row 5 */ - { 2, 1}, { 4, 2}, {20, 3}, {14, 2}, { 2, 4}, /* Row 6 */ - { 2, 1}, { 4, 2}, {20, 3}, {14, 2}, { 2, 4}, /* Row 7 */ - { 2, 1}, { 2, 2}, {20, 3}, {16, 2}, { 2, 4}, /* Row 8 */ - { 2, 1}, { 2, 2}, {20, 3}, {16, 2}, { 2, 4}, /* Row 9 */ - { 2, 1}, { 2, 2}, {18, 3}, {18, 2}, { 2, 4}, /* Row 10 */ - { 2, 1}, { 2, 2}, {18, 3}, {18, 2}, { 2, 4}, /* Row 11 */ - { 2, 1}, {18, 3}, {18, 2}, { 2, 5}, { 2, 4}, /* Row 12 */ - { 2, 1}, {18, 3}, {18, 2}, { 2, 5}, { 2, 4}, /* Row 13 */ - { 2, 1}, {16, 3}, {20, 2}, { 2, 5}, { 2, 4}, /* Row 14 */ - { 2, 1}, {16, 3}, {20, 2}, { 2, 5}, { 2, 4}, /* Row 15 */ - { 2, 1}, {14, 3}, {22, 2}, { 2, 5}, { 2, 4}, /* Row 16 */ - { 2, 1}, {14, 3}, {22, 2}, { 2, 5}, { 2, 4}, /* Row 17 */ - { 2, 1}, { 2, 2}, { 8, 3}, {24, 2}, { 4, 5}, { 2, 4}, /* Row 18 */ - { 2, 1}, { 2, 2}, { 8, 3}, {24, 2}, { 4, 5}, { 2, 4}, /* Row 19 */ - { 2, 1}, { 4, 2}, { 2, 3}, {28, 2}, { 4, 5}, { 2, 4}, /* Row 20 */ - { 2, 1}, { 4, 2}, { 2, 3}, {28, 2}, { 4, 5}, { 2, 4}, /* Row 21 */ - { 2, 1}, {32, 2}, { 6, 5}, { 2, 4}, /* Row 22 */ - { 2, 1}, {32, 2}, { 6, 5}, { 2, 4}, /* Row 23 */ - { 2, 1}, {30, 2}, { 8, 5}, { 2, 4}, /* Row 24 */ - { 2, 1}, {30, 2}, { 8, 5}, { 2, 4}, /* Row 25 */ - { 2, 1}, {26, 2}, {12, 5}, { 2, 4}, /* Row 26 */ - { 2, 1}, {26, 2}, {12, 5}, { 2, 4}, /* Row 27 */ - { 2, 1}, {22, 2}, {16, 5}, { 2, 4}, /* Row 28 */ - { 2, 1}, {22, 2}, {16, 5}, { 2, 4}, /* Row 29 */ - { 2, 1}, {16, 2}, {22, 5}, { 2, 4}, /* Row 30 */ - { 2, 1}, {16, 2}, {22, 5}, { 2, 4}, /* Row 31 */ - { 2, 1}, { 8, 2}, {30, 5}, { 2, 4}, /* Row 32 */ - { 2, 1}, { 8, 2}, {30, 5}, { 2, 4}, /* Row 33 */ - { 2, 1}, { 4, 2}, {28, 6}, { 2, 7}, { 4, 5}, { 2, 4}, /* Row 34 */ - { 2, 1}, { 4, 2}, {28, 6}, { 2, 7}, { 4, 5}, { 2, 4}, /* Row 35 */ - { 2, 1}, { 2, 2}, { 2, 5}, {30, 7}, { 4, 5}, { 2, 4}, /* Row 36 */ - { 2, 1}, { 2, 2}, { 2, 5}, {30, 7}, { 4, 5}, { 2, 4}, /* Row 37 */ - { 2, 1}, {38, 5}, { 2, 0}, /* Row 38 */ - { 2, 1}, {38, 5}, { 2, 0}, /* Row 39 */ - { 2, 1}, { 2, 0}, {34, 4}, { 2, 0}, { 2, 1}, /* Row 40 */ - { 2, 1}, { 2, 0}, {34, 4}, { 2, 0}, { 2, 1} /* Row 41 */ + {42, 0}, /* Row 0 */ + { 1, 0}, {11, 1}, {10, 2}, {19, 1}, { 1, 0}, /* Row 1 */ + { 1, 0}, { 9, 1}, {14, 2}, {17, 1}, { 1, 3}, /* Row 2 */ + { 1, 0}, { 7, 1}, {17, 2}, {16, 1}, { 1, 3}, /* Row 3 */ + { 1, 0}, { 6, 1}, {18, 2}, {16, 1}, { 1, 3}, /* Row 4 */ + { 1, 0}, { 5, 1}, {19, 2}, {16, 1}, { 1, 3}, /* Row 5 */ + { 1, 0}, { 4, 1}, {20, 2}, {16, 1}, { 1, 3}, /* Row 6 */ + { 1, 0}, { 3, 1}, {20, 2}, {17, 1}, { 1, 3}, /* Row 7 */ + { 1, 0}, { 3, 1}, {20, 2}, {17, 1}, { 1, 3}, /* Row 8 */ + { 1, 0}, { 2, 1}, {20, 2}, {17, 1}, { 1, 4}, { 1, 3}, /* Row 9 */ + { 1, 0}, { 2, 1}, {19, 2}, {18, 1}, { 1, 4}, { 1, 3}, /* Row 10 */ + { 1, 0}, { 1, 1}, {19, 2}, {19, 1}, { 1, 4}, { 1, 3}, /* Row 11 */ + { 1, 0}, { 1, 1}, {18, 2}, {20, 1}, { 1, 4}, { 1, 3}, /* Row 12 */ + { 1, 0}, {18, 2}, {20, 1}, { 2, 4}, { 1, 3}, /* Row 13 */ + { 1, 0}, {17, 2}, {21, 1}, { 2, 4}, { 1, 3}, /* Row 14 */ + { 1, 0}, {15, 2}, {22, 1}, { 3, 4}, { 1, 3}, /* Row 15 */ + { 1, 0}, {14, 2}, {23, 1}, { 3, 4}, { 1, 3}, /* Row 16 */ + { 1, 0}, {12, 2}, {24, 1}, { 4, 4}, { 1, 3}, /* Row 17 */ + { 1, 0}, {10, 2}, {26, 1}, { 4, 4}, { 1, 3}, /* Row 18 */ + { 1, 0}, { 1, 1}, { 8, 2}, {26, 1}, { 5, 4}, { 1, 3}, /* Row 19 */ + { 1, 0}, { 2, 1}, { 5, 2}, {27, 1}, { 6, 4}, { 1, 3}, /* Row 20 */ + { 1, 0}, { 4, 1}, { 1, 2}, {29, 1}, { 6, 4}, { 1, 3}, /* Row 21 */ + { 1, 0}, {33, 1}, { 7, 4}, { 1, 3}, /* Row 22 */ + { 1, 0}, {32, 1}, { 8, 4}, { 1, 3}, /* Row 23 */ + { 1, 0}, {31, 1}, { 9, 4}, { 1, 3}, /* Row 24 */ + { 1, 0}, {30, 1}, {10, 4}, { 1, 3}, /* Row 25 */ + { 1, 0}, {29, 1}, {11, 4}, { 1, 3}, /* Row 26 */ + { 1, 0}, {28, 1}, {12, 4}, { 1, 3}, /* Row 27 */ + { 1, 0}, {27, 1}, {13, 4}, { 1, 3}, /* Row 28 */ + { 1, 0}, {26, 1}, {14, 4}, { 1, 3}, /* Row 29 */ + { 1, 0}, {24, 1}, {16, 4}, { 1, 3}, /* Row 30 */ + { 1, 0}, {22, 1}, {18, 4}, { 1, 3}, /* Row 31 */ + { 1, 0}, { 6, 1}, {28, 5}, { 6, 4}, { 1, 3}, /* Row 32 */ + { 1, 0}, { 5, 1}, {29, 5}, { 1, 6}, { 5, 4}, { 1, 3}, /* Row 33 */ + { 1, 0}, { 5, 1}, {29, 5}, { 1, 6}, { 5, 4}, { 1, 3}, /* Row 34 */ + { 1, 0}, { 5, 1}, {29, 5}, { 1, 6}, { 5, 4}, { 1, 3}, /* Row 35 */ + { 1, 0}, { 5, 1}, {29, 5}, { 1, 6}, { 5, 4}, { 1, 3}, /* Row 36 */ + { 1, 0}, { 6, 1}, {28, 6}, { 6, 4}, { 1, 3}, /* Row 37 */ + { 1, 0}, { 4, 1}, {36, 4}, { 1, 3}, /* Row 38 */ + { 1, 0}, { 2, 1}, {38, 4}, { 1, 3}, /* Row 39 */ + { 1, 0}, {40, 4}, { 1, 3}, /* Row 40 */ + { 2, 0}, {40, 3} /* Row 41 */ }; /******************************************************************************************** @@ -258,5 +258,5 @@ const struct NXWidgets::SRlePaletteBitmap NxWM::g_minimizeBitmap = g_minimizeNormalLut, // Index 0: Unselected LUT g_minimizeBrightLut, // Index 1: Selected LUT }, - g_minimizeRleEntries // data - Pointer to the beginning of the RLE data + g_minimizeRleEntries // data - Pointer to the beginning of the RLE data }; From dd47fa066acf1a4a7859105b39e49b31b5eaa2c8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 09:20:13 -0600 Subject: [PATCH 192/390] NxWM: Add larger media player icon --- nxwm/Makefile | 7 +- nxwm/images/mediaplayer24x24.png | Bin 0 -> 2963 bytes nxwm/images/mediaplayer44x50.png | Bin 0 -> 1098 bytes nxwm/include/nxwmglyphs.hxx | 2 +- nxwm/src/glyph_calibration24x21.cxx | 80 ++++++++-------- nxwm/src/glyph_mediaplayer24x24.cxx | 140 ++++++++++++++-------------- 6 files changed, 119 insertions(+), 110 deletions(-) create mode 100755 nxwm/images/mediaplayer24x24.png create mode 100755 nxwm/images/mediaplayer44x50.png diff --git a/nxwm/Makefile b/nxwm/Makefile index ff4b256b1..624be08c2 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -86,7 +86,12 @@ CXXSRCS += glyph_minimize21x21.cxx glyph_play24x24.cxx glyph_stop21x21.cxx endif ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) -CXXSRCS += glyph_mediaplayer24x24.cxx cmediaplayer.cxx glyph_mplayer_controls32x32.cxx +CXXSRCS += cmediaplayer.cxx +ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) +CXXSRCS += glyph_mediaplayer44x50.cxx glyph_mplayer_controls32x32.cxx +else +CXXSRCS += glyph_mediaplayer24x24.cxx glyph_mplayer_controls32x32.cxx +endif endif SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) diff --git a/nxwm/images/mediaplayer24x24.png b/nxwm/images/mediaplayer24x24.png new file mode 100755 index 0000000000000000000000000000000000000000..bf59b82a4fc20ad26ffed1d924926f09742e3c74 GIT binary patch literal 2963 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 C * * Redistribution and use in source and binary forms, with or without diff --git a/nxwm/src/glyph_calibration24x21.cxx b/nxwm/src/glyph_calibration24x21.cxx index fb1c5e6bc..c94093119 100644 --- a/nxwm/src/glyph_calibration24x21.cxx +++ b/nxwm/src/glyph_calibration24x21.cxx @@ -144,39 +144,39 @@ static const nxgl_mxpixel_t g_calibrationSelectedLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] = { - { 11, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 3}, { 1, 2}, { 3, 0}, /* Row 0 */ - { 11, 0}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 0}, /* Row 1 */ - { 11, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 3}, { 1, 2}, /* Row 2 */ - { 3, 0}, - { 11, 0}, { 1, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 3}, { 4, 0}, /* Row 3 */ - { 9, 0}, { 2, 1}, { 2, 3}, { 2, 2}, { 4, 0}, { 1, 3}, { 4, 0}, /* Row 4 */ - { 3, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 1}, { 1, 2}, /* Row 5 */ - { 5, 0}, { 1, 1}, { 2, 3}, { 3, 0}, - { 2, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 1}, { 1, 2}, /* Row 6 */ - { 4, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 2, 0}, - { 3, 0}, { 1, 2}, { 1, 3}, { 2, 2}, { 4, 0}, { 1, 1}, { 1, 2}, { 4, 0}, /* Row 7 */ - { 1, 1}, { 3, 0}, { 1, 3}, { 2, 0}, - { 4, 0}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, { 1, 3}, /* Row 8 */ - { 3, 0}, { 2, 3}, { 1, 0}, - { 3, 0}, { 1, 1}, { 2, 3}, { 5, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, /* Row 9 */ - { 5, 0}, { 1, 3}, { 1, 0}, - { 2, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 4, 0}, { 1, 1}, { 1, 2}, /* Row 10 */ - { 3, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, - { 2, 0}, { 1, 1}, { 3, 0}, { 1, 3}, { 4, 0}, { 1, 1}, { 1, 2}, { 3, 0}, /* Row 11 */ - { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, - { 1, 0}, { 1, 1}, { 1, 3}, { 2, 4}, { 1, 5}, { 2, 3}, { 3, 0}, { 1, 1}, /* Row 12 */ - { 1, 2}, { 2, 0}, { 9, 3}, - { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 13 */ - { 1, 1}, { 1, 2}, { 11, 0}, - { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 14 */ - { 1, 1}, { 1, 2}, { 11, 0}, - { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 15 */ - { 1, 1}, { 1, 2}, { 11, 0}, - { 9, 3}, { 2, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 16 */ - { 11, 0}, { 1, 1}, { 1, 2}, { 11, 0}, /* Row 17 */ - { 10, 0}, { 1, 1}, { 2, 3}, { 1, 2}, { 10, 0}, /* Row 18 */ - { 5, 0}, { 4, 1}, { 6, 3}, { 4, 2}, { 5, 0}, /* Row 19 */ - { 4, 0}, { 4, 1}, { 8, 3}, { 4, 2}, { 4, 0}, /* Row 20 */ + {11, 0}, { 1, 1}, { 1, 2}, { 6, 0}, { 1, 3}, { 1, 2}, { 3, 0}, /* Row 0 */ + {11, 0}, { 1, 1}, { 1, 2}, { 4, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 0}, /* Row 1 */ + {11, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 3}, { 1, 2}, /* Row 2 */ + { 3, 0}, + {11, 0}, { 1, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 3}, { 4, 0}, /* Row 3 */ + { 9, 0}, { 2, 1}, { 2, 3}, { 2, 2}, { 4, 0}, { 1, 3}, { 4, 0}, /* Row 4 */ + { 3, 0}, { 1, 1}, { 1, 2}, { 2, 0}, { 2, 1}, { 2, 2}, { 1, 1}, { 1, 2}, /* Row 5 */ + { 5, 0}, { 1, 1}, { 2, 3}, { 3, 0}, + { 2, 0}, { 2, 1}, { 1, 3}, { 2, 1}, { 2, 2}, { 2, 0}, { 1, 1}, { 1, 2}, /* Row 6 */ + { 4, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 2, 0}, + { 3, 0}, { 1, 2}, { 1, 3}, { 2, 2}, { 4, 0}, { 1, 1}, { 1, 2}, { 4, 0}, /* Row 7 */ + { 1, 1}, { 3, 0}, { 1, 3}, { 2, 0}, + { 4, 0}, { 1, 3}, { 6, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, { 1, 3}, /* Row 8 */ + { 3, 0}, { 2, 3}, { 1, 0}, + { 3, 0}, { 1, 1}, { 2, 3}, { 5, 0}, { 1, 1}, { 1, 2}, { 3, 0}, { 1, 1}, /* Row 9 */ + { 5, 0}, { 1, 3}, { 1, 0}, + { 2, 0}, { 1, 1}, { 1, 3}, { 1, 0}, { 2, 3}, { 4, 0}, { 1, 1}, { 1, 2}, /* Row 10 */ + { 3, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, + { 2, 0}, { 1, 1}, { 3, 0}, { 1, 3}, { 4, 0}, { 1, 1}, { 1, 2}, { 3, 0}, /* Row 11 */ + { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 1, 0}, + { 1, 0}, { 1, 1}, { 1, 3}, { 2, 4}, { 1, 5}, { 2, 3}, { 3, 0}, { 1, 1}, /* Row 12 */ + { 1, 2}, { 2, 0}, { 9, 3}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 13 */ + { 1, 1}, { 1, 2}, {11, 0}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 14 */ + { 1, 1}, { 1, 2}, {11, 0}, + { 1, 0}, { 1, 1}, { 1, 0}, { 2, 4}, { 1, 5}, { 1, 0}, { 1, 3}, { 3, 0}, /* Row 15 */ + { 1, 1}, { 1, 2}, {11, 0}, + { 9, 3}, { 2, 0}, { 1, 1}, { 1, 2}, {11, 0}, /* Row 16 */ + {11, 0}, { 1, 1}, { 1, 2}, {11, 0}, /* Row 17 */ + {10, 0}, { 1, 1}, { 2, 3}, { 1, 2}, {10, 0}, /* Row 18 */ + { 5, 0}, { 4, 1}, { 6, 3}, { 4, 2}, { 5, 0}, /* Row 19 */ + { 4, 0}, { 4, 1}, { 8, 3}, { 4, 2}, { 4, 0}, /* Row 20 */ }; /******************************************************************************************** @@ -185,13 +185,13 @@ static const struct NXWidgets::SRlePaletteBitmapEntry g_calibrationRleEntries[] const struct NXWidgets::SRlePaletteBitmap NxWM::g_calibrationBitmap = { - CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel - CONFIG_NXWIDGETS_FMT, // fmt - Color format - BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) - BITMAP_NCOLUMNS, // width - Width in pixels - BITMAP_NROWS, // height - Height in rows - { // lut - Pointer to the beginning of the Look-Up Table (LUT) - g_calibrationNormalLut, // Index 0: Unselected LUT + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_calibrationNormalLut, // Index 0: Unselected LUT g_calibrationSelectedLut, // Index 1: Selected LUT }, g_calibrationRleEntries // data - Pointer to the beginning of the RLE data diff --git a/nxwm/src/glyph_mediaplayer24x24.cxx b/nxwm/src/glyph_mediaplayer24x24.cxx index 5e8899c38..6651cb3e1 100644 --- a/nxwm/src/glyph_mediaplayer24x24.cxx +++ b/nxwm/src/glyph_mediaplayer24x24.cxx @@ -37,9 +37,6 @@ * Included Files ********************************************************************************************/ -/* Automatically NuttX bitmap file. */ -/* Generated from play_music.png by bitmap_converter.py. */ - #include #include @@ -55,15 +52,18 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" - /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ -#define BITMAP_WIDTH 24 -#define BITMAP_HEIGHT 24 +#define BITMAP_WIDTH 24 +#define BITMAP_HEIGHT 24 #define BITMAP_PALETTESIZE 9 +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + using namespace NxWM; /* RGB24 (8-8-8) Colors */ @@ -84,70 +84,74 @@ static const NXWidgets::nxwidget_pixel_t hilight_palette[BITMAP_PALETTESIZE] = static const NXWidgets::SRlePaletteBitmapEntry bitmap[] = { - { 8, 8}, { 8, 7}, { 8, 8}, /* Row 0 */ - { 6, 8}, { 1, 7}, { 1, 3}, { 1, 5}, { 2, 2}, { 2, 1}, - { 2, 2}, { 1, 5}, { 1, 3}, { 1, 7}, { 6, 8}, /* Row 1 */ - { 4, 8}, { 2, 7}, { 1, 4}, { 1, 2}, { 1, 6}, { 6, 1}, - { 1, 6}, { 1, 2}, { 1, 4}, { 2, 7}, { 4, 8}, /* Row 2 */ - { 3, 8}, { 1, 7}, { 1, 3}, { 1, 2}, { 1, 6}, { 2, 1}, - { 4, 6}, { 2, 1}, { 2, 6}, { 2, 2}, { 1, 3}, { 1, 7}, - { 3, 8}, /* Row 3 */ - { 2, 8}, { 1, 7}, { 1, 3}, { 1, 1}, { 2, 6}, { 3, 1}, - { 2, 2}, { 1, 4}, { 1, 3}, { 5, 5}, { 1, 1}, { 1, 3}, - { 1, 7}, { 2, 8}, /* Row 4 */ - { 2, 8}, { 1, 7}, { 1, 2}, { 1, 6}, { 4, 1}, { 1, 4}, - { 3, 5}, { 2, 6}, { 3, 0}, { 1, 3}, { 2, 2}, { 1, 7}, - { 2, 8}, /* Row 5 */ - { 1, 8}, { 1, 7}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, - { 1, 5}, { 1, 6}, { 7, 0}, { 1, 3}, { 1, 2}, { 1, 6}, - { 1, 4}, { 1, 7}, { 1, 8}, /* Row 6 */ - { 1, 8}, { 1, 3}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, - { 4, 0}, { 2, 6}, { 1, 3}, { 1, 5}, { 1, 0}, { 1, 3}, - { 1, 2}, { 1, 1}, { 1, 6}, { 1, 3}, { 1, 8}, /* Row 7 */ - { 1, 3}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, - { 2, 0}, { 1, 6}, { 3, 3}, { 1, 4}, { 1, 5}, { 1, 0}, - { 1, 3}, { 1, 2}, { 1, 1}, { 1, 6}, { 1, 4}, { 1, 3}, /* Row 8 */ - { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 4}, - { 1, 3}, { 1, 4}, { 3, 2}, { 1, 5}, { 1, 0}, { 1, 3}, - { 1, 2}, { 3, 1}, { 1, 3}, /* Row 9 */ - { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, - { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 3}, { 1, 2}, - { 3, 1}, { 1, 3}, /* Row 10 */ - { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, - { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, - { 3, 1}, { 1, 3}, /* Row 11 */ - { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, - { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, - { 3, 1}, { 1, 5}, /* Row 12 */ - { 1, 3}, { 1, 6}, { 4, 1}, { 2, 2}, { 1, 5}, { 1, 0}, - { 1, 3}, { 1, 4}, { 2, 2}, { 1, 5}, { 1, 7}, { 1, 6}, - { 1, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 6}, { 1, 3}, /* Row 13 */ - { 1, 3}, { 5, 1}, { 1, 2}, { 2, 3}, { 1, 0}, { 1, 3}, - { 1, 4}, { 1, 2}, { 1, 7}, { 1, 6}, { 3, 0}, { 1, 7}, - { 1, 2}, { 2, 1}, { 1, 2}, { 1, 3}, /* Row 14 */ - { 1, 5}, { 1, 4}, { 3, 1}, { 1, 2}, { 1, 3}, { 1, 2}, - { 1, 6}, { 1, 0}, { 1, 3}, { 1, 2}, { 1, 5}, { 1, 6}, - { 4, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 5}, /* Row 15 */ - { 1, 8}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 3}, { 4, 0}, - { 1, 3}, { 1, 2}, { 1, 3}, { 1, 6}, { 3, 0}, { 1, 6}, - { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 8}, /* Row 16 */ - { 1, 8}, { 1, 5}, { 1, 2}, { 1, 1}, { 1, 5}, { 1, 6}, - { 4, 0}, { 1, 3}, { 2, 2}, { 1, 3}, { 1, 6}, { 1, 0}, - { 1, 6}, { 1, 7}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 5}, - { 1, 8}, /* Row 17 */ - { 2, 8}, { 1, 5}, { 1, 1}, { 1, 5}, { 1, 1}, { 4, 0}, - { 1, 3}, { 1, 2}, { 1, 1}, { 1, 4}, { 1, 3}, { 1, 7}, - { 1, 3}, { 1, 2}, { 3, 1}, { 1, 5}, { 2, 8}, /* Row 18 */ - { 2, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 6}, - { 1, 0}, { 1, 6}, { 1, 3}, { 1, 2}, { 9, 1}, { 1, 4}, - { 1, 5}, { 2, 8}, /* Row 19 */ - { 3, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 5}, - { 1, 3}, { 10, 1}, { 1, 4}, { 1, 5}, { 3, 8}, /* Row 20 */ - { 4, 8}, { 2, 4}, { 12, 1}, { 2, 4}, { 4, 8}, /* Row 21 */ - { 6, 8}, { 2, 4}, { 8, 1}, { 2, 4}, { 6, 8}, /* Row 22 */ - { 8, 8}, { 8, 4}, { 8, 8}, /* Row 23 */ + { 8, 8}, { 8, 7}, { 8, 8}, /* Row 0 */ + { 6, 8}, { 1, 7}, { 1, 3}, { 1, 5}, { 2, 2}, { 2, 1}, + { 2, 2}, { 1, 5}, { 1, 3}, { 1, 7}, { 6, 8}, /* Row 1 */ + { 4, 8}, { 2, 7}, { 1, 4}, { 1, 2}, { 1, 6}, { 6, 1}, + { 1, 6}, { 1, 2}, { 1, 4}, { 2, 7}, { 4, 8}, /* Row 2 */ + { 3, 8}, { 1, 7}, { 1, 3}, { 1, 2}, { 1, 6}, { 2, 1}, + { 4, 6}, { 2, 1}, { 2, 6}, { 2, 2}, { 1, 3}, { 1, 7}, + { 3, 8}, /* Row 3 */ + { 2, 8}, { 1, 7}, { 1, 3}, { 1, 1}, { 2, 6}, { 3, 1}, + { 2, 2}, { 1, 4}, { 1, 3}, { 5, 5}, { 1, 1}, { 1, 3}, + { 1, 7}, { 2, 8}, /* Row 4 */ + { 2, 8}, { 1, 7}, { 1, 2}, { 1, 6}, { 4, 1}, { 1, 4}, + { 3, 5}, { 2, 6}, { 3, 0}, { 1, 3}, { 2, 2}, { 1, 7}, + { 2, 8}, /* Row 5 */ + { 1, 8}, { 1, 7}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, + { 1, 5}, { 1, 6}, { 7, 0}, { 1, 3}, { 1, 2}, { 1, 6}, + { 1, 4}, { 1, 7}, { 1, 8}, /* Row 6 */ + { 1, 8}, { 1, 3}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, + { 4, 0}, { 2, 6}, { 1, 3}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 2}, { 1, 1}, { 1, 6}, { 1, 3}, { 1, 8}, /* Row 7 */ + { 1, 3}, { 1, 4}, { 1, 6}, { 4, 1}, { 1, 2}, { 1, 5}, + { 2, 0}, { 1, 6}, { 3, 3}, { 1, 4}, { 1, 5}, { 1, 0}, + { 1, 3}, { 1, 2}, { 1, 1}, { 1, 6}, { 1, 4}, { 1, 3}, /* Row 8 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 4}, + { 1, 3}, { 1, 4}, { 3, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 2}, { 3, 1}, { 1, 3}, /* Row 9 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 3}, { 1, 2}, + { 3, 1}, { 1, 3}, /* Row 10 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, + { 3, 1}, { 1, 3}, /* Row 11 */ + { 1, 3}, { 6, 1}, { 1, 2}, { 1, 5}, { 1, 0}, { 1, 3}, + { 1, 4}, { 4, 2}, { 1, 7}, { 1, 0}, { 1, 7}, { 1, 2}, + { 3, 1}, { 1, 5}, /* Row 12 */ + { 1, 3}, { 1, 6}, { 4, 1}, { 2, 2}, { 1, 5}, { 1, 0}, + { 1, 3}, { 1, 4}, { 2, 2}, { 1, 5}, { 1, 7}, { 1, 6}, + { 1, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 6}, { 1, 3}, /* Row 13 */ + { 1, 3}, { 5, 1}, { 1, 2}, { 2, 3}, { 1, 0}, { 1, 3}, + { 1, 4}, { 1, 2}, { 1, 7}, { 1, 6}, { 3, 0}, { 1, 7}, + { 1, 2}, { 2, 1}, { 1, 2}, { 1, 3}, /* Row 14 */ + { 1, 5}, { 1, 4}, { 3, 1}, { 1, 2}, { 1, 3}, { 1, 2}, + { 1, 6}, { 1, 0}, { 1, 3}, { 1, 2}, { 1, 5}, { 1, 6}, + { 4, 0}, { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 5}, /* Row 15 */ + { 1, 8}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 3}, { 4, 0}, + { 1, 3}, { 1, 2}, { 1, 3}, { 1, 6}, { 3, 0}, { 1, 6}, + { 1, 7}, { 1, 2}, { 2, 1}, { 1, 4}, { 1, 8}, /* Row 16 */ + { 1, 8}, { 1, 5}, { 1, 2}, { 1, 1}, { 1, 5}, { 1, 6}, + { 4, 0}, { 1, 3}, { 2, 2}, { 1, 3}, { 1, 6}, { 1, 0}, + { 1, 6}, { 1, 7}, { 1, 4}, { 2, 1}, { 1, 2}, { 1, 5}, + { 1, 8}, /* Row 17 */ + { 2, 8}, { 1, 5}, { 1, 1}, { 1, 5}, { 1, 1}, { 4, 0}, + { 1, 3}, { 1, 2}, { 1, 1}, { 1, 4}, { 1, 3}, { 1, 7}, + { 1, 3}, { 1, 2}, { 3, 1}, { 1, 5}, { 2, 8}, /* Row 18 */ + { 2, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 6}, + { 1, 0}, { 1, 6}, { 1, 3}, { 1, 2}, { 9, 1}, { 1, 4}, + { 1, 5}, { 2, 8}, /* Row 19 */ + { 3, 8}, { 1, 5}, { 1, 4}, { 1, 1}, { 1, 3}, { 1, 5}, + { 1, 3}, {10, 1}, { 1, 4}, { 1, 5}, { 3, 8}, /* Row 20 */ + { 4, 8}, { 2, 4}, {12, 1}, { 2, 4}, { 4, 8}, /* Row 21 */ + { 6, 8}, { 2, 4}, { 8, 1}, { 2, 4}, { 6, 8}, /* Row 22 */ + { 8, 8}, { 8, 4}, { 8, 8}, /* Row 23 */ }; +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + const struct NXWidgets::SRlePaletteBitmap NxWM::g_mediaplayerBitmap = { CONFIG_NXWIDGETS_BPP, From ac6071e1cfec402843df43adfdb0ae1ed04fc506 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 09:20:23 -0600 Subject: [PATCH 193/390] NxWM: Add larger media player icon --- nxwm/src/glyph_mediaplayer44x50.cxx | 302 ++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 nxwm/src/glyph_mediaplayer44x50.cxx diff --git a/nxwm/src/glyph_mediaplayer44x50.cxx b/nxwm/src/glyph_mediaplayer44x50.cxx new file mode 100644 index 000000000..c3a9412a5 --- /dev/null +++ b/nxwm/src/glyph_mediaplayer44x50.cxx @@ -0,0 +1,302 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_mediaplayer44x50.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 50 +#define BITMAP_NCOLUMNS 44 +#define BITMAP_NLUTCODES 5 + +#define DARK_MEDIAPLAYER_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef DARK_MEDIAPLAYER_ICON + +static const uint32_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x002199, 0xbdbdbd, 0x4e8199, 0x276099 /* Codes 1-4 */ +}; + +static const uint32_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x002ccc, 0xfcfcfc, 0x68accc, 0x3480cc /* Codes 1-4 */ +}; + +# else /* DARK_MEDIAPLAYER_ICON */ + +static const uint32_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x002ccc, 0xfcfcfc, 0x68accc, 0x3480cc /* Codes 1-4 */ +}; + +static const uint32_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0037ff, 0xffffff, 0x82d7ff, 0x41a0ff /* Codes 1-4 */ +}; +# endif /* DARK_MEDIAPLAYER_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef DARK_MEDIAPLAYER_ICON + +static const uint16_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0113, 0xbdf7, 0x4c13, 0x2313 /* Codes 1-4 */ +}; + +static const uint16_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0179, 0xffff, 0x6d79, 0x3419 /* Codes 1-4 */ +}; + +# else /* DARK_MEDIAPLAYER_ICON */ + +static const uint16_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x0179, 0xffff, 0x6d79, 0x3419 /* Codes 1-4 */ +}; + +static const uint16_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x01bf, 0xffff, 0x86bf, 0x451f /* Codes 1-4 */ +}; + +# endif /* DARK_MEDIAPLAYER_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef DARK_MEDIAPLAYER_ICON + +static const uint8_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x24, 0xbd, 0x74, 0x55 /* Codes 1-4 */ +}; + +static const uint8_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x31, 0xfc, 0x9b, 0x71 /* Codes 1-4 */ +}; + +# else /* DARK_MEDIAPLAYER_ICON */ + +static const uint8_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x31, 0xfc, 0x9b, 0x71 /* Codes 1-4 */ +}; + +static const uint8_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3d, 0xff, 0xc2, 0x8e /* Codes 1-4 */ +}; + +# endif /* DARK_MEDIAPLAYER_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef DARK_MEDIAPLAYER_ICON + +static const nxgl_mxpixel_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x06, 0xb6, 0x52, 0x2e, /* Codes 1-4 */ +}; + +static const nxgl_mxpixel_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07, 0xff, 0x77, 0x33, /* Codes 1-4 */ +}; + +# else /* DARK_MEDIAPLAYER_ICON */ + +static const nxgl_mxpixel_t g_mediaplayerNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07, 0xff, 0x77, 0x33, /* Codes 1-4 */ +}; + +static const nxgl_mxpixel_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x07, 0xff, 0x9b, 0x57, /* Codes 1-4 */ +}; + +# endif /* DARK_MEDIAPLAYER_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_mediaplayerRleEntries[] = +{ + {41, 0}, { 3, 1}, /* Row 0 */ + {38, 0}, { 6, 1}, /* Row 1 */ + {38, 0}, { 6, 1}, /* Row 2 */ + {34, 0}, {10, 1}, /* Row 3 */ + {30, 0}, {14, 1}, /* Row 4 */ + {26, 0}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 5 */ + {22, 0}, {13, 1}, { 6, 2}, { 3, 1}, /* Row 6 */ + {22, 0}, {13, 1}, { 6, 2}, { 3, 1}, /* Row 7 */ + {18, 0}, {13, 1}, {10, 2}, { 3, 1}, /* Row 8 */ + {14, 0}, {13, 1}, {14, 2}, { 3, 1}, /* Row 9 */ + {14, 0}, { 9, 1}, {18, 2}, { 3, 1}, /* Row 10 */ + {14, 0}, { 9, 1}, {18, 2}, { 3, 1}, /* Row 11 */ + {14, 0}, { 5, 1}, {19, 2}, { 1, 1}, { 2, 2}, { 3, 1}, /* Row 12 */ + {14, 0}, { 3, 1}, {17, 2}, { 5, 1}, { 2, 2}, { 3, 1}, /* Row 13 */ + {14, 0}, { 3, 1}, {13, 2}, { 9, 1}, { 2, 2}, { 3, 1}, /* Row 14 */ + {14, 0}, { 3, 1}, { 9, 2}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 15 */ + {14, 0}, { 3, 1}, { 9, 2}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 16 */ + {14, 0}, { 3, 1}, { 5, 2}, {10, 1}, { 4, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 17 */ + {14, 0}, { 3, 1}, { 2, 2}, { 9, 1}, { 8, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 18 */ + {14, 0}, { 3, 1}, { 2, 2}, { 6, 1}, {11, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 19 */ + {14, 0}, { 3, 1}, { 2, 2}, { 6, 1}, {11, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 20 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 21 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 22 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 23 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 24 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 25 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 26 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, /* Row 27 */ + { 1, 0}, { 3, 1}, { 2, 2}, { 3, 1}, + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 6, 0}, { 2, 3}, { 9, 1}, { 2, 2}, /* Row 28 */ + { 3, 1}, + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, /* Row 29 */ + { 3, 1}, + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 7, 1}, { 1, 4}, { 4, 1}, /* Row 30 */ + { 2, 2}, { 3, 1}, + { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, { 1, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 31 */ + { 4, 0}, { 3, 1}, { 1, 4}, { 1, 1}, { 5, 2}, { 2, 4}, { 1, 1}, { 2, 2}, + { 3, 1}, + { 6, 0}, { 2, 4}, { 9, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 1, 4}, { 2, 1}, /* Row 32 */ + { 2, 4}, {11, 2}, { 3, 1}, + { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 33 */ + { 3, 1}, + { 5, 0}, {12, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 34 */ + { 4, 0}, { 3, 1}, { 1, 4}, { 1, 1}, { 5, 2}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 35 */ + { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, + { 3, 0}, { 1, 4}, { 2, 1}, { 2, 3}, {11, 2}, { 3, 1}, { 2, 0}, { 1, 4}, /* Row 36 */ + { 2, 1}, {14, 2}, { 3, 1}, + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 37 */ + { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 38 */ + { 3, 1}, + { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {12, 2}, /* Row 39 */ + { 1, 4}, { 3, 1}, + { 2, 0}, { 1, 4}, { 2, 1}, {14, 2}, { 3, 1}, { 4, 0}, { 4, 1}, {10, 2}, /* Row 40 */ + { 3, 1}, { 1, 3}, + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, /* Row 41 */ + { 5, 2}, { 1, 4}, { 4, 1}, { 1, 0}, + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 5, 0}, { 1, 3}, {14, 1}, { 2, 0}, /* Row 42 */ + { 3, 0}, { 3, 1}, {12, 2}, { 1, 4}, { 2, 1}, { 1, 3}, { 5, 0}, { 1, 3}, /* Row 43 */ + {12, 1}, { 1, 4}, { 3, 0}, + { 4, 0}, { 4, 1}, {10, 2}, { 3, 1}, { 1, 4}, { 9, 0}, { 1, 4}, { 7, 1}, /* Row 44 */ + { 1, 3}, { 4, 0}, + { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, { 5, 2}, { 1, 4}, { 4, 1}, {23, 0}, /* Row 45 */ + { 5, 0}, { 1, 3}, {13, 1}, {25, 0}, /* Row 46 */ + { 7, 0}, {11, 1}, {26, 0}, /* Row 47 */ + { 9, 0}, { 1, 3}, { 4, 1}, { 2, 4}, {28, 0}, /* Row 48 */ + {44, 0} /* Row 49 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mediaplayerBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_mediaplayerNormalLut, // Index 0: Unselected LUT + g_mediaplayerBrightLut, // Index 1: Selected LUT + }, + g_mediaplayerRleEntries // data - Pointer to the beginning of the RLE data +}; From f57ae7d18d69ca9a78c133284f86ad7b611dd25d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 09:24:29 -0600 Subject: [PATCH 194/390] Update ChangeLogs --- ChangeLog.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2e7f9124b..2738eafc9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -440,5 +440,8 @@ * nxwm/src/glyph_calibration48x42.cxx: Add a larger NxWM Calibration icon (2014-7-13). * nxwm/src/glyph_minimize42x42.cxx: Add a larger NxWM minimize icon - (2014-8-13). + (2014-7-13). * nxwm/src/glyph_stop42x42.cxx: Add a larger NxWM close icon (2014-8-13). +* nxwm/src/glyph_mediaplayer44x50.cxx: Add a larger NxWM media player icon + (2014-7-14). + From df63f41fbf6c8b3aa5d22745e3398806e95c1284 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 11:21:02 -0600 Subject: [PATCH 195/390] NxWM: Toolbar font ID can now be separately configured --- Kconfig | 21 +++++++++++++++++++-- nxwm/include/nxwmconfig.hxx | 6 ++++++ nxwm/src/capplicationwindow.cxx | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index 8495d0908..2f91b0308 100644 --- a/Kconfig +++ b/Kconfig @@ -562,6 +562,23 @@ config NXWM_TOOLBAR_HEIGHT icons are selected endif # NXWM_CUSTOM_TOOLBAR_HEIGHT + +config NXWM_TOOLBAR_CUSTOM_FONTID + bool "Use Custom Toolbar Font" + default n + ---help--- + Set to override the NxWM default font id (NXWM_DEFAULT_FONTID). + +if NXWM_TOOLBAR_CUSTOM_FONTID + +config NXWM_TOOLBAR_FONTID + int "Toolbar Font ID" + default 0 + ---help--- + Use this default font ID in the NxConsole window instead of the + NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 (maybe invalid) + +endif # NXWM_TOOLBAR_CUSTOM_FONTID endmenu # NxWM Toolbar Configuration menu "NxWM Application Window Configuration" @@ -713,7 +730,7 @@ config NXWM_NXCONSOLE_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- - Set to override the system default font id (NXWM_DEFAULT_FONTID). + Set to override the NxWM default font id (NXWM_DEFAULT_FONTID). if NXWM_NXCONSOLE_CUSTOM_FONTID @@ -1074,7 +1091,7 @@ config NXWM_HEXCALCULATOR_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- - Set to override the system default font id (NXWM_DEFAULT_FONTID). + Set to override the NxWM default font id (NXWM_DEFAULT_FONTID). if NXWM_HEXCALCULATOR_CUSTOM_FONTID diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 453ab0421..d6202c066 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -276,6 +276,12 @@ (CONFIG_NXWM_TASKBAR_ICONHEIGHT + 2*CONFIG_NXWM_TASKBAR_HSPACING) #endif +/* CONFIG_NXWM_TOOLBAR_FONTID overrides the default NxWM font selection */ + +#ifndef CONFIG_NXWM_TOOLBAR_FONTID +# define CONFIG_NXWM_TOOLBAR_FONTID CONFIG_NXWM_DEFAULT_FONTID +#endif + /* Background Image **********************************************************/ /** * CONFIG_NXWM_BACKGROUND_IMAGE - The name of the image to use in the diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 77d196d07..0c1bb1a96 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -307,7 +307,7 @@ bool CApplicationWindow::open(void) // The rest of the toolbar will hold the left-justified application label // Create the default font instance - m_windowFont = new NXWidgets::CNxFont(CONFIG_NXWM_DEFAULT_FONTID, + m_windowFont = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_TOOLBAR_FONTID, CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_windowFont) From e82bd683857e4b098afd3cb88bff6eec80b506bd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 11:22:47 -0600 Subject: [PATCH 196/390] Update ChangeLog --- ChangeLog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2738eafc9..7ed8e7cbc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -444,4 +444,5 @@ * nxwm/src/glyph_stop42x42.cxx: Add a larger NxWM close icon (2014-8-13). * nxwm/src/glyph_mediaplayer44x50.cxx: Add a larger NxWM media player icon (2014-7-14). - +* Kconfig, nxwm/include/nxwmconfig.hxx, nxwm/src/capplicationwindow.cxx: + Toolbar font ID can now be separately configured (2014-7-14). From 727387e50b5c3b2c80bb5a5bf8b7676d1166871b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 12:29:41 -0600 Subject: [PATCH 197/390] NxWM: Add media player PNG files --- nxwm/images/mediaforward32x32.png | Bin 0 -> 6997 bytes nxwm/images/mediagrip22x22.png | Bin 0 -> 2897 bytes nxwm/images/mediapause32x32.png | Bin 0 -> 6836 bytes nxwm/images/mediaplay32x32.png | Bin 0 -> 6919 bytes nxwm/images/mediarewind32x32.png | Bin 0 -> 7012 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 nxwm/images/mediaforward32x32.png create mode 100644 nxwm/images/mediagrip22x22.png create mode 100644 nxwm/images/mediapause32x32.png create mode 100644 nxwm/images/mediaplay32x32.png create mode 100644 nxwm/images/mediarewind32x32.png diff --git a/nxwm/images/mediaforward32x32.png b/nxwm/images/mediaforward32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..445cd6391acdbb13e0c62b04a2fa6cfe360f7007 GIT binary patch literal 6997 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 literal 0 HcmV?d00001 diff --git a/nxwm/images/mediagrip22x22.png b/nxwm/images/mediagrip22x22.png new file mode 100644 index 0000000000000000000000000000000000000000..abcde61dd23564a1497056a15b1d7603b44ca0a5 GIT binary patch literal 2897 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

gm0yH-?>?{CC@5u1t?k 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 N002ovPDHLkV1ge+$e{oL literal 0 HcmV?d00001 diff --git a/nxwm/images/mediarewind32x32.png b/nxwm/images/mediarewind32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..5297418a7ffad8a93735a6d0cf0330c5a95e52c8 GIT binary patch literal 7012 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 Date: Mon, 14 Jul 2014 12:31:16 -0600 Subject: [PATCH 198/390] NxWM: Media player will dynamically position controls based on window size --- nxwm/include/cmediaplayer.hxx | 6 ++-- nxwm/src/cmediaplayer.cxx | 56 +++++++++++++++++++---------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 11ed3a0c1..eff13067a 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -116,9 +116,9 @@ namespace NxWM * in memory. If you are pinched for memory, get rid of these. */ - struct nxgl_size_s m_windowSize; /**< The size of the calculator window */ - struct nxgl_size_s m_textSize; /**< The size of the calculator textbox */ - struct nxgl_point_s m_textPos; /**< The position of the calculator textbox */ + struct nxgl_size_s m_windowSize; /**< The size of the media player window */ + struct nxgl_size_s m_textSize; /**< The size of the media player textbox */ + struct nxgl_point_s m_textPos; /**< The position of the media player textbox */ /** * Select the geometry of the media player given the current window size. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 795123cc3..a88d0b538 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -244,7 +244,7 @@ void CMediaPlayer::redraw(void) { char buffer[24]; - snprintf(buffer, 24, "Comming soon!"); + snprintf(buffer, 24, "Coming soon!"); // setText will perform the redraw as well @@ -292,7 +292,7 @@ bool CMediaPlayer::isFullScreen(void) const } /** - * Select the geometry of the calculator given the current window size. + * Select the geometry of the media player given the current window size. */ void CMediaPlayer::setGeometry(void) @@ -317,15 +317,13 @@ void CMediaPlayer::setGeometry(void) } /** - * Create the calculator widgets. Only start as part of the applicaiton + * Create the media player widgets. Only start as part of the application * start method. */ bool CMediaPlayer::createPlayer(void) { - int playControlX, playControlY; - - // Select a font for the calculator + // Select a font for the media player m_font = new NXWidgets::CNxFont((nx_fontid_e)CONFIG_NXWM_MEDIAPLAYER_FONTID, CONFIG_NXWM_DEFAULT_FONTCOLOR, @@ -368,47 +366,55 @@ bool CMediaPlayer::createPlayer(void) // Create button for rewind - playControlX = (m_windowSize.w >> 1) - 64; - playControlY = m_windowSize.h - 64; + uint32_t playControlX = (m_windowSize.w >> 1) - 64; + uint32_t playControlY = (180 * m_windowSize.h) >> 8; // Create the Rewind Image NXWidgets::CRlePaletteBitmap *pRewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - m_rew = new NXWidgets::CImage(control, - playControlX, playControlY, - 32, 32, - pRewBitmap, 0); + + m_rew = new NXWidgets:: + CImage(control, playControlX, playControlY, + 32, 32, pRewBitmap, 0); + m_rew->setBorderless(true); // Create the Play Image pRewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); - m_playPause = new NXWidgets::CImage(control, - playControlX + 32 + 16, playControlY, - 32, 32, - pRewBitmap, 0); + + m_playPause = new NXWidgets:: + CImage(control, playControlX + 32 + 16, playControlY, + 32, 32, pRewBitmap, 0); + m_playPause->setBorderless(true); // Create the Forward Image pRewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); - m_fwd = new NXWidgets::CImage(control, - playControlX + 32*3, playControlY, - 32, 32, - pRewBitmap, 0); + + m_fwd = new NXWidgets:: + CImage(control, playControlX + 32*3, playControlY, + 32, 32, pRewBitmap, 0); + m_fwd->setBorderless(true); // Create the Volume control + uint32_t volumeControlX = (9 * m_windowSize.w) >> 8; + uint32_t volumeControlY = (232 * m_windowSize.h) >> 8; + pRewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); - m_volume = new NXWidgets::CGlyphSliderHorizontal(control, - 10, m_windowSize.h - 30, - m_windowSize.w - 20, 26, - pRewBitmap, MKRGB( 63, 90,192)); + + m_volume = new NXWidgets:: + CGlyphSliderHorizontal(control, volumeControlX, volumeControlY, + m_windowSize.w - 2 * volumeControlX, 26, + pRewBitmap, MKRGB( 63, 90,192)); + m_volume->setMinimumValue(0); m_volume->setMaximumValue(100); m_volume->setValue(15); @@ -443,7 +449,7 @@ void CMediaPlayer::close(void) void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - /* Nothing here yet! Comming soon! */ + /* Nothing here yet! Coming soon! */ } /** From 9b32a47e932c22fb347c47bdd22942c2ea80bc43 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 13:00:15 -0600 Subject: [PATCH 199/390] NxWM: Media player will no reposition controls based on selected image sizes --- nxwm/src/cmediaplayer.cxx | 66 ++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index a88d0b538..9c7601058 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -364,56 +364,70 @@ bool CMediaPlayer::createPlayer(void) m_text->setFont(m_font); - // Create button for rewind - - uint32_t playControlX = (m_windowSize.w >> 1) - 64; - uint32_t playControlY = (180 * m_windowSize.h) >> 8; - - // Create the Rewind Image - - NXWidgets::CRlePaletteBitmap *pRewBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - - m_rew = new NXWidgets:: - CImage(control, playControlX, playControlY, - 32, 32, pRewBitmap, 0); - - m_rew->setBorderless(true); - // Create the Play Image - pRewBitmap = new NXWidgets:: + NXWidgets::CRlePaletteBitmap *playBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); + uint32_t playControlX = (m_windowSize.w >> 1) - (playBitmap->getWidth() >> 1); + uint32_t controlY = (180 * m_windowSize.h) >> 8; + m_playPause = new NXWidgets:: - CImage(control, playControlX + 32 + 16, playControlY, - 32, 32, pRewBitmap, 0); + CImage(control, (nxgl_coord_t)playControlX, (nxgl_coord_t)controlY, + playBitmap->getWidth(), playBitmap->getHeight(), + playBitmap); m_playPause->setBorderless(true); + // Create the Rewind Image + + NXWidgets::CRlePaletteBitmap *rewBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + + uint32_t rewControlX = playControlX - rewBitmap->getWidth() - 16; + + m_rew = new NXWidgets:: + CImage(control, (nxgl_coord_t)rewControlX, (nxgl_coord_t)controlY, + rewBitmap->getWidth(), rewBitmap->getHeight(), + rewBitmap); + + m_rew->setBorderless(true); + // Create the Forward Image - pRewBitmap = new NXWidgets:: + NXWidgets::CRlePaletteBitmap *fwdBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + + fwdBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); + uint32_t fwdControlX = playControlX + fwdBitmap->getWidth() + 16; + m_fwd = new NXWidgets:: - CImage(control, playControlX + 32*3, playControlY, - 32, 32, pRewBitmap, 0); + CImage(control, (nxgl_coord_t)fwdControlX, (nxgl_coord_t)controlY, + fwdBitmap->getWidth(), fwdBitmap->getHeight(), + fwdBitmap); m_fwd->setBorderless(true); // Create the Volume control + NXWidgets::CRlePaletteBitmap *volBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + uint32_t volumeControlX = (9 * m_windowSize.w) >> 8; uint32_t volumeControlY = (232 * m_windowSize.h) >> 8; - pRewBitmap = new NXWidgets:: + volBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); m_volume = new NXWidgets:: - CGlyphSliderHorizontal(control, volumeControlX, volumeControlY, - m_windowSize.w - 2 * volumeControlX, 26, - pRewBitmap, MKRGB( 63, 90,192)); + CGlyphSliderHorizontal(control, + (nxgl_coord_t)volumeControlX, + (nxgl_coord_t)volumeControlY, + (nxgl_coord_t)(m_windowSize.w - 2 * volumeControlX), + volBitmap->getHeight() + 4, volBitmap, + MKRGB(63, 90,192)); m_volume->setMinimumValue(0); m_volume->setMaximumValue(100); From 12fadbbe2c38087de28a72924eb80074f1a07040 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 13:00:43 -0600 Subject: [PATCH 200/390] Update ChangeLog --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7ed8e7cbc..e7dede1b6 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -446,3 +446,6 @@ (2014-7-14). * Kconfig, nxwm/include/nxwmconfig.hxx, nxwm/src/capplicationwindow.cxx: Toolbar font ID can now be separately configured (2014-7-14). +* nxwm/src/cmediaplayer.cxx: Will not dynamically position player controls + based on the display and image sizes (2014-7-14). + From f02a289c157954ccfe48ee046db7a27b3d053d88 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 16:56:40 -0600 Subject: [PATCH 201/390] Add larger images for media player. Also options to control spacing and borders on media player windows --- Kconfig | 18 ++ nxwm/Makefile | 3 +- nxwm/images/mediaforward43x41.png | Bin 0 -> 317 bytes nxwm/images/mediagrip30x30.png | Bin 0 -> 252 bytes nxwm/images/mediapause21x41.png | Bin 0 -> 157 bytes nxwm/images/mediaplay21x41.png | Bin 0 -> 289 bytes nxwm/images/mediaplayer44x50.png | Bin 1098 -> 1098 bytes nxwm/images/mediarewind43x41.png | Bin 0 -> 316 bytes nxwm/include/nxwmconfig.hxx | 4 + nxwm/src/cmediaplayer.cxx | 119 +++++--- nxwm/src/glyph_mediagrip30x30.cxx | 266 ++++++++++++++++++ nxwm/src/glyph_mediaplayer44x50.cxx | 90 +++--- nxwm/src/glyph_mplayer_controls43x41.cxx | 342 +++++++++++++++++++++++ 13 files changed, 762 insertions(+), 80 deletions(-) create mode 100755 nxwm/images/mediaforward43x41.png create mode 100755 nxwm/images/mediagrip30x30.png create mode 100755 nxwm/images/mediapause21x41.png create mode 100755 nxwm/images/mediaplay21x41.png create mode 100755 nxwm/images/mediarewind43x41.png create mode 100644 nxwm/src/glyph_mediagrip30x30.cxx create mode 100644 nxwm/src/glyph_mplayer_controls43x41.cxx diff --git a/Kconfig b/Kconfig index 2f91b0308..2bd8ea02d 100644 --- a/Kconfig +++ b/Kconfig @@ -1117,4 +1117,22 @@ config NXWM_MEDIAPLAYER NOTE: This application is currently under development and just a shell of an app which will be developed soon. +if NXWM_MEDIAPLAYER + +config NXWM_MEDIAPLAYER_XSPACING + int "Media Player Button Spacing" + default 12 + ---help--- + This is the space between play, forward, and reverse buttons in + units of pixels. + +config NXWM_MEDIAPLAYER_BORDERS + bool "Media Player Button Borders" + default n + ---help--- + If you have nice graphics, then borderless would probably be the + better choice. If you graphics is really more of a button label, + then have buttons with boarders might make more sense. + +endif # NXWM_MEDIAPLAYER endif # NXWM diff --git a/nxwm/Makefile b/nxwm/Makefile index 624be08c2..ad9b39e24 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -88,7 +88,8 @@ endif ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += cmediaplayer.cxx ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) -CXXSRCS += glyph_mediaplayer44x50.cxx glyph_mplayer_controls32x32.cxx +CXXSRCS += glyph_mediaplayer44x50.cxx glyph_mplayer_controls43x41.cxx +CXXSRCS += glyph_mediagrip30x30.cxx else CXXSRCS += glyph_mediaplayer24x24.cxx glyph_mplayer_controls32x32.cxx endif diff --git a/nxwm/images/mediaforward43x41.png b/nxwm/images/mediaforward43x41.png new file mode 100755 index 0000000000000000000000000000000000000000..3165856dd91f183a89410107416b811c474c1cf4 GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^+CZ$y!2~3gzq`)?QjEnx?oJHr&dIz4aySb-B8wRq z_zr_GH=O_IvDnBJ48X3ikd03Z3_KaSVw#d~}ARP_qHgk&b`=pMSZb z$$a+MH!B+lA%SlPOrP&53ZLX4H&G>^NM4dDl;7BA!H3>s99QI4GcO__Zc;;jmJ8Fqm4ci`sfJ$613RsO3ryV!t2eV#6kAs)w*QxXzB*?!LHC zK(bd=%J#78wyR!~Q@X-G2cNmb)O~Tr%SH|Jq$M*iW~k(B0SX5B9$b}bvbbMn@kJqq siJlo-+?FrC=n{55#q>MgW#0lJLA)78&qol`;+0Qf3cRR910 literal 0 HcmV?d00001 diff --git a/nxwm/images/mediapause21x41.png b/nxwm/images/mediapause21x41.png new file mode 100755 index 0000000000000000000000000000000000000000..35e815930cb77fc0583647106a8ab33e0be2b12d GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^qCl+4!2~2j&wdpLQjEnx?oJHr&dIz4aySb-B8wRq z_zr_GH=O_IvDnB7CB8dHX;n=zF?2hIkx*ds>l?fq~<&!?FMWZFHDK yx|WoBmu->_p7iTZp5*oq6*hAH#~**(U&A@q literal 0 HcmV?d00001 diff --git a/nxwm/images/mediaplay21x41.png b/nxwm/images/mediaplay21x41.png new file mode 100755 index 0000000000000000000000000000000000000000..aa96551ecf946090ac7bd3e9ac81f4d6f70a6a21 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^qCl+4!2~2j&wdpLQjEnx?oJHr&dIz4aySb-B8wRq z_zr_GH=O_IvDnBK(qmhY!~Sg*JP-IEHu}Uwh4yk6Dq&B{2B=e&a|5 zL8fDR;)$1;tM*@Ae5>mHH-m&Uea@cNIR|1c3q_c>uxxvq#q@k#5YxLjyT;orGaU?$ zs|ffn=Un36A)Mf6I__u=pU za%)ZZB>ers++CM+bp4Ju<}shu^(w?S|7+8fe{kox#YfFPo96ZNj_iBB@v(Qs_s~C& jS^s>Ms{8d>>M^tRQzuuJ$hlvE&S&s+^>bP0l+XkKm7a5x literal 0 HcmV?d00001 diff --git a/nxwm/images/mediaplayer44x50.png b/nxwm/images/mediaplayer44x50.png index c70a2ed7b31a88d5a4ae13fd87f0d2562c9dfff2..9eaa4e2698d20672ee3c590e536ed9fe5de68fcd 100755 GIT binary patch delta 247 zcmVumT9Mth*%bmQ?%f9CW`5!$*rO>m;RtL${N7}ryI xSh)Stg1{a)Ih|LGUZf^Uk&C~s4s81)@c{hy_5@o zUVg!k@ED#Mb}3t9(%peG-9N+zSPq-5vvIbO3DVhqI}q%qtFCWm5EwAvHat22`(fF1 zH=O_IvDnA{@dG!}lx$3Z3(GaSVw#d~}*4U$X-b^WJ~|=U?_- z+SMiYUd^xKz!`>a)(Jb5n09I_S*&J15cxOJapAuu3&Qrt2CTcUUGT!3%cpAVf#uV= z*8FU+d7HW zlj(DZN~7xciHaLuCCUj${BS$ZvBoxxon_kmx3NsJ@;Ag9m#vRczhG{v)Oc-gFvl0) zUXKO&SuRYq!OB7}W=lsetFont(m_font); - // Create the Play Image + // Create all bitmaps NXWidgets::CRlePaletteBitmap *playBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); - uint32_t playControlX = (m_windowSize.w >> 1) - (playBitmap->getWidth() >> 1); - uint32_t controlY = (180 * m_windowSize.h) >> 8; - - m_playPause = new NXWidgets:: - CImage(control, (nxgl_coord_t)playControlX, (nxgl_coord_t)controlY, - playBitmap->getWidth(), playBitmap->getHeight(), - playBitmap); - - m_playPause->setBorderless(true); - - // Create the Rewind Image - NXWidgets::CRlePaletteBitmap *rewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - uint32_t rewControlX = playControlX - rewBitmap->getWidth() - 16; + NXWidgets::CRlePaletteBitmap *fwdBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); + + // Button widths will depend on if the buttons will be bordered or not + + nxgl_coord_t playButtonW; + nxgl_coord_t rewButtonW; + nxgl_coord_t fwdButtonW; + +#ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS + // With the widest button + + nxgl_coord_t buttonW = playBitmap->getWidth(); + + if (buttonW < rewBitmap->getWidth()) + { + buttonW = rewBitmap->getWidth(); + } + + if (buttonW < fwdBitmap->getWidth()) + { + buttonW = fwdBitmap->getWidth(); + } + + // Add little space around the bitmap and use this width for all buttons + + buttonW += 8; + playButtonW = buttonW; + rewButtonW = buttonW; + fwdButtonW = buttonW; + +#else + // Use the bitmap image widths for the button widths (plus a bit) + + playButtonW = playBitmap->getWidth() + 8; + rewButtonW = rewBitmap->getWidth() + 8; + fwdButtonW = fwdBitmap->getWidth() + 8; +#endif + + // Use the same height for all buttons + + nxgl_coord_t buttonH = playBitmap->getHeight(); + + if (buttonH < rewBitmap->getHeight()) + { + buttonH = rewBitmap->getHeight(); + } + + if (buttonH < fwdBitmap->getHeight()) + { + buttonH = fwdBitmap->getHeight(); + } + + buttonH += 8; + + // Create the Play Image + + nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playButtonW >> 1); + uint32_t controlY = (180 * m_windowSize.h) >> 8; + + m_playPause = new NXWidgets:: + CImage(control, playControlX, (nxgl_coord_t)controlY, + playButtonW, buttonH, playBitmap); + + // Create the Rewind Image + + nxgl_coord_t rewControlX = playControlX - rewButtonW - + CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_rew = new NXWidgets:: - CImage(control, (nxgl_coord_t)rewControlX, (nxgl_coord_t)controlY, - rewBitmap->getWidth(), rewBitmap->getHeight(), - rewBitmap); - - m_rew->setBorderless(true); + CImage(control, rewControlX, (nxgl_coord_t)controlY, + rewButtonW, buttonH, rewBitmap); // Create the Forward Image - NXWidgets::CRlePaletteBitmap *fwdBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - - fwdBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); - - uint32_t fwdControlX = playControlX + fwdBitmap->getWidth() + 16; + nxgl_coord_t fwdControlX = playControlX + playButtonW + + CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_fwd = new NXWidgets:: - CImage(control, (nxgl_coord_t)fwdControlX, (nxgl_coord_t)controlY, - fwdBitmap->getWidth(), fwdBitmap->getHeight(), - fwdBitmap); + CImage(control, fwdControlX, (nxgl_coord_t)controlY, + fwdButtonW, buttonH, fwdBitmap); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS + // Make the images boarder-less if that is how we are configured + + m_playPause->setBorderless(true); + m_rew->setBorderless(true); m_fwd->setBorderless(true); +#else + m_playPause->setBorderless(false); + m_rew->setBorderless(false); + m_fwd->setBorderless(false); +#endif // Create the Volume control NXWidgets::CRlePaletteBitmap *volBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); uint32_t volumeControlX = (9 * m_windowSize.w) >> 8; uint32_t volumeControlY = (232 * m_windowSize.h) >> 8; - volBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); - m_volume = new NXWidgets:: CGlyphSliderHorizontal(control, (nxgl_coord_t)volumeControlX, diff --git a/nxwm/src/glyph_mediagrip30x30.cxx b/nxwm/src/glyph_mediagrip30x30.cxx new file mode 100644 index 000000000..ecbf5e4f9 --- /dev/null +++ b/nxwm/src/glyph_mediagrip30x30.cxx @@ -0,0 +1,266 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/mediagrip30x30.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define BITMAP_NROWS 30 +#define BITMAP_NCOLUMNS 30 +#define BITMAP_NLUTCODES 4 + +#define MEDIA_GRIP_DARK_ICON 1 + +/******************************************************************************************** + * Private Bitmap Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB24 (8-8-8) Colors */ + +#if CONFIG_NXWIDGETS_BPP == 24 || CONFIG_NXWIDGETS_BPP == 32 +# ifdef MEDIA_GRIP_DARK_ICON + +static const uint32_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3663ab, 0x002199, 0xbdbdbd /* Codes 0-3 */ +}; + +static const uint32_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x4884e4, 0x002ccc, 0xfcfcfc /* Codes 0-3 */ +}; + +# else /* MEDIA_GRIP_DARK_ICON */ + +static const uint32_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x4884e4, 0x002ccc, 0xfcfcfc /* Codes 0-3 */ +}; + +static const uint32_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x5aa5ff, 0x0037ff, 0xffffff /* Codes 0-3 */ +}; +# endif /* MEDIA_GRIP_DARK_ICON */ + +/* RGB16 (565) Colors */ + +#elif CONFIG_NXWIDGETS_BPP == 16 +# ifdef MEDIA_GRIP_DARK_ICON + +static const uint16_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x3315, 0x0113, 0xbdf7 /* Codes 0-3 */ +}; + +static const uint16_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x4c3c, 0x0179, 0xffff /* Codes 0-3 */ +}; + +# else /* MEDIA_GRIP_DARK_ICON */ + +static const uint16_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x4c3c, 0x0179, 0xffff /* Codes 0-3 */ +}; + +static const uint16_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x5d3f, 0x01bf, 0xffff /* Codes 0-3 */ +}; + +# endif /* MEDIA_GRIP_DARK_ICON */ + +/* 8-bit color lookups. NOTE: This is really dumb! The lookup index is 8-bits and it used + * to lookup an 8-bit value. There is no savings in that! It would be better to just put + * the 8-bit color/greyscale value in the run-length encoded image and save the cost of these + * pointless lookups. But these pointless lookups do make the logic compatible with the + * 16- and 24-bit types. + */ + +#elif CONFIG_NXWIDGETS_BPP == 8 +# ifdef CONFIG_NXWIDGETS_GREYSCALE + +/* 8-bit Greyscale */ + +# ifdef MEDIA_GRIP_DARK_ICON + +static const uint8_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x5d, 0x24, 0xbd /* Codes 0-3 */ +}; + +static const uint8_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x7d, 0x31, 0xfc /* Codes 0-3 */ +}; + +# else /* MEDIA_GRIP_DARK_ICON */ + +static const uint8_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x7d, 0x31, 0xfc /* Codes 0-3 */ +}; + +static const uint8_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x98, 0x3d, 0xff /* Codes 0-3 */ +}; + +# endif /* MEDIA_GRIP_DARK_ICON */ + +# else /* CONFIG_NXWIDGETS_GREYSCALE */ + +/* RGB8 (332) Colors */ + +# ifdef MEDIA_GRIP_DARK_ICON + +static const nxgl_mxpixel_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x2e, 0x06, 0xb6 /* Codes 0-3 */ +}; + +static const nxgl_mxpixel_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x53, 0x07, 0xff /* Codes 0-3 */ +}; + +# else /* MEDIA_GRIP_DARK_ICON */ + +static const nxgl_mxpixel_t g_gripNormalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x53, 0x07, 0xff /* Codes 0-3 */ +}; + +static const nxgl_mxpixel_t g_gripBrightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + 0x57, 0x07, 0xff /* Codes 0-3 */ +}; + +# endif /* MEDIA_GRIP_DARK_ICON */ +# endif /* CONFIG_NXWIDGETS_GREYSCALE */ +#else +# error Unsupported pixel format +#endif + +static const struct NXWidgets::SRlePaletteBitmapEntry g_gripRleEntries[] = +{ + { 1, 0}, { 1, 1}, {26, 2}, { 1, 1}, { 1, 0}, /* Row 0 */ + { 1, 1}, {28, 2}, { 1, 1}, /* Row 1 */ + {30, 2}, /* Row 2 */ + {30, 2}, /* Row 3 */ + {30, 2}, /* Row 4 */ + {30, 2}, /* Row 5 */ + {12, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 6 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 7 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 8 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 9 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 10 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 11 */ + { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, { 6, 2}, /* Row 12 */ + { 6, 2}, {18, 3}, { 6, 2}, /* Row 13 */ + { 6, 2}, {18, 3}, { 6, 2}, /* Row 14 */ + { 6, 2}, {18, 3}, { 6, 2}, /* Row 15 */ + { 6, 2}, {18, 3}, { 6, 2}, /* Row 16 */ + { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, { 6, 2}, /* Row 17 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 18 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 19 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 20 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 21 */ + {12, 2}, { 6, 3}, {12, 2}, /* Row 22 */ + {12, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 23 */ + {30, 2}, /* Row 24 */ + {30, 2}, /* Row 25 */ + {30, 2}, /* Row 26 */ + {30, 2}, /* Row 27 */ + { 1, 1}, {28, 2}, { 1, 1}, /* Row 28 */ + { 1, 0}, { 1, 1}, {26, 2}, { 1, 1}, { 1, 0} /* Row 29 */ +}; + +/******************************************************************************************** + * Public Bitmap Structure Definitions + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerVolBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + BITMAP_NCOLUMNS, // width - Width in pixels + BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_gripNormalLut, // Index 0: Unselected LUT + g_gripBrightLut, // Index 1: Selected LUT + }, + g_gripRleEntries // data - Pointer to the beginning of the RLE data +}; diff --git a/nxwm/src/glyph_mediaplayer44x50.cxx b/nxwm/src/glyph_mediaplayer44x50.cxx index c3a9412a5..0d82e6673 100644 --- a/nxwm/src/glyph_mediaplayer44x50.cxx +++ b/nxwm/src/glyph_mediaplayer44x50.cxx @@ -56,7 +56,7 @@ * Pre-Processor Definitions ********************************************************************************************/ -#define BITMAP_NROWS 50 +#define BITMAP_NROWS 48 #define BITMAP_NCOLUMNS 44 #define BITMAP_NLUTCODES 5 @@ -215,72 +215,70 @@ static const nxgl_mxpixel_t g_mediaplayerBrightLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_mediaplayerRleEntries[] = { - {41, 0}, { 3, 1}, /* Row 0 */ + {38, 0}, { 6, 1}, /* Row 0 */ {38, 0}, { 6, 1}, /* Row 1 */ - {38, 0}, { 6, 1}, /* Row 2 */ - {34, 0}, {10, 1}, /* Row 3 */ - {30, 0}, {14, 1}, /* Row 4 */ - {26, 0}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 5 */ - {22, 0}, {13, 1}, { 6, 2}, { 3, 1}, /* Row 6 */ - {22, 0}, {13, 1}, { 6, 2}, { 3, 1}, /* Row 7 */ - {18, 0}, {13, 1}, {10, 2}, { 3, 1}, /* Row 8 */ - {14, 0}, {13, 1}, {14, 2}, { 3, 1}, /* Row 9 */ - {14, 0}, { 9, 1}, {18, 2}, { 3, 1}, /* Row 10 */ - {14, 0}, { 9, 1}, {18, 2}, { 3, 1}, /* Row 11 */ - {14, 0}, { 5, 1}, {19, 2}, { 1, 1}, { 2, 2}, { 3, 1}, /* Row 12 */ - {14, 0}, { 3, 1}, {17, 2}, { 5, 1}, { 2, 2}, { 3, 1}, /* Row 13 */ - {14, 0}, { 3, 1}, {13, 2}, { 9, 1}, { 2, 2}, { 3, 1}, /* Row 14 */ - {14, 0}, { 3, 1}, { 9, 2}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 15 */ - {14, 0}, { 3, 1}, { 9, 2}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 16 */ - {14, 0}, { 3, 1}, { 5, 2}, {10, 1}, { 4, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 17 */ - {14, 0}, { 3, 1}, { 2, 2}, { 9, 1}, { 8, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 18 */ - {14, 0}, { 3, 1}, { 2, 2}, { 6, 1}, {11, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 19 */ - {14, 0}, { 3, 1}, { 2, 2}, { 6, 1}, {11, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 20 */ + {34, 0}, {10, 1}, /* Row 2 */ + {30, 0}, {14, 1}, /* Row 3 */ + {26, 0}, {18, 1}, /* Row 4 */ + {22, 0}, {17, 1}, { 2, 2}, { 3, 1}, /* Row 5 */ + {18, 0}, {17, 1}, { 6, 2}, { 3, 1}, /* Row 6 */ + {14, 0}, {17, 1}, {10, 2}, { 3, 1}, /* Row 7 */ + {14, 0}, {13, 1}, {14, 2}, { 3, 1}, /* Row 8 */ + {14, 0}, { 9, 1}, {18, 2}, { 3, 1}, /* Row 9 */ + {14, 0}, { 5, 1}, {22, 2}, { 3, 1}, /* Row 10 */ + {14, 0}, { 3, 1}, {21, 2}, { 1, 1}, { 2, 2}, { 3, 1}, /* Row 11 */ + {14, 0}, { 3, 1}, {17, 2}, { 5, 1}, { 2, 2}, { 3, 1}, /* Row 12 */ + {14, 0}, { 3, 1}, {13, 2}, { 9, 1}, { 2, 2}, { 3, 1}, /* Row 13 */ + {14, 0}, { 3, 1}, { 9, 2}, {13, 1}, { 2, 2}, { 3, 1}, /* Row 14 */ + {14, 0}, { 3, 1}, { 5, 2}, {12, 1}, { 2, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 15 */ + {14, 0}, { 3, 1}, { 2, 2}, {11, 1}, { 6, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 16 */ + {14, 0}, { 3, 1}, { 2, 2}, { 7, 1}, {10, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 17 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 18 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 19 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 20 */ {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 21 */ {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 22 */ {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 23 */ {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 24 */ - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 25 */ - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 26 */ - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, /* Row 27 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, /* Row 25 */ { 1, 0}, { 3, 1}, { 2, 2}, { 3, 1}, - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 6, 0}, { 2, 3}, { 9, 1}, { 2, 2}, /* Row 28 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 6, 0}, { 2, 3}, { 9, 1}, { 2, 2}, /* Row 26 */ { 3, 1}, - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, /* Row 29 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, /* Row 27 */ { 3, 1}, - {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 7, 1}, { 1, 4}, { 4, 1}, /* Row 30 */ + {14, 0}, { 3, 1}, { 2, 2}, { 3, 1}, { 5, 0}, { 7, 1}, { 1, 4}, { 4, 1}, /* Row 28 */ { 2, 2}, { 3, 1}, - { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, { 1, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 31 */ + { 9, 0}, { 1, 3}, { 2, 4}, { 1, 3}, { 1, 0}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 29 */ { 4, 0}, { 3, 1}, { 1, 4}, { 1, 1}, { 5, 2}, { 2, 4}, { 1, 1}, { 2, 2}, { 3, 1}, - { 6, 0}, { 2, 4}, { 9, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 1, 4}, { 2, 1}, /* Row 32 */ + { 6, 0}, { 2, 4}, { 9, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 1, 4}, { 2, 1}, /* Row 30 */ { 2, 4}, {11, 2}, { 3, 1}, - { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 33 */ + { 5, 0}, { 1, 4}, {11, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 31 */ { 3, 1}, - { 5, 0}, {12, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 34 */ - { 4, 0}, { 3, 1}, { 1, 4}, { 1, 1}, { 5, 2}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 35 */ + { 5, 0}, {12, 1}, { 2, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 32 */ + { 4, 0}, { 3, 1}, { 1, 4}, { 1, 1}, { 5, 2}, { 3, 1}, { 2, 2}, { 3, 1}, /* Row 33 */ { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, - { 3, 0}, { 1, 4}, { 2, 1}, { 2, 3}, {11, 2}, { 3, 1}, { 2, 0}, { 1, 4}, /* Row 36 */ + { 3, 0}, { 1, 4}, { 2, 1}, { 2, 3}, {11, 2}, { 3, 1}, { 2, 0}, { 1, 4}, /* Row 34 */ { 2, 1}, {14, 2}, { 3, 1}, - { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 37 */ - { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 38 */ + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, /* Row 35 */ + { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {13, 2}, /* Row 36 */ { 3, 1}, - { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {12, 2}, /* Row 39 */ + { 2, 0}, { 1, 3}, { 2, 1}, {14, 2}, { 3, 1}, { 3, 0}, { 3, 1}, {12, 2}, /* Row 37 */ { 1, 4}, { 3, 1}, - { 2, 0}, { 1, 4}, { 2, 1}, {14, 2}, { 3, 1}, { 4, 0}, { 4, 1}, {10, 2}, /* Row 40 */ + { 2, 0}, { 1, 4}, { 2, 1}, {14, 2}, { 3, 1}, { 4, 0}, { 4, 1}, {10, 2}, /* Row 38 */ { 3, 1}, { 1, 3}, - { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, /* Row 41 */ + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, /* Row 39 */ { 5, 2}, { 1, 4}, { 4, 1}, { 1, 0}, - { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 5, 0}, { 1, 3}, {14, 1}, { 2, 0}, /* Row 42 */ - { 3, 0}, { 3, 1}, {12, 2}, { 1, 4}, { 2, 1}, { 1, 3}, { 5, 0}, { 1, 3}, /* Row 43 */ + { 3, 0}, { 3, 1}, {13, 2}, { 3, 1}, { 5, 0}, { 1, 3}, {14, 1}, { 2, 0}, /* Row 40 */ + { 3, 0}, { 3, 1}, {12, 2}, { 1, 4}, { 2, 1}, { 1, 3}, { 5, 0}, { 1, 3}, /* Row 41 */ {12, 1}, { 1, 4}, { 3, 0}, - { 4, 0}, { 4, 1}, {10, 2}, { 3, 1}, { 1, 4}, { 9, 0}, { 1, 4}, { 7, 1}, /* Row 44 */ + { 4, 0}, { 4, 1}, {10, 2}, { 3, 1}, { 1, 4}, { 9, 0}, { 1, 4}, { 7, 1}, /* Row 42 */ { 1, 3}, { 4, 0}, - { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, { 5, 2}, { 1, 4}, { 4, 1}, {23, 0}, /* Row 45 */ - { 5, 0}, { 1, 3}, {13, 1}, {25, 0}, /* Row 46 */ - { 7, 0}, {11, 1}, {26, 0}, /* Row 47 */ - { 9, 0}, { 1, 3}, { 4, 1}, { 2, 4}, {28, 0}, /* Row 48 */ - {44, 0} /* Row 49 */ + { 4, 0}, { 1, 3}, { 5, 1}, { 1, 4}, { 5, 2}, { 1, 4}, { 4, 1}, {23, 0}, /* Row 43 */ + { 5, 0}, { 1, 3}, {13, 1}, {25, 0}, /* Row 44 */ + { 7, 0}, {11, 1}, {26, 0}, /* Row 45 */ + { 9, 0}, { 1, 3}, { 4, 1}, { 2, 4}, {28, 0}, /* Row 46 */ + {44, 0} /* Row 47 */ }; /******************************************************************************************** diff --git a/nxwm/src/glyph_mplayer_controls43x41.cxx b/nxwm/src/glyph_mplayer_controls43x41.cxx new file mode 100644 index 000000000..505d612d4 --- /dev/null +++ b/nxwm/src/glyph_mplayer_controls43x41.cxx @@ -0,0 +1,342 @@ +/******************************************************************************************** + * NxWidgets/nxwm/src/glyph_mediaplayer43x41.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ********************************************************************************************/ + +/******************************************************************************************** + * Included Files + ********************************************************************************************/ + +/* Automatically NuttX bitmap file. */ +/* Generated from play_music.png by bitmap_converter.py. */ + +#include + +#include +#include +#include + +#include +#include +#include + +#include "crlepalettebitmap.hxx" + +#include "nxwmconfig.hxx" +#include "nxwmglyphs.hxx" + +/******************************************************************************************** + * Pre-Processor Definitions + ********************************************************************************************/ + +#define FORWARD_BITMAP_NROWS 41 +#define FORWARD_BITMAP_NCOLUMNS 43 + +#define PLAY_BITMAP_NROWS 41 +#define PLAY_BITMAP_NCOLUMNS 21 + +#define REWIND_BITMAPNROWS 41 +#define REWIND_BITMAPNCOLUMNS 43 + +#define PAUSE_BITMAP_NROWS 41 +#define PAUSE_BITMAP_NCOLUMNS 21 + +#define BITMAP_NLUTCODES 8 + +/******************************************************************************************** + * Private Data + ********************************************************************************************/ + +using namespace NxWM; + +/* RGB Colors */ + +static const NXWidgets::nxwidget_pixel_t g_normalLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + MKRGB(189,189,189) /* Code 1 */ +}; + +static const NXWidgets::nxwidget_pixel_t g_brightLut[BITMAP_NLUTCODES] = +{ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + MKRGB(252,252,252) /* Code 1 */ +}; + +/* Bitmap definition for the "Forward" button */ + +static const struct NXWidgets::SRlePaletteBitmapEntry g_forwardRleEntries[] = +{ + { 1, 1}, {21, 0}, { 1, 1}, {20, 0}, /* Row 0 */ + { 2, 1}, {20, 0}, { 2, 1}, {19, 0}, /* Row 1 */ + { 3, 1}, {19, 0}, { 3, 1}, {18, 0}, /* Row 2 */ + { 4, 1}, {18, 0}, { 4, 1}, {17, 0}, /* Row 3 */ + { 5, 1}, {17, 0}, { 5, 1}, {16, 0}, /* Row 4 */ + { 6, 1}, {16, 0}, { 6, 1}, {15, 0}, /* Row 5 */ + { 7, 1}, {15, 0}, { 7, 1}, {14, 0}, /* Row 6 */ + { 8, 1}, {14, 0}, { 8, 1}, {13, 0}, /* Row 7 */ + { 9, 1}, {13, 0}, { 9, 1}, {12, 0}, /* Row 8 */ + {10, 1}, {12, 0}, {10, 1}, {11, 0}, /* Row 9 */ + {11, 1}, {11, 0}, {11, 1}, {10, 0}, /* Row 10 */ + {12, 1}, {10, 0}, {12, 1}, { 9, 0}, /* Row 11 */ + {13, 1}, { 9, 0}, {13, 1}, { 8, 0}, /* Row 12 */ + {14, 1}, { 8, 0}, {14, 1}, { 7, 0}, /* Row 13 */ + {15, 1}, { 7, 0}, {15, 1}, { 6, 0}, /* Row 14 */ + {16, 1}, { 6, 0}, {16, 1}, { 5, 0}, /* Row 15 */ + {17, 1}, { 5, 0}, {17, 1}, { 4, 0}, /* Row 16 */ + {18, 1}, { 4, 0}, {18, 1}, { 3, 0}, /* Row 17 */ + {19, 1}, { 3, 0}, {19, 1}, { 2, 0}, /* Row 18 */ + {20, 1}, { 2, 0}, {20, 1}, { 1, 0}, /* Row 19 */ + {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ + {20, 1}, { 2, 0}, {20, 1}, { 1, 0}, /* Row 21 */ + {19, 1}, { 3, 0}, {19, 1}, { 2, 0}, /* Row 22 */ + {18, 1}, { 4, 0}, {18, 1}, { 3, 0}, /* Row 23 */ + {17, 1}, { 5, 0}, {17, 1}, { 4, 0}, /* Row 24 */ + {16, 1}, { 6, 0}, {16, 1}, { 5, 0}, /* Row 25 */ + {15, 1}, { 7, 0}, {15, 1}, { 6, 0}, /* Row 26 */ + {14, 1}, { 8, 0}, {14, 1}, { 7, 0}, /* Row 27 */ + {13, 1}, { 9, 0}, {13, 1}, { 8, 0}, /* Row 28 */ + {12, 1}, {10, 0}, {12, 1}, { 9, 0}, /* Row 29 */ + {11, 1}, {11, 0}, {11, 1}, {10, 0}, /* Row 30 */ + {10, 1}, {12, 0}, {10, 1}, {11, 0}, /* Row 31 */ + { 9, 1}, {13, 0}, { 9, 1}, {12, 0}, /* Row 32 */ + { 8, 1}, {14, 0}, { 8, 1}, {13, 0}, /* Row 33 */ + { 7, 1}, {15, 0}, { 7, 1}, {14, 0}, /* Row 34 */ + { 6, 1}, {16, 0}, { 6, 1}, {15, 0}, /* Row 35 */ + { 5, 1}, {17, 0}, { 5, 1}, {16, 0}, /* Row 36 */ + { 4, 1}, {18, 0}, { 4, 1}, {17, 0}, /* Row 37 */ + { 3, 1}, {19, 0}, { 3, 1}, {18, 0}, /* Row 38 */ + { 2, 1}, {20, 0}, { 2, 1}, {19, 0}, /* Row 39 */ + { 1, 1}, {21, 0}, { 1, 1}, {20, 0} /* Row 40 */ +}; + +/* Bitmap definition for the "Play" button */ + +static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = +{ + { 1, 1}, {20, 0}, /* Row 0 */ + { 2, 1}, {19, 0}, /* Row 1 */ + { 3, 1}, {18, 0}, /* Row 2 */ + { 4, 1}, {17, 0}, /* Row 3 */ + { 5, 1}, {16, 0}, /* Row 4 */ + { 6, 1}, {15, 0}, /* Row 5 */ + { 7, 1}, {14, 0}, /* Row 6 */ + { 8, 1}, {13, 0}, /* Row 7 */ + { 9, 1}, {12, 0}, /* Row 8 */ + {10, 1}, {11, 0}, /* Row 9 */ + {11, 1}, {10, 0}, /* Row 10 */ + {12, 1}, { 9, 0}, /* Row 11 */ + {13, 1}, { 8, 0}, /* Row 12 */ + {14, 1}, { 7, 0}, /* Row 13 */ + {15, 1}, { 6, 0}, /* Row 14 */ + {16, 1}, { 5, 0}, /* Row 15 */ + {17, 1}, { 4, 0}, /* Row 16 */ + {18, 1}, { 3, 0}, /* Row 17 */ + {19, 1}, { 2, 0}, /* Row 18 */ + {20, 1}, { 1, 0}, /* Row 19 */ + {21, 1}, /* Row 20 */ + {20, 1}, { 1, 0}, /* Row 21 */ + {19, 1}, { 2, 0}, /* Row 22 */ + {18, 1}, { 3, 0}, /* Row 23 */ + {17, 1}, { 4, 0}, /* Row 24 */ + {16, 1}, { 5, 0}, /* Row 25 */ + {15, 1}, { 6, 0}, /* Row 26 */ + {14, 1}, { 7, 0}, /* Row 27 */ + {13, 1}, { 8, 0}, /* Row 28 */ + {12, 1}, { 9, 0}, /* Row 29 */ + {11, 1}, {10, 0}, /* Row 30 */ + {10, 1}, {11, 0}, /* Row 31 */ + { 9, 1}, {12, 0}, /* Row 32 */ + { 8, 1}, {13, 0}, /* Row 33 */ + { 7, 1}, {14, 0}, /* Row 34 */ + { 6, 1}, {15, 0}, /* Row 35 */ + { 5, 1}, {16, 0}, /* Row 36 */ + { 4, 1}, {17, 0}, /* Row 37 */ + { 3, 1}, {18, 0}, /* Row 38 */ + { 2, 1}, {19, 0}, /* Row 39 */ + { 1, 1}, {20, 0} /* Row 40 */ +}; + +/* Bitmap definition for "Rewind" control */ + +static const struct NXWidgets::SRlePaletteBitmapEntry g_rewindRleEntries[] = +{ + {20, 0}, { 1, 1}, {21, 0}, { 1, 1}, /* Row 0 */ + {19, 0}, { 2, 1}, {20, 0}, { 2, 1}, /* Row 1 */ + {18, 0}, { 3, 1}, {19, 0}, { 3, 1}, /* Row 2 */ + {17, 0}, { 4, 1}, {18, 0}, { 4, 1}, /* Row 3 */ + {16, 0}, { 5, 1}, {17, 0}, { 5, 1}, /* Row 4 */ + {15, 0}, { 6, 1}, {16, 0}, { 6, 1}, /* Row 5 */ + {14, 0}, { 7, 1}, {15, 0}, { 7, 1}, /* Row 6 */ + {13, 0}, { 8, 1}, {14, 0}, { 8, 1}, /* Row 7 */ + {12, 0}, { 9, 1}, {13, 0}, { 9, 1}, /* Row 8 */ + {11, 0}, {10, 1}, {12, 0}, {10, 1}, /* Row 9 */ + {10, 0}, {11, 1}, {11, 0}, {11, 1}, /* Row 10 */ + { 9, 0}, {12, 1}, {10, 0}, {12, 1}, /* Row 11 */ + { 8, 0}, {13, 1}, { 9, 0}, {13, 1}, /* Row 12 */ + { 7, 0}, {14, 1}, { 8, 0}, {14, 1}, /* Row 13 */ + { 6, 0}, {15, 1}, { 7, 0}, {15, 1}, /* Row 14 */ + { 5, 0}, {16, 1}, { 6, 0}, {16, 1}, /* Row 15 */ + { 4, 0}, {17, 1}, { 5, 0}, {17, 1}, /* Row 16 */ + { 3, 0}, {18, 1}, { 4, 0}, {18, 1}, /* Row 17 */ + { 2, 0}, {19, 1}, { 3, 0}, {19, 1}, /* Row 18 */ + { 1, 0}, {20, 1}, { 2, 0}, {20, 1}, /* Row 19 */ + {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ + { 1, 0}, {20, 1}, { 2, 0}, {20, 1}, /* Row 21 */ + { 2, 0}, {19, 1}, { 3, 0}, {19, 1}, /* Row 22 */ + { 3, 0}, {18, 1}, { 4, 0}, {18, 1}, /* Row 23 */ + { 4, 0}, {17, 1}, { 5, 0}, {17, 1}, /* Row 24 */ + { 5, 0}, {16, 1}, { 6, 0}, {16, 1}, /* Row 25 */ + { 6, 0}, {15, 1}, { 7, 0}, {15, 1}, /* Row 26 */ + { 7, 0}, {14, 1}, { 8, 0}, {14, 1}, /* Row 27 */ + { 8, 0}, {13, 1}, { 9, 0}, {13, 1}, /* Row 28 */ + { 9, 0}, {12, 1}, {10, 0}, {12, 1}, /* Row 29 */ + {10, 0}, {11, 1}, {11, 0}, {11, 1}, /* Row 30 */ + {11, 0}, {10, 1}, {12, 0}, {10, 1}, /* Row 31 */ + {12, 0}, { 9, 1}, {13, 0}, { 9, 1}, /* Row 32 */ + {13, 0}, { 8, 1}, {14, 0}, { 8, 1}, /* Row 33 */ + {14, 0}, { 7, 1}, {15, 0}, { 7, 1}, /* Row 34 */ + {15, 0}, { 6, 1}, {16, 0}, { 6, 1}, /* Row 35 */ + {16, 0}, { 5, 1}, {17, 0}, { 5, 1}, /* Row 36 */ + {17, 0}, { 4, 1}, {18, 0}, { 4, 1}, /* Row 37 */ + {18, 0}, { 3, 1}, {19, 0}, { 3, 1}, /* Row 38 */ + {19, 0}, { 2, 1}, {20, 0}, { 2, 1}, /* Row 39 */ + {20, 0}, { 1, 1}, {21, 0}, { 1, 1} /* Row 40 */ +}; + +/* Bitmap definition for the "Pause" button */ + +static const struct NXWidgets::SRlePaletteBitmapEntry g_pauseRleEntries[] = +{ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 0 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 1 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 2 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 3 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 4 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 5 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 6 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 7 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 8 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 9 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 10 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 11 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 12 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 13 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 14 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 15 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 16 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 17 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 18 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 19 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 20 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 21 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 22 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 23 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 24 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 25 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 26 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 27 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 28 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 29 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 30 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 31 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 32 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 33 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 34 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 35 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 36 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 37 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 38 */ + { 2, 1}, { 5, 0}, {14, 1}, /* Row 39 */ + { 2, 1}, { 5, 0}, {14, 1} /* Row 40 */ +}; + +/******************************************************************************************** + * Public Data + ********************************************************************************************/ + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerFwdBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + FORWARD_BITMAP_NCOLUMNS, // width - Width in pixels + FORWARD_BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_normalLut, // Index 0: Unselected LUT + g_brightLut, // Index 1: Selected LUT + }, + g_forwardRleEntries // data - Pointer to the beginning of the RLE data +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerPlayBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + PLAY_BITMAP_NCOLUMNS, // width - Width in pixels + PLAY_BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_normalLut, // Index 0: Unselected LUT + g_brightLut, // Index 1: Selected LUT + }, + g_playRleEntries // data - Pointer to the beginning of the RLE data +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerRewBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + REWIND_BITMAPNCOLUMNS, // width - Width in pixels + REWIND_BITMAPNROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_normalLut, // Index 0: Unselected LUT + g_brightLut, // Index 1: Selected LUT + }, + g_rewindRleEntries // data - Pointer to the beginning of the RLE data +}; + +const struct NXWidgets::SRlePaletteBitmap NxWM::g_mplayerPauseBitmap = +{ + CONFIG_NXWIDGETS_BPP, // bpp - Bits per pixel + CONFIG_NXWIDGETS_FMT, // fmt - Color format + BITMAP_NLUTCODES, // nlut - Number of colors in the lLook-Up Table (LUT) + PAUSE_BITMAP_NCOLUMNS, // width - Width in pixels + PAUSE_BITMAP_NROWS, // height - Height in rows + { // lut - Pointer to the beginning of the Look-Up Table (LUT) + g_normalLut, // Index 0: Unselected LUT + g_brightLut, // Index 1: Selected LUT + }, + g_pauseRleEntries // data - Pointer to the beginning of the RLE data +}; From fe2ce763f39ebadab9b38eb1d1f1fe6cfcf5d246 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 17:00:12 -0600 Subject: [PATCH 202/390] Update ChangeLog --- ChangeLog.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e7dede1b6..4a6985d76 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -448,4 +448,7 @@ Toolbar font ID can now be separately configured (2014-7-14). * nxwm/src/cmediaplayer.cxx: Will not dynamically position player controls based on the display and image sizes (2014-7-14). - +* nxwm/src/glyph_mediagrip30x30.cxx and glyph_mplayer_controls43x41.cxx: Add + larger images for the media player (2014-7-14). +* Kconfig, nxwm/src/cmediaplayer.cxx: Add options to manage spacing of media + player buttons and borders vs. borderless buttons (2014-7-14). From 0ed54e39800ab3d8538624cadf1b76cc8c5797c3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 20:09:58 -0600 Subject: [PATCH 203/390] CNxWidgets::CImage: Fix setImageLeft and setImageTop methods. --- libnxwidgets/src/cimage.cxx | 137 +++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 66 deletions(-) diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index eaf4e3005..043bc1f6f 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -122,7 +122,7 @@ CImage::CImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, m_highlighted = false; - // Position the top/lef corner of the bitmap in the top/left corner of the display + // Position the top/left corner of the bitmap in the top/left corner of the display m_origin.x = 0; m_origin.y = 0; @@ -203,73 +203,79 @@ void CImage::drawContents(CGraphicsPort *port) m_bitmap->setSelected(isClicked() || m_highlighted); - // This is the number of rows that we can draw at the top of the display + // This is the end row + 1 that we can write into - nxgl_coord_t nTopRows = m_bitmap->getHeight() - m_origin.y; - if (nTopRows > rect.getHeight()) + nxgl_coord_t bottomRow = m_bitmap->getHeight() + m_origin.y; + if (bottomRow > rect.getHeight()) { - nTopRows = rect.getHeight(); - } - else if (nTopRows < 0) - { - nTopRows = 0; + bottomRow = rect.getHeight(); } - // This the starting row in the bitmap image where we will begin drawing. + // Apply padding entire line buffer. - nxgl_coord_t imageRow = m_origin.y; + FAR nxwidget_pixel_t *ptr = buffer; + nxwidget_pixel_t backColor = getBackgroundColor(); + + for (int column = 0; column < rect.getWidth(); column++) + { + *ptr++ = backColor; + } // This the starting row in the display image where we will begin drawing. - nxgl_coord_t displayRow = rect.getY(); + nxgl_coord_t destRow = rect.getY(); + + // Draw any padded rows at the top of the widget before this + + for (int padRow = 0; padRow < m_origin.y; padRow++, destRow++) + { + // Put the padded row on the display + + if (isEnabled()) + { + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, + &bitmap, 0, 0); + } + else + { + port->drawBitmapGreyScale(rect.getX(), destRow, rect.getWidth(), + 1, &bitmap, 0, 0); + } + } + + // This is the number of rows that we can draw at the top of the display + + nxgl_coord_t nTopRows = bottomRow - m_origin.y; // Are we going to draw any rows at the top of the display? if (nTopRows > 0) { + // This is the end column + 1 that we can write into + + nxgl_coord_t rightColumn = m_bitmap->getWidth() + m_origin.x; + if (rightColumn > rect.getWidth()) + { + rightColumn = rect.getWidth(); + } + // This is the number of columns that we can draw on the left side of - // the display + // the display at the offset m_origin.x. - nxgl_coord_t nLeftPixels = m_bitmap->getWidth() - m_origin.x; + nxgl_coord_t nLeftPixels = rightColumn - m_origin.x; - // This is the number of rows that we have to pad on the right if the display - // width is wider than the image width + // This is the row number of the first row that we cannot draw into -#if 0 // Not used - nxgl_coord_t nRightPad; - if (nLeftPixels >= rect.getWidth()) + nxgl_coord_t lastTopRow = nTopRows + destRow; + + for (int srcRow = 0; destRow < lastTopRow; srcRow++, destRow++) { - nRightPad = 0; - } - else - { - nRightPad = rect.getWidth() - nLeftPixels; - } -#endif + // Read the graphics data for the left hand side of this row and + // place it in the row buffer at offset origin.x. - // Apply the padding to the right hand side - - FAR nxwidget_pixel_t *ptr = &buffer[nLeftPixels]; - nxwidget_pixel_t backColor = getBackgroundColor(); - - for (int column = nLeftPixels; column < rect.getWidth(); column++) - { - *ptr++ = backColor; - } - - // The is the row number of the first row that we cannot draw into - - nxgl_coord_t lastTopRow = nTopRows + m_origin.y; - - // Now draw the rows from the offset position - - for (; imageRow < lastTopRow; imageRow++, displayRow++) - { - // Get the graphics data for the right hand side of this row - - if (!m_bitmap->getRun(m_origin.x, imageRow, nLeftPixels, buffer)) + if (!m_bitmap->getRun(0, srcRow, nLeftPixels, &buffer[m_origin.x])) { - gvdbg("IBitmap::getRun failed at image row\n", imageRow); + gvdbg("IBitmap::getRun failed at image row\n", srcRow); delete buffer; return; } @@ -277,7 +283,7 @@ void CImage::drawContents(CGraphicsPort *port) // Replace any transparent pixels with the background color. // Then we can use the faster opaque drawBitmap() function. - ptr = buffer; + ptr = &buffer[m_origin.x]; for (int i = 0; i < nLeftPixels; i++, ptr++) { if (*ptr == CONFIG_NXWIDGETS_TRANSPARENT_COLOR) @@ -290,14 +296,13 @@ void CImage::drawContents(CGraphicsPort *port) if (isEnabled()) { - port->drawBitmap(rect.getX(), displayRow, rect.getWidth(), 1, + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, &bitmap, 0, 0); } else { - port->drawBitmapGreyScale(rect.getX(), displayRow, - rect.getWidth(), 1, - &bitmap, 0, 0); + port->drawBitmapGreyScale(rect.getX(), destRow, + rect.getWidth(), 1, &bitmap, 0, 0); } } } @@ -308,9 +313,7 @@ void CImage::drawContents(CGraphicsPort *port) { // Pad the entire row - FAR nxwidget_pixel_t *ptr = buffer; - nxwidget_pixel_t backColor = getBackgroundColor(); - + ptr = buffer; for (int column = 0; column < rect.getWidth(); column++) { *ptr++ = backColor; @@ -318,21 +321,19 @@ void CImage::drawContents(CGraphicsPort *port) // Now draw the rows from the offset position - for (; displayRow < rect.getHeight(); displayRow++) + for (; destRow < rect.getHeight(); destRow++) { // Put the padded row on the display if (isEnabled()) { - port->drawBitmap(rect.getX(), displayRow, - rect.getWidth(), 1, + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, &bitmap, 0, 0); } else { - port->drawBitmapGreyScale(rect.getX(),displayRow, - rect.getWidth(), 1, - &bitmap, 0, 0); + port->drawBitmapGreyScale(rect.getX(), destRow, + rect.getWidth(), 1, &bitmap, 0, 0); } } } @@ -445,14 +446,16 @@ void CImage::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) /** * Set the horizontal position of the bitmap. Zero is the left edge - * of the bitmap and values >0 will move the bit map to the right. + * of the bitmap and values > 0 will move the bit map to the right. * This method is useful for horizontal scrolling a large bitmap * within a smaller window + * + * REVISIT: m_origin.x should be permitted to go negative. */ void CImage::setImageLeft(nxgl_coord_t column) { - if (m_bitmap && column > 0 && column <= m_bitmap->getWidth()) + if (m_bitmap && column >= 0 && column < getWidth()) { m_origin.x = column; } @@ -463,13 +466,15 @@ void CImage::setImageLeft(nxgl_coord_t column) * of the bitmap and values >0 will move the bit map down. * This method is useful for vertical scrolling a large bitmap * within a smaller window + * + * REVISIT: m_origin.y should be permitted to go negative. */ void CImage::setImageTop(nxgl_coord_t row) { - if (m_bitmap && row > 0 && row <= m_bitmap->getHeight()) + if (m_bitmap && row >= 0 && row < getHeight()) { - m_origin.x = row; + m_origin.y = row; } } From 636e61b6391af28ee9b712c4eeb96ddde2647cae Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 20:11:01 -0600 Subject: [PATCH 204/390] Update ChangeLog --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4a6985d76..e048e8248 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -452,3 +452,5 @@ larger images for the media player (2014-7-14). * Kconfig, nxwm/src/cmediaplayer.cxx: Add options to manage spacing of media player buttons and borders vs. borderless buttons (2014-7-14). +* CNxWidgets::CImage: Fix setImageLeft and setImageTop methods. (2014-7-14). + From 322a3df8322f10d1da6d30b54968efaf9f285fa4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 20:37:39 -0600 Subject: [PATCH 205/390] NxWidget::CImage: Now supports helper methods to align images in the widget region --- libnxwidgets/include/cimage.hxx | 66 +++++++++++++++++++++++ libnxwidgets/src/cimage.cxx | 95 ++++++++++++++++++++++++++++++++- 2 files changed, 159 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 438ea7267..9daf9f260 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -232,6 +232,39 @@ namespace NXWidgets void setImageLeft(nxgl_coord_t column); + /** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + inline void alignHorizontalLeft(void) + { + setImageLeft(0); + } + + /** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + void alignHorizontalCenter(void); + + /** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + void alignHorizontalRight(void); + /** * Set the vertical position of the bitmap. Zero is the top edge * of the bitmap and values >0 will move the bit map down. @@ -241,6 +274,39 @@ namespace NXWidgets void setImageTop(nxgl_coord_t row); + /** + * Align the image at the top of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + inline void alignVerticalTop(void) + { + setImageTop(0); + } + + /** + * Align the image at the middle of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + void alignVerticalCenter(void); + + /** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + + void alignVerticalBottom(void); + /** * Control the highlight state. * diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 043bc1f6f..eb7e5157f 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -455,12 +455,57 @@ void CImage::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) void CImage::setImageLeft(nxgl_coord_t column) { - if (m_bitmap && column >= 0 && column < getWidth()) + // Get the the drawable region + + CRect rect; + getRect(rect); + + if (m_bitmap && column >= 0 && column < rect.getWidth()) { m_origin.x = column; } } +/** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + +void CImage::alignHorizontalCenter(void) +{ + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Center the image + + setImageLeft((rect.getWidth() - m_bitmap->getWidth()) >> 1); +} + +/** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + +void CImage::alignHorizontalRight(void) +{ + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Position the image at the right of the widget region + + setImageLeft(rect.getWidth() - m_bitmap->getWidth()); +} + /** * Set the vertical position of the bitmap. Zero is the top edge * of the bitmap and values >0 will move the bit map down. @@ -472,9 +517,55 @@ void CImage::setImageLeft(nxgl_coord_t column) void CImage::setImageTop(nxgl_coord_t row) { - if (m_bitmap && row >= 0 && row < getHeight()) + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Check the attempted Y position + + if (m_bitmap && row >= 0 && row < rect.getHeight()) { m_origin.y = row; } } +/** + * Align the image at the middle of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + +void CImage::alignVerticalCenter(void) +{ + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Center the image + + setImageTop((rect.getHeight() - m_bitmap->getHeight()) >> 1); +} + +/** + * Align the image at the left of the widget region. + * + * NOTE: The CImage widget does not support any persistent alignment + * attribute (at least not at the moment). As a result, this alignment + * can be lost if the image is changed or if the widget is resized. + */ + +void CImage::alignVerticalBottom(void) +{ + // Get the the drawable region + + CRect rect; + getRect(rect); + + // Position the image at the bottom of the widget region + + setImageTop(rect.getHeight() - m_bitmap->getHeight()); +} From ae4ffd5d554c13890017a86e911435fd73127229 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 20:38:22 -0600 Subject: [PATCH 206/390] NxWM::CMediaPlayer now uses the new CImage methods to align media controls in buttons --- nxwm/src/cmediaplayer.cxx | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 8f377ba8f..1190cee19 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -382,7 +382,7 @@ bool CMediaPlayer::createPlayer(void) nxgl_coord_t fwdButtonW; #ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS - // With the widest button + // Set the width to the widest button nxgl_coord_t buttonW = playBitmap->getWidth(); @@ -436,6 +436,14 @@ bool CMediaPlayer::createPlayer(void) CImage(control, playControlX, (nxgl_coord_t)controlY, playButtonW, buttonH, playBitmap); + m_playPause->alignHorizontalCenter(); + m_playPause->alignVerticalCenter(); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS + m_playPause->setBorderless(true); +#else + m_playPause->setBorderless(false); +#endif + // Create the Rewind Image nxgl_coord_t rewControlX = playControlX - rewButtonW - @@ -445,6 +453,14 @@ bool CMediaPlayer::createPlayer(void) CImage(control, rewControlX, (nxgl_coord_t)controlY, rewButtonW, buttonH, rewBitmap); + m_rew->alignHorizontalCenter(); + m_rew->alignVerticalCenter(); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS + m_rew->setBorderless(true); +#else + m_rew->setBorderless(false); +#endif + // Create the Forward Image nxgl_coord_t fwdControlX = playControlX + playButtonW + @@ -454,15 +470,12 @@ bool CMediaPlayer::createPlayer(void) CImage(control, fwdControlX, (nxgl_coord_t)controlY, fwdButtonW, buttonH, fwdBitmap); -#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS - // Make the images boarder-less if that is how we are configured - m_playPause->setBorderless(true); - m_rew->setBorderless(true); + m_fwd->alignHorizontalCenter(); + m_fwd->alignVerticalCenter(); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS m_fwd->setBorderless(true); #else - m_playPause->setBorderless(false); - m_rew->setBorderless(false); m_fwd->setBorderless(false); #endif From 86e75f547397f5d64c1b55ab499e4cb8d7e9da4c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 20:39:40 -0600 Subject: [PATCH 207/390] Update ChangeLog --- ChangeLog.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e048e8248..2e8580fe9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -452,5 +452,8 @@ larger images for the media player (2014-7-14). * Kconfig, nxwm/src/cmediaplayer.cxx: Add options to manage spacing of media player buttons and borders vs. borderless buttons (2014-7-14). -* CNxWidgets::CImage: Fix setImageLeft and setImageTop methods. (2014-7-14). - +* NxWidgets::CImage: Fix setImageLeft and setImageTop methods (2014-7-14). +* NxWidget::CImage: Now supports helper methods to align images in the + widget region (2014-7-14). +* NxWM::CMediaPlayer now uses the new CImage methods to align media controls + in buttons (2014-7-14). From 3f4b410fbe3d762b15fd7ef78ee76d67052d485a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 14 Jul 2014 21:15:07 -0600 Subject: [PATCH 208/390] NwWM: Minor clean-up of media player icon --- nxwm/images/mediaplayer44x50.png | Bin 1098 -> 1094 bytes nxwm/src/glyph_mediaplayer44x50.cxx | 90 ++++++++++++++-------------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/nxwm/images/mediaplayer44x50.png b/nxwm/images/mediaplayer44x50.png index 9eaa4e2698d20672ee3c590e536ed9fe5de68fcd..c0993a99e0c39dd8d81f4b17ebd81a43070d5dbc 100755 GIT binary patch delta 244 zcmVVI_r007HLL_t(Y$L*D|4g(#TLzj9x>j|uoTuS+|YL^Wfa9w1B2YBOJGvU_7;hht(059OSiNlSH!klzrS-K1# z>pa7kk1}BE1&6)%g9T?-!^9P^7Zbi4tdT$FijT%<`;5TTzCh5Wi7{abumL{F7J1WaqhQrw4z|^ho{S% uh5y1wy7~0TPEMx;cad)KoW+ln?XDitOY^w~f06Y70000l25=rK3QO_v4L)lF7EogcE^slm0~aA3td`6nJbfuw zynKTn;W0cjY*MzyqPqh}x_^iXFowx>HqJI8K|0%S2Z7CW)zxqe0s{ujhDQfbAFP^A zd|~!%S>Zli$8=7lV+iuzhJ*Eny6bHC4MuyQ-gM*fOn>I|N)g(+IZbe)x~uGTv>4Y@ yd04pp(t^MqI60kHj9#QBN|B4dt`2PbBk=(I_x1zduOo&40000 Date: Tue, 15 Jul 2014 08:05:47 -0600 Subject: [PATCH 209/390] Update media player icons again --- nxwm/Makefile | 2 +- nxwm/images/mediaforward43x41.png | Bin 317 -> 363 bytes nxwm/images/mediagrip30x30.png | Bin 252 -> 0 bytes nxwm/images/mediagrip60x30.png | Bin 0 -> 283 bytes nxwm/images/mediapause21x41.png | Bin 157 -> 0 bytes nxwm/images/mediapause43x41.png | Bin 0 -> 222 bytes nxwm/images/mediaplay21x41.png | Bin 289 -> 0 bytes nxwm/images/mediaplay43x41.png | Bin 0 -> 332 bytes nxwm/images/mediarewind43x41.png | Bin 316 -> 359 bytes ...grip30x30.cxx => glyph_mediagrip60x30.cxx} | 66 +-- nxwm/src/glyph_mplayer_controls43x41.cxx | 389 ++++++++++-------- 11 files changed, 254 insertions(+), 203 deletions(-) delete mode 100755 nxwm/images/mediagrip30x30.png create mode 100755 nxwm/images/mediagrip60x30.png delete mode 100755 nxwm/images/mediapause21x41.png create mode 100755 nxwm/images/mediapause43x41.png delete mode 100755 nxwm/images/mediaplay21x41.png create mode 100755 nxwm/images/mediaplay43x41.png rename nxwm/src/{glyph_mediagrip30x30.cxx => glyph_mediagrip60x30.cxx} (74%) diff --git a/nxwm/Makefile b/nxwm/Makefile index ad9b39e24..75c923299 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -89,7 +89,7 @@ ifeq ($(CONFIG_NXWM_MEDIAPLAYER),y) CXXSRCS += cmediaplayer.cxx ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) CXXSRCS += glyph_mediaplayer44x50.cxx glyph_mplayer_controls43x41.cxx -CXXSRCS += glyph_mediagrip30x30.cxx +CXXSRCS += glyph_mediagrip60x30.cxx else CXXSRCS += glyph_mediaplayer24x24.cxx glyph_mplayer_controls32x32.cxx endif diff --git a/nxwm/images/mediaforward43x41.png b/nxwm/images/mediaforward43x41.png index 3165856dd91f183a89410107416b811c474c1cf4..ab5440a271f048acff81dddd5c9a701190f4f556 100755 GIT binary patch delta 294 zcmV+>0one&0_y^hPJa&!Iug;TP3!;w0R2fsK~z}7#gwZN!cY)J@7#&UM$iG3qyi+J zASeP)6{uJgWkg`<0Kp6lOd$Jq_r4bulXFf!Hy92RVn>ib0N7lE5fK98h#-L}_Yom5 z>tVVHOnjq00&_nr2Z8C|b}501ffW%bTDhG--LJ+-plIcG0)Is-w-YE@xt&1K%IyS- zR&FOyv~oLvqLteT6s_D&plIcGLI+^j_Fl$x-mim%4#4F&`mVm;cF&Ut!T%Os`XGUA z_0EDsy{8~oUtEx`FDp>!3kpPfYk^L0Dv;`z3)K3Bf(rV71$Fd43##eo3u@|T3M%Wr s3+n4X3YzHO1s|>S0I=#$L3fbw0E6*{_KB+KlK=n!07*qoM6N<$f_Ei?!2kdN delta 247 zcmaFOw3lguUp=1)yUe$Oy+0Tj7|wgTIEF+VK03ousM&z$NXNhb&%fNzWIlWBo0W}& zkifSCrqA~jg->#jo2U{{BrnMn%5Utm;6v{*jw^Dj85%!r-s^qfV`HwMLG4p3#`{+~ zSk_c87bxg|H>n{%%Y|v*NcM4i*08_34y=tAF?sP{^vjEQ?pt5Zv(Ek1-jw!t?}GUM n!38e=buE_Kf4=>!td_y~P>XHcg?oHJzcF~a`njxgN@xNAzuItv diff --git a/nxwm/images/mediagrip30x30.png b/nxwm/images/mediagrip30x30.png deleted file mode 100755 index 40add47b765b9d18c1d20502e343d97d3144c93e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX1SGcvS$+jljKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfJ$613RsO3ryV!t2eV#6kAs)w*QxXzB*?!LHC zK(bd=%J#78wyR!~Q@X-G2cNmb)O~Tr%SH|Jq$M*iW~k(B0SX5B9$b}bvbbMn@kJqq siJlo-+?FrC=n{55#q>MgW#0lJLA)78&qol`;+0Qf3cRR910 diff --git a/nxwm/images/mediagrip60x30.png b/nxwm/images/mediagrip60x30.png new file mode 100755 index 0000000000000000000000000000000000000000..a2bcef665e6ac79141a68cdd5befa0bffcf18329 GIT binary patch literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^Hb5-L!2~4#|9T|>q!^2X+?^QKos)S9vL>4nJ za0`PlBg3pYAQkK-p1!W^_t^P)v;}hN_%8s3)_S@)hD01rPDx1kkW;m(_9=JULI#_| zs@txgG~iPdKYaJ>i3PQ7i7Ob@+7vn5WNn>f-b(6y{NH6LQ`zP%usFNH_|bpuV=wqF zSz6Ds0m?s;=~Y#(YV*!nJyq?b$ogl?k8ELGk!mF7p8PChQH{ULy5-YOF3zmFa&d{} zt<^s@S1uD+*&3zRANCk5xVXH=O_IvDnB7CB8dHX;n=zF?2hIkx*ds>l?fq~<&!?FMWZFHDK yx|WoBmu->_p7iTZp5*oq6*hAH#~**(U&A@q diff --git a/nxwm/images/mediapause43x41.png b/nxwm/images/mediapause43x41.png new file mode 100755 index 0000000000000000000000000000000000000000..0aa79923ebc92d02501a1c18eb0e587dbdad073a GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^+CZ$y!2~3gzq`)?QjEnx?oJHr&dIz4aySb-B8wRq z_zr_GH=O_IvF7JZ2WlmY+5Q3Ke*|IEF+VPEJu^sxY&46uud!?!3*& zH=O_IvDnBK(qmhY!~Sg*JP-IEHu}Uwh4yk6Dq&B{2B=e&a|5 zL8fDR;)$1;tM*@Ae5>mHH-m&Uea@cNIR|1c3q_c>uxxvq#q@k#5YxLjyT;orGaU?$ zs|ffn=Un36A)Mf6I__u=pU za%)ZZB>ers++CM+bp4Ju<}shu^(w?S|7+8fe{kox#YfFPo96ZNj_iBB@v(Qs_s~C& jS^s>Ms{8d>>M^tRQzuuJ$hlvE&S&s+^>bP0l+XkKm7a5x diff --git a/nxwm/images/mediaplay43x41.png b/nxwm/images/mediaplay43x41.png new file mode 100755 index 0000000000000000000000000000000000000000..440544b17bc05b35b11b92994e83f75a5906a7a8 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^+CZ$y!2~3gzq`)?QjEnx?oJHr&dIz4aySb-B8wRq z_zr_GH=O_IvF7JciZh*(5u%`&;V7FZAR;K| z$eJj;M9|NXFHuZIVE3P}&xJvvufJ|#XZe2G_x1jHr>8CdV4E-g=S(&0%sqh<&g^FS zxyLo&)aRxwIWdmPpaoA28|S36%(YR-c(%K#Zl9{dr(F%Fx|s~tbKIzjY=&u0b(hM%4;jv*0;k51bt*yJGMVt<=qWut5WXXu4a#<>zv zjJ^SEj4Nd&UOafQ;Lq;A)#aA&ZCT3O}Wj>&di=FD5m@K19q>Y!%cUy6(eJ(1gjfCCSAI1&G5xA%P5ole-BthcJGa-XaxSjd`?*iO zw&z;);y&xvFYBASs*JNw`)_)iD>n{Z(`cJ`>{#`Jr2f$f90B^3fk_AZu^N1vYCHIjb zu @@ -57,7 +57,7 @@ ********************************************************************************************/ #define BITMAP_NROWS 30 -#define BITMAP_NCOLUMNS 30 +#define BITMAP_NCOLUMNS 60 #define BITMAP_NLUTCODES 4 #define MEDIA_GRIP_DARK_ICON 1 @@ -215,36 +215,38 @@ static const nxgl_mxpixel_t g_gripBrightLut[BITMAP_NLUTCODES] = static const struct NXWidgets::SRlePaletteBitmapEntry g_gripRleEntries[] = { - { 1, 0}, { 1, 1}, {26, 2}, { 1, 1}, { 1, 0}, /* Row 0 */ - { 1, 1}, {28, 2}, { 1, 1}, /* Row 1 */ - {30, 2}, /* Row 2 */ - {30, 2}, /* Row 3 */ - {30, 2}, /* Row 4 */ - {30, 2}, /* Row 5 */ - {12, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 6 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 7 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 8 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 9 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 10 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 11 */ - { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, { 6, 2}, /* Row 12 */ - { 6, 2}, {18, 3}, { 6, 2}, /* Row 13 */ - { 6, 2}, {18, 3}, { 6, 2}, /* Row 14 */ - { 6, 2}, {18, 3}, { 6, 2}, /* Row 15 */ - { 6, 2}, {18, 3}, { 6, 2}, /* Row 16 */ - { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, { 6, 2}, /* Row 17 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 18 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 19 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 20 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 21 */ - {12, 2}, { 6, 3}, {12, 2}, /* Row 22 */ - {12, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 23 */ - {30, 2}, /* Row 24 */ - {30, 2}, /* Row 25 */ - {30, 2}, /* Row 26 */ - {30, 2}, /* Row 27 */ - { 1, 1}, {28, 2}, { 1, 1}, /* Row 28 */ - { 1, 0}, { 1, 1}, {26, 2}, { 1, 1}, { 1, 0} /* Row 29 */ + { 1, 0}, { 1, 1}, {56, 2}, { 1, 1}, { 1, 0}, /* Row 0 */ + { 1, 1}, {58, 2}, { 1, 1}, /* Row 1 */ + {60, 2}, /* Row 2 */ + {60, 2}, /* Row 3 */ + {60, 2}, /* Row 4 */ + {60, 2}, /* Row 5 */ + {42, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 6 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 7 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 8 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 9 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 10 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 11 */ + { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, {12, 2}, { 1, 1}, {16, 3}, { 1, 1}, /* Row 12 */ + { 6, 2}, + { 6, 2}, {18, 3}, {12, 2}, {18, 3}, { 6, 2}, /* Row 13 */ + { 6, 2}, {18, 3}, {12, 2}, {18, 3}, { 6, 2}, /* Row 14 */ + { 6, 2}, {18, 3}, {12, 2}, {18, 3}, { 6, 2}, /* Row 15 */ + { 6, 2}, {18, 3}, {12, 2}, {18, 3}, { 6, 2}, /* Row 16 */ + { 6, 2}, { 1, 1}, {16, 3}, { 1, 1}, {12, 2}, { 1, 1}, {16, 3}, { 1, 1}, /* Row 17 */ + { 6, 2}, + {42, 2}, { 6, 3}, {12, 2}, /* Row 18 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 19 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 20 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 21 */ + {42, 2}, { 6, 3}, {12, 2}, /* Row 22 */ + {42, 2}, { 1, 1}, { 4, 3}, { 1, 1}, {12, 2}, /* Row 23 */ + {60, 2}, /* Row 24 */ + {60, 2}, /* Row 25 */ + {60, 2}, /* Row 26 */ + {60, 2}, /* Row 27 */ + { 1, 1}, {58, 2}, { 1, 1}, /* Row 28 */ + { 1, 0}, { 1, 1}, {56, 2}, { 1, 1}, { 1, 0} /* Row 29 */ }; /******************************************************************************************** diff --git a/nxwm/src/glyph_mplayer_controls43x41.cxx b/nxwm/src/glyph_mplayer_controls43x41.cxx index 505d612d4..067c47936 100644 --- a/nxwm/src/glyph_mplayer_controls43x41.cxx +++ b/nxwm/src/glyph_mplayer_controls43x41.cxx @@ -63,13 +63,13 @@ #define FORWARD_BITMAP_NCOLUMNS 43 #define PLAY_BITMAP_NROWS 41 -#define PLAY_BITMAP_NCOLUMNS 21 +#define PLAY_BITMAP_NCOLUMNS 43 #define REWIND_BITMAPNROWS 41 #define REWIND_BITMAPNCOLUMNS 43 #define PAUSE_BITMAP_NROWS 41 -#define PAUSE_BITMAP_NCOLUMNS 21 +#define PAUSE_BITMAP_NCOLUMNS 43 #define BITMAP_NLUTCODES 8 @@ -83,202 +83,251 @@ using namespace NxWM; static const NXWidgets::nxwidget_pixel_t g_normalLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - MKRGB(189,189,189) /* Code 1 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ + MKRGB(54,99,171), /* Code 1 */ + MKRGB(0,33,153), /* Code 2 */ + MKRGB(12,16,120) /* Code 3 */ }; static const NXWidgets::nxwidget_pixel_t g_brightLut[BITMAP_NLUTCODES] = { - CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ - MKRGB(252,252,252) /* Code 1 */ + CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR, /* Code 0 */ +#if 1 // Red + MKRGB(228,132,72), /* Code 1 */ + MKRGB(204,44,0), /* Code 2 */ + MKRGB(160,24,16) /* Code 3 */ +#else // Blue + MKRGB(72,132,228), /* Code 1 */ + MKRGB(0,44,204), /* Code 2 */ + MKRGB(16,24,160) /* Code 3 */ +#endif }; /* Bitmap definition for the "Forward" button */ static const struct NXWidgets::SRlePaletteBitmapEntry g_forwardRleEntries[] = { - { 1, 1}, {21, 0}, { 1, 1}, {20, 0}, /* Row 0 */ - { 2, 1}, {20, 0}, { 2, 1}, {19, 0}, /* Row 1 */ - { 3, 1}, {19, 0}, { 3, 1}, {18, 0}, /* Row 2 */ - { 4, 1}, {18, 0}, { 4, 1}, {17, 0}, /* Row 3 */ - { 5, 1}, {17, 0}, { 5, 1}, {16, 0}, /* Row 4 */ - { 6, 1}, {16, 0}, { 6, 1}, {15, 0}, /* Row 5 */ - { 7, 1}, {15, 0}, { 7, 1}, {14, 0}, /* Row 6 */ - { 8, 1}, {14, 0}, { 8, 1}, {13, 0}, /* Row 7 */ - { 9, 1}, {13, 0}, { 9, 1}, {12, 0}, /* Row 8 */ - {10, 1}, {12, 0}, {10, 1}, {11, 0}, /* Row 9 */ - {11, 1}, {11, 0}, {11, 1}, {10, 0}, /* Row 10 */ - {12, 1}, {10, 0}, {12, 1}, { 9, 0}, /* Row 11 */ - {13, 1}, { 9, 0}, {13, 1}, { 8, 0}, /* Row 12 */ - {14, 1}, { 8, 0}, {14, 1}, { 7, 0}, /* Row 13 */ - {15, 1}, { 7, 0}, {15, 1}, { 6, 0}, /* Row 14 */ - {16, 1}, { 6, 0}, {16, 1}, { 5, 0}, /* Row 15 */ - {17, 1}, { 5, 0}, {17, 1}, { 4, 0}, /* Row 16 */ - {18, 1}, { 4, 0}, {18, 1}, { 3, 0}, /* Row 17 */ - {19, 1}, { 3, 0}, {19, 1}, { 2, 0}, /* Row 18 */ - {20, 1}, { 2, 0}, {20, 1}, { 1, 0}, /* Row 19 */ - {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ - {20, 1}, { 2, 0}, {20, 1}, { 1, 0}, /* Row 21 */ - {19, 1}, { 3, 0}, {19, 1}, { 2, 0}, /* Row 22 */ - {18, 1}, { 4, 0}, {18, 1}, { 3, 0}, /* Row 23 */ - {17, 1}, { 5, 0}, {17, 1}, { 4, 0}, /* Row 24 */ - {16, 1}, { 6, 0}, {16, 1}, { 5, 0}, /* Row 25 */ - {15, 1}, { 7, 0}, {15, 1}, { 6, 0}, /* Row 26 */ - {14, 1}, { 8, 0}, {14, 1}, { 7, 0}, /* Row 27 */ - {13, 1}, { 9, 0}, {13, 1}, { 8, 0}, /* Row 28 */ - {12, 1}, {10, 0}, {12, 1}, { 9, 0}, /* Row 29 */ - {11, 1}, {11, 0}, {11, 1}, {10, 0}, /* Row 30 */ - {10, 1}, {12, 0}, {10, 1}, {11, 0}, /* Row 31 */ - { 9, 1}, {13, 0}, { 9, 1}, {12, 0}, /* Row 32 */ - { 8, 1}, {14, 0}, { 8, 1}, {13, 0}, /* Row 33 */ - { 7, 1}, {15, 0}, { 7, 1}, {14, 0}, /* Row 34 */ - { 6, 1}, {16, 0}, { 6, 1}, {15, 0}, /* Row 35 */ - { 5, 1}, {17, 0}, { 5, 1}, {16, 0}, /* Row 36 */ - { 4, 1}, {18, 0}, { 4, 1}, {17, 0}, /* Row 37 */ - { 3, 1}, {19, 0}, { 3, 1}, {18, 0}, /* Row 38 */ - { 2, 1}, {20, 0}, { 2, 1}, {19, 0}, /* Row 39 */ - { 1, 1}, {21, 0}, { 1, 1}, {20, 0} /* Row 40 */ + { 1, 1}, {21, 0}, { 1, 1}, {20, 0}, /* Row 0 */ + { 1, 1}, { 1, 2}, {20, 0}, { 1, 1}, { 1, 2}, {19, 0}, /* Row 1 */ + { 1, 1}, { 2, 2}, {19, 0}, { 1, 1}, { 2, 2}, {18, 0}, /* Row 2 */ + { 1, 1}, { 3, 2}, {18, 0}, { 1, 1}, { 3, 2}, {17, 0}, /* Row 3 */ + { 1, 1}, { 4, 2}, {17, 0}, { 1, 1}, { 4, 2}, {16, 0}, /* Row 4 */ + { 1, 1}, { 5, 2}, {16, 0}, { 1, 1}, { 5, 2}, {15, 0}, /* Row 5 */ + { 1, 1}, { 6, 2}, {15, 0}, { 1, 1}, { 6, 2}, {14, 0}, /* Row 6 */ + { 1, 1}, { 7, 2}, {14, 0}, { 1, 1}, { 7, 2}, {13, 0}, /* Row 7 */ + { 1, 1}, { 8, 2}, {13, 0}, { 1, 1}, { 8, 2}, {12, 0}, /* Row 8 */ + { 1, 1}, { 9, 2}, {12, 0}, { 1, 1}, { 9, 2}, {11, 0}, /* Row 9 */ + { 1, 1}, {10, 2}, {11, 0}, { 1, 1}, {10, 2}, {10, 0}, /* Row 10 */ + { 1, 1}, {11, 2}, {10, 0}, { 1, 1}, {11, 2}, { 9, 0}, /* Row 11 */ + { 1, 1}, {12, 2}, { 9, 0}, { 1, 1}, {12, 2}, { 8, 0}, /* Row 12 */ + { 1, 1}, {13, 2}, { 8, 0}, { 1, 1}, {13, 2}, { 7, 0}, /* Row 13 */ + { 1, 1}, {14, 2}, { 7, 0}, { 1, 1}, {14, 2}, { 6, 0}, /* Row 14 */ + { 1, 1}, {15, 2}, { 6, 0}, { 1, 1}, {15, 2}, { 5, 0}, /* Row 15 */ + { 1, 1}, {16, 2}, { 5, 0}, { 1, 1}, {16, 2}, { 4, 0}, /* Row 16 */ + { 1, 1}, {17, 2}, { 4, 0}, { 1, 1}, {17, 2}, { 3, 0}, /* Row 17 */ + { 1, 1}, {18, 2}, { 3, 0}, { 1, 1}, {18, 2}, { 2, 0}, /* Row 18 */ + { 1, 1}, {19, 2}, { 2, 0}, { 1, 1}, {19, 2}, { 1, 0}, /* Row 19 */ + {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ + { 1, 1}, {19, 3}, { 2, 0}, { 1, 1}, {19, 3}, { 1, 0}, /* Row 21 */ + { 1, 1}, {18, 3}, { 3, 0}, { 1, 1}, {18, 3}, { 2, 0}, /* Row 22 */ + { 1, 1}, {17, 3}, { 4, 0}, { 1, 1}, {17, 3}, { 3, 0}, /* Row 23 */ + { 1, 1}, {16, 3}, { 5, 0}, { 1, 1}, {16, 3}, { 4, 0}, /* Row 24 */ + { 1, 1}, {15, 3}, { 6, 0}, { 1, 1}, {15, 3}, { 5, 0}, /* Row 25 */ + { 1, 1}, {14, 3}, { 7, 0}, { 1, 1}, {14, 3}, { 6, 0}, /* Row 26 */ + { 1, 1}, {13, 3}, { 8, 0}, { 1, 1}, {13, 3}, { 7, 0}, /* Row 27 */ + { 1, 1}, {12, 3}, { 9, 0}, { 1, 1}, {12, 3}, { 8, 0}, /* Row 28 */ + { 1, 1}, {11, 3}, {10, 0}, { 1, 1}, {11, 3}, { 9, 0}, /* Row 29 */ + { 1, 1}, {10, 3}, {11, 0}, { 1, 1}, {10, 3}, {10, 0}, /* Row 30 */ + { 1, 1}, { 9, 3}, {12, 0}, { 1, 1}, { 9, 3}, {11, 0}, /* Row 31 */ + { 1, 1}, { 8, 3}, {13, 0}, { 1, 1}, { 8, 3}, {12, 0}, /* Row 32 */ + { 1, 1}, { 7, 3}, {14, 0}, { 1, 1}, { 7, 3}, {13, 0}, /* Row 33 */ + { 1, 1}, { 6, 3}, {15, 0}, { 1, 1}, { 6, 3}, {14, 0}, /* Row 34 */ + { 1, 1}, { 5, 3}, {16, 0}, { 1, 1}, { 5, 3}, {15, 0}, /* Row 35 */ + { 1, 1}, { 4, 3}, {17, 0}, { 1, 1}, { 4, 3}, {16, 0}, /* Row 36 */ + { 1, 1}, { 3, 3}, {18, 0}, { 1, 1}, { 3, 3}, {17, 0}, /* Row 37 */ + { 1, 1}, { 2, 3}, {19, 0}, { 1, 1}, { 2, 3}, {18, 0}, /* Row 38 */ + { 1, 1}, { 1, 3}, {20, 0}, { 1, 1}, { 1, 3}, {19, 0}, /* Row 39 */ + { 1, 3}, {21, 0}, { 1, 3}, {20, 0} /* Row 40 */ }; /* Bitmap definition for the "Play" button */ static const struct NXWidgets::SRlePaletteBitmapEntry g_playRleEntries[] = { - { 1, 1}, {20, 0}, /* Row 0 */ - { 2, 1}, {19, 0}, /* Row 1 */ - { 3, 1}, {18, 0}, /* Row 2 */ - { 4, 1}, {17, 0}, /* Row 3 */ - { 5, 1}, {16, 0}, /* Row 4 */ - { 6, 1}, {15, 0}, /* Row 5 */ - { 7, 1}, {14, 0}, /* Row 6 */ - { 8, 1}, {13, 0}, /* Row 7 */ - { 9, 1}, {12, 0}, /* Row 8 */ - {10, 1}, {11, 0}, /* Row 9 */ - {11, 1}, {10, 0}, /* Row 10 */ - {12, 1}, { 9, 0}, /* Row 11 */ - {13, 1}, { 8, 0}, /* Row 12 */ - {14, 1}, { 7, 0}, /* Row 13 */ - {15, 1}, { 6, 0}, /* Row 14 */ - {16, 1}, { 5, 0}, /* Row 15 */ - {17, 1}, { 4, 0}, /* Row 16 */ - {18, 1}, { 3, 0}, /* Row 17 */ - {19, 1}, { 2, 0}, /* Row 18 */ - {20, 1}, { 1, 0}, /* Row 19 */ - {21, 1}, /* Row 20 */ - {20, 1}, { 1, 0}, /* Row 21 */ - {19, 1}, { 2, 0}, /* Row 22 */ - {18, 1}, { 3, 0}, /* Row 23 */ - {17, 1}, { 4, 0}, /* Row 24 */ - {16, 1}, { 5, 0}, /* Row 25 */ - {15, 1}, { 6, 0}, /* Row 26 */ - {14, 1}, { 7, 0}, /* Row 27 */ - {13, 1}, { 8, 0}, /* Row 28 */ - {12, 1}, { 9, 0}, /* Row 29 */ - {11, 1}, {10, 0}, /* Row 30 */ - {10, 1}, {11, 0}, /* Row 31 */ - { 9, 1}, {12, 0}, /* Row 32 */ - { 8, 1}, {13, 0}, /* Row 33 */ - { 7, 1}, {14, 0}, /* Row 34 */ - { 6, 1}, {15, 0}, /* Row 35 */ - { 5, 1}, {16, 0}, /* Row 36 */ - { 4, 1}, {17, 0}, /* Row 37 */ - { 3, 1}, {18, 0}, /* Row 38 */ - { 2, 1}, {19, 0}, /* Row 39 */ - { 1, 1}, {20, 0} /* Row 40 */ + {13, 0}, { 1, 1}, {29, 0}, /* Row 0 */ + {13, 0}, { 1, 1}, { 1, 2}, {28, 0}, /* Row 1 */ + {13, 0}, { 1, 1}, { 2, 2}, {27, 0}, /* Row 2 */ + {13, 0}, { 1, 1}, { 3, 2}, {26, 0}, /* Row 3 */ + {13, 0}, { 1, 1}, { 4, 2}, {25, 0}, /* Row 4 */ + {13, 0}, { 1, 1}, { 5, 2}, {24, 0}, /* Row 5 */ + {13, 0}, { 1, 1}, { 6, 2}, {23, 0}, /* Row 6 */ + {13, 0}, { 1, 1}, { 7, 2}, {22, 0}, /* Row 7 */ + {13, 0}, { 1, 1}, { 8, 2}, {21, 0}, /* Row 8 */ + {13, 0}, { 1, 1}, { 9, 2}, {20, 0}, /* Row 9 */ + {13, 0}, { 1, 1}, {10, 2}, {19, 0}, /* Row 10 */ + {13, 0}, { 1, 1}, {11, 2}, {18, 0}, /* Row 11 */ + {13, 0}, { 1, 1}, {12, 2}, {17, 0}, /* Row 12 */ + {13, 0}, { 1, 1}, {13, 2}, {16, 0}, /* Row 13 */ + {13, 0}, { 1, 1}, {14, 2}, {15, 0}, /* Row 14 */ + {13, 0}, { 1, 1}, {15, 2}, {14, 0}, /* Row 15 */ + {13, 0}, { 1, 1}, {16, 2}, {13, 0}, /* Row 16 */ + {13, 0}, { 1, 1}, {17, 2}, {12, 0}, /* Row 17 */ + {13, 0}, { 1, 1}, {18, 2}, {11, 0}, /* Row 18 */ + {13, 0}, { 1, 1}, {19, 2}, {10, 0}, /* Row 19 */ + {13, 0}, {21, 1}, { 9, 0}, /* Row 20 */ + {13, 0}, { 1, 1}, {19, 3}, {10, 0}, /* Row 21 */ + {13, 0}, { 1, 1}, {18, 3}, {11, 0}, /* Row 22 */ + {13, 0}, { 1, 1}, {17, 3}, {12, 0}, /* Row 23 */ + {13, 0}, { 1, 1}, {16, 3}, {13, 0}, /* Row 24 */ + {13, 0}, { 1, 1}, {15, 3}, {14, 0}, /* Row 25 */ + {13, 0}, { 1, 1}, {14, 3}, {15, 0}, /* Row 26 */ + {13, 0}, { 1, 1}, {13, 3}, {16, 0}, /* Row 27 */ + {13, 0}, { 1, 1}, {12, 3}, {17, 0}, /* Row 28 */ + {13, 0}, { 1, 1}, {11, 3}, {18, 0}, /* Row 29 */ + {13, 0}, { 1, 1}, {10, 3}, {19, 0}, /* Row 30 */ + {13, 0}, { 1, 1}, { 9, 3}, {20, 0}, /* Row 31 */ + {13, 0}, { 1, 1}, { 8, 3}, {21, 0}, /* Row 32 */ + {13, 0}, { 1, 1}, { 7, 3}, {22, 0}, /* Row 33 */ + {13, 0}, { 1, 1}, { 6, 3}, {23, 0}, /* Row 34 */ + {13, 0}, { 1, 1}, { 5, 3}, {24, 0}, /* Row 35 */ + {13, 0}, { 1, 1}, { 4, 3}, {25, 0}, /* Row 36 */ + {13, 0}, { 1, 1}, { 3, 3}, {26, 0}, /* Row 37 */ + {13, 0}, { 1, 1}, { 2, 3}, {27, 0}, /* Row 38 */ + {13, 0}, { 1, 1}, { 1, 3}, {28, 0}, /* Row 39 */ + {13, 0}, { 1, 2}, {29, 0} /* Row 40 */ }; /* Bitmap definition for "Rewind" control */ static const struct NXWidgets::SRlePaletteBitmapEntry g_rewindRleEntries[] = { - {20, 0}, { 1, 1}, {21, 0}, { 1, 1}, /* Row 0 */ - {19, 0}, { 2, 1}, {20, 0}, { 2, 1}, /* Row 1 */ - {18, 0}, { 3, 1}, {19, 0}, { 3, 1}, /* Row 2 */ - {17, 0}, { 4, 1}, {18, 0}, { 4, 1}, /* Row 3 */ - {16, 0}, { 5, 1}, {17, 0}, { 5, 1}, /* Row 4 */ - {15, 0}, { 6, 1}, {16, 0}, { 6, 1}, /* Row 5 */ - {14, 0}, { 7, 1}, {15, 0}, { 7, 1}, /* Row 6 */ - {13, 0}, { 8, 1}, {14, 0}, { 8, 1}, /* Row 7 */ - {12, 0}, { 9, 1}, {13, 0}, { 9, 1}, /* Row 8 */ - {11, 0}, {10, 1}, {12, 0}, {10, 1}, /* Row 9 */ - {10, 0}, {11, 1}, {11, 0}, {11, 1}, /* Row 10 */ - { 9, 0}, {12, 1}, {10, 0}, {12, 1}, /* Row 11 */ - { 8, 0}, {13, 1}, { 9, 0}, {13, 1}, /* Row 12 */ - { 7, 0}, {14, 1}, { 8, 0}, {14, 1}, /* Row 13 */ - { 6, 0}, {15, 1}, { 7, 0}, {15, 1}, /* Row 14 */ - { 5, 0}, {16, 1}, { 6, 0}, {16, 1}, /* Row 15 */ - { 4, 0}, {17, 1}, { 5, 0}, {17, 1}, /* Row 16 */ - { 3, 0}, {18, 1}, { 4, 0}, {18, 1}, /* Row 17 */ - { 2, 0}, {19, 1}, { 3, 0}, {19, 1}, /* Row 18 */ - { 1, 0}, {20, 1}, { 2, 0}, {20, 1}, /* Row 19 */ - {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ - { 1, 0}, {20, 1}, { 2, 0}, {20, 1}, /* Row 21 */ - { 2, 0}, {19, 1}, { 3, 0}, {19, 1}, /* Row 22 */ - { 3, 0}, {18, 1}, { 4, 0}, {18, 1}, /* Row 23 */ - { 4, 0}, {17, 1}, { 5, 0}, {17, 1}, /* Row 24 */ - { 5, 0}, {16, 1}, { 6, 0}, {16, 1}, /* Row 25 */ - { 6, 0}, {15, 1}, { 7, 0}, {15, 1}, /* Row 26 */ - { 7, 0}, {14, 1}, { 8, 0}, {14, 1}, /* Row 27 */ - { 8, 0}, {13, 1}, { 9, 0}, {13, 1}, /* Row 28 */ - { 9, 0}, {12, 1}, {10, 0}, {12, 1}, /* Row 29 */ - {10, 0}, {11, 1}, {11, 0}, {11, 1}, /* Row 30 */ - {11, 0}, {10, 1}, {12, 0}, {10, 1}, /* Row 31 */ - {12, 0}, { 9, 1}, {13, 0}, { 9, 1}, /* Row 32 */ - {13, 0}, { 8, 1}, {14, 0}, { 8, 1}, /* Row 33 */ - {14, 0}, { 7, 1}, {15, 0}, { 7, 1}, /* Row 34 */ - {15, 0}, { 6, 1}, {16, 0}, { 6, 1}, /* Row 35 */ - {16, 0}, { 5, 1}, {17, 0}, { 5, 1}, /* Row 36 */ - {17, 0}, { 4, 1}, {18, 0}, { 4, 1}, /* Row 37 */ - {18, 0}, { 3, 1}, {19, 0}, { 3, 1}, /* Row 38 */ - {19, 0}, { 2, 1}, {20, 0}, { 2, 1}, /* Row 39 */ - {20, 0}, { 1, 1}, {21, 0}, { 1, 1} /* Row 40 */ + {20, 0}, { 1, 1}, {21, 0}, { 1, 1}, /* Row 0 */ + {19, 0}, { 1, 1}, { 1, 2}, {20, 0}, { 1, 1}, { 1, 2}, /* Row 1 */ + {18, 0}, { 1, 1}, { 2, 2}, {19, 0}, { 1, 1}, { 2, 2}, /* Row 2 */ + {17, 0}, { 1, 1}, { 3, 2}, {18, 0}, { 1, 1}, { 3, 2}, /* Row 3 */ + {16, 0}, { 1, 1}, { 4, 2}, {17, 0}, { 1, 1}, { 4, 2}, /* Row 4 */ + {15, 0}, { 1, 1}, { 5, 2}, {16, 0}, { 1, 1}, { 5, 2}, /* Row 5 */ + {14, 0}, { 1, 1}, { 6, 2}, {15, 0}, { 1, 1}, { 6, 2}, /* Row 6 */ + {13, 0}, { 1, 1}, { 7, 2}, {14, 0}, { 1, 1}, { 7, 2}, /* Row 7 */ + {12, 0}, { 1, 1}, { 8, 2}, {13, 0}, { 1, 1}, { 8, 2}, /* Row 8 */ + {11, 0}, { 1, 1}, { 9, 2}, {12, 0}, { 1, 1}, { 9, 2}, /* Row 9 */ + {10, 0}, { 1, 1}, {10, 2}, {11, 0}, { 1, 1}, {10, 2}, /* Row 10 */ + { 9, 0}, { 1, 1}, {11, 2}, {10, 0}, { 1, 1}, {11, 2}, /* Row 11 */ + { 8, 0}, { 1, 1}, {12, 2}, { 9, 0}, { 1, 1}, {12, 2}, /* Row 12 */ + { 7, 0}, { 1, 1}, {13, 2}, { 8, 0}, { 1, 1}, {13, 2}, /* Row 13 */ + { 6, 0}, { 1, 1}, {14, 2}, { 7, 0}, { 1, 1}, {14, 2}, /* Row 14 */ + { 5, 0}, { 1, 1}, {15, 2}, { 6, 0}, { 1, 1}, {15, 2}, /* Row 15 */ + { 4, 0}, { 1, 1}, {16, 2}, { 5, 0}, { 1, 1}, {16, 2}, /* Row 16 */ + { 3, 0}, { 1, 1}, {17, 2}, { 4, 0}, { 1, 1}, {17, 2}, /* Row 17 */ + { 2, 0}, { 1, 1}, {18, 2}, { 3, 0}, { 1, 1}, {18, 2}, /* Row 18 */ + { 1, 0}, { 1, 1}, {19, 2}, { 2, 0}, { 1, 1}, {19, 2}, /* Row 19 */ + {21, 1}, { 1, 0}, {21, 1}, /* Row 20 */ + { 1, 0}, {20, 3}, { 2, 0}, {20, 3}, /* Row 21 */ + { 2, 0}, {19, 3}, { 3, 0}, {19, 3}, /* Row 22 */ + { 3, 0}, {18, 3}, { 4, 0}, {18, 3}, /* Row 23 */ + { 4, 0}, {17, 3}, { 5, 0}, {17, 3}, /* Row 24 */ + { 5, 0}, {16, 3}, { 6, 0}, {16, 3}, /* Row 25 */ + { 6, 0}, {15, 3}, { 7, 0}, {15, 3}, /* Row 26 */ + { 7, 0}, {14, 3}, { 8, 0}, {14, 3}, /* Row 27 */ + { 8, 0}, {13, 3}, { 9, 0}, {13, 3}, /* Row 28 */ + { 9, 0}, {12, 3}, {10, 0}, {12, 3}, /* Row 29 */ + {10, 0}, {11, 3}, {11, 0}, {11, 3}, /* Row 30 */ + {11, 0}, {10, 3}, {12, 0}, {10, 3}, /* Row 31 */ + {12, 0}, { 9, 3}, {13, 0}, { 9, 3}, /* Row 32 */ + {13, 0}, { 8, 3}, {14, 0}, { 8, 3}, /* Row 33 */ + {14, 0}, { 7, 3}, {15, 0}, { 7, 3}, /* Row 34 */ + {15, 0}, { 6, 3}, {16, 0}, { 6, 3}, /* Row 35 */ + {16, 0}, { 5, 3}, {17, 0}, { 5, 3}, /* Row 36 */ + {17, 0}, { 4, 3}, {18, 0}, { 4, 3}, /* Row 37 */ + {18, 0}, { 3, 3}, {19, 0}, { 3, 3}, /* Row 38 */ + {19, 0}, { 2, 3}, {20, 0}, { 2, 3}, /* Row 39 */ + {20, 0}, { 1, 3}, {21, 0}, { 1, 3} /* Row 40 */ }; /* Bitmap definition for the "Pause" button */ static const struct NXWidgets::SRlePaletteBitmapEntry g_pauseRleEntries[] = { - { 2, 1}, { 5, 0}, {14, 1}, /* Row 0 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 1 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 2 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 3 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 4 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 5 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 6 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 7 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 8 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 9 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 10 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 11 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 12 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 13 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 14 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 15 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 16 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 17 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 18 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 19 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 20 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 21 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 22 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 23 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 24 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 25 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 26 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 27 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 28 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 29 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 30 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 31 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 32 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 33 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 34 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 35 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 36 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 37 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 38 */ - { 2, 1}, { 5, 0}, {14, 1}, /* Row 39 */ - { 2, 1}, { 5, 0}, {14, 1} /* Row 40 */ + {12, 0}, { 6, 1}, { 7, 0}, { 6, 1}, {12, 0}, /* Row 0 */ + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 1 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 2 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 3 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 4 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 5 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 6 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 7 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 8 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 9 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 10 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 11 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 12 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 13 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 14 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 15 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 16 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 17 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 18 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 19 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 20 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 21 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 22 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 23 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 24 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 25 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 26 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 27 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 28 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 29 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 30 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 31 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 32 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 33 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 34 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 35 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 36 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 37 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 38 */ + { 1, 1}, { 3, 3}, {11, 0}, + {11, 0}, { 1, 1}, { 3, 2}, { 1, 1}, { 3, 3}, { 5, 0}, { 1, 1}, { 3, 2}, /* Row 39 */ + { 1, 1}, { 3, 3}, {11, 0}, + {12, 0}, { 6, 3}, { 7, 0}, { 6, 3}, {12, 0} /* Row 40 */ }; /******************************************************************************************** From 541a92146a0ee63b40c69936618afc5cb69ad581 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 08:41:19 -0600 Subject: [PATCH 210/390] NxWM::CMediaPlay: Now receives button events --- nxwm/include/cmediaplayer.hxx | 24 +++++++-- nxwm/src/cmediaplayer.cxx | 92 +++++++++++++++++++++++++++++++++-- 2 files changed, 109 insertions(+), 7 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index eff13067a..7f909f478 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -79,20 +79,36 @@ namespace NxWM private NXWidgets::CWidgetEventHandler { private: + /** + * This enumeration identifies the state of the media player + */ + + enum EMediaPlayerState + { + MPLAYER_STOPPED = 0, /**< No media file has been selected */ + MPLAYER_PLAYING, /**< Playing a media file */ + MPLAYER_PAUSED, /**< Playing a media file but paused */ + MPLAYER_FFORWARD, /**< Fast forwarding through a media file */ + MPLAYER_FREWIND, /**< Rewinding a media file */ + }; + /** * The structure defines a pending operation. */ struct SPendingOperation { - int64_t value; /**< Accumulated value */ - uint8_t operation; /**< Identifies the operations */ + int64_t value; /**< Accumulated value */ + uint8_t operation; /**< Identifies the operations */ }; /** * Media player state data. */ + enum EMediaPlayerState m_state; /**< Media player current state */ + enum EMediaPlayerState m_prevState; /**< Media player previous state */ + /** * Cached constructor parameters. */ @@ -147,8 +163,8 @@ namespace NxWM void close(void); /** - * Handle a widget action event. For CImage, this is a button pre- - * release event. + * Handle a widget action event. This includes a button pre/release + * release events and volume slider change events. * * @param e The event data. */ diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 1190cee19..8e0f41585 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -90,6 +90,10 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_text = (NXWidgets::CLabel *)0; m_font = (NXWidgets::CNxFont *)0; + // Initial state is stopped + + m_state = MPLAYER_STOPPED; + // Add our personalized window label NXWidgets::CNxString myName = getName(); @@ -427,7 +431,7 @@ bool CMediaPlayer::createPlayer(void) buttonH += 8; - // Create the Play Image + // Create the Play image nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playButtonW >> 1); uint32_t controlY = (180 * m_windowSize.h) >> 8; @@ -436,6 +440,8 @@ bool CMediaPlayer::createPlayer(void) CImage(control, playControlX, (nxgl_coord_t)controlY, playButtonW, buttonH, playBitmap); + // Configure the Play image + m_playPause->alignHorizontalCenter(); m_playPause->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -444,7 +450,11 @@ bool CMediaPlayer::createPlayer(void) m_playPause->setBorderless(false); #endif - // Create the Rewind Image + // Register to get events from the mouse clicks on the Play image + + m_playPause->addWidgetEventHandler(this); + + // Create the Rewind image nxgl_coord_t rewControlX = playControlX - rewButtonW - CONFIG_NXWM_MEDIAPLAYER_XSPACING; @@ -453,6 +463,8 @@ bool CMediaPlayer::createPlayer(void) CImage(control, rewControlX, (nxgl_coord_t)controlY, rewButtonW, buttonH, rewBitmap); + // Configure the Rewind image + m_rew->alignHorizontalCenter(); m_rew->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -461,6 +473,10 @@ bool CMediaPlayer::createPlayer(void) m_rew->setBorderless(false); #endif + // Register to get events from the mouse clicks on the Rewind image + + m_rew->addWidgetEventHandler(this); + // Create the Forward Image nxgl_coord_t fwdControlX = playControlX + playButtonW + @@ -471,6 +487,8 @@ bool CMediaPlayer::createPlayer(void) fwdButtonW, buttonH, fwdBitmap); + // Configure the Forward image + m_fwd->alignHorizontalCenter(); m_fwd->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -479,6 +497,10 @@ bool CMediaPlayer::createPlayer(void) m_fwd->setBorderless(false); #endif + // Register to get events from the mouse clicks on the Forward image + + m_fwd->addWidgetEventHandler(this); + // Create the Volume control NXWidgets::CRlePaletteBitmap *volBitmap = new NXWidgets:: @@ -495,10 +517,16 @@ bool CMediaPlayer::createPlayer(void) volBitmap->getHeight() + 4, volBitmap, MKRGB(63, 90,192)); + // Configure the volume control + m_volume->setMinimumValue(0); m_volume->setMaximumValue(100); m_volume->setValue(15); + // Register to get events from the mouse clicks on the Forward image + + m_volume->addWidgetEventHandler(this); + return true; } @@ -529,7 +557,65 @@ void CMediaPlayer::close(void) void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - /* Nothing here yet! Coming soon! */ + // Check is a media file has been selected. Do nothing if there is + // no media file. + + if (m_playPause->isClicked()) + { + printf("Play/pause clicked\n"); + + if (m_state == MPLAYER_PLAYING) + { + printf("Media player is now paused\n"); + m_state = MPLAYER_PAUSED; + m_prevState = MPLAYER_PAUSED; + } + else + { + printf("Media player is now playing\n"); + m_state = MPLAYER_PLAYING; + m_prevState = MPLAYER_PLAYING; + } + } + + if (m_rew->isClicked()) + { + printf("Rewind clicked\n"); + + if (m_state == MPLAYER_FREWIND) + { + // Or increase rewind speed? + printf("Reverting to previous Play/Pause state\n"); + m_state = m_prevState; + } + else + { + printf("Rewinding...\n"); + m_state = MPLAYER_FREWIND; + } + } + + if (m_fwd->isClicked()) + { + printf("Forward clicked\n"); + + if (m_state == MPLAYER_FFORWARD) + { + // Or increase fast forward speed? + printf("Reverting to previous Play/Pause state\n"); + m_state = m_prevState; + } + else + { + printf("Fast forwarding...\n"); + m_state = MPLAYER_FFORWARD; + } + } + + if (m_volume->isClicked()) + { + printf("Volume clicked\n"); + } } /** From 4d85753cf247ce69357b2eece7af7ede8266c201 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 09:29:28 -0600 Subject: [PATCH 211/390] NxWidgets::CStickyImage: New image class --- libnxwidgets/Makefile | 5 +- libnxwidgets/include/cimage.hxx | 25 +++- libnxwidgets/include/cstickyimage.hxx | 190 ++++++++++++++++++++++++++ libnxwidgets/src/cimage.cxx | 37 ++++- libnxwidgets/src/cstickyimage.cxx | 120 ++++++++++++++++ 5 files changed, 368 insertions(+), 9 deletions(-) create mode 100644 libnxwidgets/include/cstickyimage.hxx create mode 100644 libnxwidgets/src/cstickyimage.cxx diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 5ef061339..30b4b8583 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/libnxwidgets/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -64,7 +64,8 @@ CXXSRCS += cprogressbar.cxx cradiobutton.cxx cradiobuttongroup.cxx cscrollbarhor CXXSRCS += cscrollbarpanel.cxx cscrollbarvertical.cxx cscrollinglistbox.cxx CXXSRCS += cscrollingpanel.cxx cscrollingtextbox.cxx csliderhorizontal.cxx CXXSRCS += csliderhorizontalgrip.cxx cslidervertical.cxx csliderverticalgrip.cxx -CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx ctabpanel.cxx ctextbox.cxx +CXXSRCS += cstickybutton.cxx cstickybuttonarray.cxx cstickyimage.cxx ctabpanel.cxx +CXXSRCS += ctextbox.cxx # Images CXXSRCS += glyph_nxlogo160x160.cxx glyph_nxlogo320x320.cxx CXXSRCS += glyph_arrowdown.cxx glyph_checkboxon.cxx glyph_screendepthup.cxx diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index 9daf9f260..e485f6d9d 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -113,6 +113,17 @@ namespace NXWidgets struct nxgl_point_s m_origin; /**< Origin for offset image display position */ bool m_highlighted; /**< Image is highlighted */ + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the drawContents(port) and by classes that inherit from + * CImage. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + void drawContents(CGraphicsPort *port, bool selected); + /** * Draw the area of this widget that falls within the clipping region. * Called by the redraw() function to draw all visible regions. @@ -124,8 +135,18 @@ namespace NXWidgets virtual void drawContents(CGraphicsPort *port); /** - * Draw the area of this widget that falls within the clipping region. - * Called by the redraw() function to draw all visible regions. + * Draw the border of this widget. Called by the indirectly via + * drawBoard(port) and also by classes that inherit from CImage. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + void drawBorder(CGraphicsPort *port, bool selected); + + /** + * Draw the border of this widget. Called by the redraw() function to draw + * all visible regions. * * @param port The CGraphicsPort to draw to. * @see redraw() diff --git a/libnxwidgets/include/cstickyimage.hxx b/libnxwidgets/include/cstickyimage.hxx new file mode 100644 index 000000000..d89069453 --- /dev/null +++ b/libnxwidgets/include/cstickyimage.hxx @@ -0,0 +1,190 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/include/cimagebutton.hxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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 __INCLUDE_CSTICKIMAGE_HXX +#define __INCLUDE_CSTICKIMAGE_HXX + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include + +#include "cimage.hxx" +#include "cwidgetstyle.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Implementation Classes + ****************************************************************************/ + +#if defined(__cplusplus) + +namespace NXWidgets +{ + class CWidgetControl; + + /** + * CImage that sticks in the selected selected state when clicked. + */ + + class CStickyImage : public CImage + { + protected: + bool m_stuckSelection; /**< True if the image is stuck in the selected */ + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawContents(CGraphicsPort *port); + + /** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + + virtual void drawBorder(CGraphicsPort *port); + + /** + * Don't redraw on click events. The image state is completely controlled + * by the m_stuckSelection state. + * + * @param x The x coordinate of the click. + * @param y The y coordinate of the click. + */ + + virtual void onClick(nxgl_coord_t x, nxgl_coord_t y) {} + + /** + * Don't redraw on release events. The image state is completely controlled + * by the m_stuckSelection state. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Don't redraw on release events. The image state is completely controlled + * by the m_stuckSelection state. + * + * @param x The x coordinate of the mouse. + * @param y The y coordinate of the mouse. + */ + + virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { } + + /** + * Copy constructor is protected to prevent usage. + */ + + inline CStickyImage(const CStickyImage &button) : CImage(button) { } + + public: + + /** + * Constructor for an image. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the image box, relative to its parent. + * @param y The y coordinate of the image box, relative to its parent. + * @param width The width of the image box. + * @param height The height of the image box. + * @param bitmap The source bitmap image. + * @param style The style that the widget should use. If this is not + * specified, the button will use the global default widget + * style. + */ + + CStickyImage(CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, FAR IBitmap *bitmap, + CWidgetStyle *style = (CWidgetStyle *)NULL); + + /** + * Destructor. + */ + + virtual inline ~CStickyImage(void) { } + + /** + * Sets the image's stuck selection state. + * + * @param selection The new stuck selection state. + */ + + void setStuckSelection(bool selection); + + /** + * Toggles the images stuck selection state. + */ + + inline void toggleStuckSelection(void) + { + setStuckSelection(!m_stuckSelection); + } + + /** + * Returns the stuck selection state. + * + * @return True is the button is in the stuck selection state. + */ + + inline const bool isStuckSelection(void) const + { + return m_stuckSelection; + } + }; +} + +#endif // __cplusplus + +#endif // __INCLUDE_CSTICKIMAGE_HXX diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index eb7e5157f..1140df35d 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -165,13 +165,14 @@ void CImage::getPreferredDimensions(CRect &rect) const /** * Draw the area of this widget that falls within the clipping region. - * Called by the redraw() function to draw all visible regions. + * Called by the drawContents(port) and by classes that inherit from + * CImage. * * @param port The CGraphicsPort to draw to. * @see redraw() */ -void CImage::drawContents(CGraphicsPort *port) +void CImage::drawContents(CGraphicsPort *port, bool selected) { if (!m_bitmap) { @@ -201,7 +202,7 @@ void CImage::drawContents(CGraphicsPort *port) // Select the correct colorization - m_bitmap->setSelected(isClicked() || m_highlighted); + m_bitmap->setSelected(selected || m_highlighted); // This is the end row + 1 that we can write into @@ -349,7 +350,20 @@ void CImage::drawContents(CGraphicsPort *port) * @see redraw() */ -void CImage::drawBorder(CGraphicsPort *port) +void CImage::drawContents(CGraphicsPort *port) +{ + drawContents(port, isClicked()); +} + +/** + * Draw the border of this widget. Called by the indirectly via + * drawBoard(port) and also by classes that inherit from CImage. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CImage::drawBorder(CGraphicsPort *port, bool selected) { // Stop drawing if the widget indicates it should not have an outline @@ -363,7 +377,7 @@ void CImage::drawBorder(CGraphicsPort *port) nxgl_coord_t color1; nxgl_coord_t color2; - if (isClicked()) + if (selected) { // Bevelled into the screen @@ -381,6 +395,19 @@ void CImage::drawBorder(CGraphicsPort *port) port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2); } +/** + * Draw the border of this widget. Called by the redraw() function to draw + * all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CImage::drawBorder(CGraphicsPort *port) +{ + drawBorder(port, isClicked()); +} + /** * Control the highlight state. * diff --git a/libnxwidgets/src/cstickyimage.cxx b/libnxwidgets/src/cstickyimage.cxx new file mode 100644 index 000000000..a4f9c6849 --- /dev/null +++ b/libnxwidgets/src/cstickyimage.cxx @@ -0,0 +1,120 @@ +/**************************************************************************** + * NxWidgets/libnxwidgets/src/cstickyimage.cxx + * + * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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, NxWidgets, nor the names of its contributors + * me 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "cstickyimage.hxx" +#include "cgraphicsport.hxx" + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * CImage Method Implementations + ****************************************************************************/ + +using namespace NXWidgets; + +/** + * Constructor for an image. + * + * @param pWidgetControl The controlling widget for the display + * @param x The x coordinate of the image box, relative to its parent. + * @param y The y coordinate of the image box, relative to its parent. + * @param width The width of the image box. + * @param height The height of the image box. + * @param bitmap The source bitmap image. + * @param style The style that the widget should use. If this is not + * specified, the button will use the global default widget + * style. + */ + +CStickyImage::CStickyImage(CWidgetControl *pWidgetControl, + nxgl_coord_t x, nxgl_coord_t y, + nxgl_coord_t width, nxgl_coord_t height, + FAR IBitmap *bitmap, CWidgetStyle *style) +: CImage(pWidgetControl, x, y, width, height, bitmap, style) +{ + m_stuckSelection = false; +} + +/** + * Sets the image's stuck selection state. + * + * @param selection The new stuck selection state. + */ + +void CStickyImage::setStuckSelection(bool selection) +{ + m_stuckSelection = selection; + redraw(); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CStickyImage::drawContents(CGraphicsPort *port) +{ + CImage::drawContents(port, m_stuckSelection); +} + +/** + * Draw the area of this widget that falls within the clipping region. + * Called by the redraw() function to draw all visible regions. + * + * @param port The CGraphicsPort to draw to. + * @see redraw() + */ + +void CStickyImage::drawBorder(CGraphicsPort *port) +{ + CImage::drawBorder(port, m_stuckSelection); +} From 0dceeb81b446f452d3343d44ec49bf952d295e1f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 09:31:00 -0600 Subject: [PATCH 212/390] Update ChangeLog --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2e8580fe9..130c21305 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -457,3 +457,5 @@ widget region (2014-7-14). * NxWM::CMediaPlayer now uses the new CImage methods to align media controls in buttons (2014-7-14). +* NxWidgets::CStickyImage: A version of CImage that sticks in the selected + state when clicked (2014-7-15). From e38731585d61c609fa46fe8f5838fb4a4aed2bea Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 09:48:47 -0600 Subject: [PATCH 213/390] NxWM::CMediaPlayer: Now uses CStickyImages for fast forward and rewind --- nxwm/include/cmediaplayer.hxx | 5 +++-- nxwm/src/cmediaplayer.cxx | 32 +++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 7f909f478..569ab8f44 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -47,6 +47,7 @@ #include #include "cimage.hxx" +#include "cstickyimage.hxx" #include "clabel.hxx" #include "cnxfont.hxx" #include "cglyphsliderhorizontal.hxx" @@ -122,9 +123,9 @@ namespace NxWM NXWidgets::CLabel *m_text; /**< Some text in the app for now */ NXWidgets::CNxFont *m_font; /**< The font used in the media player */ - NXWidgets::CImage *m_rew; /**< Rewind control */ + NXWidgets::CStickyImage *m_rew; /**< Rewind control */ NXWidgets::CImage *m_playPause; /**< Play/Pause control */ - NXWidgets::CImage *m_fwd; /**< Forward control */ + NXWidgets::CStickyImage *m_fwd; /**< Forward control */ NXWidgets::CGlyphSliderHorizontal *m_volume; /**< Volume control */ /** diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 8e0f41585..c57ed8dcc 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -460,8 +460,8 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_rew = new NXWidgets:: - CImage(control, rewControlX, (nxgl_coord_t)controlY, - rewButtonW, buttonH, rewBitmap); + CStickyImage(control, rewControlX, (nxgl_coord_t)controlY, + rewButtonW, buttonH, rewBitmap); // Configure the Rewind image @@ -483,9 +483,8 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_fwd = new NXWidgets:: - CImage(control, fwdControlX, (nxgl_coord_t)controlY, - fwdButtonW, buttonH, fwdBitmap); - + CStickyImage(control, fwdControlX, (nxgl_coord_t)controlY, + fwdButtonW, buttonH, fwdBitmap); // Configure the Forward image @@ -564,6 +563,8 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { printf("Play/pause clicked\n"); + // Playing or pausing? + if (m_state == MPLAYER_PLAYING) { printf("Media player is now paused\n"); @@ -576,6 +577,11 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) m_state = MPLAYER_PLAYING; m_prevState = MPLAYER_PLAYING; } + + // In any case, we are certainly no longer fast forwarding or rewinding + + m_rew->setStuckSelection(false); + m_fwd->setStuckSelection(false); } if (m_rew->isClicked()) @@ -587,12 +593,20 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Or increase rewind speed? printf("Reverting to previous Play/Pause state\n"); m_state = m_prevState; + + // Show that we are no longer rewinding + + m_rew->setStuckSelection(false); } else { printf("Rewinding...\n"); m_state = MPLAYER_FREWIND; } + + // In any case, we are certainly no longer fast forwarding + + m_fwd->setStuckSelection(false); } if (m_fwd->isClicked()) @@ -604,12 +618,20 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Or increase fast forward speed? printf("Reverting to previous Play/Pause state\n"); m_state = m_prevState; + + // Show that we are no longer fast forwarding + + m_fwd->setStuckSelection(false); } else { printf("Fast forwarding...\n"); m_state = MPLAYER_FFORWARD; } + + // In any case, we are certainly no longer rewinding + + m_rew->setStuckSelection(false); } if (m_volume->isClicked()) From 089bdf5c3277073cebb86adbca880d79973cecd8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 15:09:13 -0600 Subject: [PATCH 214/390] NxWM::CMediaPlayer: Some improved state management --- nxwm/include/cmediaplayer.hxx | 8 ++ nxwm/src/cmediaplayer.cxx | 255 ++++++++++++++++++++++++---------- 2 files changed, 189 insertions(+), 74 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 569ab8f44..7c7d55624 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -163,6 +163,14 @@ namespace NxWM void close(void); + /** + * Transition to a new media player state. + * + * @param state The new state to enter. + */ + + void setMediaPlayerState(enum EMediaPlayerState state); + /** * Handle a widget action event. This includes a button pre/release * release events and volume slider change events. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index c57ed8dcc..bb9266ccc 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -246,39 +246,12 @@ void CMediaPlayer::hide(void) void CMediaPlayer::redraw(void) { - char buffer[24]; + // Redraw widgets (only) - snprintf(buffer, 24, "Coming soon!"); - - // setText will perform the redraw as well - - m_text->setText(buffer); - - // Get the widget control associated with the application window - - NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - - // Get the CCGraphicsPort instance for this window - - NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); - - // Fill the entire window with the background color - - port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, - CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); - - // Enable and redraw widgets - - m_text->enableDrawing(); m_text->redraw(); - - m_rew->enableDrawing(); - m_rew->redraw(); - m_playPause->enableDrawing(); m_playPause->redraw(); - m_fwd->enableDrawing(); + m_rew->redraw(); m_fwd->redraw(); - m_volume->enableDrawing(); m_volume->redraw(); } @@ -368,6 +341,10 @@ bool CMediaPlayer::createPlayer(void) m_text->setFont(m_font); + // Add some dummy text for now + + m_text->setText("Coming soon..."); + // Create all bitmaps NXWidgets::CRlePaletteBitmap *playBitmap = new NXWidgets:: @@ -442,6 +419,7 @@ bool CMediaPlayer::createPlayer(void) // Configure the Play image + m_playPause->disableDrawing(); m_playPause->alignHorizontalCenter(); m_playPause->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -465,6 +443,7 @@ bool CMediaPlayer::createPlayer(void) // Configure the Rewind image + m_rew->disableDrawing(); m_rew->alignHorizontalCenter(); m_rew->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -488,6 +467,7 @@ bool CMediaPlayer::createPlayer(void) // Configure the Forward image + m_fwd->disableDrawing(); m_fwd->alignHorizontalCenter(); m_fwd->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS @@ -518,6 +498,7 @@ bool CMediaPlayer::createPlayer(void) // Configure the volume control + m_volume->disableDrawing(); m_volume->setMinimumValue(0); m_volume->setMaximumValue(100); m_volume->setValue(15); @@ -526,6 +507,32 @@ bool CMediaPlayer::createPlayer(void) m_volume->addWidgetEventHandler(this); + // Make sure that all widgets are setup for the STOPPED state + + setMediaPlayerState(MPLAYER_STOPPED); + + // Redraw the background once only + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, + CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); + + // Enable drawing of all widgets + + m_text->enableDrawing(); + m_playPause->enableDrawing(); + m_rew->enableDrawing(); + m_fwd->enableDrawing(); + m_volume->enableDrawing(); + + // And redraw them + + redraw(); + return true; } @@ -547,6 +554,105 @@ void CMediaPlayer::close(void) m_taskbar->stopApplication(static_cast(this)); } +/** + * Transition to a new media player state. + * + * @param state The new state to enter. + */ + +void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) +{ + // Handle according to the new state + + switch (state) + { + case MPLAYER_STOPPED: // Initial state. Also the state after playing completes + m_state = MPLAYER_STOPPED; + + m_text->enable(); + + m_playPause->enable(); + + m_fwd->disable(); + m_fwd->setStuckSelection(false); + + m_rew->disable(); + m_rew->setStuckSelection(false); + + m_volume->enable(); + break; + + case MPLAYER_PLAYING: // Playing a media file + m_state = MPLAYER_PLAYING; + m_prevState = MPLAYER_PLAYING; + + m_text->disable(); + + m_playPause->enable(); + + m_fwd->enable(); + m_fwd->setStuckSelection(false); + + m_rew->enable(); + m_rew->setStuckSelection(false); + + m_volume->enable(); + break; + + case MPLAYER_PAUSED: // Playing a media file but paused + m_state = MPLAYER_PAUSED; + m_prevState = MPLAYER_PAUSED; + + m_text->enable(); + + m_playPause->enable(); + + m_fwd->enable(); + m_fwd->setStuckSelection(false); + + m_rew->enable(); + m_rew->setStuckSelection(false); + + m_volume->enable(); + break; + + case MPLAYER_FFORWARD: // Fast forwarding through a media file */ + m_state = MPLAYER_FFORWARD; + + m_text->disable(); + + m_playPause->enable(); + + m_fwd->enable(); + m_fwd->setStuckSelection(true); + + m_rew->enable(); + m_rew->setStuckSelection(false); + + m_volume->enable(); + break; + + case MPLAYER_FREWIND: // Rewinding a media file + m_state = MPLAYER_FREWIND; + + m_text->disable(); + + m_playPause->enable(); + + m_fwd->enable(); + m_fwd->setStuckSelection(false); + + m_rew->enable(); + m_rew->setStuckSelection(true); + + m_volume->enable(); + break; + + default: + break; + } +} + /** * Handle a widget action event. For CButtonArray, this is a button pre- * release event. @@ -556,87 +662,88 @@ void CMediaPlayer::close(void) void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - // Check is a media file has been selected. Do nothing if there is - // no media file. + // Check if the Play/Pause button was clicked if (m_playPause->isClicked()) { - printf("Play/pause clicked\n"); - - // Playing or pausing? + // Were we playing before? if (m_state == MPLAYER_PLAYING) { - printf("Media player is now paused\n"); - m_state = MPLAYER_PAUSED; - m_prevState = MPLAYER_PAUSED; + // Yes.. then now we are now paused + + setMediaPlayerState(MPLAYER_PAUSED); } + + // Were we paused or stopped before? + + else if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) + { + // Yes... then now we are playing + + setMediaPlayerState(MPLAYER_PLAYING); + } + + // If the play/pause button was pressed while were were fast + // forwarding or rewinding, then revert back to the previous + // play/pause state. + + else { - printf("Media player is now playing\n"); - m_state = MPLAYER_PLAYING; - m_prevState = MPLAYER_PLAYING; + setMediaPlayerState(m_prevState); } - - // In any case, we are certainly no longer fast forwarding or rewinding - - m_rew->setStuckSelection(false); - m_fwd->setStuckSelection(false); } + // Check if the rewind button was clicked + if (m_rew->isClicked()) { - printf("Rewind clicked\n"); + // Were we already rewinding? if (m_state == MPLAYER_FREWIND) { - // Or increase rewind speed? - printf("Reverting to previous Play/Pause state\n"); - m_state = m_prevState; + // Yes.. then revert to the previous play/pause state + // REVISIT: Or just increase rewind speed? - // Show that we are no longer rewinding - - m_rew->setStuckSelection(false); + setMediaPlayerState(m_prevState); } - else + + // We should not be stopped here, but let's check anyway + + else if (m_state != MPLAYER_STOPPED) { - printf("Rewinding...\n"); - m_state = MPLAYER_FREWIND; + // Start rewinding + + setMediaPlayerState(MPLAYER_FREWIND); } - - // In any case, we are certainly no longer fast forwarding - - m_fwd->setStuckSelection(false); } if (m_fwd->isClicked()) { - printf("Forward clicked\n"); + // Were we already fast forwarding? if (m_state == MPLAYER_FFORWARD) { - // Or increase fast forward speed? - printf("Reverting to previous Play/Pause state\n"); - m_state = m_prevState; + // Yes.. then revert to the previous play/pause state + // REVISIT: Or just increase fast forward speed? - // Show that we are no longer fast forwarding - - m_fwd->setStuckSelection(false); + setMediaPlayerState(m_prevState); } - else + + // We should not be stopped here, but let's check anyway + + else if (m_state != MPLAYER_STOPPED) { - printf("Fast forwarding...\n"); - m_state = MPLAYER_FFORWARD; + // Start fast forwarding + + setMediaPlayerState(MPLAYER_FFORWARD); } - - // In any case, we are certainly no longer rewinding - - m_rew->setStuckSelection(false); } if (m_volume->isClicked()) { - printf("Volume clicked\n"); +printf("Volume clicked\n"); // REMOVE ME } } From 4961279f28bafcd7fb91b071bdcd331a0cd59a53 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 17:33:59 -0600 Subject: [PATCH 215/390] NxMW::CMediaPlayer now supports a pause button --- libnxwidgets/include/cscrollingtextbox.hxx | 2 +- nxwm/include/cmediaplayer.hxx | 7 +- nxwm/src/cmediaplayer.cxx | 402 ++++++++++++++------- 3 files changed, 285 insertions(+), 126 deletions(-) diff --git a/libnxwidgets/include/cscrollingtextbox.hxx b/libnxwidgets/include/cscrollingtextbox.hxx index 8aedc09a9..e67277ff0 100644 --- a/libnxwidgets/include/cscrollingtextbox.hxx +++ b/libnxwidgets/include/cscrollingtextbox.hxx @@ -109,7 +109,7 @@ namespace NXWidgets */ class CScrollingTextBox : public ITextBox, public CNxWidget, - public IScrollable, public CWidgetEventHandler + public IScrollable, public CWidgetEventHandler { protected: CMultiLineTextBox *m_texbox; /**< Pointer to the textbox */ diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 7c7d55624..1e9b5a190 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -123,9 +123,10 @@ namespace NxWM NXWidgets::CLabel *m_text; /**< Some text in the app for now */ NXWidgets::CNxFont *m_font; /**< The font used in the media player */ - NXWidgets::CStickyImage *m_rew; /**< Rewind control */ - NXWidgets::CImage *m_playPause; /**< Play/Pause control */ - NXWidgets::CStickyImage *m_fwd; /**< Forward control */ + NXWidgets::CImage *m_play; /**< Play control */ + NXWidgets::CImage *m_pause; /**< Pause control */ + NXWidgets::CStickyImage *m_rewind; /**< Rewind control */ + NXWidgets::CStickyImage *m_fforward; /**< Fast forward control */ NXWidgets::CGlyphSliderHorizontal *m_volume; /**< Volume control */ /** diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index bb9266ccc..f1990f87a 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -246,12 +246,14 @@ void CMediaPlayer::hide(void) void CMediaPlayer::redraw(void) { - // Redraw widgets (only) + // Redraw widgets (only). Only one of the Play and Pause buttons should + // have drawing enabled. m_text->redraw(); - m_playPause->redraw(); - m_rew->redraw(); - m_fwd->redraw(); + m_play->redraw(); + m_pause->redraw(); + m_rewind->redraw(); + m_fforward->redraw(); m_volume->redraw(); } @@ -350,6 +352,9 @@ bool CMediaPlayer::createPlayer(void) NXWidgets::CRlePaletteBitmap *playBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); + NXWidgets::CRlePaletteBitmap *pauseBitmap = new NXWidgets:: + CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PAUSE_ICON); + NXWidgets::CRlePaletteBitmap *rewBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); @@ -359,6 +364,7 @@ bool CMediaPlayer::createPlayer(void) // Button widths will depend on if the buttons will be bordered or not nxgl_coord_t playButtonW; + nxgl_coord_t pauseButtonW; nxgl_coord_t rewButtonW; nxgl_coord_t fwdButtonW; @@ -367,6 +373,11 @@ bool CMediaPlayer::createPlayer(void) nxgl_coord_t buttonW = playBitmap->getWidth(); + if (buttonW < pauseBitmap->getWidth()) + { + buttonW = pauseBitmap->getWidth(); + } + if (buttonW < rewBitmap->getWidth()) { buttonW = rewBitmap->getWidth(); @@ -379,23 +390,42 @@ bool CMediaPlayer::createPlayer(void) // Add little space around the bitmap and use this width for all buttons - buttonW += 8; - playButtonW = buttonW; - rewButtonW = buttonW; - fwdButtonW = buttonW; + buttonW += 8; + playButtonW = buttonW; + pauseButtonW = buttonW; + rewButtonW = buttonW; + fwdButtonW = buttonW; #else // Use the bitmap image widths for the button widths (plus a bit) - playButtonW = playBitmap->getWidth() + 8; - rewButtonW = rewBitmap->getWidth() + 8; - fwdButtonW = fwdBitmap->getWidth() + 8; + playButtonW = playBitmap->getWidth() + 8; + pauseButtonW = pauseBitmap->getWidth() + 8; + rewButtonW = rewBitmap->getWidth() + 8; + fwdButtonW = fwdBitmap->getWidth() + 8; + + // The Play and Pause buttons should be the same width. But just + // in case, pick the larger width. + + if (playButtonW < pauseButtonW) + { + playButtonW = pauseButtonW; + } + else + { + pauseButtonW = playButtonW; + } #endif // Use the same height for all buttons nxgl_coord_t buttonH = playBitmap->getHeight(); + if (buttonH < pauseBitmap->getHeight()) + { + buttonH = pauseBitmap->getHeight(); + } + if (buttonH < rewBitmap->getHeight()) { buttonH = rewBitmap->getHeight(); @@ -413,72 +443,93 @@ bool CMediaPlayer::createPlayer(void) nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playButtonW >> 1); uint32_t controlY = (180 * m_windowSize.h) >> 8; - m_playPause = new NXWidgets:: + m_play = new NXWidgets:: CImage(control, playControlX, (nxgl_coord_t)controlY, playButtonW, buttonH, playBitmap); // Configure the Play image - m_playPause->disableDrawing(); - m_playPause->alignHorizontalCenter(); - m_playPause->alignVerticalCenter(); + m_play->disableDrawing(); + m_play->alignHorizontalCenter(); + m_play->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS - m_playPause->setBorderless(true); + m_play->setBorderless(true); #else - m_playPause->setBorderless(false); + m_play->setBorderless(false); #endif // Register to get events from the mouse clicks on the Play image - m_playPause->addWidgetEventHandler(this); + m_play->addWidgetEventHandler(this); + + // Create the Pause image (at the same position ans size as the Play image) + + m_pause = new NXWidgets:: + CImage(control, playControlX, (nxgl_coord_t)controlY, + playButtonW, buttonH, pauseBitmap); + + // Configure the Pause image (hidden and disabled initially) + + m_pause->disableDrawing(); + m_pause->alignHorizontalCenter(); + m_pause->alignVerticalCenter(); +#ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS + m_pause->setBorderless(true); +#else + m_pause->setBorderless(false); +#endif + + // Register to get events from the mouse clicks on the Pause image + + m_pause->addWidgetEventHandler(this); // Create the Rewind image nxgl_coord_t rewControlX = playControlX - rewButtonW - CONFIG_NXWM_MEDIAPLAYER_XSPACING; - m_rew = new NXWidgets:: + m_rewind = new NXWidgets:: CStickyImage(control, rewControlX, (nxgl_coord_t)controlY, rewButtonW, buttonH, rewBitmap); // Configure the Rewind image - m_rew->disableDrawing(); - m_rew->alignHorizontalCenter(); - m_rew->alignVerticalCenter(); + m_rewind->disableDrawing(); + m_rewind->alignHorizontalCenter(); + m_rewind->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS - m_rew->setBorderless(true); + m_rewind->setBorderless(true); #else - m_rew->setBorderless(false); + m_rewind->setBorderless(false); #endif // Register to get events from the mouse clicks on the Rewind image - m_rew->addWidgetEventHandler(this); + m_rewind->addWidgetEventHandler(this); // Create the Forward Image nxgl_coord_t fwdControlX = playControlX + playButtonW + CONFIG_NXWM_MEDIAPLAYER_XSPACING; - m_fwd = new NXWidgets:: + m_fforward = new NXWidgets:: CStickyImage(control, fwdControlX, (nxgl_coord_t)controlY, fwdButtonW, buttonH, fwdBitmap); // Configure the Forward image - m_fwd->disableDrawing(); - m_fwd->alignHorizontalCenter(); - m_fwd->alignVerticalCenter(); + m_fforward->disableDrawing(); + m_fforward->alignHorizontalCenter(); + m_fforward->alignVerticalCenter(); #ifndef CONFIG_NXWM_MEDIAPLAYER_BORDERS - m_fwd->setBorderless(true); + m_fforward->setBorderless(true); #else - m_fwd->setBorderless(false); + m_fforward->setBorderless(false); #endif // Register to get events from the mouse clicks on the Forward image - m_fwd->addWidgetEventHandler(this); + m_fforward->addWidgetEventHandler(this); // Create the Volume control @@ -507,10 +558,6 @@ bool CMediaPlayer::createPlayer(void) m_volume->addWidgetEventHandler(this); - // Make sure that all widgets are setup for the STOPPED state - - setMediaPlayerState(MPLAYER_STOPPED); - // Redraw the background once only // Get the CCGraphicsPort instance for this window @@ -521,15 +568,19 @@ bool CMediaPlayer::createPlayer(void) port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); - // Enable drawing of all widgets + // Make sure that all widgets are setup for the STOPPED state. Among other this, + // this will enable drawing in the play widget (only) + + setMediaPlayerState(MPLAYER_STOPPED); + + // Enable drawing in the text, rewind, fast-forward and drawing widgets. m_text->enableDrawing(); - m_playPause->enableDrawing(); - m_rew->enableDrawing(); - m_fwd->enableDrawing(); + m_rewind->enableDrawing(); + m_fforward->enableDrawing(); m_volume->enableDrawing(); - // And redraw them + // And redraw all of the widgets that are enabled redraw(); @@ -568,16 +619,33 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) { case MPLAYER_STOPPED: // Initial state. Also the state after playing completes m_state = MPLAYER_STOPPED; + m_prevState = MPLAYER_PLAYING; + + // Text box is enabled and ready for text entry m_text->enable(); - m_playPause->enable(); + // Play button enabled and ready to start playing - m_fwd->disable(); - m_fwd->setStuckSelection(false); + m_play->enable(); + m_play->show(); + m_play->enableDrawing(); - m_rew->disable(); - m_rew->setStuckSelection(false); + // Pause button is disabled and hidden + + m_pause->disableDrawing(); + m_pause->disable(); + m_pause->hide(); + + // Fast forward button is disabled + + m_fforward->disable(); + m_fforward->setStuckSelection(false); + + // Rewind button is disabled + + m_rewind->disable(); + m_rewind->setStuckSelection(false); m_volume->enable(); break; @@ -586,15 +654,31 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_state = MPLAYER_PLAYING; m_prevState = MPLAYER_PLAYING; + // Text box is not available while playing + m_text->disable(); - m_playPause->enable(); + // Play button hidden and disabled - m_fwd->enable(); - m_fwd->setStuckSelection(false); + m_play->disableDrawing(); + m_play->disable(); + m_play->hide(); - m_rew->enable(); - m_rew->setStuckSelection(false); + // Pause button enabled and ready to pause playing + + m_pause->enable(); + m_pause->show(); + m_pause->enableDrawing(); + + // Fast forward button is enabled and ready for use + + m_fforward->enable(); + m_fforward->setStuckSelection(false); + + // Rewind button is enabled and ready for use + + m_rewind->enable(); + m_rewind->setStuckSelection(false); m_volume->enable(); break; @@ -603,15 +687,31 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_state = MPLAYER_PAUSED; m_prevState = MPLAYER_PAUSED; + // Text box is enabled a ready for text entry + m_text->enable(); - m_playPause->enable(); + // Play button enabled and ready to resume playing - m_fwd->enable(); - m_fwd->setStuckSelection(false); + m_play->enable(); + m_play->show(); + m_play->enableDrawing(); - m_rew->enable(); - m_rew->setStuckSelection(false); + // Pause button is disabled and hidden + + m_pause->disableDrawing(); + m_pause->disable(); + m_pause->hide(); + + // Fast forward button is enabled and ready for use + + m_fforward->enable(); + m_fforward->setStuckSelection(false); + + // Rewind button is enabled and ready for use + + m_rewind->enable(); + m_rewind->setStuckSelection(false); m_volume->enable(); break; @@ -619,15 +719,48 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) case MPLAYER_FFORWARD: // Fast forwarding through a media file */ m_state = MPLAYER_FFORWARD; + // Text box is not available while fast forwarding + m_text->disable(); - m_playPause->enable(); + if (m_prevState == MPLAYER_PLAYING) + { + // Play button enabled and ready to resume playing - m_fwd->enable(); - m_fwd->setStuckSelection(true); + m_play->enable(); + m_play->show(); + m_play->enableDrawing(); - m_rew->enable(); - m_rew->setStuckSelection(false); + // Pause button is hidden and disabled + + m_pause->disableDrawing(); + m_pause->disable(); + m_pause->hide(); + } + else + { + // Play button hidden and disabled + + m_play->disableDrawing(); + m_play->disable(); + m_play->hide(); + + // Pause button button enabled and ready to stop fast forwarding + + m_pause->enable(); + m_pause->show(); + m_pause->enableDrawing(); + } + + // Fast forward button is enabled, highlighted and ready for use + + m_fforward->enable(); + m_fforward->setStuckSelection(true); + + // Rewind is enabled and ready for use + + m_rewind->enable(); + m_rewind->setStuckSelection(false); m_volume->enable(); break; @@ -635,15 +768,48 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) case MPLAYER_FREWIND: // Rewinding a media file m_state = MPLAYER_FREWIND; + // Text box is not available while rewinding + m_text->disable(); - m_playPause->enable(); + if (m_prevState == MPLAYER_PLAYING) + { + // Play button enabled and ready to resume playing - m_fwd->enable(); - m_fwd->setStuckSelection(false); + m_play->enable(); + m_play->show(); + m_play->enableDrawing(); - m_rew->enable(); - m_rew->setStuckSelection(true); + // Pause button is hidden and disabled + + m_pause->disableDrawing(); + m_pause->disable(); + m_pause->hide(); + } + else + { + // Play button hidden and disabled + + m_play->disableDrawing(); + m_play->disable(); + m_play->hide(); + + // Pause button button enabled and ready to stop fast forwarding + + m_pause->enable(); + m_pause->show(); + m_pause->enableDrawing(); + } + + // Fast forward button is enabled and ready for use + + m_fforward->enable(); + m_fforward->setStuckSelection(false); + + // Rewind button is enabled, highlighted, and ready for use + + m_rewind->enable(); + m_rewind->setStuckSelection(true); m_volume->enable(); break; @@ -662,82 +828,74 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - // Check if the Play/Pause button was clicked + // Check if the Play button was clicked - if (m_playPause->isClicked()) + if (m_play->isClicked() && m_state != MPLAYER_PLAYING) { - // Were we playing before? + // Yes... then now we are playing - if (m_state == MPLAYER_PLAYING) + setMediaPlayerState(MPLAYER_PLAYING); + } + + // These only make sense in non-STOPPED states + + if (m_state != MPLAYER_STOPPED) + { + // Check if the Pause button was clicked + + if (m_pause->isClicked() && m_state != MPLAYER_PAUSED) { - // Yes.. then now we are now paused + // Yes... then now we are playing setMediaPlayerState(MPLAYER_PAUSED); } - // Were we paused or stopped before? + // Check if the rewind button was clicked - else if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) + if (m_rewind->isClicked()) { - // Yes... then now we are playing + // Were we already rewinding? - setMediaPlayerState(MPLAYER_PLAYING); + if (m_state == MPLAYER_FREWIND) + { + // Yes.. then revert to the previous play/pause state + // REVISIT: Or just increase rewind speed? + + setMediaPlayerState(m_prevState); + } + + // We should not be stopped here, but let's check anyway + + else if (m_state != MPLAYER_STOPPED) + { + // Start rewinding + + setMediaPlayerState(MPLAYER_FREWIND); + } } - // If the play/pause button was pressed while were were fast - // forwarding or rewinding, then revert back to the previous - // play/pause state. + // Check if the fast forward button was clicked - - else + if (m_fforward->isClicked()) { - setMediaPlayerState(m_prevState); - } - } + // Were we already fast forwarding? - // Check if the rewind button was clicked + if (m_state == MPLAYER_FFORWARD) + { + // Yes.. then revert to the previous play/pause state + // REVISIT: Or just increase fast forward speed? - if (m_rew->isClicked()) - { - // Were we already rewinding? + setMediaPlayerState(m_prevState); + } - if (m_state == MPLAYER_FREWIND) - { - // Yes.. then revert to the previous play/pause state - // REVISIT: Or just increase rewind speed? + // We should not be stopped here, but let's check anyway - setMediaPlayerState(m_prevState); - } + else if (m_state != MPLAYER_STOPPED) + { + // Start fast forwarding - // We should not be stopped here, but let's check anyway - - else if (m_state != MPLAYER_STOPPED) - { - // Start rewinding - - setMediaPlayerState(MPLAYER_FREWIND); - } - } - - if (m_fwd->isClicked()) - { - // Were we already fast forwarding? - - if (m_state == MPLAYER_FFORWARD) - { - // Yes.. then revert to the previous play/pause state - // REVISIT: Or just increase fast forward speed? - - setMediaPlayerState(m_prevState); - } - - // We should not be stopped here, but let's check anyway - - else if (m_state != MPLAYER_STOPPED) - { - // Start fast forwarding - - setMediaPlayerState(MPLAYER_FFORWARD); + setMediaPlayerState(MPLAYER_FFORWARD); + } } } From 84b1cee5f8bb28db80c9f6e39b061ed858fa48f4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 17:35:30 -0600 Subject: [PATCH 216/390] Update Changelog --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 130c21305..5c0d7ae1c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -459,3 +459,6 @@ in buttons (2014-7-14). * NxWidgets::CStickyImage: A version of CImage that sticks in the selected state when clicked (2014-7-15). +* NxMW::CMediaPlayer: Now supports a pause button. Initial check-in is not + rock solid (2014-7-15). + From 9ee647cabae90fdf68d25dd0c1e7f3ca283d69e2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 18:55:59 -0600 Subject: [PATCH 217/390] NxWM: Cosmetic changes to naming and comments --- libnxwidgets/include/cstickyimage.hxx | 8 +- libnxwidgets/include/cwidgeteventargs.hxx | 2 +- libnxwidgets/src/cnxwidget.cxx | 2 +- libnxwidgets/src/cstickyimage.cxx | 2 +- nxwm/include/cmediaplayer.hxx | 6 +- nxwm/src/cmediaplayer.cxx | 158 +++++++++++----------- 6 files changed, 88 insertions(+), 90 deletions(-) diff --git a/libnxwidgets/include/cstickyimage.hxx b/libnxwidgets/include/cstickyimage.hxx index d89069453..d73da53a2 100644 --- a/libnxwidgets/include/cstickyimage.hxx +++ b/libnxwidgets/include/cstickyimage.hxx @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/libnxwidgets/include/cimagebutton.hxx + * NxWidgets/libnxwidgets/include/cstickyimage.hxx * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -127,7 +127,7 @@ namespace NXWidgets * Copy constructor is protected to prevent usage. */ - inline CStickyImage(const CStickyImage &button) : CImage(button) { } + inline CStickyImage(const CStickyImage &image) : CImage(image) { } public: @@ -141,7 +141,7 @@ namespace NXWidgets * @param height The height of the image box. * @param bitmap The source bitmap image. * @param style The style that the widget should use. If this is not - * specified, the button will use the global default widget + * specified, the image will use the global default widget * style. */ @@ -175,7 +175,7 @@ namespace NXWidgets /** * Returns the stuck selection state. * - * @return True is the button is in the stuck selection state. + * @return True if the image is in the stuck selection state. */ inline const bool isStuckSelection(void) const diff --git a/libnxwidgets/include/cwidgeteventargs.hxx b/libnxwidgets/include/cwidgeteventargs.hxx index d8058b13c..ba92ac637 100644 --- a/libnxwidgets/include/cwidgeteventargs.hxx +++ b/libnxwidgets/include/cwidgeteventargs.hxx @@ -220,7 +220,7 @@ namespace NXWidgets /** * Get the cursor control that generated the event. Applies only - * to the curso control event. + * to the cursor control event. * * @return The cursor control that generated the event. */ diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 4cf7b9b28..7db9eee99 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -781,7 +781,7 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) onPreRelease(x, y); - // Now mark the widget as NOT clicked and stop draggin actions. + // Now mark the widget as NOT clicked and stop dragging actions. m_flags.clicked = false; stopDragging(x, y); diff --git a/libnxwidgets/src/cstickyimage.cxx b/libnxwidgets/src/cstickyimage.cxx index a4f9c6849..fd9ebb55f 100644 --- a/libnxwidgets/src/cstickyimage.cxx +++ b/libnxwidgets/src/cstickyimage.cxx @@ -68,7 +68,7 @@ using namespace NXWidgets; * @param height The height of the image box. * @param bitmap The source bitmap image. * @param style The style that the widget should use. If this is not - * specified, the button will use the global default widget + * specified, the image will use the global default widget * style. */ diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 1e9b5a190..8c07eea2d 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -146,14 +146,14 @@ namespace NxWM inline void setGeometry(void); /** - * Create the Media Player conrols. Only start as part of the applicaiton + * Create the Media Player controls. Only start as part of the application * start method. */ inline bool createPlayer(void); /** - * Called when the window minimize button is pressed. + * Called when the window minimize image is pressed. */ void minimize(void); @@ -173,7 +173,7 @@ namespace NxWM void setMediaPlayerState(enum EMediaPlayerState state); /** - * Handle a widget action event. This includes a button pre/release + * Handle a widget action event. This includes a image pre/release * release events and volume slider change events. * * @param e The event data. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index f1990f87a..566386e18 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -246,7 +246,7 @@ void CMediaPlayer::hide(void) void CMediaPlayer::redraw(void) { - // Redraw widgets (only). Only one of the Play and Pause buttons should + // Redraw widgets (only). Only one of the Play and Pause images should // have drawing enabled. m_text->redraw(); @@ -361,91 +361,91 @@ bool CMediaPlayer::createPlayer(void) NXWidgets::CRlePaletteBitmap *fwdBitmap = new NXWidgets:: CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); - // Button widths will depend on if the buttons will be bordered or not + // Image widths will depend on if the images will be bordered or not - nxgl_coord_t playButtonW; - nxgl_coord_t pauseButtonW; - nxgl_coord_t rewButtonW; - nxgl_coord_t fwdButtonW; + nxgl_coord_t playImageW; + nxgl_coord_t pauseImageW; + nxgl_coord_t rewindImageW; + nxgl_coord_t fforwardImageW; #ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS - // Set the width to the widest button + // Set the width to the widest image - nxgl_coord_t buttonW = playBitmap->getWidth(); + nxgl_coord_t imageW = playBitmap->getWidth(); - if (buttonW < pauseBitmap->getWidth()) + if (imageW < pauseBitmap->getWidth()) { - buttonW = pauseBitmap->getWidth(); + imageW = pauseBitmap->getWidth(); } - if (buttonW < rewBitmap->getWidth()) + if (imageW < rewBitmap->getWidth()) { - buttonW = rewBitmap->getWidth(); + imageW = rewBitmap->getWidth(); } - if (buttonW < fwdBitmap->getWidth()) + if (imageW < fwdBitmap->getWidth()) { - buttonW = fwdBitmap->getWidth(); + imageW = fwdBitmap->getWidth(); } - // Add little space around the bitmap and use this width for all buttons + // Add little space around the bitmap and use this width for all images - buttonW += 8; - playButtonW = buttonW; - pauseButtonW = buttonW; - rewButtonW = buttonW; - fwdButtonW = buttonW; + imageW += 8; + playImageW = imageW; + pauseImageW = imageW; + rewindImageW = imageW; + fforwardImageW = imageW; #else - // Use the bitmap image widths for the button widths (plus a bit) + // Use the bitmap image widths for the image widths (plus a bit) - playButtonW = playBitmap->getWidth() + 8; - pauseButtonW = pauseBitmap->getWidth() + 8; - rewButtonW = rewBitmap->getWidth() + 8; - fwdButtonW = fwdBitmap->getWidth() + 8; + playImageW = playBitmap->getWidth() + 8; + pauseImageW = pauseBitmap->getWidth() + 8; + rewindImageW = rewBitmap->getWidth() + 8; + fforwardImageW = fwdBitmap->getWidth() + 8; - // The Play and Pause buttons should be the same width. But just + // The Play and Pause images should be the same width. But just // in case, pick the larger width. - if (playButtonW < pauseButtonW) + if (playImageW < pauseImageW) { - playButtonW = pauseButtonW; + playImageW = pauseImageW; } else { - pauseButtonW = playButtonW; + pauseImageW = playImageW; } #endif - // Use the same height for all buttons + // Use the same height for all images - nxgl_coord_t buttonH = playBitmap->getHeight(); + nxgl_coord_t imageH = playBitmap->getHeight(); - if (buttonH < pauseBitmap->getHeight()) + if (imageH < pauseBitmap->getHeight()) { - buttonH = pauseBitmap->getHeight(); + imageH = pauseBitmap->getHeight(); } - if (buttonH < rewBitmap->getHeight()) + if (imageH < rewBitmap->getHeight()) { - buttonH = rewBitmap->getHeight(); + imageH = rewBitmap->getHeight(); } - if (buttonH < fwdBitmap->getHeight()) + if (imageH < fwdBitmap->getHeight()) { - buttonH = fwdBitmap->getHeight(); + imageH = fwdBitmap->getHeight(); } - buttonH += 8; + imageH += 8; // Create the Play image - nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playButtonW >> 1); + nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playImageW >> 1); uint32_t controlY = (180 * m_windowSize.h) >> 8; m_play = new NXWidgets:: CImage(control, playControlX, (nxgl_coord_t)controlY, - playButtonW, buttonH, playBitmap); + playImageW, imageH, playBitmap); // Configure the Play image @@ -466,7 +466,7 @@ bool CMediaPlayer::createPlayer(void) m_pause = new NXWidgets:: CImage(control, playControlX, (nxgl_coord_t)controlY, - playButtonW, buttonH, pauseBitmap); + playImageW, imageH, pauseBitmap); // Configure the Pause image (hidden and disabled initially) @@ -485,12 +485,12 @@ bool CMediaPlayer::createPlayer(void) // Create the Rewind image - nxgl_coord_t rewControlX = playControlX - rewButtonW - + nxgl_coord_t rewControlX = playControlX - rewindImageW - CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_rewind = new NXWidgets:: CStickyImage(control, rewControlX, (nxgl_coord_t)controlY, - rewButtonW, buttonH, rewBitmap); + rewindImageW, imageH, rewBitmap); // Configure the Rewind image @@ -509,12 +509,12 @@ bool CMediaPlayer::createPlayer(void) // Create the Forward Image - nxgl_coord_t fwdControlX = playControlX + playButtonW + + nxgl_coord_t fwdControlX = playControlX + playImageW + CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_fforward = new NXWidgets:: CStickyImage(control, fwdControlX, (nxgl_coord_t)controlY, - fwdButtonW, buttonH, fwdBitmap); + fforwardImageW, imageH, fwdBitmap); // Configure the Forward image @@ -588,7 +588,7 @@ bool CMediaPlayer::createPlayer(void) } /** - * Called when the window minimize button is pressed. + * Called when the window minimize image is pressed. */ void CMediaPlayer::minimize(void) @@ -597,7 +597,7 @@ void CMediaPlayer::minimize(void) } /** - * Called when the window close button is pressed. + * Called when the window close image is pressed. */ void CMediaPlayer::close(void) @@ -625,24 +625,24 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_text->enable(); - // Play button enabled and ready to start playing + // Play image enabled and ready to start playing m_play->enable(); m_play->show(); m_play->enableDrawing(); - // Pause button is disabled and hidden + // Pause image is disabled and hidden m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); - // Fast forward button is disabled + // Fast forward image is disabled m_fforward->disable(); m_fforward->setStuckSelection(false); - // Rewind button is disabled + // Rewind image is disabled m_rewind->disable(); m_rewind->setStuckSelection(false); @@ -658,24 +658,24 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_text->disable(); - // Play button hidden and disabled + // Play image hidden and disabled m_play->disableDrawing(); m_play->disable(); m_play->hide(); - // Pause button enabled and ready to pause playing + // Pause image enabled and ready to pause playing m_pause->enable(); m_pause->show(); m_pause->enableDrawing(); - // Fast forward button is enabled and ready for use + // Fast forward image is enabled and ready for use m_fforward->enable(); m_fforward->setStuckSelection(false); - // Rewind button is enabled and ready for use + // Rewind image is enabled and ready for use m_rewind->enable(); m_rewind->setStuckSelection(false); @@ -691,24 +691,24 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_text->enable(); - // Play button enabled and ready to resume playing + // Play image enabled and ready to resume playing m_play->enable(); m_play->show(); m_play->enableDrawing(); - // Pause button is disabled and hidden + // Pause image is disabled and hidden m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); - // Fast forward button is enabled and ready for use + // Fast forward image is enabled and ready for use m_fforward->enable(); m_fforward->setStuckSelection(false); - // Rewind button is enabled and ready for use + // Rewind image is enabled and ready for use m_rewind->enable(); m_rewind->setStuckSelection(false); @@ -717,7 +717,7 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) break; case MPLAYER_FFORWARD: // Fast forwarding through a media file */ - m_state = MPLAYER_FFORWARD; + m_state = MPLAYER_FFORWARD; // Text box is not available while fast forwarding @@ -725,13 +725,13 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) if (m_prevState == MPLAYER_PLAYING) { - // Play button enabled and ready to resume playing + // Play image enabled and ready to resume playing m_play->enable(); m_play->show(); m_play->enableDrawing(); - // Pause button is hidden and disabled + // Pause image is hidden and disabled m_pause->disableDrawing(); m_pause->disable(); @@ -739,20 +739,20 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) } else { - // Play button hidden and disabled + // Play image hidden and disabled m_play->disableDrawing(); m_play->disable(); m_play->hide(); - // Pause button button enabled and ready to stop fast forwarding + // Pause image enabled and ready to stop fast forwarding m_pause->enable(); m_pause->show(); m_pause->enableDrawing(); } - // Fast forward button is enabled, highlighted and ready for use + // Fast forward image is enabled, highlighted and ready for use m_fforward->enable(); m_fforward->setStuckSelection(true); @@ -766,7 +766,7 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) break; case MPLAYER_FREWIND: // Rewinding a media file - m_state = MPLAYER_FREWIND; + m_state = MPLAYER_FREWIND; // Text box is not available while rewinding @@ -774,13 +774,13 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) if (m_prevState == MPLAYER_PLAYING) { - // Play button enabled and ready to resume playing + // Play image enabled and ready to resume playing m_play->enable(); m_play->show(); m_play->enableDrawing(); - // Pause button is hidden and disabled + // Pause image is hidden and disabled m_pause->disableDrawing(); m_pause->disable(); @@ -788,25 +788,25 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) } else { - // Play button hidden and disabled + // Play image hidden and disabled m_play->disableDrawing(); m_play->disable(); m_play->hide(); - // Pause button button enabled and ready to stop fast forwarding + // Pause image enabled and ready to stop fast forwarding m_pause->enable(); m_pause->show(); m_pause->enableDrawing(); } - // Fast forward button is enabled and ready for use + // Fast forward image is enabled and ready for use m_fforward->enable(); m_fforward->setStuckSelection(false); - // Rewind button is enabled, highlighted, and ready for use + // Rewind image is enabled, highlighted, and ready for use m_rewind->enable(); m_rewind->setStuckSelection(true); @@ -820,20 +820,18 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) } /** - * Handle a widget action event. For CButtonArray, this is a button pre- - * release event. + * Handle a widget action event. This includes a image pre/release + * release events and volume slider change events. * * @param e The event data. */ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { - // Check if the Play button was clicked + // Check if the Play image was clicked if (m_play->isClicked() && m_state != MPLAYER_PLAYING) { - // Yes... then now we are playing - setMediaPlayerState(MPLAYER_PLAYING); } @@ -841,7 +839,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) if (m_state != MPLAYER_STOPPED) { - // Check if the Pause button was clicked + // Check if the Pause image was clicked if (m_pause->isClicked() && m_state != MPLAYER_PAUSED) { @@ -850,7 +848,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(MPLAYER_PAUSED); } - // Check if the rewind button was clicked + // Check if the rewind image was clicked if (m_rewind->isClicked()) { @@ -874,7 +872,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } - // Check if the fast forward button was clicked + // Check if the fast forward image was clicked if (m_fforward->isClicked()) { From d36a3bcf6b96c4249d8c7dc45e37a3d47a31078c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 19:47:56 -0600 Subject: [PATCH 218/390] NxWM::CMediaPlayer: Fix issues with state changes performed on the PreRelese event handler --- nxwm/include/cmediaplayer.hxx | 23 +++++++++++++ nxwm/src/cmediaplayer.cxx | 64 ++++++++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 8c07eea2d..f0888b57f 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -93,6 +93,13 @@ namespace NxWM MPLAYER_FREWIND, /**< Rewinding a media file */ }; + enum EPendingRelease + { + PENDING_NONE = 0, /**< Nothing is pending */ + PENDING_PLAY_RELEASE, /**< Expect play image to be released */ + PENDING_PAUSE_RELEASE /**< Expect pause image to be released */ + }; + /** * The structure defines a pending operation. */ @@ -109,6 +116,7 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ + enum EPendingRelease m_pending; /**< Pending image release event */ /** * Cached constructor parameters. @@ -181,6 +189,21 @@ namespace NxWM void handleActionEvent(const NXWidgets::CWidgetEventArgs &e); + /** + * Handle a widget release event. Only the play and pause image release + * are of interest. + */ + + void handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e); + + /** + * Handle a widget release event when the widget WAS dragged outside of + * its original bounding box. Only the play and pause image release + * are of interest. + */ + + void handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs &e); + public: /** * CMediaPlayer constructor diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 566386e18..759eeead2 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -3,6 +3,7 @@ * * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit + * Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -82,17 +83,19 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) { // Save the constructor data - m_taskbar = taskbar; - m_window = window; + m_taskbar = taskbar; + m_window = window; // Nullify widgets that will be instantiated when the window is started - m_text = (NXWidgets::CLabel *)0; - m_font = (NXWidgets::CNxFont *)0; + m_text = (NXWidgets::CLabel *)0; + m_font = (NXWidgets::CNxFont *)0; // Initial state is stopped - m_state = MPLAYER_STOPPED; + m_state = MPLAYER_STOPPED; + m_prevState = MPLAYER_STOPPED; + m_pending = PENDING_NONE; // Add our personalized window label @@ -832,7 +835,11 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) if (m_play->isClicked() && m_state != MPLAYER_PLAYING) { - setMediaPlayerState(MPLAYER_PLAYING); + // Just arm the state change now, but don't do anything until the + // release occurs. Trying to do the state change before the NxWidgets + // release processing completes causes issues. + + m_pending = PENDING_PLAY_RELEASE; } // These only make sense in non-STOPPED states @@ -843,9 +850,11 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) if (m_pause->isClicked() && m_state != MPLAYER_PAUSED) { - // Yes... then now we are playing + // Just arm the state change now, but don't do anything until the + // release occurs. Trying to do the state change before the NxWidgets + // release processing completes causes issues. - setMediaPlayerState(MPLAYER_PAUSED); + m_pending = PENDING_PAUSE_RELEASE; } // Check if the rewind image was clicked @@ -903,6 +912,45 @@ printf("Volume clicked\n"); // REMOVE ME } } +/** + * Handle a widget release event. Only the play and pause image release + * are of interest. + */ + +void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) +{ + // Check if the Play image was released + + if (m_pending == PENDING_PLAY_RELEASE && !m_play->isClicked()) + { + // Now perform the delayed state change + + setMediaPlayerState(MPLAYER_PLAYING); + m_pending = PENDING_NONE; + } + + // Check if the Pause image was released + + else if (m_pending == PENDING_PAUSE_RELEASE && !m_pause->isClicked()) + { + // Now perform the delayed state change + + setMediaPlayerState(MPLAYER_PAUSED); + m_pending = PENDING_NONE; + } +} + +/** + * Handle a widget release event when the widget WAS dragged outside of + * its original bounding box. Only the play and pause image release + * are of interest. + */ + +void CMediaPlayer::handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs &e) +{ + handleReleaseEvent(e); +} + /** * CMediaPlayerFactory Constructor * From a41e9d7e639cb00a557e20ec0caefaf2e1058ef9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 19:48:29 -0600 Subject: [PATCH 219/390] Update ChangeLog --- ChangeLog.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5c0d7ae1c..22aa51280 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -459,6 +459,5 @@ in buttons (2014-7-14). * NxWidgets::CStickyImage: A version of CImage that sticks in the selected state when clicked (2014-7-15). -* NxMW::CMediaPlayer: Now supports a pause button. Initial check-in is not - rock solid (2014-7-15). +* NxMW::CMediaPlayer: Now supports a pause button (2014-7-15). From e602d5b7228fd2f794be9f8985883dd43f8e6a0c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 15 Jul 2014 20:26:37 -0600 Subject: [PATCH 220/390] NxWM::CMediaPlayer: Two places where use of play and pause buttons reversed --- nxwm/src/cmediaplayer.cxx | 60 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 759eeead2..195a9ca8d 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -621,7 +621,7 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) switch (state) { case MPLAYER_STOPPED: // Initial state. Also the state after playing completes - m_state = MPLAYER_STOPPED; + m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_PLAYING; // Text box is enabled and ready for text entry @@ -727,20 +727,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_text->disable(); if (m_prevState == MPLAYER_PLAYING) - { - // Play image enabled and ready to resume playing - - m_play->enable(); - m_play->show(); - m_play->enableDrawing(); - - // Pause image is hidden and disabled - - m_pause->disableDrawing(); - m_pause->disable(); - m_pause->hide(); - } - else { // Play image hidden and disabled @@ -754,6 +740,20 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->show(); m_pause->enableDrawing(); } + else + { + // Play image enabled and ready to stop fast forwarding + + m_play->enable(); + m_play->show(); + m_play->enableDrawing(); + + // Pause image is hidden and disabled + + m_pause->disableDrawing(); + m_pause->disable(); + m_pause->hide(); + } // Fast forward image is enabled, highlighted and ready for use @@ -777,7 +777,21 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) if (m_prevState == MPLAYER_PLAYING) { - // Play image enabled and ready to resume playing + // Play image hidden and disabled + + m_play->disableDrawing(); + m_play->disable(); + m_play->hide(); + + // Pause image enabled and ready to stop rewinding + + m_pause->enable(); + m_pause->show(); + m_pause->enableDrawing(); + } + else + { + // Play image enabled and ready to stop rewinding m_play->enable(); m_play->show(); @@ -789,20 +803,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->disable(); m_pause->hide(); } - else - { - // Play image hidden and disabled - - m_play->disableDrawing(); - m_play->disable(); - m_play->hide(); - - // Pause image enabled and ready to stop fast forwarding - - m_pause->enable(); - m_pause->show(); - m_pause->enableDrawing(); - } // Fast forward image is enabled and ready for use From c3401b677bc99a5310d52cf0636daae300ce315f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 07:16:12 -0600 Subject: [PATCH 221/390] NxWM::CMediaPlayer: Fix memory leak --- nxwm/include/cmediaplayer.hxx | 12 +++ nxwm/src/cmediaplayer.cxx | 165 ++++++++++++++++++++++------------ 2 files changed, 118 insertions(+), 59 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index f0888b57f..6d803b537 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -137,6 +137,18 @@ namespace NxWM NXWidgets::CStickyImage *m_fforward; /**< Fast forward control */ NXWidgets::CGlyphSliderHorizontal *m_volume; /**< Volume control */ + /** + * Bitmaps + * + * These are retained only so that they can be released when the media + * is closed player + */ + + NXWidgets::CRlePaletteBitmap *m_playBitmap; /**< Bitmap for the play control */ + NXWidgets::CRlePaletteBitmap *m_pauseBitmap; /**< Bitmap for the pause control */ + NXWidgets::CRlePaletteBitmap *m_rewindBitmap; /**< Bitmap for the rewind control */ + NXWidgets::CRlePaletteBitmap *m_fforwardBitmap; /**< Bitmap for the fast forward control */ + /** * Calculator geometry. This stuff does not really have to be retained * in memory. If you are pinched for memory, get rid of these. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 195a9ca8d..d72707654 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -83,19 +83,31 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) { // Save the constructor data - m_taskbar = taskbar; - m_window = window; + m_taskbar = taskbar; + m_window = window; // Nullify widgets that will be instantiated when the window is started - m_text = (NXWidgets::CLabel *)0; - m_font = (NXWidgets::CNxFont *)0; + m_text = (NXWidgets::CLabel *)0; + m_font = (NXWidgets::CNxFont *)0; + m_play = (NXWidgets::CImage *)0; + m_pause = (NXWidgets::CImage *)0; + m_rewind = (NXWidgets::CStickyImage *)0; + m_fforward = (NXWidgets::CStickyImage *)0; + m_volume = (NXWidgets::CGlyphSliderHorizontal *)0; + + // Nullify bitmaps that will be instantiated when the window is started + + m_playBitmap = (NXWidgets::CRlePaletteBitmap *)0; + m_pauseBitmap = (NXWidgets::CRlePaletteBitmap *)0; + m_rewindBitmap = (NXWidgets::CRlePaletteBitmap *)0; + m_fforwardBitmap = (NXWidgets::CRlePaletteBitmap *)0; // Initial state is stopped - m_state = MPLAYER_STOPPED; - m_prevState = MPLAYER_STOPPED; - m_pending = PENDING_NONE; + m_state = MPLAYER_STOPPED; + m_prevState = MPLAYER_STOPPED; + m_pending = PENDING_NONE; // Add our personalized window label @@ -131,6 +143,53 @@ CMediaPlayer::~CMediaPlayer(void) delete m_font; } + if (m_play) + { + delete m_play; + } + + if (m_pause) + { + delete m_pause; + } + + if (m_rewind) + { + delete m_rewind; + } + + if (m_fforward) + { + delete m_fforward; + } + + if (m_volume) + { + delete m_volume; + } + + // Destroy bitmaps + + if (m_playBitmap) + { + delete m_playBitmap; + } + + if (m_pauseBitmap) + { + delete m_pauseBitmap; + } + + if (m_rewindBitmap) + { + delete m_rewindBitmap; + } + + if (m_fforwardBitmap) + { + delete m_fforwardBitmap; + } + // Although we didn't create it, we are responsible for deleting the // application window @@ -352,103 +411,91 @@ bool CMediaPlayer::createPlayer(void) // Create all bitmaps - NXWidgets::CRlePaletteBitmap *playBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); - - NXWidgets::CRlePaletteBitmap *pauseBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PAUSE_ICON); - - NXWidgets::CRlePaletteBitmap *rewBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - - NXWidgets::CRlePaletteBitmap *fwdBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); + m_playBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); + m_pauseBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PAUSE_ICON); + m_rewindBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + m_fforwardBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); // Image widths will depend on if the images will be bordered or not - nxgl_coord_t playImageW; - nxgl_coord_t pauseImageW; - nxgl_coord_t rewindImageW; - nxgl_coord_t fforwardImageW; + nxgl_coord_t playControlW; + nxgl_coord_t rewindControlW; + nxgl_coord_t fforwardControlW; #ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS // Set the width to the widest image - nxgl_coord_t imageW = playBitmap->getWidth(); + nxgl_coord_t imageW = m_playBitmap->getWidth(); - if (imageW < pauseBitmap->getWidth()) + if (imageW < m_pauseBitmap->getWidth()) { - imageW = pauseBitmap->getWidth(); + imageW = m_pauseBitmap->getWidth(); } - if (imageW < rewBitmap->getWidth()) + if (imageW < m_rewindBitmap->getWidth()) { - imageW = rewBitmap->getWidth(); + imageW = m_rewindBitmap->getWidth(); } - if (imageW < fwdBitmap->getWidth()) + if (imageW < m_fforwardBitmap->getWidth()) { - imageW = fwdBitmap->getWidth(); + imageW = m_fforwardBitmap->getWidth(); } // Add little space around the bitmap and use this width for all images - imageW += 8; - playImageW = imageW; - pauseImageW = imageW; - rewindImageW = imageW; - fforwardImageW = imageW; + imageW += 8; + playControlW = imageW; + rewindControlW = imageW; + fforwardControlW = imageW; #else + // Use the bitmap image widths for the image widths (plus a bit) - playImageW = playBitmap->getWidth() + 8; - pauseImageW = pauseBitmap->getWidth() + 8; - rewindImageW = rewBitmap->getWidth() + 8; - fforwardImageW = fwdBitmap->getWidth() + 8; + playControlW = m_playBitmap->getWidth() + 8; + rewindControlW = m_rewindBitmap->getWidth() + 8; + fforwardControlW = m_fforwardBitmap->getWidth() + 8; // The Play and Pause images should be the same width. But just // in case, pick the larger width. - if (playImageW < pauseImageW) + nxgl_coord_t pauseControlW = m_pauseBitmap->getWidth() + 8; + if (playControlW < pauseControlW) { - playImageW = pauseImageW; - } - else - { - pauseImageW = playImageW; + playControlW = pauseControlW; } #endif // Use the same height for all images - nxgl_coord_t imageH = playBitmap->getHeight(); + nxgl_coord_t controlH = m_playBitmap->getHeight(); - if (imageH < pauseBitmap->getHeight()) + if (controlH < m_pauseBitmap->getHeight()) { - imageH = pauseBitmap->getHeight(); + controlH = m_pauseBitmap->getHeight(); } - if (imageH < rewBitmap->getHeight()) + if (controlH < m_rewindBitmap->getHeight()) { - imageH = rewBitmap->getHeight(); + controlH = m_rewindBitmap->getHeight(); } - if (imageH < fwdBitmap->getHeight()) + if (controlH < m_fforwardBitmap->getHeight()) { - imageH = fwdBitmap->getHeight(); + controlH = m_fforwardBitmap->getHeight(); } - imageH += 8; + controlH += 8; // Create the Play image - nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playImageW >> 1); + nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playControlW >> 1); uint32_t controlY = (180 * m_windowSize.h) >> 8; m_play = new NXWidgets:: CImage(control, playControlX, (nxgl_coord_t)controlY, - playImageW, imageH, playBitmap); + playControlW, controlH, m_playBitmap); // Configure the Play image @@ -469,7 +516,7 @@ bool CMediaPlayer::createPlayer(void) m_pause = new NXWidgets:: CImage(control, playControlX, (nxgl_coord_t)controlY, - playImageW, imageH, pauseBitmap); + playControlW, controlH, m_pauseBitmap); // Configure the Pause image (hidden and disabled initially) @@ -488,12 +535,12 @@ bool CMediaPlayer::createPlayer(void) // Create the Rewind image - nxgl_coord_t rewControlX = playControlX - rewindImageW - + nxgl_coord_t rewControlX = playControlX - rewindControlW - CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_rewind = new NXWidgets:: CStickyImage(control, rewControlX, (nxgl_coord_t)controlY, - rewindImageW, imageH, rewBitmap); + rewindControlW, controlH, m_rewindBitmap); // Configure the Rewind image @@ -512,12 +559,12 @@ bool CMediaPlayer::createPlayer(void) // Create the Forward Image - nxgl_coord_t fwdControlX = playControlX + playImageW + + nxgl_coord_t fwdControlX = playControlX + playControlW + CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_fforward = new NXWidgets:: CStickyImage(control, fwdControlX, (nxgl_coord_t)controlY, - fforwardImageW, imageH, fwdBitmap); + fforwardControlW, controlH, m_fforwardBitmap); // Configure the Forward image From abc11dd52af1858bb570c13e8e8fe8510bdbb645 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 11:11:00 -0600 Subject: [PATCH 222/390] NxWM::CMediaPlayer: Fix of state related bugs + Size if CLabel is increased (in preparation for becoming a CListBox) --- Kconfig | 42 ++++++++++--- .../include/cglyphsliderhorizontal.hxx | 62 ++++++++++--------- 2 files changed, 64 insertions(+), 40 deletions(-) diff --git a/Kconfig b/Kconfig index 2bd8ea02d..a1a6803e4 100644 --- a/Kconfig +++ b/Kconfig @@ -311,7 +311,7 @@ config NXWM if NXWM -menu "NxWM General settings" +menu "NxWM General Settings" config NXWM_LARGE_ICONS bool "Use large icons" @@ -675,7 +675,9 @@ config NXWM_STARTWINDOW_STACKSIZE endmenu # Start Window Configuration -menuconfig NXWM_NXCONSOLE +menu "NxConsole Window Settings" + +config NXWM_NXCONSOLE bool "NxConsole Window" default y ---help--- @@ -759,6 +761,7 @@ config NXWM_NXCONSOLE_ICON endif # NXWM_NXCONSOLE_ICON endif # NXWM_NXCONSOLE +endmenu # NxConsole Window Settings menu "NxWM Touchscreen Configuration" @@ -771,7 +774,7 @@ config NXWM_TOUCHSCREEN if NXWM_TOUCHSCREEN -comment "Touchscreen device settings" +comment "Touchscreen Device Settings" config NXWM_TOUCHSCREEN_DEVINIT bool "Touchscreen Device Initialization" @@ -844,7 +847,7 @@ config NXWM_KEYBOARD if NXWM_KEYBOARD -comment "Keyboard device settings" +comment "Keyboard Device Settings" config NXWM_KEYBOARD_DEVPATH string "Keyboard Device Path" @@ -880,7 +883,7 @@ config NXWM_KEYBOARD_LISTENERSTACK endif # NXWM_KEYBOARD endmenu # NxWM Keyboard Configuration -menu "NxWM Calibration display settings" +menu "NxWM Calibration Display Settings" config NXWM_CALIBRATION_MARGIN int "Calibration Margin" @@ -1045,9 +1048,9 @@ config NXWM_CALIBRATION_LISTENERSTACK ---help--- Calibration listener thread stack size. Default 2048 -endmenu # NxWM Calibration display settings +endmenu # NxWM Calibration Display Settings -menu "NxWM Hex Calculator display settings" +menu "NxWM Hex Calculator Display Settings" config NXWM_HEXCALCULATOR_CUSTOM_COLORS bool "Custom Hex Calculator Colors" @@ -1103,7 +1106,9 @@ config NXWM_HEXCALCULATOR_FONTID NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 endif # NXWM_HEXCALCULATOR_FONTID -endmenu # NxWM Hex Calculator display settings +endmenu # NxWM Hex Calculator Display Dettings + +menu "NxWM Media Player Display Settings" config NXWM_MEDIAPLAYER bool "NxWM Media Player" @@ -1119,13 +1124,28 @@ config NXWM_MEDIAPLAYER if NXWM_MEDIAPLAYER +config NXWM_MEDIAPLAYER_MEDIAPATH + string "Path to media" + default "/mnt/sdcard" + ---help--- + This is the full path to the mount point of the storage device + containing all of the media files accessible by the media player. + config NXWM_MEDIAPLAYER_XSPACING - int "Media Player Button Spacing" + int "Media Player Horizontal Spacing" default 12 ---help--- - This is the space between play, forward, and reverse buttons in + This is the space between play, forward, and reverse controls in units of pixels. +config NXWM_MEDIAPLAYER_YSPACING + int "Media Player Vertical Spacing" + default 8 + ---help--- + This is the space between vertical element: (1) list box, (2) play, + forward, and reverse controls, and the volume slider in units of + lines. + config NXWM_MEDIAPLAYER_BORDERS bool "Media Player Button Borders" default n @@ -1135,4 +1155,6 @@ config NXWM_MEDIAPLAYER_BORDERS then have buttons with boarders might make more sense. endif # NXWM_MEDIAPLAYER +endmenu # NxWM Media Player Display Settings + endif # NXWM diff --git a/libnxwidgets/include/cglyphsliderhorizontal.hxx b/libnxwidgets/include/cglyphsliderhorizontal.hxx index 7f5ea5445..354a097ac 100644 --- a/libnxwidgets/include/cglyphsliderhorizontal.hxx +++ b/libnxwidgets/include/cglyphsliderhorizontal.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cglyphsliderhorizontal.hxx * - * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Copyright (C) 2013, 2014 Ken Pettit. All rights reserved. * Author: Ken Pettit * * Redistribution and use in source and binary forms, with or without @@ -98,25 +98,25 @@ namespace NXWidgets class CGlyphSliderHorizontal : public ISlider, public CNxWidget, public CWidgetEventHandler { protected: - CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ - nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ - nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ - int32_t m_value; /**< Current value of the slider. */ - nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ - nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking - the gutter. */ - int32_t m_gutterWidth; /**< Width of the gutter, taking into account - any adjustments made to the width of the grip. */ - uint32_t m_contentSize; /**< Number of values in the min/max range. */ - nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */ - bool m_fill; /**< Set true if fill is active */ - uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */ + CGlyphSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ + int m_minimumValue; /**< Minimum value that the grip can represent. */ + int m_maximumValue; /**< Maximum value that the grip can represent. */ + int32_t m_value; /**< Current value of the slider. */ + nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ + nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking + the gutter. */ + int32_t m_gutterWidth; /**< Width of the gutter, taking into account + any adjustments made to the width of the grip. */ + uint32_t m_contentSize; /**< Number of values in the min/max range. */ + nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */ + bool m_fill; /**< Set true if fill is active */ + uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */ /** * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full * range of values being accessed (intentionally). - * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * The returned value is shifted left 16 places for more accuracy in fixed-point * calculations. * * @return The maximum possible value that the slider can represent. @@ -182,12 +182,15 @@ namespace NXWidgets */ CGlyphSliderHorizontal(CWidgetControl *pWidgetControl, - nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, - nxgl_coord_t height, IBitmap *pGripBitmap, - nxwidget_pixel_t fillColor, bool fill = true); + nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t height, IBitmap *pGripBitmap, + nxwidget_pixel_t fillColor, bool fill = true); /** * Destructor. + * + * NOTE: That the contained bitmap image is not destroyed when the image + * container is destroyed. */ virtual inline ~CGlyphSliderHorizontal(void) { } @@ -198,7 +201,7 @@ namespace NXWidgets * @return The smallest value. */ - inline const nxgl_coord_t getMinimumValue(void) const + inline const int getMinimumValue(void) const { return m_minimumValue; } @@ -209,7 +212,7 @@ namespace NXWidgets * @return The largest value. */ - inline const nxgl_coord_t getMaximumValue(void) const + inline const int getMaximumValue(void) const { return m_maximumValue; } @@ -220,16 +223,15 @@ namespace NXWidgets * return The current slider value. */ - inline const nxgl_coord_t getValue(void) const + inline const int getValue(void) const { - return m_value >> 16; + return (int)(m_value >> 16); } /** - * Get the value represented by the height of the grip. - * For sliders, this would typically be 1 (so each new - * grip position is worth 1). For scrollbars, this - * would be the height of the scrolling widget. + * Get the value represented by the height of the grip. For sliders, + * this would typically be 1 (so each new grip position is worth 1). + * For scrollbars, this would be the height of the scrolling widget. * * @return The page size. */ @@ -245,7 +247,7 @@ namespace NXWidgets * @param value The smallest value. */ - inline void setMinimumValue(const nxgl_coord_t value) + inline void setMinimumValue(const int value) { m_minimumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -258,7 +260,7 @@ namespace NXWidgets * @param value The largest value. */ - inline void setMaximumValue(const nxgl_coord_t value) + inline void setMaximumValue(const int value) { m_maximumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -272,11 +274,11 @@ namespace NXWidgets * @param value The new value. */ - void setValue(const nxgl_coord_t value); + void setValue(const int value); /** * Set the value that of the slider. This will reposition and redraw - * the grip. The supplied value should be bitshifted left 16 places. + * the grip. The supplied value should be shifted left 16 places. * This ensures greater accuracy than the standard setValue() method if * the slider is being used as a scrollbar. * From 9a471672b31d27b515c2bc4de659262ac0b2201f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 11:11:55 -0600 Subject: [PATCH 223/390] NxWM::CMediaPlayer: Fix of state related bugs + Size if CLabel is increased (in preparation for becoming a CListBox) --- libnxwidgets/include/cimage.hxx | 5 +- libnxwidgets/include/cscaledbitmap.hxx | 4 +- libnxwidgets/include/cscrollbarhorizontal.hxx | 14 +- libnxwidgets/include/cscrollbarvertical.hxx | 12 +- libnxwidgets/include/csliderhorizontal.hxx | 22 +- libnxwidgets/include/cslidervertical.hxx | 22 +- libnxwidgets/include/islider.hxx | 14 +- libnxwidgets/src/cglyphsliderhorizontal.cxx | 13 +- libnxwidgets/src/cscaledbitmap.cxx | 2 +- libnxwidgets/src/cscrollbarhorizontal.cxx | 14 +- libnxwidgets/src/cscrollbarvertical.cxx | 16 +- libnxwidgets/src/csliderhorizontal.cxx | 4 +- libnxwidgets/src/cslidervertical.cxx | 4 +- nxwm/include/cmediaplayer.hxx | 28 +- nxwm/include/nxwmconfig.hxx | 12 +- nxwm/src/cmediaplayer.cxx | 337 ++++++++++++------ 16 files changed, 328 insertions(+), 195 deletions(-) diff --git a/libnxwidgets/include/cimage.hxx b/libnxwidgets/include/cimage.hxx index e485f6d9d..ee72617ac 100644 --- a/libnxwidgets/include/cimage.hxx +++ b/libnxwidgets/include/cimage.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cimage.hxx * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -218,6 +218,9 @@ namespace NXWidgets /** * Destructor. + * + * NOTE: That the contained bitmap image is not destroyed when the image + * container is destroyed. */ virtual inline ~CImage() { } diff --git a/libnxwidgets/include/cscaledbitmap.hxx b/libnxwidgets/include/cscaledbitmap.hxx index 8cb25ae75..e6944ad4c 100644 --- a/libnxwidgets/include/cscaledbitmap.hxx +++ b/libnxwidgets/include/cscaledbitmap.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cscaledbitmap.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ namespace NXWidgets FAR IBitmap *m_bitmap; /**< The bitmap that is being scaled */ struct nxgl_size_s m_size; /**< Scaled size of the image */ FAR uint8_t *m_rowCache[2]; /**< Two cached rows of the image */ - int m_row; /**< Row number of the first cached row */ + unsigned int m_row; /**< Row number of the first cached row */ b16_t m_xScale; /**< X scale factor */ b16_t m_yScale; /**< Y scale factor */ diff --git a/libnxwidgets/include/cscrollbarhorizontal.hxx b/libnxwidgets/include/cscrollbarhorizontal.hxx index f6c3be3c3..65ab5b416 100644 --- a/libnxwidgets/include/cscrollbarhorizontal.hxx +++ b/libnxwidgets/include/cscrollbarhorizontal.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -171,7 +171,7 @@ namespace NXWidgets * @return The smallest value. */ - const nxgl_coord_t getMinimumValue(void) const; + const int getMinimumValue(void) const; /** * Get the largest value that the slider can represent. @@ -179,7 +179,7 @@ namespace NXWidgets * @return The largest value. */ - const nxgl_coord_t getMaximumValue(void) const; + const int getMaximumValue(void) const; /** * Get the current value of the slider. @@ -187,7 +187,7 @@ namespace NXWidgets * @return The current slider value. */ - const nxgl_coord_t getValue(void) const; + const int getValue(void) const; /** * Get the value represented by the height of the grip. @@ -206,7 +206,7 @@ namespace NXWidgets * @param value The smallest value. */ - void setMinimumValue(const nxgl_coord_t value); + void setMinimumValue(const int value); /** * Set the largest value that the slider can represent. @@ -214,7 +214,7 @@ namespace NXWidgets * @param value The largest value. */ - void setMaximumValue(const nxgl_coord_t value); + void setMaximumValue(const int value); /** * Set the value that of the slider. This will reposition @@ -223,7 +223,7 @@ namespace NXWidgets * @param value The new value. */ - void setValue(const nxgl_coord_t value); + void setValue(const int value); /** * Set the value that of the slider. This will reposition and redraw diff --git a/libnxwidgets/include/cscrollbarvertical.hxx b/libnxwidgets/include/cscrollbarvertical.hxx index 37649e970..47c0cc260 100644 --- a/libnxwidgets/include/cscrollbarvertical.hxx +++ b/libnxwidgets/include/cscrollbarvertical.hxx @@ -170,7 +170,7 @@ namespace NXWidgets * @return The smallest value. */ - const nxgl_coord_t getMinimumValue(void) const; + const int getMinimumValue(void) const; /** * Get the largest value that the slider can represent. @@ -178,7 +178,7 @@ namespace NXWidgets * @return The largest value. */ - const nxgl_coord_t getMaximumValue(void) const; + const int getMaximumValue(void) const; /** * Get the current value of the slider. @@ -186,7 +186,7 @@ namespace NXWidgets * @return The current slider value. */ - const nxgl_coord_t getValue(void) const; + const int getValue(void) const; /** * Get the value represented by the height of the grip. @@ -205,7 +205,7 @@ namespace NXWidgets * @param value The smallest value. */ - void setMinimumValue(const nxgl_coord_t value); + void setMinimumValue(const int value); /** * Set the largest value that the slider can represent. @@ -213,7 +213,7 @@ namespace NXWidgets * @param value The largest value. */ - void setMaximumValue(const nxgl_coord_t value); + void setMaximumValue(const int value); /** * Set the value that of the slider. This will reposition @@ -222,7 +222,7 @@ namespace NXWidgets * @param value The new value. */ - void setValue(const nxgl_coord_t value); + void setValue(const int value); /** * Set the value that of the slider. This will reposition and redraw diff --git a/libnxwidgets/include/csliderhorizontal.hxx b/libnxwidgets/include/csliderhorizontal.hxx index ea0c8dc18..dd03203e1 100644 --- a/libnxwidgets/include/csliderhorizontal.hxx +++ b/libnxwidgets/include/csliderhorizontal.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/csliderhorizontal.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -110,8 +110,8 @@ namespace NXWidgets { protected: CSliderHorizontalGrip *m_grip; /**< Pointer to the grip. */ - nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ - nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int m_minimumValue; /**< Minimum value that the grip can represent. */ + int m_maximumValue; /**< Maximum value that the grip can represent. */ int32_t m_value; /**< Current value of the slider. */ nxgl_coord_t m_minimumGripWidth; /**< Smallest width that the grip can become */ nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking @@ -124,7 +124,7 @@ namespace NXWidgets * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full * range of values being accessed (intentionally). - * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * The returned value is shifted left 16 places for more accuracy in fixed-point * calculations. * * @return The maximum possible value that the slider can represent. @@ -218,7 +218,7 @@ namespace NXWidgets * @return The smallest value. */ - inline const nxgl_coord_t getMinimumValue(void) const + inline const int getMinimumValue(void) const { return m_minimumValue; } @@ -229,7 +229,7 @@ namespace NXWidgets * @return The largest value. */ - inline const nxgl_coord_t getMaximumValue(void) const + inline const int getMaximumValue(void) const { return m_maximumValue; } @@ -240,7 +240,7 @@ namespace NXWidgets * return The current slider value. */ - inline const nxgl_coord_t getValue(void) const + inline const int getValue(void) const { return m_value >> 16; } @@ -265,7 +265,7 @@ namespace NXWidgets * @param value The smallest value. */ - inline void setMinimumValue(const nxgl_coord_t value) + inline void setMinimumValue(const int value) { m_minimumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -278,7 +278,7 @@ namespace NXWidgets * @param value The largest value. */ - inline void setMaximumValue(const nxgl_coord_t value) + inline void setMaximumValue(const int value) { m_maximumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -292,11 +292,11 @@ namespace NXWidgets * @param value The new value. */ - void setValue(const nxgl_coord_t value); + void setValue(const int value); /** * Set the value that of the slider. This will reposition and redraw - * the grip. The supplied value should be bitshifted left 16 places. + * the grip. The supplied value should be shifted left 16 places. * This ensures greater accuracy than the standard setValue() method if * the slider is being used as a scrollbar. * diff --git a/libnxwidgets/include/cslidervertical.hxx b/libnxwidgets/include/cslidervertical.hxx index f08010f3c..a63611823 100644 --- a/libnxwidgets/include/cslidervertical.hxx +++ b/libnxwidgets/include/cslidervertical.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cslidervertical.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -110,8 +110,8 @@ namespace NXWidgets { protected: CSliderVerticalGrip* m_grip; /**< Pointer to the grip. */ - nxgl_coord_t m_minimumValue; /**< Minimum value that the grip can represent. */ - nxgl_coord_t m_maximumValue; /**< Maximum value that the grip can represent. */ + int m_minimumValue; /**< Minimum value that the grip can represent. */ + int m_maximumValue; /**< Maximum value that the grip can represent. */ int32_t m_value; /**< Current value of the slider. */ nxgl_coord_t m_minimumGripHeight; /**< Smallest height that the grip can become. */ nxgl_coord_t m_pageSize; /**< Value of a page of data, used when clicking @@ -124,7 +124,7 @@ namespace NXWidgets * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full * range of values being accessed (intentionally). - * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * The returned value is shifted left 16 places for more accuracy in fixed-point * calculations. * * @return The maximum possible value that the slider can represent. @@ -219,7 +219,7 @@ namespace NXWidgets * @return The smallest value. */ - inline const nxgl_coord_t getMinimumValue(void) const + inline const int getMinimumValue(void) const { return m_minimumValue; } @@ -230,7 +230,7 @@ namespace NXWidgets * @return The largest value. */ - inline const nxgl_coord_t getMaximumValue(void) const + inline const int getMaximumValue(void) const { return m_maximumValue; } @@ -240,7 +240,7 @@ namespace NXWidgets * return The current slider value. */ - inline const nxgl_coord_t getValue(void) const + inline const int getValue(void) const { return m_value >> 16; } @@ -265,7 +265,7 @@ namespace NXWidgets * @param value The smallest value. */ - inline void setMinimumValue(const nxgl_coord_t value) + inline void setMinimumValue(const int value) { m_minimumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -278,7 +278,7 @@ namespace NXWidgets * @param value The largest value. */ - inline void setMaximumValue(const nxgl_coord_t value) + inline void setMaximumValue(const int value) { m_maximumValue = value; m_contentSize = m_maximumValue - m_minimumValue + 1; @@ -292,11 +292,11 @@ namespace NXWidgets * @param value The new value. */ - void setValue(const nxgl_coord_t value); + void setValue(const int value); /** * Set the value that of the slider. This will reposition and redraw - * the grip. The supplied value should be bitshifted left 16 places. + * the grip. The supplied value should be shifted left 16 places. * This ensures greater accuracy than the standard setValue() method if * the slider is being used as a scrollbar. * diff --git a/libnxwidgets/include/islider.hxx b/libnxwidgets/include/islider.hxx index 1577e9898..1069c5bd1 100644 --- a/libnxwidgets/include/islider.hxx +++ b/libnxwidgets/include/islider.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/islider.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -114,7 +114,7 @@ namespace NXWidgets * @return The smallest value. */ - virtual const nxgl_coord_t getMinimumValue(void) const = 0; + virtual const int getMinimumValue(void) const = 0; /** * Get the largest value that the slider can represent. @@ -122,7 +122,7 @@ namespace NXWidgets * @return The largest value. */ - virtual const nxgl_coord_t getMaximumValue(void) const = 0; + virtual const int getMaximumValue(void) const = 0; /** * Get the current value of the slider. @@ -130,7 +130,7 @@ namespace NXWidgets * return The current slider value. */ - virtual const nxgl_coord_t getValue(void) const = 0; + virtual const int getValue(void) const = 0; /** * Get the value represented by the height of the grip. @@ -149,7 +149,7 @@ namespace NXWidgets * @param value The smallest value. */ - virtual void setMinimumValue(const nxgl_coord_t value) = 0; + virtual void setMinimumValue(const int value) = 0; /** * Set the largest value that the slider can represent. @@ -157,7 +157,7 @@ namespace NXWidgets * @param value The largest value. */ - virtual void setMaximumValue(const nxgl_coord_t value) = 0; + virtual void setMaximumValue(const int value) = 0; /** * Set the value that of the slider. This will reposition @@ -166,7 +166,7 @@ namespace NXWidgets * @param value The new value. */ - virtual void setValue(const nxgl_coord_t value) = 0; + virtual void setValue(const int value) = 0; /** * Set the value that of the slider. This will reposition and redraw diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index 786cbec9f..0430a541f 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -1,4 +1,3 @@ - /**************************************************************************** * NxWidgets/libnxwidgets/src/cglyphsliderhorizontal.cxx * @@ -142,20 +141,19 @@ CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, } /** - * Set the value that of the slider. This will reposition - * and redraw the grip. + * Set the value of the slider. This will reposition and redraw the grip. * * @param value The new value. */ -void CGlyphSliderHorizontal::setValue(const nxgl_coord_t value) +void CGlyphSliderHorizontal::setValue(const int value) { - setValueWithBitshift((int32_t) value << 16); + setValueWithBitshift((int32_t)value << 16); } /** * Set the value that of the slider. This will reposition and redraw - * the grip. The supplied value should be bitshifted left 16 places. + * the grip. The supplied value should be shifted left 16 places. * This ensures greater accuracy than the standard setValue() method if * the slider is being used as a scrollbar. * @@ -260,7 +258,7 @@ nxgl_coord_t CGlyphSliderHorizontal::getMinimumStep(void) const * Get the maximum possible value that the slider can represent. Useful when * using the slider as a scrollbar, as the height of the grip prevents the full * range of values being accessed (intentionally). - * The returned value is bitshfted left 16 places for more accuracy in fixed-point + * The returned value is shifted left 16 places for more accuracy in fixed-point * calculations. * * @return The maximum possible value that the slider can represent. @@ -499,5 +497,6 @@ void CGlyphSliderHorizontal::onClick(nxgl_coord_t x, nxgl_coord_t y) setValueWithBitshift(m_value - (m_pageSize << 16)); } + redraw(); } diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index ad0bd1953..eb8217434 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cscaledbitmap.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/libnxwidgets/src/cscrollbarhorizontal.cxx b/libnxwidgets/src/cscrollbarhorizontal.cxx index 236ab4594..90c28d2d4 100644 --- a/libnxwidgets/src/cscrollbarhorizontal.cxx +++ b/libnxwidgets/src/cscrollbarhorizontal.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -162,7 +162,7 @@ CScrollbarHorizontal::CScrollbarHorizontal(CWidgetControl *pWidgetControl, * @return The smallest value. */ -const nxgl_coord_t CScrollbarHorizontal::getMinimumValue(void) const +const int CScrollbarHorizontal::getMinimumValue(void) const { return m_slider->getMinimumValue(); } @@ -173,7 +173,7 @@ const nxgl_coord_t CScrollbarHorizontal::getMinimumValue(void) const * @return The largest value. */ -const nxgl_coord_t CScrollbarHorizontal::getMaximumValue(void) const +const int CScrollbarHorizontal::getMaximumValue(void) const { return m_slider->getMaximumValue(); } @@ -184,7 +184,7 @@ const nxgl_coord_t CScrollbarHorizontal::getMaximumValue(void) const * @return The current slider value. */ -const nxgl_coord_t CScrollbarHorizontal::getValue(void) const +const int CScrollbarHorizontal::getValue(void) const { return m_slider->getValue(); } @@ -209,7 +209,7 @@ const nxgl_coord_t CScrollbarHorizontal::getPageSize(void) const * @param value The smallest value. */ -void CScrollbarHorizontal::setMinimumValue(const nxgl_coord_t value) +void CScrollbarHorizontal::setMinimumValue(const int value) { m_slider->setMinimumValue(value); } @@ -220,7 +220,7 @@ void CScrollbarHorizontal::setMinimumValue(const nxgl_coord_t value) * @param value The largest value. */ -void CScrollbarHorizontal::setMaximumValue(const nxgl_coord_t value) +void CScrollbarHorizontal::setMaximumValue(const int value) { m_slider->setMaximumValue(value); } @@ -232,7 +232,7 @@ void CScrollbarHorizontal::setMaximumValue(const nxgl_coord_t value) * @param value The new value. */ -void CScrollbarHorizontal::setValue(const nxgl_coord_t value) +void CScrollbarHorizontal::setValue(const int value) { m_slider->setValue(value); } diff --git a/libnxwidgets/src/cscrollbarvertical.cxx b/libnxwidgets/src/cscrollbarvertical.cxx index e287b14f2..307f6bc2a 100644 --- a/libnxwidgets/src/cscrollbarvertical.cxx +++ b/libnxwidgets/src/cscrollbarvertical.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cscrollbarhorizontal.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -160,7 +160,7 @@ CScrollbarVertical::CScrollbarVertical(CWidgetControl *pWidgetControl, * @return The smallest value. */ -const nxgl_coord_t CScrollbarVertical::getMinimumValue(void) const +const int CScrollbarVertical::getMinimumValue(void) const { return m_slider->getMinimumValue(); } @@ -171,7 +171,7 @@ const nxgl_coord_t CScrollbarVertical::getMinimumValue(void) const * @return The largest value. */ -const nxgl_coord_t CScrollbarVertical::getMaximumValue(void) const +const int CScrollbarVertical::getMaximumValue(void) const { return m_slider->getMaximumValue(); } @@ -182,7 +182,7 @@ const nxgl_coord_t CScrollbarVertical::getMaximumValue(void) const * @return The current slider value. */ -const nxgl_coord_t CScrollbarVertical::getValue(void) const +const int CScrollbarVertical::getValue(void) const { return m_slider->getValue(); } @@ -207,7 +207,7 @@ const nxgl_coord_t CScrollbarVertical::getPageSize(void) const * @param value The smallest value. */ -void CScrollbarVertical::setMinimumValue(const nxgl_coord_t value) +void CScrollbarVertical::setMinimumValue(const int value) { m_slider->setMinimumValue(value); } @@ -218,7 +218,7 @@ void CScrollbarVertical::setMinimumValue(const nxgl_coord_t value) * @param value The largest value. */ -void CScrollbarVertical::setMaximumValue(const nxgl_coord_t value) +void CScrollbarVertical::setMaximumValue(const int value) { m_slider->setMaximumValue(value); } @@ -230,7 +230,7 @@ void CScrollbarVertical::setMaximumValue(const nxgl_coord_t value) * @param value The new value. */ -void CScrollbarVertical::setValue(const nxgl_coord_t value) +void CScrollbarVertical::setValue(const int value) { m_slider->setValue(value); } @@ -381,7 +381,7 @@ void CScrollbarVertical::onResize(nxgl_coord_t width, nxgl_coord_t height) { // Remember current values - nxgl_coord_t value = getValue(); + int value = getValue(); bool events = raisesEvents(); // Disable event raising diff --git a/libnxwidgets/src/csliderhorizontal.cxx b/libnxwidgets/src/csliderhorizontal.cxx index 4462d6e74..b1444828b 100644 --- a/libnxwidgets/src/csliderhorizontal.cxx +++ b/libnxwidgets/src/csliderhorizontal.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/csliderhorizontal.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -137,7 +137,7 @@ CSliderHorizontal::CSliderHorizontal(CWidgetControl *pWidgetControl, * @param value The new value. */ -void CSliderHorizontal::setValue(const nxgl_coord_t value) +void CSliderHorizontal::setValue(const int value) { setValueWithBitshift((int32_t)value << 16); } diff --git a/libnxwidgets/src/cslidervertical.cxx b/libnxwidgets/src/cslidervertical.cxx index 9b9b0f91a..a9f40a68c 100644 --- a/libnxwidgets/src/cslidervertical.cxx +++ b/libnxwidgets/src/cslidervertical.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cslidervertical.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -138,7 +138,7 @@ CSliderVertical::CSliderVertical(CWidgetControl *pWidgetControl, * @param value The new value. */ -void CSliderVertical::setValue(const nxgl_coord_t value) +void CSliderVertical::setValue(const int value) { setValueWithBitshift((int32_t)value << 16); } diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 6d803b537..bf4ff61f4 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -117,6 +117,7 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ + unsigned int m_level; /**< Current volume level */ /** * Cached constructor parameters. @@ -148,6 +149,7 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_pauseBitmap; /**< Bitmap for the pause control */ NXWidgets::CRlePaletteBitmap *m_rewindBitmap; /**< Bitmap for the rewind control */ NXWidgets::CRlePaletteBitmap *m_fforwardBitmap; /**< Bitmap for the fast forward control */ + NXWidgets::CRlePaletteBitmap *m_volumeBitmap; /**< Volume control grip bitmap */ /** * Calculator geometry. This stuff does not really have to be retained @@ -156,7 +158,6 @@ namespace NxWM struct nxgl_size_s m_windowSize; /**< The size of the media player window */ struct nxgl_size_s m_textSize; /**< The size of the media player textbox */ - struct nxgl_point_s m_textPos; /**< The position of the media player textbox */ /** * Select the geometry of the media player given the current window size. @@ -184,6 +185,15 @@ namespace NxWM void close(void); + /** + * Redraw all widgets. Called from redraw() and also on any state + * change. + * + * @param state The new state to enter. + */ + + void redrawWidgets(void); + /** * Transition to a new media player state. * @@ -193,8 +203,14 @@ namespace NxWM void setMediaPlayerState(enum EMediaPlayerState state); /** - * Handle a widget action event. This includes a image pre/release - * release events and volume slider change events. + * Set the new volume level based on the position of the volume slider. + */ + + void setVolumeLevel(void); + + /** + * Handle a widget action event. For this application, that means image + * pre-release events. * * @param e The event data. */ @@ -216,6 +232,12 @@ namespace NxWM void handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs &e); + /** + * Handle changes in the volume level. + */ + + void handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e); + public: /** * CMediaPlayer constructor diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index c6781bcd5..40689c0f5 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/nxwmconfig.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -628,12 +628,20 @@ * Default: CONFIG_NXWM_DEFAULT_FONTID */ +#ifndef CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH +# define CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH "/mnt/sdcard" +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR # define CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR #endif #ifndef CONFIG_NXWM_MEDIAPLAYER_XSPACING -# define CONFIG_NXWM_MEDIAPLAYER_XSPACING 16 +# define CONFIG_NXWM_MEDIAPLAYER_XSPACING 12 +#endif + +#ifndef CONFIG_NXWM_MEDIAPLAYER_YSPACING +# define CONFIG_NXWM_MEDIAPLAYER_YSPACING 8 #endif #ifndef CONFIG_NXWM_MEDIAPLAYER_ICON diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index d72707654..cf44e6f7b 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -102,6 +102,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_pauseBitmap = (NXWidgets::CRlePaletteBitmap *)0; m_rewindBitmap = (NXWidgets::CRlePaletteBitmap *)0; m_fforwardBitmap = (NXWidgets::CRlePaletteBitmap *)0; + m_volumeBitmap = (NXWidgets::CRlePaletteBitmap *)0; // Initial state is stopped @@ -190,6 +191,11 @@ CMediaPlayer::~CMediaPlayer(void) delete m_fforwardBitmap; } + if (m_volumeBitmap) + { + delete m_volumeBitmap; + } + // Although we didn't create it, we are responsible for deleting the // application window @@ -263,9 +269,14 @@ bool CMediaPlayer::run(void) void CMediaPlayer::stop(void) { - // Just disable further drawing + // Just disable further drawing on all widgets m_text->disableDrawing(); + m_play->disableDrawing(); + m_pause->disableDrawing(); + m_rewind->disableDrawing(); + m_fforward->disableDrawing(); + m_volume->disableDrawing(); } /** @@ -303,20 +314,27 @@ void CMediaPlayer::hide(void) /** * Redraw the entire window. The application has been maximized or * otherwise moved to the top of the hierarchy. This method is call from - * CTaskbar when the application window must be displayed + * CTaskbar when the application window must be displayed. */ void CMediaPlayer::redraw(void) { - // Redraw widgets (only). Only one of the Play and Pause images should - // have drawing enabled. + // Get the widget control associated with the application window - m_text->redraw(); - m_play->redraw(); - m_pause->redraw(); - m_rewind->redraw(); - m_fforward->redraw(); - m_volume->redraw(); + NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); + + // Get the CCGraphicsPort instance for this window + + NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); + + // Fill the entire window with the background color + + port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, + CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); + + // Redraw all widgets + + redrawWidgets(); } /** @@ -345,16 +363,6 @@ void CMediaPlayer::setGeometry(void) // Get the size of the window (void)window->getSize(&m_windowSize); - - // Get the size of the text box. Same width as the m_keypad - - m_textSize.w = m_windowSize.w - 10; - m_textSize.h = 36; - - // Now position the text box - - m_textPos.x = 5; - m_textPos.y = 5; } /** @@ -379,13 +387,68 @@ bool CMediaPlayer::createPlayer(void) NXWidgets::CWidgetControl *control = m_window->getWidgetControl(); - // Create a label to show some text. A simple label is used - // because the power of a text box is un-necessary in this application. + // Work out all of the vertical placement first. In order to do that, we + // will need create all of the bitmaps first so that we an use the bitmap + // height in the calculation. + + m_playBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); + m_pauseBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PAUSE_ICON); + m_rewindBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); + m_fforwardBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); + m_volumeBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); + + if (!m_playBitmap || !m_pauseBitmap || !m_rewindBitmap || + !m_fforwardBitmap || !m_volumeBitmap) + { + gdbg("ERROR: Failed to one or more bitmaps\n"); + return false; + } + + // Control image height. Use the same height for all images + + nxgl_coord_t controlH = m_playBitmap->getHeight(); + + if (controlH < m_pauseBitmap->getHeight()) + { + controlH = m_pauseBitmap->getHeight(); + } + + if (controlH < m_rewindBitmap->getHeight()) + { + controlH = m_rewindBitmap->getHeight(); + } + + if (controlH < m_fforwardBitmap->getHeight()) + { + controlH = m_fforwardBitmap->getHeight(); + } + + controlH += 8; + + // Place the volume slider at a comfortable distance from the bottom of + // the display + + nxgl_coord_t volumeTop = m_windowSize.h - m_volumeBitmap->getHeight() - + CONFIG_NXWM_MEDIAPLAYER_YSPACING; + + // Place the player controls just above that. The list box will then end + // just above the controls. + + nxgl_coord_t controlTop = volumeTop - controlH - + CONFIG_NXWM_MEDIAPLAYER_YSPACING; + + // The list box will then end just above the controls. The end of the + // list box is the same as its height because the origin is zero. + + nxgl_coord_t textHeight = controlTop - CONFIG_NXWM_MEDIAPLAYER_YSPACING; + + // Create a label to show some text. + // Note that the list box will extend all of the way to the edges of the + // display and is only limited at the bottom by the player controls. + + m_text = new NXWidgets:: + CLabel(control, 0, 0, m_windowSize.w, textHeight, "0"); - m_text = new NXWidgets::CLabel(control, - m_textPos.x, m_textPos.y, - m_textSize.w, m_textSize.h, - "0"); if (!m_text) { gdbg("ERROR: Failed to create CLabel\n"); @@ -409,13 +472,7 @@ bool CMediaPlayer::createPlayer(void) m_text->setText("Coming soon..."); - // Create all bitmaps - - m_playBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PLAY_ICON); - m_pauseBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_PAUSE_ICON); - m_rewindBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_REW_ICON); - m_fforwardBitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_FWD_ICON); - + // Control image widths. // Image widths will depend on if the images will be bordered or not nxgl_coord_t playControlW; @@ -423,7 +480,8 @@ bool CMediaPlayer::createPlayer(void) nxgl_coord_t fforwardControlW; #ifdef CONFIG_NXWM_MEDIAPLAYER_BORDERS - // Set the width to the widest image + // Use the same width for all control images. Set the width to the width + // of the widest image nxgl_coord_t imageW = m_playBitmap->getWidth(); @@ -450,7 +508,6 @@ bool CMediaPlayer::createPlayer(void) fforwardControlW = imageW; #else - // Use the bitmap image widths for the image widths (plus a bit) playControlW = m_playBitmap->getWidth() + 8; @@ -467,35 +524,19 @@ bool CMediaPlayer::createPlayer(void) } #endif - // Use the same height for all images - - nxgl_coord_t controlH = m_playBitmap->getHeight(); - - if (controlH < m_pauseBitmap->getHeight()) - { - controlH = m_pauseBitmap->getHeight(); - } - - if (controlH < m_rewindBitmap->getHeight()) - { - controlH = m_rewindBitmap->getHeight(); - } - - if (controlH < m_fforwardBitmap->getHeight()) - { - controlH = m_fforwardBitmap->getHeight(); - } - - controlH += 8; - // Create the Play image nxgl_coord_t playControlX = (m_windowSize.w >> 1) - (playControlW >> 1); - uint32_t controlY = (180 * m_windowSize.h) >> 8; m_play = new NXWidgets:: - CImage(control, playControlX, (nxgl_coord_t)controlY, - playControlW, controlH, m_playBitmap); + CImage(control, playControlX, controlTop, playControlW, controlH, + m_playBitmap); + + if (!m_play) + { + gdbg("ERROR: Failed to create play control\n"); + return false; + } // Configure the Play image @@ -515,8 +556,14 @@ bool CMediaPlayer::createPlayer(void) // Create the Pause image (at the same position ans size as the Play image) m_pause = new NXWidgets:: - CImage(control, playControlX, (nxgl_coord_t)controlY, - playControlW, controlH, m_pauseBitmap); + CImage(control, playControlX, controlTop, playControlW, controlH, + m_pauseBitmap); + + if (!m_pause) + { + gdbg("ERROR: Failed to create pause control\n"); + return false; + } // Configure the Pause image (hidden and disabled initially) @@ -539,8 +586,14 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_rewind = new NXWidgets:: - CStickyImage(control, rewControlX, (nxgl_coord_t)controlY, - rewindControlW, controlH, m_rewindBitmap); + CStickyImage(control, rewControlX, controlTop, rewindControlW, + controlH, m_rewindBitmap); + + if (!m_rewind) + { + gdbg("ERROR: Failed to create rewind control\n"); + return false; + } // Configure the Rewind image @@ -563,8 +616,14 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_MEDIAPLAYER_XSPACING; m_fforward = new NXWidgets:: - CStickyImage(control, fwdControlX, (nxgl_coord_t)controlY, - fforwardControlW, controlH, m_fforwardBitmap); + CStickyImage(control, fwdControlX, controlTop, fforwardControlW, + controlH, m_fforwardBitmap); + + if (!m_fforward) + { + gdbg("ERROR: Failed to create fast forward control\n"); + return false; + } // Configure the Forward image @@ -583,20 +642,22 @@ bool CMediaPlayer::createPlayer(void) // Create the Volume control - NXWidgets::CRlePaletteBitmap *volBitmap = new NXWidgets:: - CRlePaletteBitmap(&CONFIG_NXWM_MPLAYER_VOL_ICON); - uint32_t volumeControlX = (9 * m_windowSize.w) >> 8; - uint32_t volumeControlY = (232 * m_windowSize.h) >> 8; m_volume = new NXWidgets:: CGlyphSliderHorizontal(control, (nxgl_coord_t)volumeControlX, - (nxgl_coord_t)volumeControlY, + volumeTop, (nxgl_coord_t)(m_windowSize.w - 2 * volumeControlX), - volBitmap->getHeight() + 4, volBitmap, + m_volumeBitmap->getHeight() + 4, m_volumeBitmap, MKRGB(63, 90,192)); + if (!m_volume) + { + gdbg("ERROR: Failed to create volume control\n"); + return false; + } + // Configure the volume control m_volume->disableDrawing(); @@ -604,25 +665,19 @@ bool CMediaPlayer::createPlayer(void) m_volume->setMaximumValue(100); m_volume->setValue(15); - // Register to get events from the mouse clicks on the Forward image + // Register to get events from the value changes in the volume slider m_volume->addWidgetEventHandler(this); - // Redraw the background once only - // Get the CCGraphicsPort instance for this window - - NXWidgets::CGraphicsPort *port = control->getGraphicsPort(); - - // Fill the entire window with the background color - - port->drawFilledRect(0, 0, m_windowSize.w, m_windowSize.h, - CONFIG_NXWM_MEDIAPLAYER_BACKGROUNDCOLOR); - // Make sure that all widgets are setup for the STOPPED state. Among other this, // this will enable drawing in the play widget (only) setMediaPlayerState(MPLAYER_STOPPED); + // Set the volume level + + setVolumeLevel(); + // Enable drawing in the text, rewind, fast-forward and drawing widgets. m_text->enableDrawing(); @@ -633,7 +688,6 @@ bool CMediaPlayer::createPlayer(void) // And redraw all of the widgets that are enabled redraw(); - return true; } @@ -655,6 +709,54 @@ void CMediaPlayer::close(void) m_taskbar->stopApplication(static_cast(this)); } +/** + * Redraw all widgets. Called from redraw() and also on any state + * change. + * + * @param state The new state to enter. + */ + +void CMediaPlayer::redrawWidgets(void) +{ + // Redraw widgets. We have to re-enable drawing all all widgets since + // drawing was disabled by the hide() method. + + m_text->enableDrawing(); + m_text->redraw(); + + // Only one of the Play and Pause images should have drawing enabled. + + if (m_state != MPLAYER_STOPPED && m_prevState == MPLAYER_PLAYING) + { + // Playing... show the pause button + // REVISIT: Really only available if there is a selected file in the list box + + m_pause->enableDrawing(); + m_pause->redraw(); + } + else + { + // Paused or Stopped... show the play button + + m_play->enableDrawing(); + m_play->redraw(); + } + + // Rewind and play buttons are only shown if we are not STOPPED + + if (m_state != MPLAYER_STOPPED) + { + m_rewind->enableDrawing(); + m_rewind->redraw(); + + m_fforward->enableDrawing(); + m_fforward->redraw(); + } + + m_volume->enableDrawing(); + m_volume->redraw(); +} + /** * Transition to a new media player state. * @@ -663,6 +765,10 @@ void CMediaPlayer::close(void) void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) { + // Stop drawing on all widgets + + stop(); + // Handle according to the new state switch (state) @@ -676,14 +782,13 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_text->enable(); // Play image enabled and ready to start playing + // REVISIT: Really only available if there is a selected file in the list box m_play->enable(); m_play->show(); - m_play->enableDrawing(); // Pause image is disabled and hidden - m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); @@ -710,7 +815,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) // Play image hidden and disabled - m_play->disableDrawing(); m_play->disable(); m_play->hide(); @@ -718,7 +822,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->enable(); m_pause->show(); - m_pause->enableDrawing(); // Fast forward image is enabled and ready for use @@ -729,8 +832,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_rewind->enable(); m_rewind->setStuckSelection(false); - - m_volume->enable(); break; case MPLAYER_PAUSED: // Playing a media file but paused @@ -745,25 +846,19 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_play->enable(); m_play->show(); - m_play->enableDrawing(); // Pause image is disabled and hidden - m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); // Fast forward image is enabled and ready for use - m_fforward->enable(); m_fforward->setStuckSelection(false); // Rewind image is enabled and ready for use - m_rewind->enable(); m_rewind->setStuckSelection(false); - - m_volume->enable(); break; case MPLAYER_FFORWARD: // Fast forwarding through a media file */ @@ -777,7 +872,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) { // Play image hidden and disabled - m_play->disableDrawing(); m_play->disable(); m_play->hide(); @@ -785,7 +879,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->enable(); m_pause->show(); - m_pause->enableDrawing(); } else { @@ -793,26 +886,20 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_play->enable(); m_play->show(); - m_play->enableDrawing(); // Pause image is hidden and disabled - m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); } // Fast forward image is enabled, highlighted and ready for use - m_fforward->enable(); m_fforward->setStuckSelection(true); // Rewind is enabled and ready for use - m_rewind->enable(); m_rewind->setStuckSelection(false); - - m_volume->enable(); break; case MPLAYER_FREWIND: // Rewinding a media file @@ -826,7 +913,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) { // Play image hidden and disabled - m_play->disableDrawing(); m_play->disable(); m_play->hide(); @@ -834,7 +920,6 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->enable(); m_pause->show(); - m_pause->enableDrawing(); } else { @@ -842,36 +927,48 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_play->enable(); m_play->show(); - m_play->enableDrawing(); // Pause image is hidden and disabled - m_pause->disableDrawing(); m_pause->disable(); m_pause->hide(); } // Fast forward image is enabled and ready for use - m_fforward->enable(); m_fforward->setStuckSelection(false); // Rewind image is enabled, highlighted, and ready for use - m_rewind->enable(); m_rewind->setStuckSelection(true); - - m_volume->enable(); break; default: break; } + + // Re-enable drawing and redraw all widgets for the new state + + redrawWidgets(); } /** - * Handle a widget action event. This includes a image pre/release - * release events and volume slider change events. + * Set the new volume level based on the position of the volume slider. + */ + +void CMediaPlayer::setVolumeLevel(void) +{ + // Current volume level values. This is already pre-scaled in the range 0-100 + + m_level = m_volume->getValue(); + + // Now, provide the new volume setting to the NX Player +#warning Missing logic +} + +/** + * Handle a widget action event. For this application, that means image + * pre-release events. * * @param e The event data. */ @@ -952,11 +1049,6 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } } - - if (m_volume->isClicked()) - { -printf("Volume clicked\n"); // REMOVE ME - } } /** @@ -998,6 +1090,15 @@ void CMediaPlayer::handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs & handleReleaseEvent(e); } +/** + * Handle changes in the volume level. + */ + +void CMediaPlayer::handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e) +{ + setVolumeLevel(); +} + /** * CMediaPlayerFactory Constructor * From d551a96690105abe8f4edf3e13fbea30378d5ee9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 11:12:22 -0600 Subject: [PATCH 224/390] update changelog --- ChangeLog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 22aa51280..c63ee3ea8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -460,4 +460,9 @@ * NxWidgets::CStickyImage: A version of CImage that sticks in the selected state when clicked (2014-7-15). * NxMW::CMediaPlayer: Now supports a pause button (2014-7-15). +* NxMW::CMediaPlayer: Fix some memory leaks (2014-7-16). +* NxMW::CMediaPlayer: Change spacing, make text region big enough to support + a multi-line, scrollable region (2014-7-16). +* NxMW::CMediaPlayer: Correctly catch the volume level change event + (2014-7-16). From becc6901db7bfc361758e8b4133e04c6911147e7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 14:11:02 -0600 Subject: [PATCH 225/390] NxWM::CMediaPlayer: Convert CLabel to a CListBox --- libnxwidgets/include/clistbox.hxx | 2 +- libnxwidgets/include/cnxwidget.hxx | 12 ++ .../include/cwidgeteventhandlerlist.hxx | 2 +- libnxwidgets/src/clistbox.cxx | 4 +- libnxwidgets/src/cnxwidget.cxx | 4 +- libnxwidgets/src/cwidgeteventhandlerlist.cxx | 4 +- nxwm/include/cmediaplayer.hxx | 44 ++-- nxwm/src/cmediaplayer.cxx | 189 ++++++++++++++---- 8 files changed, 203 insertions(+), 58 deletions(-) diff --git a/libnxwidgets/include/clistbox.hxx b/libnxwidgets/include/clistbox.hxx index d4861af8c..07a6296e8 100644 --- a/libnxwidgets/include/clistbox.hxx +++ b/libnxwidgets/include/clistbox.hxx @@ -259,7 +259,7 @@ namespace NXWidgets virtual void selectOption(const int index); /** - * Select an option by its index. + * De-select an option by its index. * Redraws the widget and raises a value changed event. * * @param index The index of the option to select. diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index dd1880cc2..543c0b24b 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -801,6 +801,7 @@ namespace NXWidgets * * @return Const pointer to CWidgetStyle stored inside this widget. */ + inline const CWidgetStyle *getWidgetStyle() const { return &m_style; } /** @@ -867,6 +868,17 @@ namespace NXWidgets m_widgetEventHandlers->removeWidgetEventHandler(eventHandler); } + /** + * Return the number of registered event handlers + * + * @return The number of registered event handlers + */ + + inline int nWidgetEventHandlers(void) const + { + return m_widgetEventHandlers->size(); + } + /** * Enables or disables event firing for this widget. * diff --git a/libnxwidgets/include/cwidgeteventhandlerlist.hxx b/libnxwidgets/include/cwidgeteventhandlerlist.hxx index 7d5424365..66f5cd654 100644 --- a/libnxwidgets/include/cwidgeteventhandlerlist.hxx +++ b/libnxwidgets/include/cwidgeteventhandlerlist.hxx @@ -151,7 +151,7 @@ namespace NXWidgets * @return The size of the array. */ - inline nxgl_coord_t size(void) const + inline int size(void) const { return m_widgetEventHandlers.size(); } diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index d37915e42..8d076f3d3 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include "cwidgetcontrol.hxx" #include "clistbox.hxx" diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 7db9eee99..99f7014cc 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include "cnxwidget.hxx" #include "cgraphicsport.hxx" diff --git a/libnxwidgets/src/cwidgeteventhandlerlist.cxx b/libnxwidgets/src/cwidgeteventhandlerlist.cxx index 840778bac..d3f0bfe9e 100644 --- a/libnxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/libnxwidgets/src/cwidgeteventhandlerlist.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include "cnxwidget.hxx" #include "cwidgeteventhandler.hxx" diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index bf4ff61f4..455792db5 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -46,10 +46,11 @@ #include #include +#include "cnxfont.hxx" #include "cimage.hxx" #include "cstickyimage.hxx" -#include "clabel.hxx" -#include "cnxfont.hxx" +#include "clistbox.hxx" +#include "clistboxdataitem.hxx" #include "cglyphsliderhorizontal.hxx" #include "iapplication.hxx" @@ -117,7 +118,14 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ - unsigned int m_level; /**< Current volume level */ + int m_level; /**< Current volume level */ + int m_fileIndex; /**< Index to selected file in the list box */ + + /** + * Media player geometry. + */ + + struct nxgl_size_s m_windowSize; /**< The size of the media player window */ /** * Cached constructor parameters. @@ -130,7 +138,7 @@ namespace NxWM * Widgets */ - NXWidgets::CLabel *m_text; /**< Some text in the app for now */ + NXWidgets::CListBox *m_listbox; /**< List box containing media files selections */ NXWidgets::CNxFont *m_font; /**< The font used in the media player */ NXWidgets::CImage *m_play; /**< Play control */ NXWidgets::CImage *m_pause; /**< Pause control */ @@ -152,19 +160,31 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_volumeBitmap; /**< Volume control grip bitmap */ /** - * Calculator geometry. This stuff does not really have to be retained - * in memory. If you are pinched for memory, get rid of these. + * Open a media file for playing. Called after a file has been selected + * from the list box. */ - struct nxgl_size_s m_windowSize; /**< The size of the media player window */ - struct nxgl_size_s m_textSize; /**< The size of the media player textbox */ + inline bool openMediaFile(const NXWidgets::CListBoxDataItem *item); /** - * Select the geometry of the media player given the current window size. - * Only called as part of construction. - */ + * Close media file. Called when a new media file is selected, when a + * media file is de-selected, or when destroying the media player instance. + */ - inline void setGeometry(void); + inline void closeMediaFile(void); + + /** + * Select the geometry of the media player given the current window size. + * Only called as part of construction. + */ + + inline void setGeometry(void); + + /** + * Load media files into the list box. + */ + + inline bool showMediaFiles(const char *mediaPath); /** * Create the Media Player controls. Only start as part of the application diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index cf44e6f7b..b13f76609 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -88,7 +88,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) // Nullify widgets that will be instantiated when the window is started - m_text = (NXWidgets::CLabel *)0; + m_listbox = (NXWidgets::CListBox *)0; m_font = (NXWidgets::CNxFont *)0; m_play = (NXWidgets::CImage *)0; m_pause = (NXWidgets::CImage *)0; @@ -109,6 +109,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_STOPPED; m_pending = PENDING_NONE; + m_fileIndex = -1; // Add our personalized window label @@ -134,9 +135,9 @@ CMediaPlayer::~CMediaPlayer(void) { // Destroy widgets - if (m_text) + if (m_listbox) { - delete m_text; + delete m_listbox; } if (m_font) @@ -249,7 +250,7 @@ bool CMediaPlayer::run(void) { // Create the widgets (if we have not already done so) - if (!m_text) + if (!m_listbox) { // Create the widgets @@ -271,7 +272,7 @@ void CMediaPlayer::stop(void) { // Just disable further drawing on all widgets - m_text->disableDrawing(); + m_listbox->disableDrawing(); m_play->disableDrawing(); m_pause->disableDrawing(); m_rewind->disableDrawing(); @@ -350,6 +351,26 @@ bool CMediaPlayer::isFullScreen(void) const return m_window->isFullScreen(); } +/** + * Open a media file for playing. Called after a file has been selected + * from the list box. + */ + +bool CMediaPlayer::openMediaFile(const NXWidgets::CListBoxDataItem *item) +{ +#warning Missing logic + return true; +} + +/** + * Close media file. Called when a new media file is selected, when a media file is de-selected, or when destroying the media player instance. + */ + +void CMediaPlayer::closeMediaFile(void) +{ +#warning Missing logic +} + /** * Select the geometry of the media player given the current window size. */ @@ -365,6 +386,44 @@ void CMediaPlayer::setGeometry(void) (void)window->getSize(&m_windowSize); } +/** + * Load media files into the list box. + */ + +inline bool CMediaPlayer::showMediaFiles(const char *mediaPath) +{ + // Remove any filenames already in the list box + + m_listbox->removeAllOptions(); + +#if 0 + // Open the media path directory + // Read each directory entry + // Add the directory entry to the list box + // Close the directory +#else +# warning "Missing Logic" + + // Just add a couple of dummy files for testing + + m_listbox->addOption("File 1", 0, + CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR, + CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, + CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR, + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); + m_listbox->addOption("File 2", 1, + CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR, + CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, + CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR, + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); +#endif + + // Sort the file names in alphabetical order + + m_listbox->sort(); + return true; +} + /** * Create the media player widgets. Only start as part of the application * start method. @@ -440,37 +499,34 @@ bool CMediaPlayer::createPlayer(void) // The list box will then end just above the controls. The end of the // list box is the same as its height because the origin is zero. - nxgl_coord_t textHeight = controlTop - CONFIG_NXWM_MEDIAPLAYER_YSPACING; + nxgl_coord_t listHeight = controlTop - CONFIG_NXWM_MEDIAPLAYER_YSPACING; - // Create a label to show some text. + // Create a list box to show media file selections. // Note that the list box will extend all of the way to the edges of the // display and is only limited at the bottom by the player controls. + // REVISIT: This should be a scrollable list box - m_text = new NXWidgets:: - CLabel(control, 0, 0, m_windowSize.w, textHeight, "0"); - - if (!m_text) + m_listbox = new NXWidgets::CListBox(control, 0, 0, m_windowSize.w, listHeight); + if (!m_listbox) { - gdbg("ERROR: Failed to create CLabel\n"); + gdbg("ERROR: Failed to create CListBox\n"); return false; } - // Align text on the left + // Configure the list box - m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_RIGHT); + m_listbox->disableDrawing(); + m_listbox->setAllowMultipleSelections(false); + m_listbox->setFont(m_font); + m_listbox->setBorderless(false); - // Disable drawing and events until we are asked to redraw the window + // Register to get events when a new file is selected from the list box - m_text->disableDrawing(); - m_text->setRaisesEvents(false); + m_listbox->addWidgetEventHandler(this); - // Select the font + // Show the media files that are available for playing - m_text->setFont(m_font); - - // Add some dummy text for now - - m_text->setText("Coming soon..."); + showMediaFiles(CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH); // Control image widths. // Image widths will depend on if the images will be bordered or not @@ -678,9 +734,9 @@ bool CMediaPlayer::createPlayer(void) setVolumeLevel(); - // Enable drawing in the text, rewind, fast-forward and drawing widgets. + // Enable drawing in the list box, rewind, fast-forward and drawing widgets. - m_text->enableDrawing(); + m_listbox->enableDrawing(); m_rewind->enableDrawing(); m_fforward->enableDrawing(); m_volume->enableDrawing(); @@ -721,8 +777,8 @@ void CMediaPlayer::redrawWidgets(void) // Redraw widgets. We have to re-enable drawing all all widgets since // drawing was disabled by the hide() method. - m_text->enableDrawing(); - m_text->redraw(); + m_listbox->enableDrawing(); + m_listbox->redraw(); // Only one of the Play and Pause images should have drawing enabled. @@ -777,9 +833,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_PLAYING; - // Text box is enabled and ready for text entry + // List box is enabled and ready for file selection - m_text->enable(); + m_listbox->enable(); // Play image enabled and ready to start playing // REVISIT: Really only available if there is a selected file in the list box @@ -809,9 +865,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_state = MPLAYER_PLAYING; m_prevState = MPLAYER_PLAYING; - // Text box is not available while playing + // List box is not available while playing - m_text->disable(); + m_listbox->disable(); // Play image hidden and disabled @@ -838,9 +894,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_state = MPLAYER_PAUSED; m_prevState = MPLAYER_PAUSED; - // Text box is enabled a ready for text entry + // List box is enabled a ready for file selection - m_text->enable(); + m_listbox->enable(); // Play image enabled and ready to resume playing @@ -864,9 +920,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) case MPLAYER_FFORWARD: // Fast forwarding through a media file */ m_state = MPLAYER_FFORWARD; - // Text box is not available while fast forwarding + // List box is not available while fast forwarding - m_text->disable(); + m_listbox->disable(); if (m_prevState == MPLAYER_PLAYING) { @@ -905,9 +961,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) case MPLAYER_FREWIND: // Rewinding a media file m_state = MPLAYER_FREWIND; - // Text box is not available while rewinding + // List box is not available while rewinding - m_text->disable(); + m_listbox->disable(); if (m_prevState == MPLAYER_PLAYING) { @@ -1049,6 +1105,63 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } } + + // Check for new file selections from the list box + + int newFileIndex = m_listbox->getSelectedIndex(); + + // Check if anything is selected + + if (newFileIndex < 0) + { + // Nothing is selected.. If we are not stopped, then stop now + + if (m_state != MPLAYER_STOPPED) + { + closeMediaFile(); + setMediaPlayerState(MPLAYER_STOPPED); + } + } + + // A media file is selected. Were stopped before? + + else if (m_state == MPLAYER_STOPPED) + { + // Yes.. open the new media file and go to the PAUSE state + + if (!openMediaFile(m_listbox->getSelectedOption())) + { + m_fileIndex = -1; + gdbg("openMediaFile failed\m"); + } + else + { + m_fileIndex = newFileIndex; + setMediaPlayerState(MPLAYER_PAUSED); + } + } + + // We already have a media file loaded. Is it the same file? + + else if (m_fileIndex != newFileIndex) + { + // No.. It is a new file. Close that media file, load the newly + // selected file, and make sure that we are in the paused state + // (that should already be the case) + + closeMediaFile(); + if (!openMediaFile(m_listbox->getSelectedOption())) + { + gdbg("openMediaFile failed\m"); + m_fileIndex = -1; + setMediaPlayerState(MPLAYER_STOPPED); + } + else + { + m_fileIndex = newFileIndex; + setMediaPlayerState(MPLAYER_PAUSED); + } + } } /** @@ -1098,7 +1211,7 @@ void CMediaPlayer::handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e) { setVolumeLevel(); } - + /** * CMediaPlayerFactory Constructor * From fb00e71771febb63b3ed20d08ee2dd20b3366728 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 14:12:25 -0600 Subject: [PATCH 226/390] Update changelog --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c63ee3ea8..4cef61f21 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -465,4 +465,6 @@ a multi-line, scrollable region (2014-7-16). * NxMW::CMediaPlayer: Correctly catch the volume level change event (2014-7-16). - +* NxMW::CMediaPlayer: Concert CLabel to a CListBox to support selection of + one of many media files to play. This should be a CScrollingTextBox to + support an indefinitely large number of media files (2014-7-16). From ef1112d7744752ce21327cfdef338e689c7385cd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 15:09:20 -0600 Subject: [PATCH 227/390] Use cstdint, etc. vs stdint.h, etc. --- libnxwidgets/include/clistbox.hxx | 4 ++-- libnxwidgets/include/clistdata.hxx | 4 ++-- libnxwidgets/src/cglyphsliderhorizontal.cxx | 1 + libnxwidgets/src/clistbox.cxx | 4 ++-- libnxwidgets/src/clistboxdataitem.cxx | 4 ++-- libnxwidgets/src/clistdata.cxx | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libnxwidgets/include/clistbox.hxx b/libnxwidgets/include/clistbox.hxx index 07a6296e8..f6c774abd 100644 --- a/libnxwidgets/include/clistbox.hxx +++ b/libnxwidgets/include/clistbox.hxx @@ -76,8 +76,8 @@ #include -#include -#include +#include +#include #include diff --git a/libnxwidgets/include/clistdata.hxx b/libnxwidgets/include/clistdata.hxx index 81aa1f3f6..da46a6acd 100644 --- a/libnxwidgets/include/clistdata.hxx +++ b/libnxwidgets/include/clistdata.hxx @@ -76,8 +76,8 @@ #include -#include -#include +#include +#include #include diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index 0430a541f..b75ff736d 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -3,6 +3,7 @@ * * Copyright (C) 2013 Ken Pettit. All rights reserved. * Author: Ken Pettit + * Gregory Nutt (updates to Ken's fundamental work) * * Based on and copied from csliderhorizontal.cxx written by Gregory Nutt * diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index 8d076f3d3..1c5d1e507 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -462,7 +462,7 @@ void CListBox::drawContents(CGraphicsPort *port) nxgl_coord_t clipY = rect.getY(); nxgl_coord_t clipHeight = rect.getHeight(); - // Precalc values for option draw loop + // Precalculate values for option draw loop nxgl_coord_t optionHeight = getOptionHeight(); @@ -607,7 +607,7 @@ void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y) const CListBoxDataItem *item = (const CListBoxDataItem*)m_options.getItem(m_lastSelectedIndex); - // Are we setting or unsetting? + // Are we selecting or de-selecting? if (item->isSelected()) { diff --git a/libnxwidgets/src/clistboxdataitem.cxx b/libnxwidgets/src/clistboxdataitem.cxx index 22a9323bb..01c544b5f 100644 --- a/libnxwidgets/src/clistboxdataitem.cxx +++ b/libnxwidgets/src/clistboxdataitem.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include "cwidgetcontrol.hxx" #include "clistboxdataitem.hxx" diff --git a/libnxwidgets/src/clistdata.cxx b/libnxwidgets/src/clistdata.cxx index 7a02e3e37..ba825b42d 100644 --- a/libnxwidgets/src/clistdata.cxx +++ b/libnxwidgets/src/clistdata.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include #include "clistdata.hxx" From b1e7a4e4f877a42561376a0ddfb58871aa3ec1ef Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 16:31:31 -0600 Subject: [PATCH 228/390] Rename CONFIG_NX_MOUSE to CONFIG_NX_INPUT, then add CONFIG_NX_XYINPUT_MOUSE and CONFIG_XYINPUT_TOUCHSCREEN --- Kconfig | 1 + libnxwidgets/include/ccallback.hxx | 4 ++-- libnxwidgets/include/cwindoweventhandler.hxx | 2 +- libnxwidgets/include/cwindoweventhandlerlist.hxx | 2 +- libnxwidgets/include/nxconfig.hxx | 6 +++--- libnxwidgets/src/ccallback.cxx | 6 +++--- libnxwidgets/src/cwidgetcontrol.cxx | 2 +- libnxwidgets/src/cwindoweventhandlerlist.cxx | 2 +- nxwm/include/cwindowmessenger.hxx | 2 +- nxwm/src/cwindowmessenger.cxx | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Kconfig b/Kconfig index a1a6803e4..aea80e076 100644 --- a/Kconfig +++ b/Kconfig @@ -1113,6 +1113,7 @@ menu "NxWM Media Player Display Settings" config NXWM_MEDIAPLAYER bool "NxWM Media Player" default n + depends on FS_READABLE ---help--- Enable support for the MP3 Media Player. This features requires a board that includes an MP3 Codec chip, such as the Mikromedia diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index bef4a2ca9..8127dc20d 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -158,11 +158,11 @@ namespace NXWidgets * nxtk_openwindow, or nxtk_opentoolbar). */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT static void newMouseEvent(NXHANDLE hwnd, FAR const struct nxgl_point_s *pos, uint8_t buttons, FAR void *arg); -#endif /* CONFIG_NX_MOUSE */ +#endif /* CONFIG_NX_XYINPUT */ /** * New keyboard/keypad data is available for the window. The new diff --git a/libnxwidgets/include/cwindoweventhandler.hxx b/libnxwidgets/include/cwindoweventhandler.hxx index 379ae4725..6a8fcbf0c 100644 --- a/libnxwidgets/include/cwindoweventhandler.hxx +++ b/libnxwidgets/include/cwindoweventhandler.hxx @@ -94,7 +94,7 @@ namespace NXWidgets * @param e The event data. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT virtual void handleMouseEvent(void) { } #endif diff --git a/libnxwidgets/include/cwindoweventhandlerlist.hxx b/libnxwidgets/include/cwindoweventhandlerlist.hxx index a076e63cf..e677339c2 100644 --- a/libnxwidgets/include/cwindoweventhandlerlist.hxx +++ b/libnxwidgets/include/cwindoweventhandlerlist.hxx @@ -149,7 +149,7 @@ namespace NXWidgets * Raise an NX mouse window input event. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void raiseMouseEvent(void); #endif diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 05c6d8422..34be7a788 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -57,7 +57,7 @@ * * CONFIG_HAVE_CXX=y : C++ support is required * CONFIG_NX=y : NX graphics support must be enabled - * CONFIG_NX_MOUSE=y : Required to enable NX mouse/touchscreen support + * CONFIG_NX_XYINPUT=y : Required to enable NX mouse/touchscreen support * CONFIG_NX_KBD=y : Required to enabled NX keyboard support * CONFIG_NX_NPLANES=1 : Only a single video plane is supported * @@ -160,8 +160,8 @@ * Required to enable NX mouse/touchscreen support */ -#ifndef CONFIG_NX_MOUSE -# warning "NX mouse/touchscreen support is required (CONFIG_NX_MOUSE)" +#ifndef CONFIG_NX_XYINPUT +# warning "NX mouse/touchscreen support is required (CONFIG_NX_XYINPUT)" #endif /** diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 488016162..4550d24b0 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -77,7 +77,7 @@ CCallback::CCallback(CWidgetControl *widgetControl) m_callbacks.redraw = redraw; m_callbacks.position = position; -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT m_callbacks.mousein = newMouseEvent; #endif #ifdef CONFIG_NX_KBD @@ -165,7 +165,7 @@ void CCallback::position(NXHANDLE hwnd, * nxtk_openwindow, or nxtk_opentoolbar). */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void CCallback::newMouseEvent(NXHANDLE hwnd, FAR const struct nxgl_point_s *pos, uint8_t buttons, FAR void *arg) @@ -181,7 +181,7 @@ void CCallback::newMouseEvent(NXHANDLE hwnd, This->m_widgetControl->newMouseEvent(pos, buttons); } -#endif /* CONFIG_NX_MOUSE */ +#endif /* CONFIG_NX_XYINPUT */ /** * New keyboard/keypad data is available for the window. The new keyboard diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 2cb1a930d..aab75b84c 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -448,7 +448,7 @@ void CWidgetControl::redrawEvent(FAR const struct nxgl_rect_s *nxRect, bool more * @param buttons See NX_MOUSE_* definitions. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t buttons) { // Save the mouse X/Y position diff --git a/libnxwidgets/src/cwindoweventhandlerlist.cxx b/libnxwidgets/src/cwindoweventhandlerlist.cxx index 79dd97d7f..265fd7ff2 100644 --- a/libnxwidgets/src/cwindoweventhandlerlist.cxx +++ b/libnxwidgets/src/cwindoweventhandlerlist.cxx @@ -136,7 +136,7 @@ void CWindowEventHandlerList::raiseGeometryEvent(void) * Raise an NX mouse window input event. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void CWindowEventHandlerList::raiseMouseEvent(void) { for (int i = 0; i < m_eventHandlers.size(); ++i) diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index a30010fd8..3822813d1 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -103,7 +103,7 @@ namespace NxWM * @param e The event data. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void handleMouseEvent(void); #endif diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 114690838..86120aacd 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -91,7 +91,7 @@ CWindowMessenger::~CWindowMessenger(void) * @param e The event data. */ -#ifdef CONFIG_NX_MOUSE +#ifdef CONFIG_NX_XYINPUT void CWindowMessenger::handleMouseEvent(void) { // The logic path here is tortuous but flexible: From f5626ea60594e88fc1e990ddb5fb2fddcdacb4d5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 19:20:44 -0600 Subject: [PATCH 229/390] Misc changes related to MediaPlayer. Nothing really significant --- Kconfig | 6 + libnxwidgets/include/cwidgetcontrol.hxx | 21 +++- libnxwidgets/src/cglyphsliderhorizontal.cxx | 30 ++--- .../src/cglyphsliderhorizontalgrip.cxx | 2 +- libnxwidgets/src/cnxwidget.cxx | 6 +- libnxwidgets/src/cwidgetcontrol.cxx | 112 ++++++++++-------- nxwm/include/nxwmconfig.hxx | 4 + nxwm/src/cmediaplayer.cxx | 14 ++- nxwm/src/ctouchscreen.cxx | 2 +- nxwm/src/cwindowmessenger.cxx | 1 - 10 files changed, 119 insertions(+), 79 deletions(-) diff --git a/Kconfig b/Kconfig index aea80e076..34a96e89d 100644 --- a/Kconfig +++ b/Kconfig @@ -1147,6 +1147,12 @@ config NXWM_MEDIAPLAYER_YSPACING forward, and reverse controls, and the volume slider in units of lines. +config NXWM_MEDIAPLAYER_VOLUMESTEP + int "Media Player Volume Step" + default 5 + ---help--- + This increment in volume, up or down, when the volume bar is clicked. + config NXWM_MEDIAPLAYER_BORDERS bool "Media Player Button Borders" default n diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index f0afe2c47..69bbd1798 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -102,9 +102,16 @@ namespace NXWidgets * NX mouse callback */ - struct SMouse +#ifdef CONFIG_NX_XYINPUT + struct SXYInput { + // A touchscreen has no buttons. However, the convention is that + // touchscreen contacts are reported with the LEFT button pressed. + // The loss of contct is reported with no buttons pressed. + #if 0 // Center and right buttons are not used + // But only a mouse has center and right buttons + uint16_t leftPressed : 1; /**< Left button pressed (or touchscreen contact) */ uint16_t centerPressed : 1; /**< Center button pressed (not @@ -143,6 +150,9 @@ namespace NXWidgets uint8_t doubleClick : 1; /**< Left button double click */ uint8_t unused : 3; /**< Padding bits */ #endif + + // These are attributes common to both touchscreen and mouse input devices + nxgl_coord_t x; /**< Current X coordinate of the mouse/touch */ nxgl_coord_t y; /**< Current Y coordinate of @@ -156,6 +166,7 @@ namespace NXWidgets struct timespec leftReleaseTime; /**< Time the left button was released */ }; +#endif /** * State data @@ -181,8 +192,10 @@ namespace NXWidgets * I/O */ - struct SMouse m_mouse; /**< Current pointer +#ifdef CONFIG_NX_XYINPUT + struct SXYInput m_xyinput; /**< Current XY input device state */ +#endif CNxWidget *m_clickedWidget; /**< Pointer to the widget that is clicked. */ CNxWidget *m_focusedWidget; /**< Pointer to the widget @@ -357,11 +370,13 @@ namespace NXWidgets giveBoundsSem(); } +#ifdef CONFIG_NX_XYINPUT /** * Clear all mouse events */ void clearMouseEvents(void); +#endif public: @@ -553,7 +568,7 @@ namespace NXWidgets inline bool doubleClick(void) { - return (bool)m_mouse.doubleClick; + return (bool)m_xyinput.doubleClick; } /** diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index b75ff736d..da7150ef7 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -76,8 +76,8 @@ #include -#include -#include +#include +#include #include "cwidgetcontrol.hxx" #include "cglyphsliderhorizontal.hxx" @@ -112,25 +112,25 @@ CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, nxwidget_pixel_t fillColor, bool fill) :CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) { - m_minimumValue = 0; - m_maximumValue = 0; - m_contentSize = 0; - m_value = 0; - m_minimumGripWidth = 10; - m_pageSize = 1; - m_fillColor = fillColor; - m_fill = fill; - m_barThickness = 8; + m_minimumValue = 0; + m_maximumValue = 0; + m_contentSize = 0; + m_value = 0; + m_minimumGripWidth = 10; + m_pageSize = 1; + m_fillColor = fillColor; + m_fill = fill; + m_barThickness = 8; - m_flags.permeable = false; - m_flags.borderless = false; + m_flags.permeable = false; + m_flags.borderless = false; m_flags.doubleClickable = false; // Create grip CRect rect; getClientRect(rect); - m_gutterWidth = rect.getWidth(); + m_gutterWidth = rect.getWidth(); // Create grip @@ -214,7 +214,7 @@ void CGlyphSliderHorizontal::handleDragEvent(const CWidgetEventArgs & e) { // Handle grip events - if ((e.getSource() == m_grip) && (e.getSource() != NULL)) + if (e.getSource() == m_grip && e.getSource() != NULL) { int32_t newValue = getGripValue() >> 16; diff --git a/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx index 6e7be0af2..277a4f276 100644 --- a/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontalgrip.cxx @@ -167,7 +167,7 @@ void CGlyphSliderHorizontalGrip::onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y */ void CGlyphSliderHorizontalGrip::onDrag(nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t vX, nxgl_coord_t vY) + nxgl_coord_t vX, nxgl_coord_t vY) { // Work out where we're moving to diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 99f7014cc..c0c406dde 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -100,7 +100,7 @@ using namespace NXWidgets; /** * Constructor. * - * @param pWidgetControl The controllwing widget for the display + * @param pWidgetControl The controlling widget for the display * @param x The x coordinate of the widget. * @param y The y coordinate of the widget. * @param width The width of the widget. @@ -831,9 +831,9 @@ bool CNxWidget::release(nxgl_coord_t x, nxgl_coord_t y) bool CNxWidget::drag(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY) { - if ((isEnabled()) && (m_flags.dragging)) + if (isEnabled() && m_flags.dragging) { - if ((vX != 0) || (vY != 0)) + if (vX != 0 || vY != 0) { onDrag(x, y, vX, vY); m_widgetEventHandlers->raiseDragEvent(x, y, vX, vY); diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index aab75b84c..989cb5293 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -39,10 +39,10 @@ #include -#include -#include +#include +#include #include -#include +#include #include #include "nxconfig.hxx" @@ -101,7 +101,9 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) // Initialize the mouse/touchscreen event and keyboard data structures - memset(&m_mouse, 0, sizeof(struct SMouse)); +#ifdef CONFIG_NX_XYINPUT + memset(&m_xyinput, 0, sizeof(struct SXYInput)); +#endif m_nCh = 0; m_nCc = 0; @@ -453,8 +455,8 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b { // Save the mouse X/Y position - m_mouse.x = pos->x; - m_mouse.y = pos->y; + m_xyinput.x = pos->x; + m_xyinput.y = pos->y; // Update button press states @@ -465,41 +467,41 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b // Handle left button press events. leftHeld means that the left mouse // button was pressed on the previous sample as well. - if (m_mouse.leftHeld) + if (m_xyinput.leftHeld) { - m_mouse.leftDrag = 1; + m_xyinput.leftDrag = 1; } else { // New left button press - m_mouse.leftPressed = 1; + m_xyinput.leftPressed = 1; - (void)clock_gettime(CLOCK_REALTIME, &m_mouse.leftPressTime); + (void)clock_gettime(CLOCK_REALTIME, &m_xyinput.leftPressTime); // Check for double click event - if (elapsedTime(&m_mouse.leftReleaseTime) <= CONFIG_NXWIDGETS_DOUBLECLICK_TIME) + if (elapsedTime(&m_xyinput.leftReleaseTime) <= CONFIG_NXWIDGETS_DOUBLECLICK_TIME) { - m_mouse.doubleClick = 1; + m_xyinput.doubleClick = 1; } } - m_mouse.leftHeld = 1; + m_xyinput.leftHeld = 1; } else { // Handle left button release events - if (m_mouse.leftHeld) + if (m_xyinput.leftHeld) { // New left button release - m_mouse.leftReleased = 1; - (void)clock_gettime(CLOCK_REALTIME, &m_mouse.leftReleaseTime); + m_xyinput.leftReleased = 1; + (void)clock_gettime(CLOCK_REALTIME, &m_xyinput.leftReleaseTime); } - m_mouse.leftHeld = 0; + m_xyinput.leftHeld = 0; } #if 0 // Center and right buttons not used @@ -508,31 +510,31 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b // Handle center button press events. centerHeld means that the center mouse // button was pressed on the previous sample as well. - if (m_mouse.centerHeld) + if (m_xyinput.centerHeld) { - m_mouse.centerDrag = 1; + m_xyinput.centerDrag = 1; } else { // New center button press - m_mouse.centerPressed = 1; + m_xyinput.centerPressed = 1; } - m_mouse.centerHeld = 1; + m_xyinput.centerHeld = 1; } else { // Handle center button release events - if (m_mouse.centerHeld) + if (m_xyinput.centerHeld) { // New center button release - m_mouse.centerReleased = 1; + m_xyinput.centerReleased = 1; } - m_mouse.centerHeld = 0; + m_xyinput.centerHeld = 0; } if ((buttons & NX_MOUSE_RIGHTBUTTON) != 0) @@ -540,31 +542,31 @@ void CWidgetControl::newMouseEvent(FAR const struct nxgl_point_s *pos, uint8_t b // Handle right button press events. rightHeld means that the right mouse // button was pressed on the previous sample as well. - if (m_mouse.rightHeld) + if (m_xyinput.rightHeld) { - m_mouse.rightDrag = 1; + m_xyinput.rightDrag = 1; } else { // New right button press - m_mouse.rightPressed = 1; + m_xyinput.rightPressed = 1; } - m_mouse.rightHeld = 1; + m_xyinput.rightHeld = 1; } else { // Handle right button release events - if (m_mouse.rightHeld) + if (m_xyinput.rightHeld) { // New right button release - m_mouse.rightReleased = 1; + m_xyinput.rightReleased = 1; } - m_mouse.rightHeld = 0; + m_xyinput.rightHeld = 0; } #endif @@ -646,7 +648,7 @@ void CWidgetControl::newCursorControlEvent(ECursorControl cursorControl) * that inherits from INxWindow. * 3) The call this method with the static_cast to INxWindow to, * finally, create the CGraphicsPort for this window. - * 4) After that, the fully smartend CWidgetControl instance can + * 4) After that, the fully smartened CWidgetControl instance can * be used to generate additional widgets. * * @param window The instance of INxWindow needed to construct the @@ -684,7 +686,7 @@ void CWidgetControl::copyWidgetStyle(CWidgetStyle *dest, const CWidgetStyle *src } /** - * Return the elapsed time in millisconds + * Return the elapsed time in milliseconds * * @param tp A time in the past from which to compute the elapsed time. * @return The elapsed time since tp @@ -791,17 +793,18 @@ void CWidgetControl::processDeleteQueue(void) bool CWidgetControl::pollMouseEvents(CNxWidget *widget) { +#ifdef CONFIG_NX_XYINPUT bool mouseEvent = true; // Assume that an interesting mouse event occurred // All widgets - if (m_mouse.leftPressed) + if (m_xyinput.leftPressed) { // Handle a new left button press event - handleLeftClick(m_mouse.x, m_mouse.y, widget); + handleLeftClick(m_xyinput.x, m_xyinput.y, widget); } - else if (m_mouse.leftDrag) + else if (m_xyinput.leftDrag) { // The left button is still being held down @@ -809,16 +812,16 @@ bool CWidgetControl::pollMouseEvents(CNxWidget *widget) { // Handle a mouse drag event - m_clickedWidget->drag(m_mouse.x, m_mouse.y, - m_mouse.x - m_mouse.lastX, - m_mouse.y - m_mouse.lastY); + m_clickedWidget->drag(m_xyinput.x, m_xyinput.y, + m_xyinput.x - m_xyinput.lastX, + m_xyinput.y - m_xyinput.lastY); } } else if (m_clickedWidget != (CNxWidget *)NULL) { // Mouse left button release event - m_clickedWidget->release(m_mouse.x, m_mouse.y); + m_clickedWidget->release(m_xyinput.x, m_xyinput.y); } else { @@ -833,9 +836,12 @@ bool CWidgetControl::pollMouseEvents(CNxWidget *widget) // Save the mouse position for the next poll - m_mouse.lastX = m_mouse.x; - m_mouse.lastY = m_mouse.y; + m_xyinput.lastX = m_xyinput.x; + m_xyinput.lastY = m_xyinput.y; return mouseEvent; +#else + return false; +#endif } /** @@ -940,23 +946,25 @@ void CWidgetControl::takeBoundsSem(void) * Clear all mouse events */ +#ifdef CONFIG_NX_XYINPUT void CWidgetControl::clearMouseEvents(void) { // Clear all press and release events once they have been processed - m_mouse.leftPressed = 0; - m_mouse.leftReleased = 0; - m_mouse.leftDrag = 0; + m_xyinput.leftPressed = 0; + m_xyinput.leftReleased = 0; + m_xyinput.leftDrag = 0; #if 0 // Center and right buttons are not used - m_mouse.centerPressed = 0; - m_mouse.centerReleased = 0; - m_mouse.centerDrag = 0; + m_xyinput.centerPressed = 0; + m_xyinput.centerReleased = 0; + m_xyinput.centerDrag = 0; - m_mouse.rightPressed = 0; - m_mouse.rightReleased = 0; - m_mouse.rightDrag = 0; + m_xyinput.rightPressed = 0; + m_xyinput.rightReleased = 0; + m_xyinput.rightDrag = 0; #endif - m_mouse.doubleClick = 0; + m_xyinput.doubleClick = 0; } +#endif diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 40689c0f5..7a4c4ff8d 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -644,6 +644,10 @@ # define CONFIG_NXWM_MEDIAPLAYER_YSPACING 8 #endif +#ifndef CONFIG_NXWM_MEDIAPLAYER_VOLUMESTEP +# define CONFIG_NXWM_MEDIAPLAYER_VOLUMESTEP 5 +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_ICON # define CONFIG_NXWM_MEDIAPLAYER_ICON NxWM::g_mediaplayerBitmap #endif diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index b13f76609..757b0b96e 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -720,6 +720,7 @@ bool CMediaPlayer::createPlayer(void) m_volume->setMinimumValue(0); m_volume->setMaximumValue(100); m_volume->setValue(15); + m_volume->setPageSize(CONFIG_NXWM_MEDIAPLAYER_VOLUMESTEP); // Register to get events from the value changes in the volume slider @@ -1014,12 +1015,19 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) void CMediaPlayer::setVolumeLevel(void) { - // Current volume level values. This is already pre-scaled in the range 0-100 + // Get the current volume level value. This is already pre-scaled in the + // range 0-100 - m_level = m_volume->getValue(); + int newLevel = m_volume->getValue(); - // Now, provide the new volume setting to the NX Player + // Has the volume level changed? + + if (m_level != newLevel) + { + // Yes.. provide the new volume setting to the NX Player #warning Missing logic + m_level = newLevel; + } } /** diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index f05f29ebd..0a1bea71f 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -447,7 +447,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) // Was the button up or down? uint8_t buttons; - if ((sample->point[0].flags & (TOUCH_DOWN|TOUCH_MOVE)) != 0) + if ((sample->point[0].flags & (TOUCH_DOWN | TOUCH_MOVE)) != 0) { buttons = NX_MOUSE_LEFTBUTTON; } diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 86120aacd..2ffc309b3 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -122,7 +122,6 @@ void CWindowMessenger::handleMouseEvent(void) work_state_t *state = new work_state_t; state->windowMessenger = this; - int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { From b998c623da5bf2adb2813db7484bac7c7ef215bb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 16 Jul 2014 22:13:41 -0600 Subject: [PATCH 230/390] MXT driver: Fix error in thread test... backward logic --- nxwm/src/ctouchscreen.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 0a1bea71f..68fec4e5b 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -591,5 +591,3 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) (void)nx_mousein(handle, x, y, buttons); } - - From 010cc0e624e75b457a0c007f50a8849993f79921 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:13:37 -0600 Subject: [PATCH 231/390] NxWidgets::CGraphicsPort: Fix drawBitmapGreyScale method. Actually drew nothing because of several errors in positioning and buffer usage --- libnxwidgets/src/cgraphicsport.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index f128c3293..5791ab773 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -531,6 +531,11 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, // Working buffer. Holds one converted row from the bitmap FAR nxwidget_pixel_t *run = new nxwidget_pixel_t[width]; + if (!run) + { + gvdbg("ERROR: Failed to allocated run buffer\n"); + return; + } // Pointer to the beginning of the first source row @@ -539,8 +544,8 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, // Setup non-changing blit parameters struct nxgl_point_s origin; - origin.x = 0; - origin.y = 0; + origin.x = x; + origin.y = y; struct nxgl_rect_s dest; dest.pt1.x = x; @@ -562,9 +567,9 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, // Get the next RGB pixel and break out the individual components nxwidget_pixel_t rgb = *runSrc++; - nxwidget_pixel_t r = RGB2RED(rgb); - nxwidget_pixel_t g = RGB2GREEN(rgb); - nxwidget_pixel_t b = RGB2BLUE(rgb); + nxwidget_pixel_t r = RGB2RED(rgb); + nxwidget_pixel_t g = RGB2GREEN(rgb); + nxwidget_pixel_t b = RGB2BLUE(rgb); // A truly accurate greyscale conversion would be complex. Let's // just average. @@ -575,11 +580,12 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, // Now blit the single row - (void)m_pNxWnd->bitmap(&dest, (FAR void *)bitmap->data, &origin, bitmap->stride); + (void)m_pNxWnd->bitmap(&dest, run, &origin, bitmap->stride); // Setup for the next source row y++; + origin.y = y; dest.pt1.y = y; dest.pt2.y = y; From 6f18adea58f0622c8603009cd312fd179b2e266c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:15:41 -0600 Subject: [PATCH 232/390] NxWidgets::CImage: Should not attempt to draw the empty regions at the top and the bottom of the image box in greyscale --- libnxwidgets/src/cimage.cxx | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 1140df35d..713078f22 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -230,18 +230,10 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) for (int padRow = 0; padRow < m_origin.y; padRow++, destRow++) { - // Put the padded row on the display + // Put the padded row on the display (never greyscale) - if (isEnabled()) - { - port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, - &bitmap, 0, 0); - } - else - { - port->drawBitmapGreyScale(rect.getX(), destRow, rect.getWidth(), - 1, &bitmap, 0, 0); - } + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, + &bitmap, 0, 0); } // This is the number of rows that we can draw at the top of the display @@ -303,7 +295,7 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) else { port->drawBitmapGreyScale(rect.getX(), destRow, - rect.getWidth(), 1, &bitmap, 0, 0); + rect.getWidth(), 1, &bitmap, 0, 0); } } } @@ -324,18 +316,10 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) for (; destRow < rect.getHeight(); destRow++) { - // Put the padded row on the display + // Put the padded row on the display (never greyscale) - if (isEnabled()) - { - port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, - &bitmap, 0, 0); - } - else - { - port->drawBitmapGreyScale(rect.getX(), destRow, - rect.getWidth(), 1, &bitmap, 0, 0); - } + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, + &bitmap, 0, 0); } } From 47c361c36f32b594d6954efc86b2d314ca132e13 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:18:36 -0600 Subject: [PATCH 233/390] NxWM::CMediaPlayer: Fix some state-related bugs introduced yesterday. Improved state-related button displayes. Now correctly catches and handles file selection events --- nxwm/include/cmediaplayer.hxx | 6 + nxwm/src/cmediaplayer.cxx | 206 +++++++++++++++++++++------------- 2 files changed, 137 insertions(+), 75 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 455792db5..0584429a4 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -228,6 +228,12 @@ namespace NxWM void setVolumeLevel(void); + /** + * Check if a new file has been selected (or de-selected) in the list box + */ + + inline void checkFileSelection(void); + /** * Handle a widget action event. For this application, that means image * pre-release events. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 757b0b96e..ffe0692d1 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -799,16 +799,13 @@ void CMediaPlayer::redrawWidgets(void) m_play->redraw(); } - // Rewind and play buttons are only shown if we are not STOPPED + // Rewind and play buttons - if (m_state != MPLAYER_STOPPED) - { - m_rewind->enableDrawing(); - m_rewind->redraw(); + m_rewind->enableDrawing(); + m_rewind->redraw(); - m_fforward->enableDrawing(); - m_fforward->redraw(); - } + m_fforward->enableDrawing(); + m_fforward->redraw(); m_volume->enableDrawing(); m_volume->redraw(); @@ -838,10 +835,18 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_listbox->enable(); - // Play image enabled and ready to start playing - // REVISIT: Really only available if there is a selected file in the list box + // Play image is visible, but enabled and ready to start playing only + // if a file is selected + + if (m_fileIndex < 0) + { + m_play->disable(); + } + else + { + m_play->enable(); + } - m_play->enable(); m_play->show(); // Pause image is disabled and hidden @@ -1030,6 +1035,83 @@ void CMediaPlayer::setVolumeLevel(void) } } +/** + * Check if a new file has been selected (or de-selected) in the list box + */ + +void CMediaPlayer::checkFileSelection(void) +{ + // Check for new file selections from the list box + + int newFileIndex = m_listbox->getSelectedIndex(); + + // Check if anything is selected + + if (newFileIndex < 0) + { + // No file is selected + + m_fileIndex = -1; + + // Nothing is selected.. If we are not stopped, then stop now + + if (m_state != MPLAYER_STOPPED) + { + closeMediaFile(); + setMediaPlayerState(MPLAYER_STOPPED); + } + } + + // A media file is selected. Were stopped before? + + else if (m_state == MPLAYER_STOPPED) + { + // Yes.. open the new media file and go to the PAUSE state + + if (!openMediaFile(m_listbox->getSelectedOption())) + { + // Remain in the stopped state if we fail to open the file + + m_fileIndex = -1; + gdbg("openMediaFile failed\m"); + } + else + { + // And go to the PAUSED state (enabling the PLAY button) + + m_fileIndex = newFileIndex; + setMediaPlayerState(MPLAYER_PAUSED); + } + } + + // We already have a media file loaded. Is it the same file? + + else if (m_fileIndex != newFileIndex) + { + // No.. It is a new file. Close that media file, load the newly + // selected file, and make sure that we are in the paused state + // (that should already be the case) + + closeMediaFile(); + if (!openMediaFile(m_listbox->getSelectedOption())) + { + // Go to the STOPPED state on a failure to open the media file + // The play button will be disable because m_fileIndex == -1. + + gdbg("openMediaFile failed\m"); + m_fileIndex = -1; + setMediaPlayerState(MPLAYER_STOPPED); + } + else + { + // And go to the PAUSED state (enabling the PLAY button) + + m_fileIndex = newFileIndex; + setMediaPlayerState(MPLAYER_PAUSED); + } + } +} + /** * Handle a widget action event. For this application, that means image * pre-release events. @@ -1113,63 +1195,6 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } } - - // Check for new file selections from the list box - - int newFileIndex = m_listbox->getSelectedIndex(); - - // Check if anything is selected - - if (newFileIndex < 0) - { - // Nothing is selected.. If we are not stopped, then stop now - - if (m_state != MPLAYER_STOPPED) - { - closeMediaFile(); - setMediaPlayerState(MPLAYER_STOPPED); - } - } - - // A media file is selected. Were stopped before? - - else if (m_state == MPLAYER_STOPPED) - { - // Yes.. open the new media file and go to the PAUSE state - - if (!openMediaFile(m_listbox->getSelectedOption())) - { - m_fileIndex = -1; - gdbg("openMediaFile failed\m"); - } - else - { - m_fileIndex = newFileIndex; - setMediaPlayerState(MPLAYER_PAUSED); - } - } - - // We already have a media file loaded. Is it the same file? - - else if (m_fileIndex != newFileIndex) - { - // No.. It is a new file. Close that media file, load the newly - // selected file, and make sure that we are in the paused state - // (that should already be the case) - - closeMediaFile(); - if (!openMediaFile(m_listbox->getSelectedOption())) - { - gdbg("openMediaFile failed\m"); - m_fileIndex = -1; - setMediaPlayerState(MPLAYER_STOPPED); - } - else - { - m_fileIndex = newFileIndex; - setMediaPlayerState(MPLAYER_PAUSED); - } - } } /** @@ -1183,20 +1208,49 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) if (m_pending == PENDING_PLAY_RELEASE && !m_play->isClicked()) { - // Now perform the delayed state change + // Yes.. Now perform the delayed state change + // + // If we were previously STOPPED or PAUSED, then enter the PLAYING + // state. - setMediaPlayerState(MPLAYER_PLAYING); - m_pending = PENDING_NONE; + if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) + { + setMediaPlayerState(MPLAYER_PLAYING); + } + + // Ignore the event if we are already in the PLAYING state + + else if (m_state != MPLAYER_PLAYING) + { + // Otherwise, we must be fast forwarding or rewinding. In these + // cases, stop the action and return to the previous state + + setMediaPlayerState(m_prevState); + } } // Check if the Pause image was released else if (m_pending == PENDING_PAUSE_RELEASE && !m_pause->isClicked()) { - // Now perform the delayed state change + // Yes.. Now perform the delayed state change + // + // If we were previously PLAYING, then enter the PAUSED state. - setMediaPlayerState(MPLAYER_PAUSED); - m_pending = PENDING_NONE; + if (m_state == MPLAYER_PLAYING) + { + setMediaPlayerState(MPLAYER_PAUSED); + } + + // Ignore the event if we are already in the PAUSED or STOPPED states + + else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_PAUSED) + { + // Otherwise, we must be fast forwarding or rewinding. In these + // cases, stop the action and return to the previous state + + setMediaPlayerState(m_prevState); + } } } @@ -1212,12 +1266,14 @@ void CMediaPlayer::handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs & } /** - * Handle changes in the volume level. + * Handle value changes. This will get events when there is a change in the + * volume level or a file is selected or deselected. */ void CMediaPlayer::handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e) { setVolumeLevel(); + checkFileSelection(); } /** From e52affe2346d38f8d27810684f0300b25674f2bf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:19:27 -0600 Subject: [PATCH 234/390] Cosmetic.. include cstdint instead of stdint.h, et al --- libnxwidgets/src/crlepalettebitmap.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/crlepalettebitmap.cxx b/libnxwidgets/src/crlepalettebitmap.cxx index a648f0533..a31fe912b 100644 --- a/libnxwidgets/src/crlepalettebitmap.cxx +++ b/libnxwidgets/src/crlepalettebitmap.cxx @@ -73,8 +73,8 @@ #include -#include -#include +#include +#include #include #include From 9067bb92f196316fa7a2207875556cf68aec75da Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:19:54 -0600 Subject: [PATCH 235/390] Update ChangeLog --- ChangeLog.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4cef61f21..39d3606cf 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -468,3 +468,11 @@ * NxMW::CMediaPlayer: Concert CLabel to a CListBox to support selection of one of many media files to play. This should be a CScrollingTextBox to support an indefinitely large number of media files (2014-7-16). +* NxWidgets::CGraphicsPort: Fix drawBitmapGreyScale method. Actually drew + nothing because of several errors in positioning and buffer usage + (2014-7-17) +* NxWidgets::CImage: Should not attempt to draw the "empty" regions at the + top and the bottom of the image box in greyscale (2014-7-17). +* NxWM::CMediaPlayer: Fix some state-related bugs introduced yesterday. + Improved state-related button displayes. Now correctly catches and + handles file selection events (2014-7-17). From 1e6833d533562e5df7c58cd0bc2e189868467818 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:34:41 -0600 Subject: [PATCH 236/390] NxWidgets::CImage: Cannot use NxWidgets::CGraphicsPort:drawBitmapGreyScale() because it does not respect transparent or background colors in its current form. The end result is that makes the image background grey as well as the image --- libnxwidgets/src/cimage.cxx | 41 ++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 713078f22..291552217 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -273,30 +273,47 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) return; } - // Replace any transparent pixels with the background color. - // Then we can use the faster opaque drawBitmap() function. + // Pre-process special pixel values... Then we can use the faster + // opaque drawBitmap() function. ptr = &buffer[m_origin.x]; for (int i = 0; i < nLeftPixels; i++, ptr++) { + // Replace any transparent pixels with the background color. + if (*ptr == CONFIG_NXWIDGETS_TRANSPARENT_COLOR) { *ptr = backColor; } + + // Convert pixels (other than the background color) to grey + // scale if the image is disabled. We can't use + // CGraphicsPort::drawBitmapGreyColor because it does not + // (yet) understand transparent pixels and has no idea what it + // should do with background colors. + + else if (*ptr != backColor && !isEnabled()) + { + // Get the next RGB pixel and break out the individual + // components + + nxwidget_pixel_t rgb = *ptr; + nxwidget_pixel_t r = RGB2RED(rgb); + nxwidget_pixel_t g = RGB2GREEN(rgb); + nxwidget_pixel_t b = RGB2BLUE(rgb); + + // A truly accurate greyscale conversion would be complex. + // Let's just average. + + nxwidget_pixel_t avg = (r + g + b) / 3; + *ptr = MKRGB(avg, avg, avg); + } } // And put these on the display - if (isEnabled()) - { - port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, - &bitmap, 0, 0); - } - else - { - port->drawBitmapGreyScale(rect.getX(), destRow, - rect.getWidth(), 1, &bitmap, 0, 0); - } + port->drawBitmap(rect.getX(), destRow, rect.getWidth(), 1, + &bitmap, 0, 0); } } From 13e0b8509d4b9b2ecdd127fc5b3b0f485e68eadc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:34:51 -0600 Subject: [PATCH 237/390] Update ChangeLog --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 39d3606cf..9c2275abc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -476,3 +476,7 @@ * NxWM::CMediaPlayer: Fix some state-related bugs introduced yesterday. Improved state-related button displayes. Now correctly catches and handles file selection events (2014-7-17). +* NxWidgets::CImage: Cannot use NxWidgets::CGraphicsPort:drawBitmapGreyScale() + because it does not respect transparent or background colors in its current + form. The end result is that makes the image background grey as well as the + image (2014-7-17). \ No newline at end of file From 4a34820526bce4a6670c32828779ae3339b08ebd Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:57:32 -0600 Subject: [PATCH 238/390] NxWM::CMediaPlayer: State variable was left in a bad state and caused some problems down the road --- nxwm/src/cmediaplayer.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index ffe0692d1..caaeffed3 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -1073,7 +1073,7 @@ void CMediaPlayer::checkFileSelection(void) // Remain in the stopped state if we fail to open the file m_fileIndex = -1; - gdbg("openMediaFile failed\m"); + gdbg("openMediaFile failed\n"); } else { @@ -1098,7 +1098,7 @@ void CMediaPlayer::checkFileSelection(void) // Go to the STOPPED state on a failure to open the media file // The play button will be disable because m_fileIndex == -1. - gdbg("openMediaFile failed\m"); + gdbg("openMediaFile failed\n"); m_fileIndex = -1; setMediaPlayerState(MPLAYER_STOPPED); } @@ -1227,6 +1227,10 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(m_prevState); } + + // No longer any action pending the PLAY image release + + m_pending = PENDING_NONE; } // Check if the Pause image was released @@ -1251,6 +1255,10 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(m_prevState); } + + // No longer any action pending the PAUSE image release + + m_pending = PENDING_NONE; } } From 1f87d19f7dc87e61644bdeaa63a108e27bb93466 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 10:57:50 -0600 Subject: [PATCH 239/390] Update ChangeLog --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9c2275abc..a6346293f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -479,4 +479,6 @@ * NxWidgets::CImage: Cannot use NxWidgets::CGraphicsPort:drawBitmapGreyScale() because it does not respect transparent or background colors in its current form. The end result is that makes the image background grey as well as the - image (2014-7-17). \ No newline at end of file + image (2014-7-17). +* NxWM::CMediaPlayer: State variable was left in a bad state and caused some + problems down the road (2014-7-17). From ea791a350e21a0f1757c2537e06f93de58b28d0d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 12:12:02 -0600 Subject: [PATCH 240/390] NxWidgets::CGlyphSliderHorizontal: No longer uses a hard-coded slider height; the slider height is now provided as a parameter, replacing the widget height which is now calculated from the glip image height --- Kconfig | 23 +++++++++ .../include/cglyphsliderhorizontal.hxx | 11 +++-- libnxwidgets/include/cnxwidget.hxx | 2 +- libnxwidgets/src/cglyphsliderhorizontal.cxx | 48 ++++++++++++++----- libnxwidgets/src/cnxwidget.cxx | 28 +++++------ nxwm/include/nxwmconfig.hxx | 8 ++++ 6 files changed, 88 insertions(+), 32 deletions(-) diff --git a/Kconfig b/Kconfig index 34a96e89d..ec56d09a2 100644 --- a/Kconfig +++ b/Kconfig @@ -1153,6 +1153,29 @@ config NXWM_MEDIAPLAYER_VOLUMESTEP ---help--- This increment in volume, up or down, when the volume bar is clicked. +config NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT + int "Minimum Player Volume Minimum Height" + default 6 + ---help--- + The height of the slider is automatically calculated from the height + of the grip image. However, we will not let the height of the grip + get smaller than this value. + + NOTE: This width includes the size of the slider upper and lower + borders. + +config NXWM_MEDIAPLAYER_CUSTOM_COLORS + bool "Select Custom Media Player Colors" + default n + +if NXWM_MEDIAPLAYER_CUSTOM_COLORS + + config NXWM_MEDIAPLAYER_VOLUMECOLOR + hex "Media Volume Slide Color + default 0x0 + +endif # NXWM_MEDIAPLAYER_CUSTOM_COLORS + config NXWM_MEDIAPLAYER_BORDERS bool "Media Player Button Borders" default n diff --git a/libnxwidgets/include/cglyphsliderhorizontal.hxx b/libnxwidgets/include/cglyphsliderhorizontal.hxx index 354a097ac..6d23237b7 100644 --- a/libnxwidgets/include/cglyphsliderhorizontal.hxx +++ b/libnxwidgets/include/cglyphsliderhorizontal.hxx @@ -174,16 +174,19 @@ namespace NXWidgets /** * Constructor. * - * @param pWidgetControl The widget control instance for the window. + * @param control The widget control instance for the window. * @param x The x coordinate of the slider, relative to its parent. * @param y The y coordinate of the slider, relative to its parent. * @param width The width of the slider. - * @param height The height of the slider. + * @param thickness The thickness of the slider. + * @param gripBitmap The slider grip image + * @param fillColor The color to use when filling the grip + * @param fill True: The grip will be filled with fillColor */ - CGlyphSliderHorizontal(CWidgetControl *pWidgetControl, + CGlyphSliderHorizontal(CWidgetControl *control, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, - nxgl_coord_t height, IBitmap *pGripBitmap, + nxgl_coord_t thickness, IBitmap *gripBitmap, nxwidget_pixel_t fillColor, bool fill = true); /** diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index 543c0b24b..a67938d48 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -170,7 +170,7 @@ namespace NXWidgets protected: CWidgetControl *m_widgetControl; /**< The controlling widget for the display */ - CRect m_rect; /**< Rectange bounding the widget. */ + CRect m_rect; /**< Rectangle bounding the widget. */ // Dragging variables diff --git a/libnxwidgets/src/cglyphsliderhorizontal.cxx b/libnxwidgets/src/cglyphsliderhorizontal.cxx index da7150ef7..0d6238a39 100644 --- a/libnxwidgets/src/cglyphsliderhorizontal.cxx +++ b/libnxwidgets/src/cglyphsliderhorizontal.cxx @@ -79,6 +79,7 @@ #include #include +#include "ibitmap.hxx" #include "cwidgetcontrol.hxx" #include "cglyphsliderhorizontal.hxx" #include "cglyphsliderhorizontalgrip.hxx" @@ -98,20 +99,24 @@ using namespace NXWidgets; /** * Constructor. * - * @param pWidgetControl The controlling widget for the display + * @param control The widget control instance for the window. * @param x The x coordinate of the slider, relative to its parent. * @param y The y coordinate of the slider, relative to its parent. * @param width The width of the slider. - * @param height The height of the slider. + * @param thickness The thickness of the slider. + * @param gripBitmap The slider grip image + * @param fillColor The color to use when filling the grip + * @param fill True: The grip will be filled with fillColor */ -CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, - nxgl_coord_t x, nxgl_coord_t y, - nxgl_coord_t width, nxgl_coord_t height, - IBitmap * pGripBitmap, - nxwidget_pixel_t fillColor, bool fill) -:CNxWidget(pWidgetControl, x, y, width, height, WIDGET_DRAGGABLE) +CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl *control, + nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, + nxgl_coord_t thickness, IBitmap *gripBitmap, + nxwidget_pixel_t fillColor, bool fill) +:CNxWidget(control, x, y, width, thickness, WIDGET_DRAGGABLE) { + // Initialize state data + m_minimumValue = 0; m_maximumValue = 0; m_contentSize = 0; @@ -120,22 +125,39 @@ CGlyphSliderHorizontal::CGlyphSliderHorizontal(CWidgetControl * pWidgetControl, m_pageSize = 1; m_fillColor = fillColor; m_fill = fill; - m_barThickness = 8; + m_barThickness = thickness; + + // Correct the height of the widget. The widget height was initially set + // to the thickness of the grip. But the grip image is normally a little + // taller than the slider is thick. + // + // Do use the resize method here; we are not ready for the resize events. + + nxgl_coord_t gripHeight = gripBitmap->getHeight() + 4; + if (gripHeight > thickness) + { + // Reset the widget height to the height of the grip image + + m_rect.setHeight(gripHeight); + } + + // Set widget attributes m_flags.permeable = false; m_flags.borderless = false; m_flags.doubleClickable = false; - // Create grip + // Set the "gutter" width CRect rect; getClientRect(rect); m_gutterWidth = rect.getWidth(); - // Create grip + // Create the grip - m_grip = new CGlyphSliderHorizontalGrip(pWidgetControl, x, y, - width, height, pGripBitmap); + m_grip = new CGlyphSliderHorizontalGrip(control, x, y, + gripBitmap->getWidth() + 4, + gripHeight, gripBitmap); m_grip->setBorderless(true); m_grip->addWidgetEventHandler(this); addWidget(m_grip); diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index c0c406dde..6d6ddb7b8 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -158,10 +158,10 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, // Dragging values - m_grabPointX = 0; - m_grabPointY = 0; - m_newX = 0; - m_newY = 0; + m_grabPointX = 0; + m_grabPointY = 0; + m_newX = 0; + m_newY = 0; // Set initial flag values @@ -177,24 +177,24 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, // Set hierarchy pointers - m_parent = (CNxWidget *)NULL; - m_focusedChild = (CNxWidget *)NULL; + m_parent = (CNxWidget *)NULL; + m_focusedChild = (CNxWidget *)NULL; // Double-click clock_gettime(CLOCK_REALTIME, &m_lastClickTime); - m_lastClickX = 0; - m_lastClickY = 0; - m_doubleClickBounds = DOUBLE_CLICK_BOUNDS; + m_lastClickX = 0; + m_lastClickY = 0; + m_doubleClickBounds = DOUBLE_CLICK_BOUNDS; // Set border size to 1 line - m_borderSize.top = 1; - m_borderSize.right = 1; - m_borderSize.bottom = 1; - m_borderSize.left = 1; + m_borderSize.top = 1; + m_borderSize.right = 1; + m_borderSize.bottom = 1; + m_borderSize.left = 1; - m_widgetEventHandlers = new CWidgetEventHandlerList(this); + m_widgetEventHandlers = new CWidgetEventHandlerList(this); } /** diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 7a4c4ff8d..4160fbae7 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -648,6 +648,14 @@ # define CONFIG_NXWM_MEDIAPLAYER_VOLUMESTEP 5 #endif +#ifndef CONFIG_NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT +# define CONFIG_NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT 6 +#endif + +#ifndef CONFIG_NXWM_MEDIAPLAYER_VOLUMECOLOR +# define CONFIG_NXWM_MEDIAPLAYER_VOLUMECOLOR MKRGB(63,90,192) +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_ICON # define CONFIG_NXWM_MEDIAPLAYER_ICON NxWM::g_mediaplayerBitmap #endif From 5af2bcff94a40f1ffdae92c5ae4f1a8157522f0a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 12:14:04 -0600 Subject: [PATCH 241/390] NxWM::CMediaPlayer: Now calculates the volume slider height from the grip image height --- nxwm/src/cmediaplayer.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index caaeffed3..0c4831076 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -698,15 +698,21 @@ bool CMediaPlayer::createPlayer(void) // Create the Volume control - uint32_t volumeControlX = (9 * m_windowSize.w) >> 8; + uint32_t volumeControlX = (9 * (uint32_t)m_windowSize.w) >> 8; + nxgl_coord_t volumeControlW = (nxgl_coord_t)(m_windowSize.w - 2 * volumeControlX); + nxgl_coord_t volumeControlH = m_volumeBitmap->getHeight() - 4; + + // Don't let the height of the volume control get too small + + if (volumeControlH < CONFIG_NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT) + { + volumeControlH = CONFIG_NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT; + } m_volume = new NXWidgets:: - CGlyphSliderHorizontal(control, - (nxgl_coord_t)volumeControlX, - volumeTop, - (nxgl_coord_t)(m_windowSize.w - 2 * volumeControlX), - m_volumeBitmap->getHeight() + 4, m_volumeBitmap, - MKRGB(63, 90,192)); + CGlyphSliderHorizontal(control, (nxgl_coord_t)volumeControlX, volumeTop, + volumeControlW, volumeControlH, m_volumeBitmap, + CONFIG_NXWM_MEDIAPLAYER_VOLUMECOLOR); if (!m_volume) { From f62f6b33f3eb94815189b4ffc2a036ccb3bdee37 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 12:14:35 -0600 Subject: [PATCH 242/390] Update ChangeLog --- ChangeLog.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index a6346293f..e89b60d35 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -482,3 +482,9 @@ image (2014-7-17). * NxWM::CMediaPlayer: State variable was left in a bad state and caused some problems down the road (2014-7-17). +* NxWidgets::CGlyphSliderHorizontal: No longer uses a hard-coded slider + height; the slider height is now provided as a parameter, replacing the + widget height which is now calculated from the glip image height + (2014-7-17). +* NxWM::CMediaPlayer: Now calculates the volume slider height from the grip + image height (2014-7-17). From 1db74a34948d90f499e6d2fa637d6db6d66e244e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 13:38:37 -0600 Subject: [PATCH 243/390] NxWM::CApplicationWindow: Created the custom font for the toolbar title, but never used it. --- libnxwidgets/include/clabel.hxx | 2 ++ libnxwidgets/include/cnxwidget.hxx | 2 ++ libnxwidgets/src/clabel.cxx | 2 ++ libnxwidgets/src/cnxwidget.cxx | 3 +++ nxwm/src/capplicationwindow.cxx | 1 + 5 files changed, 10 insertions(+) diff --git a/libnxwidgets/include/clabel.hxx b/libnxwidgets/include/clabel.hxx index ccadb55ee..99e4b1ec7 100644 --- a/libnxwidgets/include/clabel.hxx +++ b/libnxwidgets/include/clabel.hxx @@ -333,6 +333,8 @@ namespace NXWidgets * Sets the font. * * @param font A pointer to the font to use. + * + * NOTE: This font is not deleted when the widget is destroyed! */ virtual void setFont(CNxFont *font); diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index a67938d48..d6a2654e1 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -1012,6 +1012,8 @@ namespace NXWidgets * Sets the font. * * @param font A pointer to the font to use. + * + * NOTE: This font is not deleted when the widget is destroyed! */ virtual void setFont(CNxFont *font); diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx index 319b707b6..f9132c3c2 100644 --- a/libnxwidgets/src/clabel.cxx +++ b/libnxwidgets/src/clabel.cxx @@ -252,6 +252,8 @@ void CLabel::getPreferredDimensions(CRect &rect) const * Sets the font. * * @param font A pointer to the font to use. + * + * NOTE: This font is not deleted when the widget is destroyed! */ void CLabel::setFont(CNxFont *font) diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 6d6ddb7b8..5060e42c2 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -466,6 +466,8 @@ void CNxWidget::setBorderless(bool borderless) * Sets the font. * * @param font A pointer to the font to use. + * + * NOTE: This font is not deleted when the widget is destroyed! */ void CNxWidget::setFont(CNxFont *font) @@ -1408,6 +1410,7 @@ const CNxWidget *CNxWidget::getChild(int index) const { return m_children[index]; } + return (CNxWidget *)NULL; } diff --git a/nxwm/src/capplicationwindow.cxx b/nxwm/src/capplicationwindow.cxx index 0c1bb1a96..c4652ca5a 100644 --- a/nxwm/src/capplicationwindow.cxx +++ b/nxwm/src/capplicationwindow.cxx @@ -334,6 +334,7 @@ bool CApplicationWindow::open(void) // Configure the label + m_windowLabel->setFont(m_windowFont); m_windowLabel->setBorderless(true); m_windowLabel->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_LEFT); m_windowLabel->setTextAlignmentVert(NXWidgets::CLabel::TEXT_ALIGNMENT_VERT_CENTER); From 087ab16b6d048cbbf8be61d7a8b16bfe419fdf78 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 13:38:53 -0600 Subject: [PATCH 244/390] Update ChangeLogs --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index e89b60d35..4f77418f7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -488,3 +488,6 @@ (2014-7-17). * NxWM::CMediaPlayer: Now calculates the volume slider height from the grip image height (2014-7-17). +* NxWM::CApplicationWindow: Created the custom font for the toolbar title, + but never used it! (2014-7-17). + \ No newline at end of file From 689797562f5204388d3e98c96b938f39d56e3fd6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 15:06:05 -0600 Subject: [PATCH 245/390] NxWM: Increase default priority of mouse and keyboard listener threads. Does not seem to make any difference but still seems like a good idea --- Kconfig | 13 +++++++++---- libnxwidgets/include/nxconfig.hxx | 4 ++-- nxwm/include/nxwmconfig.hxx | 12 ++++++++---- nxwm/src/ctouchscreen.cxx | 10 ++++++---- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Kconfig b/Kconfig index ec56d09a2..37fdccabe 100644 --- a/Kconfig +++ b/Kconfig @@ -814,9 +814,11 @@ config NXWM_TOUCHSCREEN_SIGNO config NXWM_TOUCHSCREEN_LISTENERPRIO int "Touchscreen Listener Task Priority" - default 100 + default 120 ---help--- - Priority of the touchscreen listener thread. Default: 100 + Priority of the touchscreen listener thread. This listener should + have a higher priority than most display-related tsks otherwise it + may miss touchscreen events. Default: 120 config NXWM_TOUCHSCREEN_LISTENERSTACK int "Touchscreen Listener Task Stack Size" @@ -870,9 +872,12 @@ config NXWM_KEYBOARD_BUFSIZE config NXWM_KEYBOARD_LISTENERPRIO int "Keyboard Listener Task Priority" - default 100 + default 120 ---help--- - Priority of the touchscreen listener thread. Default: 100 + Priority of the touchscreen listener thread.This listener should + have a higher priority than most display-related tsks otherwise it + may miss touchscreen events (not really very likely because keyboard + input is relatively slow). Default: 120 config NXWM_KEYBOARD_LISTENERSTACK int "Keyboard Listener Task Stack Size" diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 34be7a788..9face1e70 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -68,7 +68,7 @@ * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server. This applies * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). - * Default: SCHED_PRIORITY_DEFAULT+1. NOTE: Of the three priority + * Default: (SCHED_PRIORITY_DEFAULT+10). NOTE: Of the three priority * definitions here, CONFIG_NXWIDGETS_SERVERPRIO should have the highest * priority to avoid data overrun race conditions. Such errors would most * likely appear as duplicated rows of data on the display. @@ -214,7 +214,7 @@ */ #ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1) +# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+10) #endif #ifndef CONFIG_NXWIDGETS_CLIENTPRIO diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 4160fbae7..75f860c9d 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -429,7 +429,7 @@ * CONFIG_NXWM_TOUCHSCREEN_SIGNO - The realtime signal used to wake up the * touchscreen listener thread. Default: 5 * CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO - Priority of the touchscreen listener - * thread. Default: SCHED_PRIORITY_DEFAULT + * thread. Default: (SCHED_PRIORITY_DEFAULT + 20) * CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK - Touchscreen listener thread stack * size. Default 1024 */ @@ -447,7 +447,11 @@ #endif #ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO -# define CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO SCHED_PRIORITY_DEFAULT +# define CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO (SCHED_PRIORITY_DEFAULT + 20) +#endif + +#if CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO <= CONFIG_NXWM_CALIBRATION_LISTENERPRIO +# warning You should have CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO > CONFIG_NXWM_CALIBRATION_LISTENERPRIO #endif #ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK @@ -465,7 +469,7 @@ * CONFIG_NXWM_KEYBOARD_BUFSIZE - The size of the keyboard read data buffer. * Default: 16 * CONFIG_NXWM_KEYBOARD_LISTENERPRIO - Priority of the touchscreen listener - * thread. Default: SCHED_PRIORITY_DEFAULT + * thread. Default: (SCHED_PRIORITY_DEFAULT + 20) * CONFIG_NXWM_KEYBOARD_LISTENERSTACK - Keyboard listener thread stack * size. Default 1024 */ @@ -483,7 +487,7 @@ #endif #ifndef CONFIG_NXWM_KEYBOARD_LISTENERPRIO -# define CONFIG_NXWM_KEYBOARD_LISTENERPRIO SCHED_PRIORITY_DEFAULT +# define CONFIG_NXWM_KEYBOARD_LISTENERPRIO (SCHED_PRIORITY_DEFAULT + 20) #endif #ifndef CONFIG_NXWM_KEYBOARD_LISTENERSTACK diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 68fec4e5b..545405b81 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -363,10 +363,12 @@ FAR void *CTouchscreen::listener(FAR void *arg) #endif } - // On a truly success read, the size of the returned data will - // be exactly the size of one touchscreen sample + // On a truly successful read, the size of the returned data will + // be greater than or equal to size of one touchscreen sample. It + // be greater only in the case of a multi-touch touchscreen device + // when multi-touches are reported. - else if (nbytes == sizeof(struct touch_sample_s)) + else if (nbytes >= (ssize_t)sizeof(struct touch_sample_s)) { // Looks like good touchscreen input... process it @@ -375,7 +377,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) else { dbg("ERROR Unexpected read size=%d, expected=%d\n", - nbytes, sizeof(struct touch_sample_s)); + nbytes, sizeof(struct touch_sample_s)); } } From c8e7cce4f89c836dfa4d6459d94a28ef2cb3164d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 17 Jul 2014 17:58:24 -0600 Subject: [PATCH 246/390] Cosmet updates to some comments --- UnitTests/nxwm/nxwm_main.cxx | 4 ++-- nxwm/src/cmediaplayer.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 1fddfeb28..13e0bd8b1 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -772,7 +772,7 @@ int nxwm_main(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN #ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA - // There are two possibilies: (1) We started the calibration earlier and now + // There are two possibilities: (1) We started the calibration earlier and now // need to obtain the calibration data from the calibration process, or (2) // We have already obtained stored calibration data in which case, the calibration // process never ran. @@ -782,7 +782,7 @@ int nxwm_main(int argc, char *argv[]) { // Since we started the touchscreen calibration program maximized, it will // run immediately when we start the window manager. There is no positive - // handshake to know whenthe touchscreen has been calibrated. If we really + // handshake to know when the touchscreen has been calibrated. If we really // want to know, we have to poll printf("nxwm_main: Waiting for touchscreen calibration\n"); diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 0c4831076..14ca32eed 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -1102,7 +1102,7 @@ void CMediaPlayer::checkFileSelection(void) if (!openMediaFile(m_listbox->getSelectedOption())) { // Go to the STOPPED state on a failure to open the media file - // The play button will be disable because m_fileIndex == -1. + // The play button will be disabled because m_fileIndex == -1. gdbg("openMediaFile failed\n"); m_fileIndex = -1; From cff7b270a9ae86bef58241ed79cb53694e9adadc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 21 Jul 2014 17:43:18 -0600 Subject: [PATCH 247/390] NxWidgets: Fix a typo in the Kconfig file --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index 37fdccabe..ccef01ddb 100644 --- a/Kconfig +++ b/Kconfig @@ -1176,7 +1176,7 @@ config NXWM_MEDIAPLAYER_CUSTOM_COLORS if NXWM_MEDIAPLAYER_CUSTOM_COLORS config NXWM_MEDIAPLAYER_VOLUMECOLOR - hex "Media Volume Slide Color + hex "Media Volume Slide Color" default 0x0 endif # NXWM_MEDIAPLAYER_CUSTOM_COLORS From 23c30fd9236e7be9515114b8fbc0dfaa4b25f90c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:32:10 -0600 Subject: [PATCH 248/390] NxWidgets::CNxString: Make destructor virtual. From Petteri Aimonen --- libnxwidgets/include/cnxstring.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/include/cnxstring.hxx b/libnxwidgets/include/cnxstring.hxx index 247919116..50adea21c 100644 --- a/libnxwidgets/include/cnxstring.hxx +++ b/libnxwidgets/include/cnxstring.hxx @@ -220,7 +220,7 @@ namespace NXWidgets * Destructor. */ - inline ~CNxString() + virtual inline ~CNxString() { delete[] m_text; m_text = (FAR nxwidget_char_t *)NULL; From 1cf57a4097a9824b4d4ccd93d91d4c8973724a77 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:36:08 -0600 Subject: [PATCH 249/390] NxWidgets::CTaskbar: Fix type of return value fromopenRawWindow() method. From Petteri Aimonen --- nxwm/src/ctaskbar.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 3a5e44aec..a5c4fc711 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -818,7 +818,7 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) if (!window) { delete control; - return false; + return NULL; } // Open (and initialize) the window @@ -828,7 +828,7 @@ NXWidgets::CNxWindow *CTaskbar::openRawWindow(void) { delete window; window = (NXWidgets::CNxWindow *)0; - return false; + return NULL; } return window; From ad2aa947f1fc2a863e304584c6cb745a10277318 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:40:39 -0600 Subject: [PATCH 250/390] NxWidgets::CTabPanel: Modify behavior in showPage() method. Eliminate a duplicate redraw that caused flickering; re-order some logic so that widgets are hidden before operated on. From Petteri Aimonen --- libnxwidgets/src/ctabpanel.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libnxwidgets/src/ctabpanel.cxx b/libnxwidgets/src/ctabpanel.cxx index 1f1769e00..ed7524edb 100644 --- a/libnxwidgets/src/ctabpanel.cxx +++ b/libnxwidgets/src/ctabpanel.cxx @@ -103,18 +103,15 @@ void CTabPanel::showPage(uint8_t index) for (int i = 0; i < m_tabpages.size(); i++) { - if (i == index) - { - m_tabpages.at(i)->enable(); - m_tabpages.at(i)->show(); - m_tabpages.at(i)->redraw(); - } - else + if (i != index) { m_tabpages.at(i)->hide(); m_tabpages.at(i)->disable(); } } + + m_tabpages.at(index)->enable(); + m_tabpages.at(index)->show(); } void CTabPanel::handleActionEvent(const CWidgetEventArgs &e) From a864dcd7cd79a4647498371133692aa629cdf61e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:46:02 -0600 Subject: [PATCH 251/390] Make CTabPanel raise action event when tab is changed. Also add a function for getting the currently selected tab index. From Petteri Aimonen --- libnxwidgets/include/ctabpanel.hxx | 4 +++- libnxwidgets/src/ctabpanel.cxx | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/include/ctabpanel.hxx b/libnxwidgets/include/ctabpanel.hxx index 887f66fc0..2d6b95ca5 100644 --- a/libnxwidgets/include/ctabpanel.hxx +++ b/libnxwidgets/include/ctabpanel.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/ctabpanel.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Petteri Aimonen * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,8 @@ namespace NXWidgets void setPageName(uint8_t index, const CNxString &name); void showPage(uint8_t index); + + uint8_t getCurrentPageIndex() const; }; } diff --git a/libnxwidgets/src/ctabpanel.cxx b/libnxwidgets/src/ctabpanel.cxx index ed7524edb..430093d23 100644 --- a/libnxwidgets/src/ctabpanel.cxx +++ b/libnxwidgets/src/ctabpanel.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/ctabpanel.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Petteri Aimonen * * Redistribution and use in source and binary forms, with or without @@ -123,8 +123,14 @@ void CTabPanel::handleActionEvent(const CWidgetEventArgs &e) m_buttonbar->isAnyButtonStuckDown(x, y); showPage(x); + m_widgetEventHandlers->raiseActionEvent(); } } - - +uint8_t CTabPanel::getCurrentPageIndex() const +{ + int x = 0; + int y = 0; + m_buttonbar->isAnyButtonStuckDown(x, y); + return x; +} From ca6b53f704bfd2efcae20c578bdfb824b7bb20d0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:48:32 -0600 Subject: [PATCH 252/390] Make CNxTimer stop itself before destruction. Otherwise a call to an invalid work queue entry may occur. From Petteri Aimonen --- libnxwidgets/src/cnxtimer.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index d54981570..5a08a6f52 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -129,6 +129,7 @@ CNxTimer::CNxTimer(CWidgetControl *pWidgetControl, uint32_t timeout, bool repeat CNxTimer::~CNxTimer(void) { + stop(); } /** From fa74711ee66d59bb0d244b5b3a1d3eb6ae1e7540 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:49:23 -0600 Subject: [PATCH 253/390] Update ChangeLog --- ChangeLog.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4f77418f7..27e298902 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -490,4 +490,16 @@ image height (2014-7-17). * NxWM::CApplicationWindow: Created the custom font for the toolbar title, but never used it! (2014-7-17). - \ No newline at end of file +* NxWidgets::CNxString: Make destructor virtual. From Petteri Aimonen + (2014-7-22). +* NxWidgets::CTaskbar: Fix type of return value fromopenRawWindow() + method. From Petteri Aimonen (2014-7-22). +* NxWidgets::CTabPanel: Modify behavior in showPage() method. Eliminate a + duplicate redraw that caused flickering; re-order some logic so that + widgets are hidden before operated on. From Petteri Aimonen (2014-7-22). +* NxWidgets:CTabPanel: Make CTabPanel raise action event when tab is + changed. Also add a function for getting the currently selected tab + index. From Petteri Aimonen (2014-7-22). +* NxWidgets::CNxTimer: Make CNxTimer stop itself before destruction. + Otherwise a call to an invalid work queue entry may occur. From Petteri + Aimonen (2014-7-22). From a6e47d7eb373f13389292a297a40c12f1e5bb068 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 14:45:54 -0600 Subject: [PATCH 254/390] NxWM: Add configuration options to filter CMediaPlayer files based on extension --- Kconfig | 98 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 80 insertions(+), 18 deletions(-) diff --git a/Kconfig b/Kconfig index ccef01ddb..8bd5ef26d 100644 --- a/Kconfig +++ b/Kconfig @@ -1118,7 +1118,7 @@ menu "NxWM Media Player Display Settings" config NXWM_MEDIAPLAYER bool "NxWM Media Player" default n - depends on FS_READABLE + depends on FS_READABLE && SYSTEM_NXPLAYER ---help--- Enable support for the MP3 Media Player. This features requires a board that includes an MP3 Codec chip, such as the Mikromedia @@ -1130,6 +1130,8 @@ config NXWM_MEDIAPLAYER if NXWM_MEDIAPLAYER +menu "Media File Configuration" + config NXWM_MEDIAPLAYER_MEDIAPATH string "Path to media" default "/mnt/sdcard" @@ -1137,6 +1139,61 @@ config NXWM_MEDIAPLAYER_MEDIAPATH This is the full path to the mount point of the storage device containing all of the media files accessible by the media player. +config NXWM_MEDIAPLAYER_NOFILTER + bool "Disable filtering by file name extension + default y + +config NXWM_MEDIAPLAYER_FILTER + bool + default n + +if !NXWM_MEDIAPLAYER_NOFILTER + +config NXWM_MEDIAPLAYER_FILTER_AC3 + bool "Accept .ac3 extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_DTS + bool "Accept .dts extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_WAV + bool "Accept .wav extension" + default y + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_PCM + bool "Accept .pcm extension" + default y + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_MP3 + bool "Accept .mp3 extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_MIDI + bool "Accept .mid extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_WMA + bool "Accept .wma extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +config NXWM_MEDIAPLAYER_FILTER_OGGVORBIS + bool "Accept .ogg extension" + default n + select NXWM_MEDIAPLAYER_FILTER + +endif # !NXWM_MEDIAPLAYER_NOFILTER +endmenu # Media File Configuration + +menu "General Look and Feel" + config NXWM_MEDIAPLAYER_XSPACING int "Media Player Horizontal Spacing" default 12 @@ -1152,23 +1209,6 @@ config NXWM_MEDIAPLAYER_YSPACING forward, and reverse controls, and the volume slider in units of lines. -config NXWM_MEDIAPLAYER_VOLUMESTEP - int "Media Player Volume Step" - default 5 - ---help--- - This increment in volume, up or down, when the volume bar is clicked. - -config NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT - int "Minimum Player Volume Minimum Height" - default 6 - ---help--- - The height of the slider is automatically calculated from the height - of the grip image. However, we will not let the height of the grip - get smaller than this value. - - NOTE: This width includes the size of the slider upper and lower - borders. - config NXWM_MEDIAPLAYER_CUSTOM_COLORS bool "Select Custom Media Player Colors" default n @@ -1189,6 +1229,28 @@ config NXWM_MEDIAPLAYER_BORDERS better choice. If you graphics is really more of a button label, then have buttons with boarders might make more sense. +endmenu # General Look and Feel + +menu "Volume Control Configuration" + +config NXWM_MEDIAPLAYER_VOLUMESTEP + int "Media Player Volume Step" + default 5 + ---help--- + This increment in volume, up or down, when the volume bar is clicked. + +config NXWM_MEDIAPLAYER_MINVOLUMEHEIGHT + int "Minimum Player Volume Minimum Height" + default 6 + ---help--- + The height of the slider is automatically calculated from the height + of the grip image. However, we will not let the height of the grip + get smaller than this value. + + NOTE: This width includes the size of the slider upper and lower + borders. + +endmenu # Volume Configuration" endif # NXWM_MEDIAPLAYER endmenu # NxWM Media Player Display Settings From c4fa22d933d9a1080949a9a1bc808c52ae53c9e6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 14:47:38 -0600 Subject: [PATCH 255/390] NxWM::CMediaPlayer: Add logic to read files from the media mountpoint, filter them by extension, and display the file names in the listbox --- nxwm/src/cmediaplayer.cxx | 95 ++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 17 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 14ca32eed..c3df41c8c 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -41,6 +41,8 @@ #include #include +#include +#include #include #include "cwidgetcontrol.hxx" @@ -396,27 +398,86 @@ inline bool CMediaPlayer::showMediaFiles(const char *mediaPath) m_listbox->removeAllOptions(); -#if 0 // Open the media path directory + + FAR DIR *dirp = opendir(CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH); + if (!dirp) + { + m_listbox->addOption("Media volume is not mounted", 0, + MKRGB(192, 0, 0), + CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, + MKRGB(255, 0, 0), + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); + return false; + } + // Read each directory entry - // Add the directory entry to the list box - // Close the directory -#else -# warning "Missing Logic" - // Just add a couple of dummy files for testing + FAR struct dirent *direntry; + int index; - m_listbox->addOption("File 1", 0, - CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR, - CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, - CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR, - CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); - m_listbox->addOption("File 2", 1, - CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR, - CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, - CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR, - CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); + for (direntry = readdir(dirp), index = 0; + direntry; + direntry = readdir(dirp)) + { + // TODO: Recursively examine files in all sub-directories + // Ignore directory entries beginning with '.' + + if (direntry->d_name[0] == '.') + { + continue; + } + +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER) + // Filter files by extension + + FAR const char *extension = std::strchr(direntry->d_name, '.'); + if (!extension || (true +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_AC3 + && std::strcmp(extension, ".ac3") != 0 #endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_DTS + && std::strcmp(extension, ".dts") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WAV + && std::strcmp(extension, ".wav") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_PCM + && std::strcmp(extension, ".pcm") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MP3 + && std::strcmp(extension, ".mp3") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MIDI + && sstd::trcmp(extension, ".mid") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WMA + && std::strcmp(extension, ".wma") != 0 +#endif +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_OGGVORBIS + && std::strcmp(extension, ".ogg") != 0 +#endif + )) + { + // File does not match any configured extension + + continue; + } +#endif + + // Add the directory entry to the list box + + m_listbox->addOption(direntry->d_name, index, + CONFIG_NXWIDGETS_DEFAULT_ENABLEDTEXTCOLOR, + CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR, + CONFIG_NXWIDGETS_DEFAULT_SELECTEDTEXTCOLOR, + CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR); + index++; + } + + // Close the directory + + (void)closedir(dirp); // Sort the file names in alphabetical order @@ -526,7 +587,7 @@ bool CMediaPlayer::createPlayer(void) // Show the media files that are available for playing - showMediaFiles(CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH); + (void)showMediaFiles(CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH); // Control image widths. // Image widths will depend on if the images will be bordered or not From 08539e3e772b88c4ff04635a66663efd0aabaff2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 15:21:03 -0600 Subject: [PATCH 256/390] Update ChangeLogs --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 27e298902..dcdd8b8ec 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -503,3 +503,7 @@ * NxWidgets::CNxTimer: Make CNxTimer stop itself before destruction. Otherwise a call to an invalid work queue entry may occur. From Petteri Aimonen (2014-7-22). +* NxWidgets/Kconfig: Add configuration options to filter CMediaPlayer files + based on extension (2014-7-23) +* NxWM::CMediaPlayer: Add logic to read files from the media mountpoint, + filter them by extension, and display the file names in the listbox (2014-7-23). From 492518a43a7f134e9eedfa922f17e6ed03e9a06d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 17:20:52 -0600 Subject: [PATCH 257/390] Fix missing right parenthesis in conditional compilation; Also, should use strcasecmp vs. strcmp when comparing for matches in extension --- nxwm/src/cmediaplayer.cxx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index c3df41c8c..d94b57369 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -433,29 +433,29 @@ inline bool CMediaPlayer::showMediaFiles(const char *mediaPath) FAR const char *extension = std::strchr(direntry->d_name, '.'); if (!extension || (true -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_AC3 - && std::strcmp(extension, ".ac3") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_AC3) + && std::strcasecmp(extension, ".ac3") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_DTS - && std::strcmp(extension, ".dts") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_DTS) + && std::strcasecmp(extension, ".dts") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WAV - && std::strcmp(extension, ".wav") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WAV) + && std::strcasecmp(extension, ".wav") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_PCM - && std::strcmp(extension, ".pcm") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_PCM) + && std::strcasecmp(extension, ".pcm") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MP3 - && std::strcmp(extension, ".mp3") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MP3) + && std::strcasecmp(extension, ".mp3") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MIDI - && sstd::trcmp(extension, ".mid") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_MIDI) + && std::strcasecmp(extension, ".mid") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WMA - && std::strcmp(extension, ".wma") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_WMA) + && std::strcasecmp(extension, ".wma") != 0 #endif -#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_OGGVORBIS - && std::strcmp(extension, ".ogg") != 0 +#if defined(CONFIG_NXWM_MEDIAPLAYER_FILTER_OGGVORBIS) + && std::strcasecmp(extension, ".ogg") != 0 #endif )) { From 214263010668d2e06fbfa5a18188c1170f2fcbfa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 18:19:00 -0600 Subject: [PATCH 258/390] NxWM: Beginning integration of NxPlayer into Nxwm::MediaPlayer. Gets handle, sets device, and releases handle. Lots more to be done --- Kconfig | 16 ++++- nxwm/include/cmediaplayer.hxx | 17 +++++- nxwm/include/nxwmconfig.hxx | 4 ++ nxwm/src/cmediaplayer.cxx | 112 +++++++++++++++++++++++++++++++++- 4 files changed, 144 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index 8bd5ef26d..6608d7a56 100644 --- a/Kconfig +++ b/Kconfig @@ -1130,6 +1130,20 @@ config NXWM_MEDIAPLAYER if NXWM_MEDIAPLAYER +menu "NxPlayer Integration" + +config NXWM_MEDIAPLAYER_PREFERRED_DEVICE + string "Preferred audio device" + default "pcm0" + depends on NXPLAYER_INCLUDE_PREFERRED_DEVICE + ---help--- + NxPlayer expects us to specify a preferred audio device. This + selection allows us to identify that preferred audio device. This + device is identified by a simple name string that corresponds to an + audio device that can be found under /dev/audio. + +endmenu # NxPlayer Integration + menu "Media File Configuration" config NXWM_MEDIAPLAYER_MEDIAPATH @@ -1166,7 +1180,7 @@ config NXWM_MEDIAPLAYER_FILTER_WAV config NXWM_MEDIAPLAYER_FILTER_PCM bool "Accept .pcm extension" - default y + default n select NXWM_MEDIAPLAYER_FILTER config NXWM_MEDIAPLAYER_FILTER_MP3 diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 0584429a4..b2f5072f6 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -115,6 +115,7 @@ namespace NxWM * Media player state data. */ + FAR struct nxplayer_s *m_player; /**< NxPlayer handle */ enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ @@ -184,7 +185,21 @@ namespace NxWM * Load media files into the list box. */ - inline bool showMediaFiles(const char *mediaPath); + inline bool showMediaFiles(FAR const char *mediaPath); + +#ifdef CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE + /** + * Set the preferred audio device for playback + */ + + inline bool setDevice(FAR const char *devPath); +#endif + + /** + * Configure the NxPlayer. + */ + + inline bool configureNxPlayer(void); /** * Create the Media Player controls. Only start as part of the application diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 75f860c9d..b2c3f4c54 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -632,6 +632,10 @@ * Default: CONFIG_NXWM_DEFAULT_FONTID */ +#ifndef CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE +# define CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE "pcm0" +#endif + #ifndef CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH # define CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH "/mnt/sdcard" #endif diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index d94b57369..f31a4567a 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -42,9 +42,12 @@ #include #include +#include #include #include +#include + #include "cwidgetcontrol.hxx" #include "nxwmconfig.hxx" @@ -108,6 +111,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) // Initial state is stopped + m_player = (FAR struct nxplayer_s *)0; m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_STOPPED; m_pending = PENDING_NONE; @@ -199,6 +203,13 @@ CMediaPlayer::~CMediaPlayer(void) delete m_volumeBitmap; } + // Release the NxPlayer + + if (m_player) + { + nxplayer_release(m_player); + } + // Although we didn't create it, we are responsible for deleting the // application window @@ -250,10 +261,19 @@ NXWidgets::CNxString CMediaPlayer::getName(void) bool CMediaPlayer::run(void) { - // Create the widgets (if we have not already done so) + // Configure the NxPlayer and create the widgets (if we have not already + // done so) - if (!m_listbox) + if (!m_player) { + // Configure the NxPlayer library and player thread + + if (!configureNxPlayer()) + { + gdbg("ERROR: Failed to configure NxPlayer\n"); + return false; + } + // Create the widgets if (!createPlayer()) @@ -485,6 +505,92 @@ inline bool CMediaPlayer::showMediaFiles(const char *mediaPath) return true; } +/** + * Set the preferred audio device for playback + */ + +#ifdef CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE +bool CMediaPlayer::setDevice(FAR const char *devPath) +{ + // First try to open the file using the device name as provided + + int ret = nxplayer_setdevice(m_player, devPath); + if (ret == -ENOENT) + { + char path[32]; + + // Append the device path and try again + +#ifdef CONFIG_AUDIO_CUSTOM_DEV_PATH +#ifdef CONFIG_AUDIO_DEV_ROOT + std::snprintf(path, sizeof(path), "/dev/%s", devPath); +#else + std::snprintf(path, sizeof(path), CONFIG_AUDIO_DEV_PATH "/%s", devPath); +#endif +#else + std::snprintf(path, sizeof(path), "/dev/audio/%s", devPath); +#endif + ret = nxplayer_setdevice(m_player, path); + } + + // Test if the device file exists + + if (ret == -ENOENT) + { + // Device doesn't exit. Report an error + + gdbg("ERROR: Device %s not found\n", devPath); + return false; + } + + // Test if is is an audio device + + if (ret == -ENODEV) + { + gdbg("ERROR: Device %s is not an audio device\n", devPath); + return false; + } + + if (ret < 0) + { + gdbg("ERROR: Error selecting device %s\n", devPath); + return false; + } + + // Device set successfully + + return true; +} +#endif + +/** + * Configure the NxPlayer. + */ + +bool CMediaPlayer::configureNxPlayer(void) +{ + // Get the NxPlayer handle + + m_player = nxplayer_create(); + if (!m_player) + { + gdbg("ERROR: Failed get NxPlayer handle\n"); + return false; + } + +#ifdef CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE + // Set the NxPlayer audio device + + if (!setDevice(CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE)) + { + gdbg("ERROR: Failed select NxPlayer audio device\n"); + return false; + } +#endif + + return true; +} + /** * Create the media player widgets. Only start as part of the application * start method. @@ -499,7 +605,7 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR failed to create font\n"); + gdbg("ERROR: Failed to create font\n"); return false; } From 422fd3ea023ec2bc363b8d369d73f616a0bcc5a6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 23 Jul 2014 18:24:02 -0600 Subject: [PATCH 259/390] Update ChangeLogs --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index dcdd8b8ec..94422c387 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -507,3 +507,6 @@ based on extension (2014-7-23) * NxWM::CMediaPlayer: Add logic to read files from the media mountpoint, filter them by extension, and display the file names in the listbox (2014-7-23). +* NxWM::CMediaPlayer: Beginning integration of NxPlayer into Nxwm::MediaPlayer. + Gets handle, sets device, and releases handle. Lots more to be done + (2014-7-23). From 7d814aa2b1cf669e5a91411c270fb056a33948aa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 06:52:54 -0600 Subject: [PATCH 260/390] Need debug output from CMediaPlayer if either audio or graphics debug enabled --- nxwm/include/cmediaplayer.hxx | 14 +++++++++ nxwm/src/cmediaplayer.cxx | 54 ++++++++++++++++++++++------------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index b2f5072f6..6e19ddaf3 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -83,6 +83,20 @@ namespace NxWM private: /** * This enumeration identifies the state of the media player + * + * State Transition Table + * ---------+----------+----------+----------+----------+----------+----------+ + * | FILE | FILE | | | FAST | | + * STATE | SELECTED |DESELECTED| PLAY | PAUSE | FORWARD | REWIND | + * ---------+----------+----------+----------+----------+----------+----------+ + * STOPPED | PAUSED | X | X | X | X | X | + * PAUSED | PAUSED | STOPPED | PLAYING | X |FFORWARD1 | REWIND1 | + * PLAYING | X | X | X | PAUSED |FFORWARD2 | REWIND2 | + * FFORWARD1| X | X | PAUSED | X | PAUSED | REWIND1 | + * REWIND1 | X | X | PAUSED | X |FFORWARD1 | PAUSED | + * FFORWARD2| X | X | X | PLAYING | PLAYING | REWIND1 | + * REWIND2 | X | X | X | PLAYING |FFORWARD1 | PLAYING | + * ---------+----------+----------+----------+----------+----------+----------+ */ enum EMediaPlayerState diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index f31a4567a..8354585f7 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -58,6 +58,20 @@ * Pre-Processor Definitions ********************************************************************************************/ +/* We want debug output from this file if either audio or graphics debug is enabled. */ + +#if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS) +# undef dbg +# undef vdbg +# ifdef CONFIG_CPP_HAVE_VARARGS +# define dbg(x...) +# define vdbg(x...) +# else +# define dbg (void) +# define vdbg (void) +# endif +#endif + /******************************************************************************************** * Private Types ********************************************************************************************/ @@ -270,7 +284,7 @@ bool CMediaPlayer::run(void) if (!configureNxPlayer()) { - gdbg("ERROR: Failed to configure NxPlayer\n"); + dbg("ERROR: Failed to configure NxPlayer\n"); return false; } @@ -278,7 +292,7 @@ bool CMediaPlayer::run(void) if (!createPlayer()) { - gdbg("ERROR: Failed to create widgets\n"); + dbg("ERROR: Failed to create widgets\n"); return false; } } @@ -539,7 +553,7 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) { // Device doesn't exit. Report an error - gdbg("ERROR: Device %s not found\n", devPath); + dbg("ERROR: Device %s not found\n", devPath); return false; } @@ -547,13 +561,13 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) if (ret == -ENODEV) { - gdbg("ERROR: Device %s is not an audio device\n", devPath); + dbg("ERROR: Device %s is not an audio device\n", devPath); return false; } if (ret < 0) { - gdbg("ERROR: Error selecting device %s\n", devPath); + dbg("ERROR: Error selecting device %s\n", devPath); return false; } @@ -574,7 +588,7 @@ bool CMediaPlayer::configureNxPlayer(void) m_player = nxplayer_create(); if (!m_player) { - gdbg("ERROR: Failed get NxPlayer handle\n"); + dbg("ERROR: Failed get NxPlayer handle\n"); return false; } @@ -583,7 +597,7 @@ bool CMediaPlayer::configureNxPlayer(void) if (!setDevice(CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE)) { - gdbg("ERROR: Failed select NxPlayer audio device\n"); + dbg("ERROR: Failed select NxPlayer audio device\n"); return false; } #endif @@ -605,7 +619,7 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR: Failed to create font\n"); + dbg("ERROR: Failed to create font\n"); return false; } @@ -626,7 +640,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_playBitmap || !m_pauseBitmap || !m_rewindBitmap || !m_fforwardBitmap || !m_volumeBitmap) { - gdbg("ERROR: Failed to one or more bitmaps\n"); + dbg("ERROR: Failed to one or more bitmaps\n"); return false; } @@ -676,7 +690,7 @@ bool CMediaPlayer::createPlayer(void) m_listbox = new NXWidgets::CListBox(control, 0, 0, m_windowSize.w, listHeight); if (!m_listbox) { - gdbg("ERROR: Failed to create CListBox\n"); + dbg("ERROR: Failed to create CListBox\n"); return false; } @@ -757,7 +771,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_play) { - gdbg("ERROR: Failed to create play control\n"); + dbg("ERROR: Failed to create play control\n"); return false; } @@ -784,7 +798,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_pause) { - gdbg("ERROR: Failed to create pause control\n"); + dbg("ERROR: Failed to create pause control\n"); return false; } @@ -814,7 +828,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_rewind) { - gdbg("ERROR: Failed to create rewind control\n"); + dbg("ERROR: Failed to create rewind control\n"); return false; } @@ -844,7 +858,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_fforward) { - gdbg("ERROR: Failed to create fast forward control\n"); + dbg("ERROR: Failed to create fast forward control\n"); return false; } @@ -883,7 +897,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_volume) { - gdbg("ERROR: Failed to create volume control\n"); + dbg("ERROR: Failed to create volume control\n"); return false; } @@ -1246,7 +1260,7 @@ void CMediaPlayer::checkFileSelection(void) // Remain in the stopped state if we fail to open the file m_fileIndex = -1; - gdbg("openMediaFile failed\n"); + dbg("ERROR: openMediaFile failed\n"); } else { @@ -1271,7 +1285,7 @@ void CMediaPlayer::checkFileSelection(void) // Go to the STOPPED state on a failure to open the media file // The play button will be disabled because m_fileIndex == -1. - gdbg("openMediaFile failed\n"); + dbg("ERROR: openMediaFile failed\n"); m_fileIndex = -1; setMediaPlayerState(MPLAYER_STOPPED); } @@ -1480,7 +1494,7 @@ IApplication *CMediaPlayerFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - gdbg("ERROR: Failed to create CApplicationWindow\n"); + dbg("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -1488,7 +1502,7 @@ IApplication *CMediaPlayerFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CApplicationWindow\n"); + dbg("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -1499,7 +1513,7 @@ IApplication *CMediaPlayerFactory::create(void) CMediaPlayer *mediaPlayer = new CMediaPlayer(m_taskbar, window); if (!mediaPlayer) { - gdbg("ERROR: Failed to instantiate CMediaPlayer\n"); + dbg("ERROR: Failed to instantiate CMediaPlayer\n"); delete window; return (IApplication *)0; } From afd005ccdeae33f907607ed38e729e6521a4e0e3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 08:28:10 -0600 Subject: [PATCH 261/390] Audio: Add hooks for fast-forward and rewind needed by CMediaPlayer; add hooks for equalizer settings needed by the WM8904 --- nxwm/include/cmediaplayer.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 6e19ddaf3..9ba86c988 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -97,6 +97,16 @@ namespace NxWM * FFORWARD2| X | X | X | PLAYING | PLAYING | REWIND1 | * REWIND2 | X | X | X | PLAYING |FFORWARD1 | PLAYING | * ---------+----------+----------+----------+----------+----------+----------+ + * + * Configuration Dependencies. States in the above state transition table may + * not be supported if any of the following features are excluded from the + * configuration: + * + * CONFIG_AUDIO_EXCLUDE_STOP + * CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME + * CONFIG_AUDIO_EXCLUDE_VOLUME + * CONFIG_AUDIO_EXCLUDE_FFORWARD + * CONFIG_AUDIO_EXCLUDE_REWIND */ enum EMediaPlayerState From 80be4efcf1080874a48e2d53fd503e9d680f373d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 11:02:39 -0600 Subject: [PATCH 262/390] NxWM::CMediaPlayer: Condition out features corresonding to NxPlayer features that are not enabled --- nxwm/include/cmediaplayer.hxx | 7 ++++++- nxwm/src/cmediaplayer.cxx | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 9ba86c988..17b174f5d 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -143,7 +143,9 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME int m_level; /**< Current volume level */ +#endif int m_fileIndex; /**< Index to selected file in the list box */ /** @@ -261,11 +263,13 @@ namespace NxWM void setMediaPlayerState(enum EMediaPlayerState state); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME /** * Set the new volume level based on the position of the volume slider. */ void setVolumeLevel(void); +#endif /** * Check if a new file has been selected (or de-selected) in the list box @@ -298,7 +302,8 @@ namespace NxWM void handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs &e); /** - * Handle changes in the volume level. + * Handle value changes. This will get events when there is a change in the + * volume level or a file is selected or deselected. */ void handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e); diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 8354585f7..d7f3a2505 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -129,6 +129,9 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_STOPPED; m_pending = PENDING_NONE; +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME + m_level = 0; +#endif m_fileIndex = -1; // Add our personalized window label @@ -843,9 +846,11 @@ bool CMediaPlayer::createPlayer(void) m_rewind->setBorderless(false); #endif +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND // Register to get events from the mouse clicks on the Rewind image m_rewind->addWidgetEventHandler(this); +#endif // Create the Forward Image @@ -873,9 +878,11 @@ bool CMediaPlayer::createPlayer(void) m_fforward->setBorderless(false); #endif +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD // Register to get events from the mouse clicks on the Forward image m_fforward->addWidgetEventHandler(this); +#endif // Create the Volume control @@ -909,18 +916,22 @@ bool CMediaPlayer::createPlayer(void) m_volume->setValue(15); m_volume->setPageSize(CONFIG_NXWM_MEDIAPLAYER_VOLUMESTEP); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME // Register to get events from the value changes in the volume slider m_volume->addWidgetEventHandler(this); +#endif // Make sure that all widgets are setup for the STOPPED state. Among other this, // this will enable drawing in the play widget (only) setMediaPlayerState(MPLAYER_STOPPED); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME // Set the volume level setVolumeLevel(); +#endif // Enable drawing in the list box, rewind, fast-forward and drawing widgets. @@ -1051,7 +1062,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_rewind->disable(); m_rewind->setStuckSelection(false); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_volume->enable(); +#endif break; case MPLAYER_PLAYING: // Playing a media file @@ -1072,15 +1085,19 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->enable(); m_pause->show(); +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD // Fast forward image is enabled and ready for use m_fforward->enable(); m_fforward->setStuckSelection(false); +#endif +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND // Rewind image is enabled and ready for use m_rewind->enable(); m_rewind->setStuckSelection(false); +#endif break; case MPLAYER_PAUSED: // Playing a media file but paused @@ -1101,16 +1118,21 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->disable(); m_pause->hide(); +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD // Fast forward image is enabled and ready for use m_fforward->setStuckSelection(false); +#endif +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND // Rewind image is enabled and ready for use m_rewind->setStuckSelection(false); +#endif break; case MPLAYER_FFORWARD: // Fast forwarding through a media file */ +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD m_state = MPLAYER_FFORWARD; // List box is not available while fast forwarding @@ -1146,12 +1168,16 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_fforward->setStuckSelection(true); +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND // Rewind is enabled and ready for use m_rewind->setStuckSelection(false); +#endif +#endif break; case MPLAYER_FREWIND: // Rewinding a media file +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND m_state = MPLAYER_FREWIND; // List box is not available while rewinding @@ -1183,13 +1209,16 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_pause->hide(); } +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD // Fast forward image is enabled and ready for use m_fforward->setStuckSelection(false); +#endif // Rewind image is enabled, highlighted, and ready for use m_rewind->setStuckSelection(true); +#endif break; default: @@ -1205,6 +1234,7 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) * Set the new volume level based on the position of the volume slider. */ +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME void CMediaPlayer::setVolumeLevel(void) { // Get the current volume level value. This is already pre-scaled in the @@ -1221,6 +1251,7 @@ void CMediaPlayer::setVolumeLevel(void) m_level = newLevel; } } +#endif /** * Check if a new file has been selected (or de-selected) in the list box @@ -1334,6 +1365,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) m_pending = PENDING_PAUSE_RELEASE; } +#ifndef CONFIG_AUDIO_EXCLUDE_REWIND // Check if the rewind image was clicked if (m_rewind->isClicked()) @@ -1357,7 +1389,9 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(MPLAYER_FREWIND); } } +#endif +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD // Check if the fast forward image was clicked if (m_fforward->isClicked()) @@ -1381,6 +1415,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(MPLAYER_FFORWARD); } } +#endif } } @@ -1467,7 +1502,9 @@ void CMediaPlayer::handleReleaseOutsideEvent(const NXWidgets::CWidgetEventArgs & void CMediaPlayer::handleValueChangeEvent(const NXWidgets::CWidgetEventArgs &e) { +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME setVolumeLevel(); +#endif checkFileSelection(); } From 061e95bd912290fb66745a721a015b77f03719c6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 14:57:38 -0600 Subject: [PATCH 263/390] NxWidgets::CNxString: Add a getAllocSize() method to make it easier to convert CNxStrings to NUL-terminated C strings --- libnxwidgets/include/cnxstring.hxx | 20 ++++++++++++++++---- libnxwidgets/src/cnxstring.cxx | 7 ++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/libnxwidgets/include/cnxstring.hxx b/libnxwidgets/include/cnxstring.hxx index 50adea21c..2fa230ab1 100644 --- a/libnxwidgets/include/cnxstring.hxx +++ b/libnxwidgets/include/cnxstring.hxx @@ -239,9 +239,9 @@ namespace NXWidgets /** * Copy the internal array to the supplied buffer. The buffer must be * large enough to contain the full text in the string. The - * getByteCount() method can be used to obtain the length of the string. + * getAllocSize() method can be used to obtain the length of the string. * Unlike the CNxString class, the char array is null-terminated. - * The buffer must be (getByteCount() + 1) bytes long, in order to + * The buffer must be (getAllocSize() + 1) bytes long, in order to * accommodate the terminator. * * @param buffer Buffer to copy the internal char array to. @@ -322,11 +322,23 @@ namespace NXWidgets * @return The length of the string. */ - inline const int getLength(void) const + inline const unsigned int getLength(void) const { return m_stringLength; }; + /** + * Get the size of a buffer (in bytes) required in order to copy the + * internal string into an the array. This is normally used in + * conjunction with copyToCharArray(). Note that the returned size + * includes additional byte(s) to hold NUL termination. + */ + + inline const unsigned int getAllocSize(void) const + { + return sizeof(nxwidget_char_t) * (m_stringLength + 1); + } + /** * Get the character at the specified index. This function is useful * for finding the occasional character at an index, but for iterating @@ -463,7 +475,7 @@ namespace NXWidgets * @return This string. */ - CNxString& operator=(nxwidget_char_t letter); + CNxString &operator=(nxwidget_char_t letter); /** * Compares this string to the argument. diff --git a/libnxwidgets/src/cnxstring.cxx b/libnxwidgets/src/cnxstring.cxx index 8548de636..4962858fa 100644 --- a/libnxwidgets/src/cnxstring.cxx +++ b/libnxwidgets/src/cnxstring.cxx @@ -161,9 +161,9 @@ CStringIterator *CNxString::newStringIterator() const /** * Copy the internal array to the supplied buffer. The buffer must be * large enough to contain the full text in the string. The - * getByteCount() method can be used to obtain the length of the string. + * getAllocSize() method can be used to obtain the length of the string. * Unlike the CNxString class, the char array is null-terminated. - * The buffer must be (getByteCount() + 2) bytes long, in order to + * The buffer must be (getAllocSize() + 2) bytes long, in order to * accommodate the terminator. * * @param buffer Buffer to copy the internal char array to. @@ -677,6 +677,7 @@ CNxString& CNxString::operator=(const CNxString &string) { setText(string); } + return *this; } @@ -688,7 +689,7 @@ CNxString& CNxString::operator=(const CNxString &string) * @return This string. */ -CNxString& CNxString::operator=(const char *string) +CNxString& CNxString::operator=(FAR const char *string) { setText(string); return *this; From e5ff9a4798a72c96bb9eefd323c7c3efd39e44d5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 14:59:00 -0600 Subject: [PATCH 264/390] Add a do-notthin, virtual destructor to eliminate a warning --- nxwm/include/iapplication.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nxwm/include/iapplication.hxx b/nxwm/include/iapplication.hxx index 882c5e6ea..c586e20de 100644 --- a/nxwm/include/iapplication.hxx +++ b/nxwm/include/iapplication.hxx @@ -218,6 +218,15 @@ namespace NxWM class IApplicationFactory { public: + /** + * A virtual destructor is required in order to override the IApplicationFactory + * destructor. We do this because if we delete IApplicationFactory, we want the + * destructor of the class that inherits from IApplication to run, not this + * one. + */ + + virtual ~IApplicationFactory(void) { } + /** * Create a new instance of an application. */ From 4c6723f96ecfdacbbcef99fe97e7cc57f387243c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 15:01:05 -0600 Subject: [PATCH 265/390] Lots of changes to integrate with Ken's NxPlayer --- Kconfig | 2 +- nxwm/include/cmediaplayer.hxx | 25 ++- nxwm/src/cmediaplayer.cxx | 310 ++++++++++++++++++++++++++++------ 3 files changed, 276 insertions(+), 61 deletions(-) diff --git a/Kconfig b/Kconfig index 6608d7a56..c36e20e24 100644 --- a/Kconfig +++ b/Kconfig @@ -1154,7 +1154,7 @@ config NXWM_MEDIAPLAYER_MEDIAPATH containing all of the media files accessible by the media player. config NXWM_MEDIAPLAYER_NOFILTER - bool "Disable filtering by file name extension + bool "Disable filtering by file name extension" default y config NXWM_MEDIAPLAYER_FILTER diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 17b174f5d..4f664d8e5 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -143,10 +143,11 @@ namespace NxWM enum EMediaPlayerState m_state; /**< Media player current state */ enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ + NXWidgets::CNxString m_filePath; /**< The full path to the selected file */ + bool m_fileReady; /**< True: Ready to play */ #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME - int m_level; /**< Current volume level */ + uint8_t m_level; /**< Current volume level, range 0-100 */ #endif - int m_fileIndex; /**< Index to selected file in the list box */ /** * Media player geometry. @@ -187,18 +188,26 @@ namespace NxWM NXWidgets::CRlePaletteBitmap *m_volumeBitmap; /**< Volume control grip bitmap */ /** - * Open a media file for playing. Called after a file has been selected - * from the list box. + * Get the full media file path and make ready for playing. Called + * after a file has been selected from the list box. */ - inline bool openMediaFile(const NXWidgets::CListBoxDataItem *item); + bool getMediaFile(const NXWidgets::CListBoxDataItem *item); /** - * Close media file. Called when a new media file is selected, when a - * media file is de-selected, or when destroying the media player instance. + * Get the full media file path and make ready for playing. Called + * after a file has been selected from the list box. */ - inline void closeMediaFile(void); + bool openMediaFile(const NXWidgets::CListBoxDataItem *item); + + /** + * Stop playing the current file. Called when a new media file is selected, + * when a media file is de-selected, or when destroying the media player + * instance. + */ + + void stopPlaying(void); /** * Select the geometry of the media player given the current window size. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index d7f3a2505..35cba1e30 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -40,6 +40,8 @@ #include +#include + #include #include #include @@ -47,6 +49,7 @@ #include #include +#include #include "cwidgetcontrol.hxx" @@ -132,7 +135,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_level = 0; #endif - m_fileIndex = -1; + m_fileReady = false; // Add our personalized window label @@ -391,23 +394,96 @@ bool CMediaPlayer::isFullScreen(void) const } /** - * Open a media file for playing. Called after a file has been selected - * from the list box. + * Get the full media file path and make ready for playing. Called + * after a file has been selected from the list box. */ -bool CMediaPlayer::openMediaFile(const NXWidgets::CListBoxDataItem *item) +bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) { -#warning Missing logic + // Get the full path to the file + + NXWidgets::CNxString newFilePath(CONFIG_NXWM_MEDIAPLAYER_MEDIAPATH "/"); + newFilePath.append(item->getText()); + + // Make sure that this is a different name than the one we already have + + if (!m_fileReady || m_filePath.compareTo(newFilePath) != 0) + { + // It is a new file name + // Get the path to the file as a regular C-style string + + NXWidgets::nxwidget_char_t *filePath = + new NXWidgets::nxwidget_char_t[m_filePath.getAllocSize() + 1]; + + if (!filePath) + { + dbg("ERROR: Failed to allocate file path\n"); + return false; + } + + m_filePath.copyToCharArray(filePath); + + // Verify that the file of this name exists and that it is a not + // something weird (like a directory or a block device). + // REVISIT: Should check if read-able as well. + + struct stat buf; + int ret = stat((FAR const char *)filePath, &buf); + delete filePath; + + if (ret < 0) + { + int errcode = errno; + dbg("ERROR: Could not stat file: %d\n", errcode); + + // Make sure there is no previous file information + + m_fileReady = false; + m_filePath.remove(0); + return false; + } + + if (S_ISDIR(buf.st_mode) || S_ISBLK(buf.st_mode)) + { + dbg("ERROR: Not a regular file\n"); + + // Make sure there is no previous file information + + m_fileReady = false; + m_filePath.remove(0); + return false; + } + } + + // Save the new file path and mark ready to play + + m_filePath = newFilePath; + m_fileReady = true; return true; } /** - * Close media file. Called when a new media file is selected, when a media file is de-selected, or when destroying the media player instance. - */ + * Stop playing the current file. Called when a new media file is selected, + * when a media file is de-selected, or when destroying the media player + * instance. + */ -void CMediaPlayer::closeMediaFile(void) +void CMediaPlayer::stopPlaying(void) { -#warning Missing logic +#ifndef CONFIG_AUDIO_EXCLUDE_STOP + // Stop playing the file + + int ret = nxplayer_stop(m_player); + if (ret < 0) + { + auddbg("ERROR: nxplayer_stop failed: %d\n", ret); + } +#endif + + // Clear information about the selected file + + m_fileReady = false; + m_filePath.remove(0); } /** @@ -1036,7 +1112,7 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) // Play image is visible, but enabled and ready to start playing only // if a file is selected - if (m_fileIndex < 0) + if (m_fileReady) { m_play->disable(); } @@ -1082,7 +1158,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) // Pause image enabled and ready to pause playing +#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME m_pause->enable(); +#endif m_pause->show(); #ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD @@ -1148,7 +1226,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) // Pause image enabled and ready to stop fast forwarding +#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME m_pause->enable(); +#endif m_pause->show(); } else @@ -1193,7 +1273,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) // Pause image enabled and ready to stop rewinding +#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME m_pause->enable(); +#endif m_pause->show(); } else @@ -1241,14 +1323,28 @@ void CMediaPlayer::setVolumeLevel(void) // range 0-100 int newLevel = m_volume->getValue(); + if (newLevel < 0 || newLevel > 100) + { + dbg("ERROR: volume is out of range: %d\n", newLevel); + } // Has the volume level changed? - if (m_level != newLevel) + else if ((int)m_level != newLevel) { // Yes.. provide the new volume setting to the NX Player -#warning Missing logic - m_level = newLevel; + + int ret = nxplayer_setvolume(m_player, (uint16_t)newLevel); + if (ret < OK) + { + dbg("ERROR: nxplayer_setvolume failed: %d\n", ret); + } + else + { + // New volume set successfully.. save the new setting + + m_level = (uint8_t)newLevel; + } } } #endif @@ -1269,64 +1365,59 @@ void CMediaPlayer::checkFileSelection(void) { // No file is selected - m_fileIndex = -1; + m_fileReady = false; // Nothing is selected.. If we are not stopped, then stop now if (m_state != MPLAYER_STOPPED) { - closeMediaFile(); + stopPlaying(); setMediaPlayerState(MPLAYER_STOPPED); } } - // A media file is selected. Were stopped before? + // A media file is selected. Were we stopped before? else if (m_state == MPLAYER_STOPPED) { - // Yes.. open the new media file and go to the PAUSE state + // Yes.. Get the new media file path and go to the PAUSE state - if (!openMediaFile(m_listbox->getSelectedOption())) + if (!getMediaFile(m_listbox->getSelectedOption())) { // Remain in the stopped state if we fail to open the file - m_fileIndex = -1; - dbg("ERROR: openMediaFile failed\n"); + dbg("ERROR: getMediaFile failed\n"); } else { // And go to the PAUSED state (enabling the PLAY button) - m_fileIndex = newFileIndex; setMediaPlayerState(MPLAYER_PAUSED); } } - // We already have a media file loaded. Is it the same file? + // Make sure that we are not already playing, - else if (m_fileIndex != newFileIndex) + stopPlaying(); + + // Get the path to the newly selected file, and make sure that we are + // in the paused state (that should already be the case). NOTE that if + // for some reason this is the same file that we were already playing, + // then playing will be restarted. + + if (!getMediaFile(m_listbox->getSelectedOption())) { - // No.. It is a new file. Close that media file, load the newly - // selected file, and make sure that we are in the paused state - // (that should already be the case) + // Go to the STOPPED state on a failure to open the media file + // The play button will be disabled because m_fileReady is false. - closeMediaFile(); - if (!openMediaFile(m_listbox->getSelectedOption())) - { - // Go to the STOPPED state on a failure to open the media file - // The play button will be disabled because m_fileIndex == -1. + dbg("ERROR: getMediaFile failed\n"); + setMediaPlayerState(MPLAYER_STOPPED); + } + else + { + // And go to the PAUSED state (enabling the PLAY button) - dbg("ERROR: openMediaFile failed\n"); - m_fileIndex = -1; - setMediaPlayerState(MPLAYER_STOPPED); - } - else - { - // And go to the PAUSED state (enabling the PLAY button) - - m_fileIndex = newFileIndex; - setMediaPlayerState(MPLAYER_PAUSED); - } + setMediaPlayerState(MPLAYER_PAUSED); } } @@ -1377,7 +1468,15 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Yes.. then revert to the previous play/pause state // REVISIT: Or just increase rewind speed? - setMediaPlayerState(m_prevState); + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); + if (ret < 0) + { + dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + } + else + { + setMediaPlayerState(m_prevState); + } } // We should not be stopped here, but let's check anyway @@ -1386,7 +1485,15 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { // Start rewinding - setMediaPlayerState(MPLAYER_FREWIND); + int ret = nxplayer_rewind(m_player, SUBSAMPLE_4X); + if (ret < 0) + { + dbg("ERROR: nxplayer_rewind failed: %d\n", ret); + } + else + { + setMediaPlayerState(MPLAYER_FREWIND); + } } } #endif @@ -1403,7 +1510,16 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Yes.. then revert to the previous play/pause state // REVISIT: Or just increase fast forward speed? - setMediaPlayerState(m_prevState); + + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); + if (ret < 0) + { + dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + } + else + { + setMediaPlayerState(m_prevState); + } } // We should not be stopped here, but let's check anyway @@ -1412,7 +1528,15 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { // Start fast forwarding - setMediaPlayerState(MPLAYER_FFORWARD); + int ret = nxplayer_fforward(m_player, SUBSAMPLE_4X); + if (ret < 0) + { + dbg("ERROR: nxplayer_fforward failed: %d\n", ret); + } + else + { + setMediaPlayerState(MPLAYER_FFORWARD); + } } } #endif @@ -1430,16 +1554,67 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) if (m_pending == PENDING_PLAY_RELEASE && !m_play->isClicked()) { - // Yes.. Now perform the delayed state change + // Yes.. Now perform the delayed state change. // // If we were previously STOPPED or PAUSED, then enter the PLAYING // state. + // If there is no selected file, then the play button does nothing - if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) +#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME + if (m_state == MPLAYER_PAUSED) { - setMediaPlayerState(MPLAYER_PLAYING); + // Resume playing + + int ret = nxplayer_resume(m_player); + if (ret < 0) + { + dbg("ERROR: nxplayer_resume() failed: %d\n", ret); + } + else + { + setMediaPlayerState(MPLAYER_PLAYING); + } + } + else if (m_state == MPLAYER_STOPPED) +#else + if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) +#endif + { + // Has a file been selected? If not the ignore the event + + if (m_fileReady) + { + // Get the path to the file as a regular C-style string + + NXWidgets::nxwidget_char_t *filePath = + new NXWidgets::nxwidget_char_t[m_filePath.getAllocSize() + 1]; + + if (!filePath) + { + dbg("ERROR: Failed to allocate file path\n"); + return; + } + + m_filePath.copyToCharArray(filePath); + + // And start playing + + int ret = nxplayer_playfile(m_player, (FAR const char *)filePath, + AUDIO_FMT_UNDEF, AUDIO_FMT_UNDEF); + if (ret < 0) + { + dbg("ERROR: nxplayer_playfile failed: %d\n", ret); + } + else + { + setMediaPlayerState(MPLAYER_PLAYING); + } + + delete filePath; + } } +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) // Ignore the event if we are already in the PLAYING state else if (m_state != MPLAYER_PLAYING) @@ -1447,14 +1622,24 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // Otherwise, we must be fast forwarding or rewinding. In these // cases, stop the action and return to the previous state - setMediaPlayerState(m_prevState); + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); + if (ret < 0) + { + dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + } + else + { + setMediaPlayerState(m_prevState); + } } +#endif // No longer any action pending the PLAY image release m_pending = PENDING_NONE; } +#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME // Check if the Pause image was released else if (m_pending == PENDING_PAUSE_RELEASE && !m_pause->isClicked()) @@ -1465,9 +1650,20 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) if (m_state == MPLAYER_PLAYING) { - setMediaPlayerState(MPLAYER_PAUSED); + // Pause playing + + int ret = nxplayer_pause(m_player); + if (ret < 0) + { + dbg("ERROR: nxplayer_pause() failed: %d\n", ret); + } + else + { + setMediaPlayerState(MPLAYER_PAUSED); + } } +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) // Ignore the event if we are already in the PAUSED or STOPPED states else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_PAUSED) @@ -1475,13 +1671,23 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // Otherwise, we must be fast forwarding or rewinding. In these // cases, stop the action and return to the previous state - setMediaPlayerState(m_prevState); + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); + if (ret < 0) + { + dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + } + else + { + setMediaPlayerState(m_prevState); + } } +#endif // No longer any action pending the PAUSE image release m_pending = PENDING_NONE; } +#endif } /** From 3bf1fc10d28bb3e73755778b3c483d1e1650ce00 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 15:09:22 -0600 Subject: [PATCH 266/390] Update ChangeLogs --- ChangeLog.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 94422c387..0a426c17c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -510,3 +510,9 @@ * NxWM::CMediaPlayer: Beginning integration of NxPlayer into Nxwm::MediaPlayer. Gets handle, sets device, and releases handle. Lots more to be done (2014-7-23). +* NxWidgets::CNxString: Add a getAllocSize() method to make it easier to + convert CNxStrings to NUL-terminated C strings (2014-7-24). +* NxWM::IApplicationFactory: dd a do-nothing, virtual destructor to + eliminate a warning (2014-7-24). +* NxWM::CMediaPlayer: Lots of changes to integrate with Ken's NxPlayer + (2014-7-24). From 34e06191947160c97e216fd14ebd34b205ceddcf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 20:02:12 -0600 Subject: [PATCH 267/390] Remove some warnings --- libnxwidgets/src/cnxstring.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libnxwidgets/src/cnxstring.cxx b/libnxwidgets/src/cnxstring.cxx index 4962858fa..512b68134 100644 --- a/libnxwidgets/src/cnxstring.cxx +++ b/libnxwidgets/src/cnxstring.cxx @@ -274,7 +274,8 @@ void CNxString::append(const CNxString &text) FAR nxwidget_char_t *dest = &m_text[m_stringLength]; FAR const nxwidget_char_t *src = text.getCharArray(); - for (int i = 0; i < text.getLength(); i++) + + for (unsigned int i = 0; i < text.getLength(); i++) { *dest++ = *src++; } @@ -328,6 +329,7 @@ void CNxString::insert(const CNxString &text, int index) FAR nxwidget_char_t *dest = newText; FAR const nxwidget_char_t *src = m_text; + for (int i = 0; i < index; i++) { *dest++ = *src++; @@ -336,7 +338,8 @@ void CNxString::insert(const CNxString &text, int index) // Insert the additional text into the new string src = text.getCharArray(); - for (int i = 0; i < text.getLength(); i++) + + for (unsigned int i = 0; i < text.getLength(); i++) { *dest++ = *src++; } @@ -344,6 +347,7 @@ void CNxString::insert(const CNxString &text, int index) // Copy the end of the existing text the the newly allocated string src = &m_text[index]; + for (int i = index; i < m_stringLength; i++) { *dest++ = *src++; @@ -375,7 +379,8 @@ void CNxString::insert(const CNxString &text, int index) dest = &m_text[index]; src = text.getCharArray(); - for (int i = 0; i < text.getLength(); i++) + + for (unsigned int i = 0; i < text.getLength(); i++) { *dest++ = *src++; } @@ -436,6 +441,7 @@ void CNxString::remove(const int startIndex, const int count) FAR nxwidget_char_t *dest = &m_text[startIndex]; FAR const nxwidget_char_t *src = &m_text[endIndex]; + for (int i = m_stringLength - endIndex; i > 0; i--) { *dest++ = *src++; From 04152576fa361ad5a62275930a659780c489bbb3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Jul 2014 20:11:37 -0600 Subject: [PATCH 268/390] NxWM:CMediaPlayer: Fix some string handling and memory allocation errors --- nxwm/src/cmediaplayer.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 35cba1e30..8f833638c 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -413,7 +413,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) // Get the path to the file as a regular C-style string NXWidgets::nxwidget_char_t *filePath = - new NXWidgets::nxwidget_char_t[m_filePath.getAllocSize() + 1]; + new NXWidgets::nxwidget_char_t[newFilePath.getAllocSize()]; if (!filePath) { @@ -421,20 +421,21 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) return false; } - m_filePath.copyToCharArray(filePath); + newFilePath.copyToCharArray(filePath); // Verify that the file of this name exists and that it is a not // something weird (like a directory or a block device). + // // REVISIT: Should check if read-able as well. struct stat buf; int ret = stat((FAR const char *)filePath, &buf); - delete filePath; + delete[] filePath; if (ret < 0) { int errcode = errno; - dbg("ERROR: Could not stat file: %d\n", errcode); + dbg("ERROR: Could not stat file %s: %d\n", filePath, errcode); // Make sure there is no previous file information @@ -1587,7 +1588,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // Get the path to the file as a regular C-style string NXWidgets::nxwidget_char_t *filePath = - new NXWidgets::nxwidget_char_t[m_filePath.getAllocSize() + 1]; + new NXWidgets::nxwidget_char_t[m_filePath.getAllocSize()]; if (!filePath) { @@ -1603,14 +1604,14 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) AUDIO_FMT_UNDEF, AUDIO_FMT_UNDEF); if (ret < 0) { - dbg("ERROR: nxplayer_playfile failed: %d\n", ret); + dbg("ERROR: nxplayer_playfile %s failed: %d\n", filePath, ret); } else { setMediaPlayerState(MPLAYER_PLAYING); } - delete filePath; + delete[] filePath; } } From 7b43b0543b3674caf246fb062e145f5ac8e77bbf Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 25 Jul 2014 10:11:30 -0600 Subject: [PATCH 269/390] NxWM::CMediaPlayer: Revise state logic. We need an additional state for the case where a file is selected, but playing has not yet start. Several other state-related fixes --- nxwm/include/cmediaplayer.hxx | 12 ++- nxwm/src/cmediaplayer.cxx | 150 +++++++++++++++++++++------------- 2 files changed, 101 insertions(+), 61 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 4f664d8e5..1b9b98a66 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -89,9 +89,10 @@ namespace NxWM * | FILE | FILE | | | FAST | | * STATE | SELECTED |DESELECTED| PLAY | PAUSE | FORWARD | REWIND | * ---------+----------+----------+----------+----------+----------+----------+ - * STOPPED | PAUSED | X | X | X | X | X | - * PAUSED | PAUSED | STOPPED | PLAYING | X |FFORWARD1 | REWIND1 | + * STOPPED | STAGED | X | X | X | X | X | + * STAGED | STAGED | STOPPED | PLAYING | X | X | X | * PLAYING | X | X | X | PAUSED |FFORWARD2 | REWIND2 | + * PAUSED | STAGED | STOPPED | PLAYING | X |FFORWARD1 | REWIND1 | * FFORWARD1| X | X | PAUSED | X | PAUSED | REWIND1 | * REWIND1 | X | X | PAUSED | X |FFORWARD1 | PAUSED | * FFORWARD2| X | X | X | PLAYING | PLAYING | REWIND1 | @@ -112,12 +113,19 @@ namespace NxWM enum EMediaPlayerState { MPLAYER_STOPPED = 0, /**< No media file has been selected */ + MPLAYER_STAGED, /**< Media file selected, not playing */ MPLAYER_PLAYING, /**< Playing a media file */ MPLAYER_PAUSED, /**< Playing a media file but paused */ MPLAYER_FFORWARD, /**< Fast forwarding through a media file */ MPLAYER_FREWIND, /**< Rewinding a media file */ }; + /** + * Describes the state of an image touch. Some image touch cannot be + * processed until the image contact is lost. This enumeration arms and + * manages those cases. + */ + enum EPendingRelease { PENDING_NONE = 0, /**< Nothing is pending */ diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 8f833638c..b43139f79 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -2,6 +2,7 @@ * NxWidgets/nxwm/src/cmediaplayer.cxx * * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Ken Pettit * Gregory Nutt * @@ -1057,8 +1058,12 @@ void CMediaPlayer::redrawWidgets(void) m_listbox->redraw(); // Only one of the Play and Pause images should have drawing enabled. + // Play should be visible if we are in any STOPPED state of if we + // are fast forward or rewind state that came from the PAUSED state - if (m_state != MPLAYER_STOPPED && m_prevState == MPLAYER_PLAYING) + if (m_state != MPLAYER_STOPPED && // Stopped states + m_state != MPLAYER_STAGED && + m_prevState == MPLAYER_PLAYING) // Previously playing { // Playing... show the pause button // REVISIT: Really only available if there is a selected file in the list box @@ -1104,24 +1109,16 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) { case MPLAYER_STOPPED: // Initial state. Also the state after playing completes m_state = MPLAYER_STOPPED; - m_prevState = MPLAYER_PLAYING; + m_prevState = MPLAYER_STOPPED; // List box is enabled and ready for file selection m_listbox->enable(); - // Play image is visible, but enabled and ready to start playing only - // if a file is selected - - if (m_fileReady) - { - m_play->disable(); - } - else - { - m_play->enable(); - } + // Play image is visible, but disabled. It will not enabled until + // we enter the MPLAYER_STAGED state after a file is selected + m_play->disable(); m_play->show(); // Pause image is disabled and hidden @@ -1139,6 +1136,43 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_rewind->disable(); m_rewind->setStuckSelection(false); + // Volume slider is available + +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME + m_volume->enable(); +#endif + break; + + case MPLAYER_STAGED: // Media file selected, not playing + m_state = MPLAYER_STAGED; + m_prevState = MPLAYER_STOPPED; + + // List box is still enabled a ready for file selection + + m_listbox->enable(); + + // Play image enabled and ready to start playing + + m_play->enable(); + m_play->show(); + + // Pause image is disabled and hidden + + m_pause->disable(); + m_pause->hide(); + + // Fast forward image is disabled + + m_fforward->disable(); + m_fforward->setStuckSelection(false); + + // Rewind image is disabled + + m_rewind->disable(); + m_rewind->setStuckSelection(false); + + // Volume slider is available + #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_volume->enable(); #endif @@ -1372,54 +1406,48 @@ void CMediaPlayer::checkFileSelection(void) if (m_state != MPLAYER_STOPPED) { + // Stop playing. Should be okay if m_state == MPLAYER_STAGED. + // We are not really playing yet, but NxPlayer should be able + // to handle that. + stopPlaying(); + + // Then go to the STOPPED state + setMediaPlayerState(MPLAYER_STOPPED); } } - - // A media file is selected. Were we stopped before? - - else if (m_state == MPLAYER_STOPPED) + else { - // Yes.. Get the new media file path and go to the PAUSE state + // A media file is selected. Were we in a STOPPED state before? + // Make sure that we are not already playing. Should be okay if + // are in a STOPPED or STAGED state. We are not really playing + // yet those cases, but NxPlayer should be able to handle any + // spurious stops. + + stopPlaying(); + + // Get the path to the newly selected file if (!getMediaFile(m_listbox->getSelectedOption())) { - // Remain in the stopped state if we fail to open the file + // Go to the STOPPED state on a failure to open the media file + // The play button will be disabled because m_fileReady is false. + // No harm done if we were already STOPPED. dbg("ERROR: getMediaFile failed\n"); + setMediaPlayerState(MPLAYER_STOPPED); } else { - // And go to the PAUSED state (enabling the PLAY button) + // We have the file. Go to the STAGED state (enabling the PLAY + // button). NOTE that if for some reason this is the same file + // that we were already and playing, then playing will be + // restarted. - setMediaPlayerState(MPLAYER_PAUSED); + setMediaPlayerState(MPLAYER_STAGED); } } - - // Make sure that we are not already playing, - - stopPlaying(); - - // Get the path to the newly selected file, and make sure that we are - // in the paused state (that should already be the case). NOTE that if - // for some reason this is the same file that we were already playing, - // then playing will be restarted. - - if (!getMediaFile(m_listbox->getSelectedOption())) - { - // Go to the STOPPED state on a failure to open the media file - // The play button will be disabled because m_fileReady is false. - - dbg("ERROR: getMediaFile failed\n"); - setMediaPlayerState(MPLAYER_STOPPED); - } - else - { - // And go to the PAUSED state (enabling the PLAY button) - - setMediaPlayerState(MPLAYER_PAUSED); - } } /** @@ -1444,7 +1472,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // These only make sense in non-STOPPED states - if (m_state != MPLAYER_STOPPED) + if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_STAGED) { // Check if the Pause image was clicked @@ -1480,9 +1508,9 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } - // We should not be stopped here, but let's check anyway + // We should not be in a STOPPED state here, but let's check anyway - else if (m_state != MPLAYER_STOPPED) + else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_STAGED) { // Start rewinding @@ -1511,7 +1539,6 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Yes.. then revert to the previous play/pause state // REVISIT: Or just increase fast forward speed? - int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { @@ -1523,9 +1550,9 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) } } - // We should not be stopped here, but let's check anyway + // We should not be in a STOPPED state here, but let's check anyway - else if (m_state != MPLAYER_STOPPED) + else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_STAGED) { // Start fast forwarding @@ -1576,9 +1603,9 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) setMediaPlayerState(MPLAYER_PLAYING); } } - else if (m_state == MPLAYER_STOPPED) + else if (m_state == MPLAYER_STAGED) #else - if (m_state == MPLAYER_STOPPED || m_state == MPLAYER_PAUSED) + if (m_state == MPLAYER_STAGED || m_state == MPLAYER_PAUSED) #endif { // Has a file been selected? If not the ignore the event @@ -1615,13 +1642,16 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) } } -#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) - // Ignore the event if we are already in the PLAYING state + // Ignore the event if (1) we are already in the PLAYING state, or (2) + // we are still in the STOPPED state (with no file selected). - else if (m_state != MPLAYER_PLAYING) +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + // The remaining cases include only the FFORWARD and REWIND states + + else if (m_state == MPLAYER_FFORWARD || m_state == MPLAYER_FREWIND) { - // Otherwise, we must be fast forwarding or rewinding. In these - // cases, stop the action and return to the previous state + // In these states, stop the fast motion action and return to the + // previous state int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) @@ -1667,7 +1697,9 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) #if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) // Ignore the event if we are already in the PAUSED or STOPPED states - else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_PAUSED) + else if (m_state != MPLAYER_STOPPED && + m_state != MPLAYER_STAGED && + m_state != MPLAYER_PAUSED) { // Otherwise, we must be fast forwarding or rewinding. In these // cases, stop the action and return to the previous state From 501d3dc1a325538355c9f2508a71e1313ff2001b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 25 Jul 2014 10:13:15 -0600 Subject: [PATCH 270/390] Update ChangeLogs --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 0a426c17c..5b4702884 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -516,3 +516,6 @@ eliminate a warning (2014-7-24). * NxWM::CMediaPlayer: Lots of changes to integrate with Ken's NxPlayer (2014-7-24). +* NxWM::CMediaPlayer: Revise state logic. We need an additional state for + the case where a file is selected, but playing has not yet start. Several + other state-related fixes (2014-7-25). From ad3862a3834ae697a06a11c6fdeb05592edc2234 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 25 Jul 2014 11:32:23 -0600 Subject: [PATCH 271/390] NxWM: Fix default ICON name. g_playBitmap24x24 does not exist, should be g_playBitmap --- Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index c36e20e24..52aa90da1 100644 --- a/Kconfig +++ b/Kconfig @@ -625,15 +625,15 @@ config NXWM_CUSTOM_STARTWINDOW_ICON bool "Custom Start Window Icon" default n ---help--- - Select to override the default Start Window Icon: NxWM::g_playBitmap24x24 + Select to override the default Start Window Icon: NxWM::g_playBitmap if NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_ICON string "StartWindow Icon" - default "NxWM::g_playBitmap24x24" + default "NxWM::g_playBitmap" ---help--- - The glyph to use as the start window icon. Default: NxWM::g_playBitmap24x24 + The glyph to use as the start window icon. Default: NxWM::g_playBitmap endif # NXWM_CUSTOM_STARTWINDOW_ICON From c0d9be145fb0a59f0f74813bc604239f1330f6d6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jul 2014 10:46:00 -0600 Subject: [PATCH 272/390] NxWM::CMediaPlayer: Need to remember last text box selection or else each new Value Change event from the volume slider is confused with a new file selection --- nxwm/include/cmediaplayer.hxx | 1 + nxwm/src/cmediaplayer.cxx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 1b9b98a66..ea1133f98 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -152,6 +152,7 @@ namespace NxWM enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ NXWidgets::CNxString m_filePath; /**< The full path to the selected file */ + unsigned int m_fileIndex; /**< Last selected text box selection */ bool m_fileReady; /**< True: Ready to play */ #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME uint8_t m_level; /**< Current volume level, range 0-100 */ diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index b43139f79..cd76e5a9c 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -133,6 +133,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_state = MPLAYER_STOPPED; m_prevState = MPLAYER_STOPPED; m_pending = PENDING_NONE; + m_fileIndex = -1; #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_level = 0; #endif @@ -1401,6 +1402,7 @@ void CMediaPlayer::checkFileSelection(void) // No file is selected m_fileReady = false; + m_fileIndex = -1; // Nothing is selected.. If we are not stopped, then stop now @@ -1417,8 +1419,16 @@ void CMediaPlayer::checkFileSelection(void) setMediaPlayerState(MPLAYER_STOPPED); } } - else + + // Ignore the file selection if it is the same file that was selected + // last time. + + else if (newFileIndex != m_fileIndex) { + // Remember the file selection + + m_fileIndex = newFileIndex; + // A media file is selected. Were we in a STOPPED state before? // Make sure that we are not already playing. Should be okay if // are in a STOPPED or STAGED state. We are not really playing From 4353ca97b291c1fa0ab7af0ca4473fa8ca3a7e9a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jul 2014 10:46:46 -0600 Subject: [PATCH 273/390] Updated ChangeLog --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5b4702884..5d11346f0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -519,3 +519,6 @@ * NxWM::CMediaPlayer: Revise state logic. We need an additional state for the case where a file is selected, but playing has not yet start. Several other state-related fixes (2014-7-25). +* NxWM::CMediaPlayer: Need to remember last text box selection or else each + new Value Change event from the volume slider is confused with a new file + selection (2014-7-27). From af3ba4fb9a2857519b3b64d2967897320b627a01 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jul 2014 12:25:15 -0600 Subject: [PATCH 274/390] NxWM::CMediaPlayer: successive presses on fast forward or rewind button now increase the subsampling, wrapping back to 2X when the maximum of 16x is reached. --- nxwm/include/cmediaplayer.hxx | 11 ++++++-- nxwm/src/cmediaplayer.cxx | 53 ++++++++++++++++++++++++++--------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index ea1133f98..fc71c0b25 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -2,7 +2,9 @@ * NxWidgets/nxwm/include/cmediaplayer.hxx * * Copyright (C) 2013 Ken Pettit. All rights reserved. + * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Ken Pettit + * Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -93,8 +95,8 @@ namespace NxWM * STAGED | STAGED | STOPPED | PLAYING | X | X | X | * PLAYING | X | X | X | PAUSED |FFORWARD2 | REWIND2 | * PAUSED | STAGED | STOPPED | PLAYING | X |FFORWARD1 | REWIND1 | - * FFORWARD1| X | X | PAUSED | X | PAUSED | REWIND1 | - * REWIND1 | X | X | PAUSED | X |FFORWARD1 | PAUSED | + * FFORWARD1| X | X | PAUSED | X |FFORWARD1 | REWIND1 | + * REWIND1 | X | X | PAUSED | X |FFORWARD1 | REWIND1 | * FFORWARD2| X | X | X | PLAYING | PLAYING | REWIND1 | * REWIND2 | X | X | X | PLAYING |FFORWARD1 | PLAYING | * ---------+----------+----------+----------+----------+----------+----------+ @@ -152,11 +154,14 @@ namespace NxWM enum EMediaPlayerState m_prevState; /**< Media player previous state */ enum EPendingRelease m_pending; /**< Pending image release event */ NXWidgets::CNxString m_filePath; /**< The full path to the selected file */ - unsigned int m_fileIndex; /**< Last selected text box selection */ + int m_fileIndex; /**< Last selected text box selection */ bool m_fileReady; /**< True: Ready to play */ #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME uint8_t m_level; /**< Current volume level, range 0-100 */ #endif +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD + uint8_t m_subSample; /**< Current FFFORWARD subsampling */ +#endif /** * Media player geometry. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index cd76e5a9c..ad63e13cd 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -136,6 +136,9 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_fileIndex = -1; #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_level = 0; +#endif +#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD + m_subSample = AUDIO_SUBSAMPLE_NONE; #endif m_fileReady = false; @@ -1504,13 +1507,22 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) if (m_state == MPLAYER_FREWIND) { - // Yes.. then revert to the previous play/pause state - // REVISIT: Or just increase rewind speed? + // Yes.. then just increase rewind rate (by specifying a + // higher level of sub-sampling) - int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); + if (m_subSample >= AUDIO_SUBSAMPLE_MAX) + { + m_subSample = AUDIO_SUBSAMPLE_MIN; + } + else + { + m_subSample++; + } + + int ret = nxplayer_rewind(m_player, m_subSample); if (ret < 0) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + dbg("ERROR: nxplayer_rewind failed: %d\n", ret); } else { @@ -1522,9 +1534,11 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_STAGED) { - // Start rewinding + // Start rewinding at the minimum rate - int ret = nxplayer_rewind(m_player, SUBSAMPLE_4X); + m_subSample = AUDIO_SUBSAMPLE_MIN; + + int ret = nxplayer_rewind(m_player, m_subSample); if (ret < 0) { dbg("ERROR: nxplayer_rewind failed: %d\n", ret); @@ -1546,17 +1560,22 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) if (m_state == MPLAYER_FFORWARD) { - // Yes.. then revert to the previous play/pause state - // REVISIT: Or just increase fast forward speed? + // Yes.. then just increase fast forward rate (by specifying a + // level level of sub-sampling) - int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); - if (ret < 0) + if (m_subSample >= AUDIO_SUBSAMPLE_MAX) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + m_subSample = AUDIO_SUBSAMPLE_MIN; } else { - setMediaPlayerState(m_prevState); + m_subSample++; + } + + int ret = nxplayer_fforward(m_player, m_subSample); + if (ret < 0) + { + dbg("ERROR: nxplayer_fforward failed: %d\n", ret); } } @@ -1564,9 +1583,11 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) else if (m_state != MPLAYER_STOPPED && m_state != MPLAYER_STAGED) { - // Start fast forwarding + // Start fast forwarding at the minimum rate - int ret = nxplayer_fforward(m_player, SUBSAMPLE_4X); + m_subSample = AUDIO_SUBSAMPLE_MIN; + + int ret = nxplayer_fforward(m_player, m_subSample); if (ret < 0) { dbg("ERROR: nxplayer_fforward failed: %d\n", ret); @@ -1663,6 +1684,8 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // In these states, stop the fast motion action and return to the // previous state + m_subSample = AUDIO_SUBSAMPLE_NONE; + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { @@ -1714,6 +1737,8 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // Otherwise, we must be fast forwarding or rewinding. In these // cases, stop the action and return to the previous state + m_subSample = AUDIO_SUBSAMPLE_NONE; + int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { From 606d431206de68d779103ad9976671d3d76c3724 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jul 2014 19:31:52 -0600 Subject: [PATCH 275/390] CNxWM::CMediaPlayer: Correct handling of increments to sub-sampling rate --- nxwm/include/cmediaplayer.hxx | 2 +- nxwm/src/cmediaplayer.cxx | 43 ++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index fc71c0b25..35a1630f0 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -160,7 +160,7 @@ namespace NxWM uint8_t m_level; /**< Current volume level, range 0-100 */ #endif #ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD - uint8_t m_subSample; /**< Current FFFORWARD subsampling */ + uint8_t m_subSample; /**< Current FFFORWARD subsampling index */ #endif /** diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index ad63e13cd..1ffde57a0 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -76,6 +76,8 @@ # endif #endif +#define AUDIO_NSUBSAMPLES 4 + /******************************************************************************************** * Private Types ********************************************************************************************/ @@ -84,6 +86,11 @@ * Private Data ********************************************************************************************/ +static const uint8_t g_motionSteps[AUDIO_NSUBSAMPLES] = +{ + AUDIO_SUBSAMPLE_2X, AUDIO_SUBSAMPLE_4X, AUDIO_SUBSAMPLE_8X, AUDIO_SUBSAMPLE_16X +}; + /******************************************************************************************** * Private Functions ********************************************************************************************/ @@ -138,7 +145,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_level = 0; #endif #ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD - m_subSample = AUDIO_SUBSAMPLE_NONE; + m_subSample = 0; #endif m_fileReady = false; @@ -1510,16 +1517,13 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Yes.. then just increase rewind rate (by specifying a // higher level of sub-sampling) - if (m_subSample >= AUDIO_SUBSAMPLE_MAX) + m_subSample++; + if (m_subSample >= AUDIO_NSUBSAMPLES) { - m_subSample = AUDIO_SUBSAMPLE_MIN; - } - else - { - m_subSample++; + m_subSample = 0; } - int ret = nxplayer_rewind(m_player, m_subSample); + int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { dbg("ERROR: nxplayer_rewind failed: %d\n", ret); @@ -1536,9 +1540,9 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { // Start rewinding at the minimum rate - m_subSample = AUDIO_SUBSAMPLE_MIN; + m_subSample = 0; - int ret = nxplayer_rewind(m_player, m_subSample); + int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { dbg("ERROR: nxplayer_rewind failed: %d\n", ret); @@ -1563,16 +1567,13 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) // Yes.. then just increase fast forward rate (by specifying a // level level of sub-sampling) - if (m_subSample >= AUDIO_SUBSAMPLE_MAX) + m_subSample++; + if (m_subSample >= AUDIO_NSUBSAMPLES) { - m_subSample = AUDIO_SUBSAMPLE_MIN; - } - else - { - m_subSample++; + m_subSample = 0; } - int ret = nxplayer_fforward(m_player, m_subSample); + int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { dbg("ERROR: nxplayer_fforward failed: %d\n", ret); @@ -1585,9 +1586,9 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { // Start fast forwarding at the minimum rate - m_subSample = AUDIO_SUBSAMPLE_MIN; + m_subSample = 0; - int ret = nxplayer_fforward(m_player, m_subSample); + int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { dbg("ERROR: nxplayer_fforward failed: %d\n", ret); @@ -1684,7 +1685,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // In these states, stop the fast motion action and return to the // previous state - m_subSample = AUDIO_SUBSAMPLE_NONE; + m_subSample = 0; int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) @@ -1737,7 +1738,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) // Otherwise, we must be fast forwarding or rewinding. In these // cases, stop the action and return to the previous state - m_subSample = AUDIO_SUBSAMPLE_NONE; + m_subSample = 0; int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) From 42ef5ab70d77180989c0d7caeafab82ef414ca10 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 27 Jul 2014 19:34:52 -0600 Subject: [PATCH 276/390] Update ChangeLogs --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5d11346f0..e17307515 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -522,3 +522,5 @@ * NxWM::CMediaPlayer: Need to remember last text box selection or else each new Value Change event from the volume slider is confused with a new file selection (2014-7-27). +* NxWM::CMediaPlayer: Correct handling of increments to sub-sampling rate + (2014-7-27). From 94cec8caff2f7a8f90ca708a76c7df2640e3efe5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Jul 2014 12:47:01 -0600 Subject: [PATCH 277/390] NXWidgets::CNxWidget: Remove an unused bit field --- libnxwidgets/include/cnxwidget.hxx | 25 ++++++++++++------------- libnxwidgets/src/clabel.cxx | 25 ++++++++++++++++++------- libnxwidgets/src/cnxwidget.cxx | 25 +++++++++++++------------ 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/libnxwidgets/include/cnxwidget.hxx b/libnxwidgets/include/cnxwidget.hxx index d6a2654e1..854e869a3 100644 --- a/libnxwidgets/include/cnxwidget.hxx +++ b/libnxwidgets/include/cnxwidget.hxx @@ -141,19 +141,18 @@ namespace NXWidgets typedef struct { - uint8_t clicked : 1; /**< True if the widget is currently clicked. */ - uint8_t hasFocus : 1; /**< True if the widget has focus. */ - uint8_t dragging : 1; /**< True if the widget is being dragged. */ - uint8_t deleted : 1; /**< True if the widget has been deleted. */ - uint8_t borderless : 1; /**< True if the widget is borderless. */ - uint8_t draggable : 1; /**< True if the widget can be dragged. */ - uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */ - uint8_t enabled : 1; /**< True if the widget is enabled. */ - uint8_t permeable : 1; /**< True if the widget's children can exceed its dimensions. */ - uint8_t erased : 1; /**< True if the widget is currently erased from the frame buffer. */ - uint8_t visibleRegionCacheInvalid : 1; /**< True if the region cache is invalid. */ - uint8_t hidden : 1; /**< True if the widget is hidden. */ - uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */ + uint8_t clicked : 1; /**< True if the widget is currently clicked. */ + uint8_t hasFocus : 1; /**< True if the widget has focus. */ + uint8_t dragging : 1; /**< True if the widget is being dragged. */ + uint8_t deleted : 1; /**< True if the widget has been deleted. */ + uint8_t borderless : 1; /**< True if the widget is borderless. */ + uint8_t draggable : 1; /**< True if the widget can be dragged. */ + uint8_t drawingEnabled : 1; /**< True if the widget can be drawn. */ + uint8_t enabled : 1; /**< True if the widget is enabled. */ + uint8_t permeable : 1; /**< True if the widget's children can exceed its dimensions. */ + uint8_t erased : 1; /**< True if the widget is currently erased from the frame buffer. */ + uint8_t hidden : 1; /**< True if the widget is hidden. */ + uint8_t doubleClickable : 1; /**< True if the widget can be double-clicked. */ } Flags; /** diff --git a/libnxwidgets/src/clabel.cxx b/libnxwidgets/src/clabel.cxx index f9132c3c2..560d7033e 100644 --- a/libnxwidgets/src/clabel.cxx +++ b/libnxwidgets/src/clabel.cxx @@ -322,15 +322,26 @@ void CLabel::drawContents(CGraphicsPort *port) int width = font->getStringWidth(m_text); // Draw the background (excluding the border and the text area) + // Left port->drawFilledRect(rect.getX(), rect.getY(), - pos.x - rect.getX(), rect.getHeight(), backColor); // Left + pos.x - rect.getX(), rect.getHeight(), backColor); + + // Right + port->drawFilledRect(pos.x + width, rect.getY(), - rect.getX2() - (pos.x + width) + 1, rect.getHeight(), backColor); // Right - port->drawFilledRect(pos.x, rect.getY(), - width, pos.y - rect.getY(), backColor); // Top - port->drawFilledRect(pos.x, pos.y + height, - width, rect.getY2() - (pos.y + height) + 1, backColor); // Bottom + rect.getX2() - (pos.x + width) + 1, + rect.getHeight(), backColor); + + // Top + + port->drawFilledRect(pos.x, rect.getY(), width, pos.y - rect.getY(), + backColor); + + // Bottom + + port->drawFilledRect(pos.x, pos.y + height, width, + rect.getY2() - (pos.y + height) + 1, backColor); #endif // Add the text using the selected color and background color @@ -350,7 +361,7 @@ void CLabel::drawContents(CGraphicsPort *port) void CLabel::drawBorder(CGraphicsPort *port) { // Check if the widget indicates it should have an outline: That - // the outline is enabled and the this is not just a text-only + // (1) the outline is enabled and (2) that this is not just a text-only // redraw if (!isBorderless() && !isTextChange()) diff --git a/libnxwidgets/src/cnxwidget.cxx b/libnxwidgets/src/cnxwidget.cxx index 5060e42c2..45238d42c 100644 --- a/libnxwidgets/src/cnxwidget.cxx +++ b/libnxwidgets/src/cnxwidget.cxx @@ -165,15 +165,14 @@ CNxWidget::CNxWidget(CWidgetControl *pWidgetControl, // Set initial flag values - m_flags.clicked = false; - m_flags.dragging = false; - m_flags.hasFocus = false; - m_flags.deleted = false; - m_flags.drawingEnabled = false; - m_flags.enabled = true; - m_flags.erased = true; - m_flags.visibleRegionCacheInvalid = true; - m_flags.hidden = false; + m_flags.clicked = false; + m_flags.dragging = false; + m_flags.hasFocus = false; + m_flags.deleted = false; + m_flags.drawingEnabled = false; + m_flags.enabled = true; + m_flags.erased = true; + m_flags.hidden = false; // Set hierarchy pointers @@ -329,14 +328,16 @@ bool CNxWidget::isDrawingEnabled(void) const { if (m_parent->isDrawingEnabled()) { - // Drawing is enabled if the widget is drawable and not deleted + // Drawing is enabled if the widget is drawable, not deleted, and not hidden - return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden)); + return (m_flags.drawingEnabled && !m_flags.deleted && !m_flags.hidden); } } else { - return (m_flags.drawingEnabled && (!m_flags.deleted) && (!m_flags.hidden)); + // Drawing is enabled if the widget is drawable, not deleted, and not hidden + + return (m_flags.drawingEnabled && !m_flags.deleted && !m_flags.hidden); } return false; From 598dfba79f0db85d8c9db71250eb10700f286cb7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Jul 2014 12:48:05 -0600 Subject: [PATCH 278/390] NxWM::CMediaPlayer: Add a CLabel that show the current fast forward/rewind speed --- nxwm/include/cmediaplayer.hxx | 15 ++++- nxwm/src/cmediaplayer.cxx | 119 ++++++++++++++++++++++++++++++++-- 2 files changed, 126 insertions(+), 8 deletions(-) diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index 35a1630f0..f36036a2a 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -51,6 +51,7 @@ #include "cnxfont.hxx" #include "cimage.hxx" #include "cstickyimage.hxx" +#include "clabel.hxx" #include "clistbox.hxx" #include "clistboxdataitem.hxx" #include "cglyphsliderhorizontal.hxx" @@ -159,7 +160,7 @@ namespace NxWM #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME uint8_t m_level; /**< Current volume level, range 0-100 */ #endif -#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) uint8_t m_subSample; /**< Current FFFORWARD subsampling index */ #endif @@ -187,6 +188,9 @@ namespace NxWM NXWidgets::CStickyImage *m_rewind; /**< Rewind control */ NXWidgets::CStickyImage *m_fforward; /**< Fast forward control */ NXWidgets::CGlyphSliderHorizontal *m_volume; /**< Volume control */ +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + NXWidgets::CLabel *m_speed; /**< FForward/rewind speed */ +#endif /** * Bitmaps @@ -300,6 +304,15 @@ namespace NxWM inline void checkFileSelection(void); +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + /** + * Update fast forward/rewind speed indicator. Called on each state + * change and after each change in the speed of motion. + */ + + void updateMotionIndicator(void); +#endif + /** * Handle a widget action event. For this application, that means image * pre-release events. diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 1ffde57a0..3091d6758 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -125,6 +125,9 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) m_rewind = (NXWidgets::CStickyImage *)0; m_fforward = (NXWidgets::CStickyImage *)0; m_volume = (NXWidgets::CGlyphSliderHorizontal *)0; +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + m_speed = (NXWidgets::CLabel *)0; +#endif // Nullify bitmaps that will be instantiated when the window is started @@ -144,7 +147,7 @@ CMediaPlayer::CMediaPlayer(CTaskbar *taskbar, CApplicationWindow *window) #ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_level = 0; #endif -#ifndef CONFIG_AUDIO_EXCLUDE_FFORWARD +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) m_subSample = 0; #endif m_fileReady = false; @@ -208,6 +211,13 @@ CMediaPlayer::~CMediaPlayer(void) delete m_volume; } +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + if (m_speed) + { + delete m_speed; + } +#endif + // Destroy bitmaps if (m_playBitmap) @@ -332,6 +342,9 @@ void CMediaPlayer::stop(void) m_rewind->disableDrawing(); m_fforward->disableDrawing(); m_volume->disableDrawing(); +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + m_speed->disableDrawing(); +#endif } /** @@ -1011,6 +1024,32 @@ bool CMediaPlayer::createPlayer(void) m_volume->addWidgetEventHandler(this); #endif +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + // Create the speed of motion indicator + // The bounding box is determined by the font size + + nxgl_coord_t motionW = (nxgl_coord_t)(3 * m_font->getMaxWidth()); + nxgl_coord_t motionH = (nxgl_coord_t)(m_font->getHeight()); + + // Horizontal position: aligned with the right size of volume slider + // Vertical postion: same as the motion controls + + m_speed = new NXWidgets::CLabel(control, + volumeControlX + volumeControlW - motionW, + controlTop + (controlH - motionH) / 2, + motionW, motionH, ""); + + // Configure the speed indicator + + m_speed->disableDrawing(); + m_speed->setBorderless(true); + m_speed->setRaisesEvents(false); + m_speed->setFont(m_font); + m_speed->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_RIGHT); + m_speed->setTextAlignmentVert(NXWidgets::CLabel::TEXT_ALIGNMENT_VERT_CENTER); + m_speed->hide(); +#endif + // Make sure that all widgets are setup for the STOPPED state. Among other this, // this will enable drawing in the play widget (only) @@ -1098,6 +1137,11 @@ void CMediaPlayer::redrawWidgets(void) m_fforward->enableDrawing(); m_fforward->redraw(); +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + m_speed->enableDrawing(); + m_speed->redraw(); +#endif + m_volume->enableDrawing(); m_volume->redraw(); } @@ -1147,9 +1191,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_rewind->disable(); m_rewind->setStuckSelection(false); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME // Volume slider is available -#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_volume->enable(); #endif break; @@ -1182,9 +1226,9 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) m_rewind->disable(); m_rewind->setStuckSelection(false); +#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME // Volume slider is available -#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME m_volume->enable(); #endif break; @@ -1353,6 +1397,12 @@ void CMediaPlayer::setMediaPlayerState(enum EMediaPlayerState state) break; } +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) + // Update the motion indicator for the new state + + updateMotionIndicator(); +#endif + // Re-enable drawing and redraw all widgets for the new state redrawWidgets(); @@ -1470,6 +1520,57 @@ void CMediaPlayer::checkFileSelection(void) } } +/** + * Update fast forward/rewind speed indicator. Called on each state change + * and after each change in the speed of motion. + */ + +#if !defined(CONFIG_AUDIO_EXCLUDE_FFORWARD) || !defined(CONFIG_AUDIO_EXCLUDE_REWIND) +void CMediaPlayer::updateMotionIndicator(void) +{ + m_speed->disableDrawing(); + if (m_state == MPLAYER_FFORWARD || m_state == MPLAYER_FREWIND) + { + // Set the new speed string + + char buffer[8]; + (void)std::snprintf(buffer, 8, "%dX", g_motionSteps[m_subSample]); + + NXWidgets::CNxString speed(buffer); + m_speed->setText(speed); + + // Show (un-hide) the speed indicator + + m_speed->show(); + + // Redraw the speed indicator + + m_speed->enableDrawing(); + m_speed->redraw(); + } + + // No, then the speed indicator should be hidden. But don't redraw if + // it is already hidden + + else if (!m_speed->isHidden()) + { + // Clear the new speed string + + NXWidgets::CNxString nospeed(""); + m_speed->setText(nospeed); + + // Redraw the empty speed indicator + + m_speed->enableDrawing(); + m_speed->redraw(); + + // Hide the speed indicator + + m_speed->hide(); + } +} +#endif + /** * Handle a widget action event. For this application, that means image * pre-release events. @@ -1528,10 +1629,10 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { dbg("ERROR: nxplayer_rewind failed: %d\n", ret); } - else - { - setMediaPlayerState(m_prevState); - } + + // Update the speed indicator + + updateMotionIndicator(); } // We should not be in a STOPPED state here, but let's check anyway @@ -1578,6 +1679,10 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) { dbg("ERROR: nxplayer_fforward failed: %d\n", ret); } + + // Update the speed indicator + + updateMotionIndicator(); } // We should not be in a STOPPED state here, but let's check anyway From ae70882ce124a565885c32623a5bda7e9642b489 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 28 Jul 2014 12:49:24 -0600 Subject: [PATCH 279/390] Update ChangeLogs --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index e17307515..6893183f4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -524,3 +524,6 @@ selection (2014-7-27). * NxWM::CMediaPlayer: Correct handling of increments to sub-sampling rate (2014-7-27). +* XWidgets::CNxWidget: Remove an unused bit field (2014-7-28). +* NxWM::CMediaPlayer: Add a CLabel that show the current fast forward/rewind + speed (2014-7-28). From e40617d52a8bf7cf0c35845af49ba1361c831296 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Jul 2014 20:02:34 -0600 Subject: [PATCH 280/390] Update TODO listi and README --- TODO.txt | 103 +++++++++++++++++++++---------------------------------- 1 file changed, 39 insertions(+), 64 deletions(-) diff --git a/TODO.txt b/TODO.txt index 1c4632d27..105be3737 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,12 +1,26 @@ NxWidgets --------- + Title: LARGE BITMAP SUPPORT + Description: In CImage, m_origin.x and .y need to be allowed to go + negative so that you can pan through a large image. + Status: Open + Priority: Low + + Title: GLYPH BACKGROUNDS + Description: For most glyphs, background could is set to the currently + selected background color. An option should be to set the + background of glyphs (only) to transparent. + Status: Open + Priority: Low for now + NxWM ---- (4) General Issues - (3) NxConsole Issues - (1) CHexCalculator Issues + (0) NxConsole Issues + (0) CHexCalculator Issues + (3) CMediaPlayer Issues (1) Platform specific Issues See also the NuttX TODO list graphics/ section for related issues. @@ -16,7 +30,7 @@ o General NxWM Issues Title: DISPLAY INTIALIZATION Description: During the initialization of the display, the basic frame of the - start window is draw momentarily. The is just the empty window + start window is drawn momentarily. The is just the empty window frame. This is a consequence of how NX creates windows: The are enabled all of the time so the windows are visible when they are being created. The solution would be to add some disable @@ -49,7 +63,7 @@ o General NxWM Issues Title: THREAD SAFETY Description: I am not sure how thread-safe the NxWidgets are. There is - is very little mutli-thread in the widgets now. The "NX listener" + is very little multi-thread in the widgets now. The "NX listener" thread interacts to update mouse (and keyboard) data but all of the heavy work is done on the "start window" thread. I think everything is okay now, but it may be necessary in the future @@ -74,74 +88,34 @@ o General NxWM Issues o NxConsole Issues ---------------- - Title: MULTIPLE COPIES OF AN NxCONSOLE - Description: From the start window, you an create multiple copies of the - NxConsole. However, there is a problem in the current - implementation: Each NxConsole receives its input from the - serial console so, for example, it you enter text one character - will go to one NxConsole instance and the next character goes - to a different instance. That is correct behavior within the - current design, but not very usable. We need a mechanism to - assure that the top window is the one that receives all - eyboard input. NX already provides this capability with its - nx_kbdin interface(), but that is not currently used. At present, - NxConsoles get their input from /dev/console which is the serial - port. The necessary change is to create an NX input device for - /dev/console that will get its input from NX. - Status: Closed with was fixed with the check-in of 5/20/2012 (about - SVN version 4755). The fixed version is available in SVN but - won't be in a released version until NxWidgets-1.2 is released. - Priority: Medium high, basically prohibits the use of multiple NSH windows. - - Title: CLOSING AN NxCONSOLE - Description: If you open multiple NxConsole applications, they all receive - serial input (as noted in the previous bug). However, if - you close one of the NxConsoles, then the others no longer - received input (or no long generate output -- that cannot be - distinguished). - Status: Closed with was fixed with the check-in of 5/20/2012 (about - SVN version 4755). The fixed version is available in SVN but - won't be in a released version until NxWidgets-1.2 is released. - Priority: Medium high, basically prohibits the use of multiple NSH windows. - - Title: DOUBLE DISPLAY UPDATES - Description: When the NxConsole window is first opened, there are usually - double updates, i.e., the display forms twice. - Status: Open - Priorioty: Low, this would be necessary to fix to productize the windows. - o CHexCalculator Issues --------------------- - Title: NEW DATA ENTRY IS APPENDED TO PREVIOUS RESULT - Description: For example 1+2= and 3 is shown. But if you enter 4, then - 34 is shown. You have to manually clear the calculator ("C") - before entering the next number. +o CMediaPlayer Issues + ------------------- + + Title: SCROLLING FILE LIST + Description: Current implementation uses a CListBox which can only show a + fixed number of files. Perhaps CMediaPlayer should use + something like CScrollingTextBox. Status: Open - Priority: Low, this is only a demo. This would, of course, have to be - fixed if you wanted a production quality calculator (but then - you would probably also want to add quite a few more features - as well). + Priority: Low for now + + Title: PLAY PROGRESS FEEDBACK + Decription: Need a way to know the position in the file, how long the + file is (in minutes), and an indication when playing + complete. + Status: Open + Priorit: Medium. Certain affect usability. + + Title: NO BALANCE/TONE/EQUALIZER CONTORLS + Description: The title says it all + Status: Open + Priority: Medium. That is big functional limitation. o Platform specific Issues ------------------------ - Title: MISSING TOUCH RELEASE - Description: Using the STM3240G-EVAL board with the STMPE11 touchscreen, you - will find that there are occasional missing indications of when - you release a icon. This is believed to be a data overrun in the - STPMPE11 data path. The STMPE11 generates data a very high - rate and it is believe that it sometimes misses the interrupt - that indicates that the touch is released. The symptom in NxWM - is that you touch an icon, it is highlighted but when you release - the touch nothing happens. The icon stays highlighted. Touching - the icon again usually works around this problem. - Status: Closed with was fixed with the check-in of 5/21/2012 (about - SVN version 4758). The was change made to NuttX, not NxWidgets. - The fixed version is available in SVN but won't be in a released - version until NuttX-6.198 is released. - Priorioty: Low, but really annoying. - Title: BUGS WHEN CANNOT READ FROM LCD Description: There is a kludge in there to handle the case where we cannot read the background data because the LCD does not support read @@ -156,3 +130,4 @@ o Platform specific Issues places as well and begs for a better solution. Status: Open Priority: Medium-Low + From a4656341df0f7f5d53d03f1ac032b8341f91b236 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Jul 2014 11:03:42 -0600 Subject: [PATCH 281/390] Update TODO list --- TODO.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/TODO.txt b/TODO.txt index 105be3737..374c5b388 100644 --- a/TODO.txt +++ b/TODO.txt @@ -14,10 +14,19 @@ NxWidgets Status: Open Priority: Low for now + Title: MESSAGE BOX + Description: Need the moral equivalent of a Windows message box: A + simple, model window that provides a message a button to + dismiss the message. This would be helpful, for example, + to handle behaviors on errors instead of just failing + quietly. + Status: Open + Priority: Low. Nothing depends on this now. + NxWM ---- - (4) General Issues + (4) General NxWMIssues (0) NxConsole Issues (0) CHexCalculator Issues (3) CMediaPlayer Issues @@ -30,7 +39,7 @@ o General NxWM Issues Title: DISPLAY INTIALIZATION Description: During the initialization of the display, the basic frame of the - start window is drawn momentarily. The is just the empty window + start window is drawn momentarily. This is just the empty window frame. This is a consequence of how NX creates windows: The are enabled all of the time so the windows are visible when they are being created. The solution would be to add some disable @@ -61,17 +70,6 @@ o General NxWM Issues Status: Open Priority: Medium low - Title: THREAD SAFETY - Description: I am not sure how thread-safe the NxWidgets are. There is - is very little multi-thread in the widgets now. The "NX listener" - thread interacts to update mouse (and keyboard) data but all - of the heavy work is done on the "start window" thread. I think - everything is okay now, but it may be necessary in the future - to introduce some semaphore protection in theCWidgetControl methods - to make them thread safe. - Status: Open - Priority: Low - Title: COMBINE CTouchscreen AND CKeyboard THREADS Description: Right now, two separate threads handle touchscreen and keyboard/ console input. Each just waits on read() and when toushcscreen @@ -117,7 +115,7 @@ o Platform specific Issues ------------------------ Title: BUGS WHEN CANNOT READ FROM LCD - Description: There is a kludge in there to handle the case where we cannot + Description: There is a kludge in the code to handle the case where we cannot read the background data because the LCD does not support read operations. You cannot read from the STM3240G-EVAL LCD right now (it might be possible, but I have not figured out how yet). From aa42efa31bbd43297be222afd5d5fe5006f55a1c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Jul 2014 17:01:51 -0600 Subject: [PATCH 282/390] dd support for a USB keyboard as the NxConsole and text widget input. Not fully functional as of this initial check-in. Basic functionality is there, but there are conditions were the keyboard gets lost. --- Kconfig | 23 +++- nxwm/include/ckeyboard.hxx | 50 ++++++- nxwm/src/ckeyboard.cxx | 259 +++++++++++++++++++++++++++++-------- nxwm/src/cnxconsole.cxx | 7 +- 4 files changed, 274 insertions(+), 65 deletions(-) diff --git a/Kconfig b/Kconfig index 52aa90da1..3ee3bd123 100644 --- a/Kconfig +++ b/Kconfig @@ -855,13 +855,24 @@ config NXWM_KEYBOARD_DEVPATH string "Keyboard Device Path" default "/dev/console" ---help--- - The full path to the touchscreen device. Default: "/dev/console" + The full path to the keyboard device. Default: "/dev/console" + +config NXWM_KEYBOARD_USBHOST + bool "USB Keyboard Device" + default n + ---help--- + This setting indicates that NXWM_KEYBOARD_DEVPATH is a USB keyboard. + A USB Keyboard is a removable device. When it is inserted, then + device at NXWM_KEYBOARD_DEVPATH will appear; when it removed, + keyboard reads will fail and the device at NXWM_KEYBOARD_DEVPATH + will disappear. Selecting this option builds addtional logic into + the keyboard listener thread in order to handle this case. config NXWM_KEYBOARD_SIGNO int "Keyboard Task Signal Number" default 6 ---help--- - The realtime signal used to wake up the touchscreen listener thread. + The realtime signal used to wake up the keyboard listener thread. Default: 6 config NXWM_KEYBOARD_BUFSIZE @@ -874,10 +885,10 @@ config NXWM_KEYBOARD_LISTENERPRIO int "Keyboard Listener Task Priority" default 120 ---help--- - Priority of the touchscreen listener thread.This listener should - have a higher priority than most display-related tsks otherwise it - may miss touchscreen events (not really very likely because keyboard - input is relatively slow). Default: 120 + Priority of the keyboard listener thread. This listener should + have a higher priority than most display-related tasks otherwise it + may miss keyboard input (not really very likely because keyboard + input is relatively slow). Default: 120 config NXWM_KEYBOARD_LISTENERSTACK int "Keyboard Listener Task Stack Size" diff --git a/nxwm/include/ckeyboard.hxx b/nxwm/include/ckeyboard.hxx index 7036472fb..e224fd11c 100644 --- a/nxwm/include/ckeyboard.hxx +++ b/nxwm/include/ckeyboard.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/nxwm/include/keyboard.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CKEYBOARD_HXX -#define __INCLUDE_CKEYBOARD_HXX +#ifndef __NXWM_INCLUDE_CKEYBOARD_HXX +#define __NXWM_INCLUDE_CKEYBOARD_HXX /**************************************************************************** * Included Files @@ -93,8 +93,46 @@ namespace NxWM sem_t m_waitSem; /**< Used to synchronize with the listener thread */ /** - * The keyboard listener thread. This is the entry point of a thread that - * listeners for and dispatches keyboard events to the NX server. + * Open the keyboard device. Not very interesting for the case of + * standard device but much more interesting for a USB keyboard device + * that may disappear when the keyboard is disconnect but later reappear + * when the keyboard is reconnected. In this case, this function will + * not return until the keyboard device was successfully opened (or + * until an irrecoverable error occurs. + * + * Opens the keyboard device specified by CONFIG_NXWM_KEYBOARD_DEVPATH. + * + * @return On success, then method returns a valid file descriptor that + * can be used to redirect stdin. A negated errno value is returned + * if an irrecoverable error occurs. + */ + + inline int open(void); + + /** + * This is the heart of the keyboard listener thread. It contains the + * actual logic that listeners for and dispatches keyboard events to the + * NX server. + * + * @return If the session terminates gracefully (i.e., because >m_state + * is no longer equal to LISTENER_RUNNING, then method returns OK. A + * negated errno value is returned if an error occurs while reading from + * the keyboard device. A read error, depending upon the type of the + * error, may simply indicate that a USB keyboard was removed and we + * should wait for the keyboard to be connected. + */ + + inline int session(void); + + /** + * The keyboard listener thread. This is the entry point of a thread + * that listeners for and dispatches keyboard events to the NX server. + * It simply opens the keyboard device (using CKeyboard::open()) and + * executes the session (via CKeyboard::session()). + * + * If an errors while reading from the keyboard device AND we are + * configured to use a USB keyboard, then this function will wait for + * the USB keyboard to be re-connected. * * @param arg. The CKeyboard 'this' pointer cast to a void*. * @return This function normally does not return but may return NULL on @@ -130,4 +168,4 @@ namespace NxWM }; } -#endif // __INCLUDE_CKEYBOARD_HXX +#endif // __NXWM_INCLUDE_CKEYBOARD_HXX diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index 0f3f11d37..f643fbf6b 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -156,9 +156,166 @@ bool CKeyboard::start(void) return m_state == LISTENER_RUNNING; } - /** - * The keyboard listener thread. This is the entry point of a thread that - * listeners for and dispatches keyboard events to the NX server. +/** + * Open the keyboard device. Not very interesting for the case of + * standard device but much more interesting for a USB keyboard device + * that may disappear when the keyboard is disconnect but later reappear + * when the keyboard is reconnected. In this case, this function will + * not return until the keyboard device was successfully opened (or + * until an irrecoverable error occurs. + * + * Opens the keyboard device specified by CONFIG_NXWM_KEYBOARD_DEVPATH. + * + * @return On success, then method returns a valid file descriptor that + * can be used to redirect stdin. A negated errno value is returned + * if an irrecoverable error occurs. + */ + +int CKeyboard::open(void) +{ + int fd; + + // Loop until we have successfully opened the USB keyboard (or until some + // irrecoverable error occurs). + + do + { + // Try to open the keyboard device + + fd = std::open(CONFIG_NXWM_KEYBOARD_DEVPATH, O_RDONLY); + if (fd < 0) + { + int errcode = errno; + DEBUGASSERT(errcode > 0); + + // EINTR should be ignored because it is not really an error at + // all. We should retry immediately + + if (errcode != EINTR) + { +#ifdef CONFIG_NXWM_KEYBOARD_USBHOST + // ENOENT means that the USB device is not yet connected and, + // hence, has no entry under /dev. If the USB driver still + // exists under /dev (because other threads still have the driver + // open), then we might also get ENODEV. + + if (errcode == ENOENT || errcode == ENODEV) + { + // REVIST: Can we inject a constant string here to let the + // user know that we are waiting for a USB keyboard to be + // connected? + + // Sleep a bit and try again + + gvdbg("WAITING for a USB device\n"); + std::sleep(2); + } + + // Anything else would be really bad. + + else +#endif + { + // Let the top-level logic decide what it wants to do + // about all really bad things + + gdbg("ERROR: Failed to open %s for reading: %d\n", + CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); + return -errcode; + } + } + } + } + while (fd < 0); + + return fd; +} + +/** + * This is the heart of the keyboard listener thread. It contains the + * actual logic that listeners for and dispatches keyboard events to the + * NX server. + * + * @return If the session terminates gracefully (i.e., because >m_state + * is no longer equal to LISTENER_RUNNING), then method returns OK. A + * negated errno value is returned if an error occurs while reading from + * the keyboard device. A read error, depending upon the type of the + * error, may simply indicate that a USB keyboard was removed and we + * should wait for the keyboard to be connected. + */ + +int CKeyboard::session(void) +{ + gvdbg("Session started\n"); + + // Loop, reading and dispatching keyboard data + + while (m_state == LISTENER_RUNNING) + { + // Read one keyboard sample + + gvdbg("Listening for keyboard input\n"); + + uint8_t rxbuffer[CONFIG_NXWM_KEYBOARD_BUFSIZE]; + ssize_t nbytes = read(m_kbdFd, rxbuffer, + CONFIG_NXWM_KEYBOARD_BUFSIZE); + + // Check for errors + + if (nbytes < 0) + { + int errcode = errno; + DEBUGASSERT(errcode > 0); + + // EINTR is not really an error, it simply means that something is + // trying to get our attention. We need to check m_state to see + // if we were asked to terminate + + if (errcode != EINTR) + { + // Let the top-level listener logic decide what to do about + // the read failure. + + gdbg("ERROR: read %s failed: %d\n", + CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); + return -errcode; + } + + fdbg("Awakened with EINTR\n"); + } + + // Give the keyboard input to NX + + else if (nbytes > 0) + { + // Looks like good keyboard input... process it. + // First, get the server handle + + NXHANDLE handle = m_server->getServer(); + + // Then inject the keyboard input into NX + + int ret = nx_kbdin(handle, (uint8_t)nbytes, rxbuffer); + if (ret < 0) + { + gdbg("ERROR: nx_kbdin failed: %d\n", ret); + //break; ignore the error + } + } + } + + return OK; +} + +/** + * The keyboard listener thread. This is the entry point of a thread + * that listeners for and dispatches keyboard events to the NX server. + * It simply opens the keyboard device (using CKeyboard::open()) and + * executes the session (via CKeyboard::session()). + * + * If an errors while reading from the keyboard device AND we are + * configured to use a USB keyboard, then this function will wait for + * the USB keyboard to be re-connected. * * @param arg. The CKeyboard 'this' pointer cast to a void*. * @return This function normally does not return but may return NULL on @@ -171,68 +328,66 @@ FAR void *CKeyboard::listener(FAR void *arg) gvdbg("Listener started\n"); - // Open the keyboard device - - This->m_kbdFd = std::open(CONFIG_NXWM_KEYBOARD_DEVPATH, O_RDONLY); - if (This->m_kbdFd < 0) - { - gdbg("ERROR Failed to open %s for reading: %d\n", - CONFIG_NXWM_KEYBOARD_DEVPATH, errno); - This->m_state = LISTENER_FAILED; - sem_post(&This->m_waitSem); - return (FAR void *)0; - } - - // Indicate that we have successfully initialized +#ifdef CONFIG_NXWM_KEYBOARD_USBHOST + // Indicate that we have successfully started. We might be stuck waiting + // for a USB keyboard to be connected, but we are technically running This->m_state = LISTENER_RUNNING; sem_post(&This->m_waitSem); - // Now loop, reading and dispatching keyboard data + // Loop until we are told to quit while (This->m_state == LISTENER_RUNNING) - { - // Read one keyboard sample - - gvdbg("Listening for keyboard input\n"); - - uint8_t rxbuffer[CONFIG_NXWM_KEYBOARD_BUFSIZE]; - ssize_t nbytes = read(This->m_kbdFd, rxbuffer, CONFIG_NXWM_KEYBOARD_BUFSIZE); - - // Check for errors - - if (nbytes < 0) - { - // The only expect error is to be interrupt by a signal -#ifdef CONFIG_DEBUG - int errval = errno; - - gdbg("ERROR: read %s failed: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errval); - DEBUGASSERT(errval == EINTR); #endif - } + { + // Open/Re-open the keyboard device - // Give the keyboard input to NX - - else if (nbytes > 0) + This->m_kbdFd = This->open(); + if (This->m_kbdFd < 0) { - // Looks like good keyboard input... process it. - // First, get the server handle - - NXHANDLE handle = This->m_server->getServer(); - - // Then inject the keyboard input into NX - - int ret = nx_kbdin(handle, (uint8_t)nbytes, rxbuffer); - if (ret < 0) - { - gdbg("ERROR: nx_kbdin failed\n"); - } + gdbg("ERROR: open failed: %d\n", This->m_kbdFd); + This->m_state = LISTENER_FAILED; + sem_post(&This->m_waitSem); + return (FAR void *)0; } + +#ifndef CONFIG_NXWM_KEYBOARD_USBHOST + // Indicate that we have successfully initialized + + This->m_state = LISTENER_RUNNING; + sem_post(&This->m_waitSem); +#endif + + // Now execute the session. The session will run until either (1) we + // were asked to terminate gracefully (with m_state !=LISTENER_RUNNING), + // of if an error occurred while reading from the keyboard device. If + // we are configured to use a USB keyboard, then this error, depending + // upon what the error is, may indicate that the USB keyboard has been + // removed. In that case, we need to continue looping and, hopefully, + // the USB keyboard will be reconnected. + + int ret = This->session(); +#ifdef CONFIG_NXWM_KEYBOARD_USBHOST + if (ret < 0) + { + fdbg("ERROR: CKeyboard::session() returned %d\n", ret); + } +#else + // No errors from session() are expected + + DEBUGASSERT(ret == OK); + UNUSED(ret); +#endif + + // Close the keyboard device + + (void)std::close(This->m_kbdFd); + This->m_kbdFd = -1; } // We should get here only if we were asked to terminate via - // m_state = LISTENER_STOPREQUESTED + // m_state = LISTENER_STOPREQUESTED (or perhaps if some irrecoverable + // error has occurred). gvdbg("Listener exiting\n"); This->m_state = LISTENER_TERMINATED; diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index e78e91631..d9bab9cfd 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/cnxconsole.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012. 2104 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -60,6 +60,11 @@ /******************************************************************************************** * Pre-Processor Definitions ********************************************************************************************/ +/* Configuration ****************************************************************************/ + +#ifdef CONFIG_NSH_USBKBD +# warning You probably do not really want CONFIG_NSH_USBKBD, try CONFIG_NXWM_KEYBOARD_USBHOST +#endif /******************************************************************************************** * Private Types From 210ab96c92cca02ea08bbcb1e7aa62576b076969 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Jul 2014 17:03:31 -0600 Subject: [PATCH 283/390] Update ChangeLog --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6893183f4..c68892b80 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -527,3 +527,7 @@ * XWidgets::CNxWidget: Remove an unused bit field (2014-7-28). * NxWM::CMediaPlayer: Add a CLabel that show the current fast forward/rewind speed (2014-7-28). +* NxWM::CKeyboard: Add support for a USB keyboard as the NxConsole and text + widget input. Not fully functional as of this initial check-in. Basic + functionality is there, but there are conditions were the keyboard gets + lost (2014-7-30). From 6a6881f8e45f94f440ec2d11b24ec1f4770277a4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 6 Aug 2014 09:19:26 -0600 Subject: [PATCH 284/390] NSH Networking: Software assigned MAC address is now configurable. From Lazlo --- nxwm/src/cnxconsole.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index d9bab9cfd..b8577b635 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -664,6 +664,7 @@ bool NxWM::nshlibInitialize(void) return false; } #endif + return true; } From 6c6fe0ffc9d3b8b4630c20645683a9609ba08622 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 14 Aug 2014 15:46:00 -0600 Subject: [PATCH 285/390] Update ChangeLogs and ReleaseNotes for 7.4 release (not complete) --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c68892b80..656d324fe 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -425,7 +425,7 @@ the touchscreen must be initialized in kernel space before NxWM is started (2013-12-30). -1.12 2014-xx-xx Gregory Nutt +1.12 2014-08-15 Gregory Nutt * libnxwidgets/include/nxconfig.hxx and libnxwidgets/src/cscaledbitmap.cxx: Fix typo RBG -> RGB. This makes NxWidgets incompatible with versions of @@ -531,3 +531,5 @@ widget input. Not fully functional as of this initial check-in. Basic functionality is there, but there are conditions were the keyboard gets lost (2014-7-30). + +1.13 2014-xx-xx Gregory Nutt From 45f09cc0bc82ad96097d8e4b35a6b2fd386135fc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 14 Aug 2014 16:01:27 -0600 Subject: [PATCH 286/390] Update ChangeLogs and ReleaseNotes for 7.4 release (not complete) --- ChangeLog.txt | 4 +-- ReleaseNotes.txt | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 656d324fe..2d89d3f91 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -446,7 +446,7 @@ (2014-7-14). * Kconfig, nxwm/include/nxwmconfig.hxx, nxwm/src/capplicationwindow.cxx: Toolbar font ID can now be separately configured (2014-7-14). -* nxwm/src/cmediaplayer.cxx: Will not dynamically position player controls +* nxwm/src/cmediaplayer.cxx: Will now dynamically position player controls based on the display and image sizes (2014-7-14). * nxwm/src/glyph_mediagrip30x30.cxx and glyph_mplayer_controls43x41.cxx: Add larger images for the media player (2014-7-14). @@ -465,7 +465,7 @@ a multi-line, scrollable region (2014-7-16). * NxMW::CMediaPlayer: Correctly catch the volume level change event (2014-7-16). -* NxMW::CMediaPlayer: Concert CLabel to a CListBox to support selection of +* NxMW::CMediaPlayer: Convert CLabel to a CListBox to support selection of one of many media files to play. This should be a CScrollingTextBox to support an indefinitely large number of media files (2014-7-16). * NxWidgets::CGraphicsPort: Fix drawBitmapGreyScale method. Actually drew diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 69d240ad7..7999c18c4 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -378,3 +378,74 @@ Additional new features and extended functionality in Version 1.11: graphics application lies in user space and the graphics server lies in protected kernel space. This change is mostly a matter of repartitioning functionality and should not cause in any functional differences. + +NxWidgets-1.12 +============== + +The 13th release of the NxWidgets package was made on August 14, 2014. This +release depends on NuttX-7.3 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.12: + +* NxWM: Rename all ICON glyph files to include the size of the ICON as part + of the file name. This allows us to support different sizes for the same + ICON +* NxWM: Add larger versions (approx 50x50) versions of all ICONs. +* NxWM::CToolBar: Toolbar font ID can now be separately configured. +* NxWM::CMediaPlayer: Will now dynamically position player controls + based on the display and image sizes. +* NxWM::CMediaPlayer: Add options to manage spacing of media player + buttons and borders vs. borderless buttons. +* NxWidget::CImage: Now includes methods to align images in the widget + region. +* NxWM::CMediaPlayer now uses the new CImage methods to align media controls + in buttons. +* NxWidgets::CStickyImage: A version of CImage that sticks in the selected + state when clicked. +* NxMW::CMediaPlayer: Now supports a pause button. +* NxMW::CMediaPlayer: Convert CLabel to a CListBox to support selection of + one of many media files to play. This should be a CScrollingTextBox to + support an indefinitely large number of media files. +* NxWidgets::CGlyphSliderHorizontal: No longer uses a hard-coded slider + height; the slider height is now provided as a parameter, replacing the + widget height which is now calculated from the glip image height. +* NxWM::CMediaPlayer: Now calculates the volume slider height from the grip + image height. +* NxWidgets:CTabPanel: Make CTabPanel raise action event when tab is + changed. Also add a function for getting the currently selected tab + index. From Petteri Aimonen. +* NxWidgets/Kconfig: Add configuration options to filter CMediaPlayer files + based on extension. +* NxWM::CMediaPlayer: Add logic to read files from the media mountpoint, + filter them by extension, and display the file names in the listbox. +* NxWM::CMediaPlayer: Now integrated with the NxPlayer library. +* NxWidgets::CNxString: Add a getAllocSize() method to make it easier to + convert CNxStrings to NUL-terminated C strings. +* NxWM::CMediaPlayer: Add a CLabel that show the current fast forward/rewind + speed. +* NxWM::CKeyboard: Add support for a USB keyboard as the NxConsole and text + widget input. + +Bugfixes: + +* NxWidgets: Fix typo RBG -> RGB. This makes NxWidgets incompatible with + versions of NuttX 7.2 and below. +* NxWidgets::CImage: Fix setImageLeft and setImageTop methods +* NxMW::CMediaPlayer: Correctly catch the volume level change event. +* NxWidgets::CGraphicsPort: Fix drawBitmapGreyScale method. Actually drew + nothing because of several errors in positioning and buffer usage. +* NxWidgets::CImage: Should not attempt to draw the "empty" regions at the + top and the bottom of the image box in greyscale. +* NxWidgets::CNxString: Make destructor virtual. From Petteri Aimonen. +* NxWidgets::CTaskbar: Fix type of return value from openRawWindow() + method. From Petteri Aimonen. +* NxWidgets::CTabPanel: Modify behavior in showPage() method. Eliminate a + duplicate redraw that caused flickering; re-order some logic so that + widgets are hidden before operated on. From Petteri Aimonen. +* NxWidgets::CNxTimer: Make CNxTimer stop itself before destruction. + Otherwise a call to an invalid work queue entry may occur. From Petteri + Aimonen. +* NxWM::IApplicationFactory: Add a do-nothing, virtual destructor to + eliminate a warning. +* XWidgets::CNxWidget: Remove an unused bit field. From a322b28cf093a2164fa429212551628f87e2f30c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 20 Aug 2014 14:15:34 -0600 Subject: [PATCH 287/390] SAM4E-EK: Add an NxWM configuration --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index 3ee3bd123..9e4c4ec9a 100644 --- a/Kconfig +++ b/Kconfig @@ -845,7 +845,7 @@ config NXWM_KEYBOARD bool "Keyboard Support" default n ---help--- - Define to build in touchscreen support. + Define to build in keyboard support. if NXWM_KEYBOARD From 171fff2ef0e09492eed1bb0a30a9352e1490efb8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 29 Aug 2014 14:47:22 -0600 Subject: [PATCH 288/390] Rename CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED; Partially integrate new CONFIG_BUILD_KERNEL --- Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 9e4c4ec9a..4f6b84b73 100644 --- a/Kconfig +++ b/Kconfig @@ -52,7 +52,7 @@ if NX_MULTIUSER config NXWIDGET_SERVERINIT bool "Start server" default y - depends on !NUTTX_KERNEL + depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- If this option is selected, then the NxWidgets::CNxServer class will bring up the NX server when it is initialized. If this option is @@ -779,7 +779,7 @@ comment "Touchscreen Device Settings" config NXWM_TOUCHSCREEN_DEVINIT bool "Touchscreen Device Initialization" default y - depends on !NUTTX_KERNEL + depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- It this option is selected, then the NxWM:CTouchscreen listener thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO) From d78a62aaf0e91e0103229250df90272172a3d82d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 1 Sep 2014 13:21:15 -0600 Subject: [PATCH 289/390] Remove final traces of the 8015 from the NuttX source tree --- libnxwidgets/src/cnxserver.cxx | 2 +- nxwm/src/cnxconsole.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 8dd448b87..e87c0fdf6 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -217,7 +217,7 @@ bool CNxServer::connect(void) // Start the server task gvdbg("CNxServer::connect: Starting server task\n"); - pid_t serverId = TASK_CREATE("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, + pid_t serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR char * const *)0); if (serverId < 0) diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index b8577b635..be0718a10 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -250,7 +250,7 @@ bool CNxConsole::run(void) g_nxconvars.nxcon = 0; sched_lock(); - m_pid = TASK_CREATE("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, + m_pid = task_create("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxconsole, (FAR char * const *)0); From d4488e79ca12c053388a7f58e8406cc33ea117a5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 14:18:08 -0600 Subject: [PATCH 290/390] Rename CONFIG_NXCONSOLE* to CONFIG_NXTERM* --- UnitTests/README.txt | 2 +- libnxwidgets/include/cbgwindow.hxx | 2 +- libnxwidgets/include/ccallback.hxx | 6 +++--- libnxwidgets/include/cnxtkwindow.hxx | 2 +- libnxwidgets/include/cnxtoolbar.hxx | 2 +- libnxwidgets/include/cnxwindow.hxx | 2 +- libnxwidgets/include/inxwindow.hxx | 4 ++-- libnxwidgets/include/nxconfig.hxx | 4 ++-- libnxwidgets/src/ccallback.cxx | 6 +++--- nxwm/include/nxwmconfig.hxx | 6 +++--- nxwm/src/cnxconsole.cxx | 12 ++++++------ 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 97f3eec7c..044fcc175 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -87,7 +87,7 @@ Installing and Building the Unit Tests d) Special configuration requirements for the nxwm unit test: - CONFIG_NXCONSOLE=y + CONFIG_NXTERM=y CONFIG_NX_MULTIUSER=y e) Other .config file changes -- NSH configurations only. diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 0b73a01de..57c0a1675 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -220,7 +220,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN inline void redirectNxConsole(NXCONSOLE handle) { setNxConsole(handle); diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 8127dc20d..8d96f0022 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -49,7 +49,7 @@ #include #include -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN # include #endif @@ -93,7 +93,7 @@ namespace NXWidgets private: CWidgetControl *m_widgetControl; /**< The widget control instance for this window */ struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN NXCONSOLE m_nxconsole; /**< The NxConsole handle for redirection of keyboard input */ #endif @@ -257,7 +257,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN inline void setNxConsole(NXCONSOLE handle) { m_nxconsole = handle; diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index ea18595de..5bf2a1a03 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -241,7 +241,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN inline void redirectNxConsole(NXCONSOLE handle) { setNxConsole(handle); diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index 501067f0d..7a8a783b2 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -210,7 +210,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN inline void redirectNxConsole(NXCONSOLE handle) { setNxConsole(handle); diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 780276a5f..525a0c851 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -214,7 +214,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN inline void redirectNxConsole(NXCONSOLE handle) { setNxConsole(handle); diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 826d1784e..4aa2c519b 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -47,7 +47,7 @@ #include #include -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN # include #endif @@ -186,7 +186,7 @@ namespace NXWidgets * directed to the widgets within the window. */ -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN virtual void redirectNxConsole(NXCONSOLE handle) = 0; #endif diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 9face1e70..f6c9ead90 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -188,8 +188,8 @@ * reducing the AND of these three conditions to a single condition. */ -#if !defined(CONFIG_NX_KBD) || !defined(CONFIG_NXCONSOLE) -# undef CONFIG_NXCONSOLE_NXKBDIN +#if !defined(CONFIG_NX_KBD) || !defined(CONFIG_NXTERM) +# undef CONFIG_NXTERM_NXKBDIN #endif /* NX Server/Device Configuration *******************************************/ diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 4550d24b0..cec7ea1bf 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -44,7 +44,7 @@ #include #include -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN # include #endif @@ -87,7 +87,7 @@ CCallback::CCallback(CWidgetControl *widgetControl) // Keyboard input is initially direct to the widgets within the window -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN m_nxconsole = (NXCONSOLE)0; #endif } @@ -209,7 +209,7 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, // (default) OR is NX keyboard input being re-directed to an NxConsole // driver? -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN if (This->m_nxconsole) { // Keyboard input is going to an NxConsole diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index b2c3f4c54..a0b91e0ef 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -57,7 +57,7 @@ * 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 + * CONFIG_NXTERM=y : For NxConsole support * CONFIG_SCHED_ONEXIT : Support for on_exit() * * General settings: @@ -89,8 +89,8 @@ * selected */ -#if defined(CONFIG_NXWM_NXCONSOLE) && !defined(CONFIG_NXCONSOLE) -# warning "NxConsole support may be needed (CONFIG_NXCONSOLE)" +#if defined(CONFIG_NXWM_NXCONSOLE) && !defined(CONFIG_NXTERM) +# warning "NxConsole support may be needed (CONFIG_NXTERM)" #endif /** diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index be0718a10..f2449e6b1 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -278,7 +278,7 @@ bool CNxConsole::run(void) // Re-direct NX keyboard input to the new NxConsole driver DEBUGASSERT(g_nxconvars.nxcon != 0); -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN window->redirectNxConsole(g_nxconvars.nxcon); #endif // Save the handle to use in the stop method @@ -331,7 +331,7 @@ void CNxConsole::stop(void) { // Re-store NX keyboard input routing -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN NXWidgets::INxWindow *window = m_window->getWindow(); window->redirectNxConsole((NXCONSOLE)0); #endif @@ -455,7 +455,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) // Open the NxConsole driver -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN fd = open(devname, O_RDWR); #else fd = open(devname, O_WRONLY); @@ -474,19 +474,19 @@ int CNxConsole::nxconsole(int argc, char *argv[]) (void)std::fflush(stdout); (void)std::fflush(stderr); -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN (void)std::fclose(stdin); #endif (void)std::fclose(stdout); (void)std::fclose(stderr); -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN (void)std::dup2(fd, 0); #endif (void)std::dup2(fd, 1); (void)std::dup2(fd, 2); -#ifdef CONFIG_NXCONSOLE_NXKBDIN +#ifdef CONFIG_NXTERM_NXKBDIN (void)std::fdopen(0, "r"); #endif (void)std::fdopen(1, "w"); From e9e12a5ffbc1611179032eeeaa390af37d376bc2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 14:25:51 -0600 Subject: [PATCH 291/390] Rename CONFIG_EXAMPLES_NXCONSOLE to CONFIG_EXAMPLES_NXTERM; rename CONFIG_NXWM_NXCONSOLE to CONFIG_NXWM_NXTERM --- ChangeLog.txt | 2 +- Kconfig | 36 ++++++++++++++-------------- UnitTests/nxwm/nxwm_main.cxx | 8 +++---- nxwm/Makefile | 2 +- nxwm/include/nxwmconfig.hxx | 46 ++++++++++++++++++------------------ nxwm/src/cnxconsole.cxx | 14 +++++------ 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2d89d3f91..dbea761b3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -417,7 +417,7 @@ This is because in the kernel build mode, the NX server must be initialized in kernel mode by the RTOS before applications using the server run in user mode. -* NxWm: Added CONFIG_NXWM_NXCONSOLE that can be used to disable the NxConsole +* NxWm: Added CONFIG_NXWM_NXTERM that can be used to disable the NxConsole window (2013-12-30). * NxWm::CTouchscreen: Added CONFIG_NXWM_TOUCHSCREEN_DEVINIT that can be used to suppress calls to initialize the touchscreen device from the listener diff --git a/Kconfig b/Kconfig index 4f6b84b73..f5b03e58f 100644 --- a/Kconfig +++ b/Kconfig @@ -677,16 +677,16 @@ endmenu # Start Window Configuration menu "NxConsole Window Settings" -config NXWM_NXCONSOLE +config NXWM_NXTERM bool "NxConsole Window" default y ---help--- Enable support for the NxConsole window which provides a text window in which you can interact with NSH. -if NXWM_NXCONSOLE +if NXWM_NXTERM -config NXWM_NXCONSOLE_PRIO +config NXWM_NXTERM_PRIO int "NxConsole Task Priority" default 100 ---help--- @@ -696,14 +696,14 @@ config NXWM_NXCONSOLE_PRIO else there may be data overrun errors. Such errors would most likely appear as duplicated rows of data on the display. -config NXWM_NXCONSOLE_STACKSIZE +config NXWM_NXTERM_STACKSIZE int "NxConsole Task Stack Size" default 2048 ---help--- The stack size to use when starting the NxConsole task. Default: 2048 bytes. -config NXWM_NXCONSOLE_CUSTOM_COLORS +config NXWM_NXTERM_CUSTOM_COLORS bool "Custom NxConsole Colors" default n ---help--- @@ -712,55 +712,55 @@ config NXWM_NXCONSOLE_CUSTOM_COLORS (there are no default colors because the hexadecimal representation of the default colors depend on the pixel depth). Default: n -if NXWM_NXCONSOLE_CUSTOM_COLORS +if NXWM_NXTERM_CUSTOM_COLORS -config NXWM_NXCONSOLE_WCOLOR +config NXWM_NXTERM_WCOLOR hex "NxConsole Background Color" ---help--- The color of the NxConsole window background. Default: RGB(192,192,192) -config NXWM_NXCONSOLE_FONTCOLOR +config NXWM_NXTERM_FONTCOLOR hex "NxConsole Font Color" ---help--- The color of the fonts to use in the NxConsole window. Default: RGB(0,0,0) -endif # NXWM_NXCONSOLE_CUSTOM_COLORS +endif # NXWM_NXTERM_CUSTOM_COLORS -config NXWM_NXCONSOLE_CUSTOM_FONTID +config NXWM_NXTERM_CUSTOM_FONTID bool "Use Custom Default Font" default n ---help--- Set to override the NxWM default font id (NXWM_DEFAULT_FONTID). -if NXWM_NXCONSOLE_CUSTOM_FONTID +if NXWM_NXTERM_CUSTOM_FONTID -config NXWM_NXCONSOLE_FONTID +config NXWM_NXTERM_FONTID int "NxConsole Font ID" default 0 ---help--- Use this default font ID in the NxConsole window instead of the NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 -endif # NXWM_NXCONSOLE_CUSTOM_FONTID +endif # NXWM_NXTERM_CUSTOM_FONTID -config NXWM_CUSTOM_NXCONSOLE_ICON +config NXWM_CUSTOM_NXTERM_ICON bool "Custom NxConsole Icon" default n ---help--- Select to override the default NxConsole Window Icon: NxWM::g_cmdBitmap -if NXWM_CUSTOM_NXCONSOLE_ICON +if NXWM_CUSTOM_NXTERM_ICON -config NXWM_NXCONSOLE_ICON +config NXWM_NXTERM_ICON string "NxConsole Icon" default "NxWM::g_cmdBitmap" ---help--- The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap -endif # NXWM_NXCONSOLE_ICON -endif # NXWM_NXCONSOLE +endif # NXWM_NXTERM_ICON +endif # NXWM_NXTERM endmenu # NxConsole Window Settings menu "NxWM Touchscreen Configuration" diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 13e0bd8b1..379b03186 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -51,7 +51,7 @@ #include "ctaskbar.hxx" #include "cstartwindow.hxx" -#ifdef CONFIG_NXWM_NXCONSOLE +#ifdef CONFIG_NXWM_NXTERM # include "cnxconsole.hxx" #endif @@ -548,7 +548,7 @@ static bool createCalibration(void) // Name: createNxConsole ///////////////////////////////////////////////////////////////////////////// -#ifdef CONFIG_NXWM_NXCONSOLE +#ifdef CONFIG_NXWM_NXTERM static bool createNxConsole(void) { // Add the NxConsole application to the start window @@ -678,7 +678,7 @@ int nxwm_main(int argc, char *argv[]) // Initialize the NSH library -#ifdef CONFIG_NXWM_NXCONSOLE +#ifdef CONFIG_NXWM_NXTERM printf("nxwm_main: Initialize the NSH library\n"); if (!NxWM::nshlibInitialize()) { @@ -736,7 +736,7 @@ int nxwm_main(int argc, char *argv[]) // Create the NxConsole application and add it to the start window -#ifdef CONFIG_NXWM_NXCONSOLE +#ifdef CONFIG_NXWM_NXTERM if (!createNxConsole()) { printf("nxwm_main: ERROR: Failed to create the NxConsole application\n"); diff --git a/nxwm/Makefile b/nxwm/Makefile index 75c923299..8dd287c64 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -70,7 +70,7 @@ ifeq ($(CONFIG_NXWM_TOUCHSCREEN),y) CXXSRCS += ccalibration.cxx endif -ifeq ($(CONFIG_NXWM_NXCONSOLE),y) +ifeq ($(CONFIG_NXWM_NXTERM),y) CXXSRCS += cnxconsole.cxx endif diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index a0b91e0ef..a7578a206 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -85,11 +85,11 @@ #endif /** - * NxConsole support is (probably) required if CONFIG_NXWM_NXCONSOLE is + * NxConsole support is (probably) required if CONFIG_NXWM_NXTERM is * selected */ -#if defined(CONFIG_NXWM_NXCONSOLE) && !defined(CONFIG_NXTERM) +#if defined(CONFIG_NXWM_NXTERM) && !defined(CONFIG_NXTERM) # warning "NxConsole support may be needed (CONFIG_NXTERM)" #endif @@ -367,54 +367,54 @@ /** * NxConsole Window Configuration * - * CONFIG_NXWM_NXCONSOLE_PRIO - Priority of the NxConsole task. Default: + * CONFIG_NXWM_NXTERM_PRIO - Priority of the NxConsole task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. * Such errors would most likely appear as duplicated rows of data on the * display. - * CONFIG_NXWM_NXCONSOLE_STACKSIZE - The stack size to use when starting the + * CONFIG_NXWM_NXTERM_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. + * CONFIG_NXWM_NXTERM_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 + * CONFIG_NXWM_NXTERM_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 + * CONFIG_NXWM_NXTERM_FONTID - The ID of the font to use in the NxConsole * window. Default: CONFIG_NXWM_DEFAULT_FONTID - * CONFIG_NXWM_NXCONSOLE_ICON - The glyph to use as the NxConsole icon + * CONFIG_NXWM_NXTERM_ICON - The glyph to use as the NxConsole icon */ -#ifdef CONFIG_NXWM_NXCONSOLE -# ifndef CONFIG_NXWM_NXCONSOLE_PRIO -# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT +#ifdef CONFIG_NXWM_NXTERM +# ifndef CONFIG_NXWM_NXTERM_PRIO +# define CONFIG_NXWM_NXTERM_PRIO SCHED_PRIORITY_DEFAULT # endif -# if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXCONSOLE_PRIO" +# if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO +# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO" # warning" -- This can result in data overrun errors" # endif -# ifndef CONFIG_NXWM_NXCONSOLE_STACKSIZE -# define CONFIG_NXWM_NXCONSOLE_STACKSIZE 2048 +# ifndef CONFIG_NXWM_NXTERM_STACKSIZE +# define CONFIG_NXWM_NXTERM_STACKSIZE 2048 # endif -# ifndef CONFIG_NXWM_NXCONSOLE_WCOLOR -# define CONFIG_NXWM_NXCONSOLE_WCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR +# ifndef CONFIG_NXWM_NXTERM_WCOLOR +# define CONFIG_NXWM_NXTERM_WCOLOR CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR # endif -# ifndef CONFIG_NXWM_NXCONSOLE_FONTCOLOR -# define CONFIG_NXWM_NXCONSOLE_FONTCOLOR CONFIG_NXWM_DEFAULT_FONTCOLOR +# ifndef CONFIG_NXWM_NXTERM_FONTCOLOR +# define CONFIG_NXWM_NXTERM_FONTCOLOR CONFIG_NXWM_DEFAULT_FONTCOLOR # endif -# ifndef CONFIG_NXWM_NXCONSOLE_FONTID -# define CONFIG_NXWM_NXCONSOLE_FONTID CONFIG_NXWM_DEFAULT_FONTID +# ifndef CONFIG_NXWM_NXTERM_FONTID +# define CONFIG_NXWM_NXTERM_FONTID CONFIG_NXWM_DEFAULT_FONTID # endif /** * The NxConsole window glyph */ -# ifndef CONFIG_NXWM_NXCONSOLE_ICON -# define CONFIG_NXWM_NXCONSOLE_ICON NxWM::g_cmdBitmap +# ifndef CONFIG_NXWM_NXTERM_ICON +# define CONFIG_NXWM_NXTERM_ICON NxWM::g_cmdBitmap # endif #endif diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxconsole.cxx index f2449e6b1..ff5ed92c2 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxconsole.cxx @@ -179,7 +179,7 @@ IApplicationWindow *CNxConsole::getWindow(void) const NXWidgets::IBitmap *CNxConsole::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = - new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXCONSOLE_ICON); + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXTERM_ICON); return bitmap; } @@ -235,9 +235,9 @@ bool CNxConsole::run(void) // Describe the NxConsole - g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXCONSOLE_WCOLOR; - g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXCONSOLE_FONTCOLOR; - g_nxconvars.wndo.fontid = CONFIG_NXWM_NXCONSOLE_FONTID; + g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR; + g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR; + g_nxconvars.wndo.fontid = CONFIG_NXWM_NXTERM_FONTID; // Get the size of the window @@ -250,8 +250,8 @@ bool CNxConsole::run(void) g_nxconvars.nxcon = 0; sched_lock(); - m_pid = task_create("NxConsole", CONFIG_NXWM_NXCONSOLE_PRIO, - CONFIG_NXWM_NXCONSOLE_STACKSIZE, nxconsole, + m_pid = task_create("NxConsole", CONFIG_NXWM_NXTERM_PRIO, + CONFIG_NXWM_NXTERM_STACKSIZE, nxconsole, (FAR char * const *)0); // Did we successfully start the NxConsole task? @@ -629,7 +629,7 @@ IApplication *CNxConsoleFactory::create(void) NXWidgets::IBitmap *CNxConsoleFactory::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = - new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXCONSOLE_ICON); + new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXTERM_ICON); return bitmap; } From a39743bbf33ad1ab35e86e3dbb0190a98b0d3b82 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 14:41:45 -0600 Subject: [PATCH 292/390] Change all references to NxConsole to NxTerm --- nxwm/Makefile | 2 +- nxwm/include/chexcalculator.hxx | 4 +- nxwm/include/cmediaplayer.hxx | 2 +- nxwm/include/{cnxconsole.hxx => cnxterm.h} | 46 +++---- nxwm/include/cwindowmessenger.hxx | 2 +- nxwm/include/nxwmconfig.hxx | 24 ++-- nxwm/src/chexcalculator.cxx | 2 +- nxwm/src/cmediaplayer.cxx | 2 +- nxwm/src/{cnxconsole.cxx => cnxterm.cxx} | 132 ++++++++++----------- nxwm/src/ctaskbar.cxx | 2 +- 10 files changed, 109 insertions(+), 109 deletions(-) rename nxwm/include/{cnxconsole.hxx => cnxterm.h} (84%) rename nxwm/src/{cnxconsole.cxx => cnxterm.cxx} (82%) diff --git a/nxwm/Makefile b/nxwm/Makefile index 8dd287c64..7e5705c7a 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -71,7 +71,7 @@ CXXSRCS += ccalibration.cxx endif ifeq ($(CONFIG_NXWM_NXTERM),y) -CXXSRCS += cnxconsole.cxx +CXXSRCS += cnxterm.cxx endif # Images diff --git a/nxwm/include/chexcalculator.hxx b/nxwm/include/chexcalculator.hxx index fc5de07b6..7a19567cb 100644 --- a/nxwm/include/chexcalculator.hxx +++ b/nxwm/include/chexcalculator.hxx @@ -44,7 +44,7 @@ #include #include -#include +#include #include "cbuttonarray.hxx" #include "clabel.hxx" @@ -70,7 +70,7 @@ namespace NxWM { /** - * This class implements the NxConsole application. + * This class implements the NxTerm application. */ class CHexCalculator : public IApplication, diff --git a/nxwm/include/cmediaplayer.hxx b/nxwm/include/cmediaplayer.hxx index f36036a2a..a5597d06b 100644 --- a/nxwm/include/cmediaplayer.hxx +++ b/nxwm/include/cmediaplayer.hxx @@ -46,7 +46,7 @@ #include #include -#include +#include #include "cnxfont.hxx" #include "cimage.hxx" diff --git a/nxwm/include/cnxconsole.hxx b/nxwm/include/cnxterm.h similarity index 84% rename from nxwm/include/cnxconsole.hxx rename to nxwm/include/cnxterm.h index 52fee386a..c97e3b911 100644 --- a/nxwm/include/cnxconsole.hxx +++ b/nxwm/include/cnxterm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * NxWidgets/nxwm/include/cnxconsole.hxx + * NxWidgets/nxwm/include/cnxterm.hxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CNXCONSOLE_HXX -#define __INCLUDE_CNXCONSOLE_HXX +#ifndef __INCLUDE_CNXTERM_HXX +#define __INCLUDE_CNXTERM_HXX /**************************************************************************** * Included Files @@ -44,7 +44,7 @@ #include #include -#include +#include #include "iapplication.hxx" #include "capplicationwindow.hxx" @@ -72,27 +72,27 @@ namespace NxWM bool nshlibInitialize(void); /** - * This class implements the NxConsole application. + * This class implements the NxTerm application. */ - class CNxConsole : public IApplication, private IApplicationCallback + class CNxTerm : public IApplication, private IApplicationCallback { 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 */ + NXTERMi m_nxcon; /**< NxTerm handle */ + pid_t m_pid; /**< Task ID of the NxTerm thread */ /** - * This is the NxConsole task. This function first redirects output to the + * This is the NxTerm task. This function first redirects output to the * console window then calls to start the NSH logic. */ - static int nxconsole(int argc, char *argv[]); + static int nxterm(int argc, char *argv[]); /** - * This is the NxConsole task exit handler. It is registered with on_exit() - * and called automatically when the nxconsole task exits. + * This is the NxTerm task exit handler. It is registered with on_exit() + * and called automatically when the nxterm task exits. */ static void exitHandler(int code, FAR void *arg); @@ -111,7 +111,7 @@ namespace NxWM public: /** - * CNxConsole constructor + * CNxTerm constructor * * @param window. The application window * @@ -119,13 +119,13 @@ namespace NxWM * @param window. The window to be used by this application. */ - CNxConsole(CTaskbar *taskbar, CApplicationWindow *window); + CNxTerm(CTaskbar *taskbar, CApplicationWindow *window); /** - * CNxConsole destructor + * CNxTerm destructor */ - ~CNxConsole(void); + ~CNxTerm(void); /** * Each implementation of IApplication must provide a method to recover @@ -203,28 +203,28 @@ namespace NxWM bool isFullScreen(void) const; }; - class CNxConsoleFactory : public IApplicationFactory + class CNxTermFactory : public IApplicationFactory { private: CTaskbar *m_taskbar; /**< The taskbar */ public: /** - * CNxConsoleFactory Constructor + * CNxTermFactory Constructor * * @param taskbar. The taskbar instance used to terminate calibration */ - CNxConsoleFactory(CTaskbar *taskbar); + CNxTermFactory(CTaskbar *taskbar); /** - * CNxConsoleFactory Destructor + * CNxTermFactory Destructor */ - inline ~CNxConsoleFactory(void) { } + inline ~CNxTermFactory(void) { } /** - * Create a new instance of an CNxConsole (as IApplication). + * Create a new instance of an CNxTerm (as IApplication). */ IApplication *create(void); @@ -242,4 +242,4 @@ namespace NxWM } #endif // __cplusplus -#endif // __INCLUDE_CNXCONSOLE_HXX +#endif // __INCLUDE_CNXTERM_HXX diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index 3822813d1..bfe6e9d08 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -46,7 +46,7 @@ #include #include -#include +#include #include "cwindoweventhandler.hxx" #include "cwidgetstyle.hxx" diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index a7578a206..42b091b27 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -57,7 +57,7 @@ * CONFIG_HAVE_CXX : C++ support is required * CONFIG_NX : NX must enabled * CONFIG_NX_MULTIUSER=y : NX must be configured in multiuse mode - * CONFIG_NXTERM=y : For NxConsole support + * CONFIG_NXTERM=y : For NxTerm support * CONFIG_SCHED_ONEXIT : Support for on_exit() * * General settings: @@ -85,12 +85,12 @@ #endif /** - * NxConsole support is (probably) required if CONFIG_NXWM_NXTERM is + * NxTerm support is (probably) required if CONFIG_NXWM_NXTERM is * selected */ #if defined(CONFIG_NXWM_NXTERM) && !defined(CONFIG_NXTERM) -# warning "NxConsole support may be needed (CONFIG_NXTERM)" +# warning "NxTerm support may be needed (CONFIG_NXTERM)" #endif /** @@ -363,24 +363,24 @@ # define CONFIG_NXWM_STARTWINDOW_STACKSIZE 2048 #endif -/* NxConsole Window *********************************************************/ +/* NxTerm Window *********************************************************/ /** - * NxConsole Window Configuration + * NxTerm Window Configuration * - * CONFIG_NXWM_NXTERM_PRIO - Priority of the NxConsole task. Default: + * CONFIG_NXWM_NXTERM_PRIO - Priority of the NxTerm task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. * Such errors would most likely appear as duplicated rows of data on the * display. * CONFIG_NXWM_NXTERM_STACKSIZE - The stack size to use when starting the - * NxConsole task. Default: 2048 bytes. - * CONFIG_NXWM_NXTERM_WCOLOR - The color of the NxConsole window background. + * NxTerm task. Default: 2048 bytes. + * CONFIG_NXWM_NXTERM_WCOLOR - The color of the NxTerm window background. * Default: MKRGB(192,192,192) * CONFIG_NXWM_NXTERM_FONTCOLOR - The color of the fonts to use in the - * NxConsole window. Default: MKRGB(0,0,0) - * CONFIG_NXWM_NXTERM_FONTID - The ID of the font to use in the NxConsole + * NxTerm window. Default: MKRGB(0,0,0) + * CONFIG_NXWM_NXTERM_FONTID - The ID of the font to use in the NxTerm * window. Default: CONFIG_NXWM_DEFAULT_FONTID - * CONFIG_NXWM_NXTERM_ICON - The glyph to use as the NxConsole icon + * CONFIG_NXWM_NXTERM_ICON - The glyph to use as the NxTerm icon */ #ifdef CONFIG_NXWM_NXTERM @@ -410,7 +410,7 @@ # endif /** - * The NxConsole window glyph + * The NxTerm window glyph */ # ifndef CONFIG_NXWM_NXTERM_ICON diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index dc42de0c0..d0a4eb285 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -973,7 +973,7 @@ CHexCalculatorFactory::CHexCalculatorFactory(CTaskbar *taskbar) IApplication *CHexCalculatorFactory::create(void) { // Call CTaskBar::openFullScreenWindow to create a application window for - // the NxConsole application + // the NxTerm application CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 3091d6758..32c67c807 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -1906,7 +1906,7 @@ CMediaPlayerFactory::CMediaPlayerFactory(CTaskbar *taskbar) IApplication *CMediaPlayerFactory::create(void) { // Call CTaskBar::openFullScreenWindow to create a application window for - // the NxConsole application + // the NxTerm application CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) diff --git a/nxwm/src/cnxconsole.cxx b/nxwm/src/cnxterm.cxx similarity index 82% rename from nxwm/src/cnxconsole.cxx rename to nxwm/src/cnxterm.cxx index ff5ed92c2..a26009a4d 100644 --- a/nxwm/src/cnxconsole.cxx +++ b/nxwm/src/cnxterm.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cnxconsole.cxx + * NxWidgets/nxwm/src/cnxterm.cxx * * Copyright (C) 2012. 2104 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -55,7 +55,7 @@ #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" -#include "cnxconsole.hxx" +#include "cnxterm.hxx" /******************************************************************************************** * Pre-Processor Definitions @@ -73,19 +73,19 @@ namespace NxWM { /** - * This structure is used to pass start up parameters to the NxConsole task and to assure the - * the NxConsole is successfully started. + * This structure is used to pass start up parameters to the NxTerm task and to assure the + * the NxTerm is successfully started. */ - struct SNxConsole + struct SNxTerm { FAR void *console; /**< The console 'this' pointer use with on_exit() */ sem_t exclSem; /**< Sem that gives exclusive access to this structure */ sem_t waitSem; /**< Sem that posted when the task is initialized */ NXTKWINDOW hwnd; /**< Window handle */ - NXCONSOLE nxcon; /**< NxConsole handle */ + NXTERM nxcon; /**< NxTerm handle */ int minor; /**< Next device minor number */ - struct nxcon_window_s wndo; /**< Describes the NxConsole window */ + struct nxcon_window_s wndo; /**< Describes the NxTerm window */ bool result; /**< True if successfully initialized */ }; @@ -94,11 +94,11 @@ namespace NxWM ********************************************************************************************/ /** - * This global data structure is used to pass start parameters to NxConsole task and to - * assure that the NxConsole is successfully started. + * This global data structure is used to pass start parameters to NxTerm task and to + * assure that the NxTerm is successfully started. */ - static struct SNxConsole g_nxconvars; + static struct SNxTerm g_nxconvars; } /******************************************************************************************** @@ -106,25 +106,25 @@ namespace NxWM ********************************************************************************************/ /******************************************************************************************** - * CNxConsole Method Implementations + * CNxTerm Method Implementations ********************************************************************************************/ using namespace NxWM; /** - * CNxConsole constructor + * CNxTerm constructor * * @param window. The application window */ -CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) +CNxTerm::CNxTerm(CTaskbar *taskbar, CApplicationWindow *window) { // Save the constructor data m_taskbar = taskbar; m_window = window; - // The NxConsole is not runing + // The NxTerm is not runing m_pid = -1; m_nxcon = 0; @@ -140,14 +140,14 @@ CNxConsole::CNxConsole(CTaskbar *taskbar, CApplicationWindow *window) } /** - * CNxConsole destructor + * CNxTerm destructor * * @param window. The application window */ -CNxConsole::~CNxConsole(void) +CNxTerm::~CNxTerm(void) { - // There would be a problem if we were stopped with the NxConsole task + // There would be a problem if we were stopped with the NxTerm task // running... that should never happen but we'll check anyway: stop(); @@ -163,7 +163,7 @@ CNxConsole::~CNxConsole(void) * the contained CApplicationWindow instance. */ -IApplicationWindow *CNxConsole::getWindow(void) const +IApplicationWindow *CNxTerm::getWindow(void) const { return static_cast(m_window); } @@ -176,7 +176,7 @@ IApplicationWindow *CNxConsole::getWindow(void) const * be deleted by the caller when it is no long needed. */ -NXWidgets::IBitmap *CNxConsole::getIcon(void) +NXWidgets::IBitmap *CNxTerm::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXTERM_ICON); @@ -190,7 +190,7 @@ NXWidgets::IBitmap *CNxConsole::getIcon(void) * @return A copy if CNxString that contains the name of the application. */ -NXWidgets::CNxString CNxConsole::getName(void) +NXWidgets::CNxString CNxTerm::getName(void) { return NXWidgets::CNxString("NuttShell"); } @@ -201,7 +201,7 @@ NXWidgets::CNxString CNxConsole::getName(void) * @return True if the application was successfully started. */ -bool CNxConsole::run(void) +bool CNxTerm::run(void) { // Some sanity checking @@ -233,7 +233,7 @@ bool CNxConsole::run(void) g_nxconvars.hwnd = control->getWindowHandle(); - // Describe the NxConsole + // Describe the NxTerm g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR; g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR; @@ -243,23 +243,23 @@ bool CNxConsole::run(void) (void)window->getSize(&g_nxconvars.wndo.wsize); - // Start the NxConsole task + // Start the NxTerm task g_nxconvars.console = (FAR void *)this; g_nxconvars.result = false; g_nxconvars.nxcon = 0; sched_lock(); - m_pid = task_create("NxConsole", CONFIG_NXWM_NXTERM_PRIO, - CONFIG_NXWM_NXTERM_STACKSIZE, nxconsole, + m_pid = task_create("NxTerm", CONFIG_NXWM_NXTERM_PRIO, + CONFIG_NXWM_NXTERM_STACKSIZE, nxterm, (FAR char * const *)0); - // Did we successfully start the NxConsole task? + // Did we successfully start the NxTerm task? bool result = true; if (m_pid < 0) { - gdbg("ERROR: Failed to create the NxConsole task\n"); + gdbg("ERROR: Failed to create the NxTerm task\n"); result = false; } else @@ -275,11 +275,11 @@ bool CNxConsole::run(void) if (ret == OK && g_nxconvars.result) { - // Re-direct NX keyboard input to the new NxConsole driver + // Re-direct NX keyboard input to the new NxTerm driver DEBUGASSERT(g_nxconvars.nxcon != 0); #ifdef CONFIG_NXTERM_NXKBDIN - window->redirectNxConsole(g_nxconvars.nxcon); + window->redirectNxTerm(g_nxconvars.nxcon); #endif // Save the handle to use in the stop method @@ -287,10 +287,10 @@ bool CNxConsole::run(void) } else { - // sem_timedwait failed OR the NxConsole task reported a + // sem_timedwait failed OR the NxTerm task reported a // failure. Stop the application - gdbg("ERROR: Failed start the NxConsole task\n"); + gdbg("ERROR: Failed start the NxTerm task\n"); stop(); result = false; } @@ -304,18 +304,18 @@ bool CNxConsole::run(void) * Stop the application. */ -void CNxConsole::stop(void) +void CNxTerm::stop(void) { - // Delete the NxConsole task if it is still running (this could strand + // Delete the NxTerm task if it is still running (this could strand // resources). If we get here due to CTaskbar::stopApplication() processing - // initialed by CNxConsole::exitHandler, then do *not* delete the task (it + // initialed by CNxTerm::exitHandler, then do *not* delete the task (it // is already being deleted). if (m_pid >= 0) { // Calling task_delete() will also invoke the on_exit() handler. We se // m_pid = -1 before calling task_delete() to let the on_exit() handler, - // CNxConsole::exitHandler(), know that it should not do anything + // CNxTerm::exitHandler(), know that it should not do anything pid_t pid = m_pid; m_pid = -1; @@ -333,10 +333,10 @@ void CNxConsole::stop(void) #ifdef CONFIG_NXTERM_NXKBDIN NXWidgets::INxWindow *window = m_window->getWindow(); - window->redirectNxConsole((NXCONSOLE)0); + window->redirectNxTerm((NXTERM)0); #endif - // Unregister the NxConsole driver + // Unregister the NxTerm driver nxcon_unregister(m_nxcon); m_nxcon = 0; @@ -352,7 +352,7 @@ void CNxConsole::stop(void) * will, finally, safely delete the application. */ -void CNxConsole::destroy(void) +void CNxTerm::destroy(void) { // Block any further window messages @@ -368,7 +368,7 @@ void CNxConsole::destroy(void) * maximized, but not at the top of the hierarchy */ -void CNxConsole::hide(void) +void CNxTerm::hide(void) { // Disable drawing and events } @@ -379,7 +379,7 @@ void CNxConsole::hide(void) * CTaskbar when the application window must be displayed */ -void CNxConsole::redraw(void) +void CNxTerm::redraw(void) { // Recover the NXTK window instance contained in the application window @@ -390,7 +390,7 @@ void CNxConsole::redraw(void) struct nxgl_size_s windowSize; (void)window->getSize(&windowSize); - // Redraw the entire NxConsole window + // Redraw the entire NxTerm window struct nxgl_rect_s rect; rect.pt1.x = 0; @@ -409,17 +409,17 @@ void CNxConsole::redraw(void) * @return True if this is a full screen window. */ -bool CNxConsole::isFullScreen(void) const +bool CNxTerm::isFullScreen(void) const { return m_window->isFullScreen(); } /** - * This is the NxConsole task. This function first redirects output to the + * This is the NxTerm task. This function first redirects output to the * console window then calls to start the NSH logic. */ -int CNxConsole::nxconsole(int argc, char *argv[]) +int CNxTerm::nxterm(int argc, char *argv[]) { // To stop compiler complaining about "jump to label crosses initialization // of 'int fd' @@ -453,7 +453,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) g_nxconvars.minor++; - // Open the NxConsole driver + // Open the NxTerm driver #ifdef CONFIG_NXTERM_NXKBDIN fd = open(devname, O_RDWR); @@ -469,7 +469,7 @@ int CNxConsole::nxconsole(int argc, char *argv[]) // Now re-direct stdout and stderr so that they use the NX console driver. // Notes: (1) stdin is retained (file descriptor 0, probably the the serial // console). (2) Don't bother trying to put debug instrumentation in the - // following becaue it will end up in the NxConsole window. + // following becaue it will end up in the NxTerm window. (void)std::fflush(stdout); (void)std::fflush(stderr); @@ -524,27 +524,27 @@ errout: } /** - * This is the NxConsole task exit handler. It registered with on_exit() - * and called automatically when the nxconsole task exits. + * This is the NxTerm task exit handler. It registered with on_exit() + * and called automatically when the nxterm task exits. */ -void CNxConsole::exitHandler(int code, FAR void *arg) +void CNxTerm::exitHandler(int code, FAR void *arg) { - CNxConsole *This = (CNxConsole *)arg; + CNxTerm *This = (CNxTerm *)arg; - // If we got here because of the task_delete() call in CNxConsole::stop(), + // If we got here because of the task_delete() call in CNxTerm::stop(), // then m_pid will be set to -1 to let us know that we do not need to do // anything if (This->m_pid >= 0) { - // Set m_pid to -1 to prevent calling detlete_task() in CNxConsole::stop(). - // CNxConsole::stop() is called by the processing initiated by the following + // Set m_pid to -1 to prevent calling detlete_task() in CNxTerm::stop(). + // CNxTerm::stop() is called by the processing initiated by the following // call to CTaskbar::stopApplication() This->m_pid = -1; - // Remove the NxConsole application from the taskbar + // Remove the NxTerm application from the taskbar This->m_taskbar->stopApplication(This); } @@ -554,7 +554,7 @@ void CNxConsole::exitHandler(int code, FAR void *arg) * Called when the window minimize button is pressed. */ -void CNxConsole::minimize(void) +void CNxTerm::minimize(void) { m_taskbar->minimizeApplication(static_cast(this)); } @@ -563,30 +563,30 @@ void CNxConsole::minimize(void) * Called when the window close button is pressed. */ -void CNxConsole::close(void) +void CNxTerm::close(void) { m_taskbar->stopApplication(static_cast(this)); } /** - * CNxConsoleFactory Constructor + * CNxTermFactory Constructor * * @param taskbar. The taskbar instance used to terminate the console */ -CNxConsoleFactory::CNxConsoleFactory(CTaskbar *taskbar) +CNxTermFactory::CNxTermFactory(CTaskbar *taskbar) { m_taskbar = taskbar; } /** - * Create a new instance of an CNxConsole (as IApplication). + * Create a new instance of an CNxTerm (as IApplication). */ -IApplication *CNxConsoleFactory::create(void) +IApplication *CNxTermFactory::create(void) { // Call CTaskBar::openFullScreenWindow to create a full screen window for - // the NxConsole application + // the NxTerm application CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) @@ -607,15 +607,15 @@ IApplication *CNxConsoleFactory::create(void) // Instantiate the application, providing the window to the application's // constructor - CNxConsole *nxconsole = new CNxConsole(m_taskbar, window); - if (!nxconsole) + CNxTerm *nxterm = new CNxTerm(m_taskbar, window); + if (!nxterm) { - gdbg("ERROR: Failed to instantiate CNxConsole\n"); + gdbg("ERROR: Failed to instantiate CNxTerm\n"); delete window; return (IApplication *)0; } - return static_cast(nxconsole); + return static_cast(nxterm); } /** @@ -626,7 +626,7 @@ IApplication *CNxConsoleFactory::create(void) * be deleted by the caller when it is no long needed. */ -NXWidgets::IBitmap *CNxConsoleFactory::getIcon(void) +NXWidgets::IBitmap *CNxTermFactory::getIcon(void) { NXWidgets::CRlePaletteBitmap *bitmap = new NXWidgets::CRlePaletteBitmap(&CONFIG_NXWM_NXTERM_ICON); diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index a5c4fc711..1bc39aebd 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -56,7 +56,7 @@ ********************************************************************************************/ /******************************************************************************************** - * CNxConsole Method Implementations + * CNxTerm Method Implementations ********************************************************************************************/ using namespace NxWM; From 70db99420031968aeeb620b052ed8bc159edbf47 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 14:43:30 -0600 Subject: [PATCH 293/390] Update ChangeLog --- ChangeLog.txt | 3 ++ Kconfig | 44 ++++++++++++++-------------- README.txt | 2 +- TODO.txt | 4 +-- UnitTests/nxwm/nxwm_main.cxx | 32 ++++++++++---------- libnxwidgets/doc/mainpage.h | 2 +- libnxwidgets/include/cbgwindow.hxx | 14 ++++----- libnxwidgets/include/ccallback.hxx | 18 ++++++------ libnxwidgets/include/cnxtkwindow.hxx | 14 ++++----- libnxwidgets/include/cnxtoolbar.hxx | 14 ++++----- libnxwidgets/include/cnxwindow.hxx | 14 ++++----- libnxwidgets/include/inxwindow.hxx | 14 ++++----- libnxwidgets/include/nxconfig.hxx | 2 +- libnxwidgets/src/ccallback.cxx | 12 ++++---- 14 files changed, 96 insertions(+), 93 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index dbea761b3..c560d2183 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -533,3 +533,6 @@ lost (2014-7-30). 1.13 2014-xx-xx Gregory Nutt + +* Change all references to NxConsole to NxTerm. This introduces an + incompatibility with versions prior to NuttX-7.5 (2014-9-20). diff --git a/Kconfig b/Kconfig index f5b03e58f..89e7e222d 100644 --- a/Kconfig +++ b/Kconfig @@ -575,7 +575,7 @@ config NXWM_TOOLBAR_FONTID int "Toolbar Font ID" default 0 ---help--- - Use this default font ID in the NxConsole window instead of the + Use this default font ID in the NxTerm window instead of the NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 (maybe invalid) endif # NXWM_TOOLBAR_CUSTOM_FONTID @@ -675,55 +675,55 @@ config NXWM_STARTWINDOW_STACKSIZE endmenu # Start Window Configuration -menu "NxConsole Window Settings" +menu "NxTerm Window Settings" config NXWM_NXTERM - bool "NxConsole Window" + bool "NxTerm Window" default y ---help--- - Enable support for the NxConsole window which provides a text window + Enable support for the NxTerm window which provides a text window in which you can interact with NSH. if NXWM_NXTERM config NXWM_NXTERM_PRIO - int "NxConsole Task Priority" + int "NxTerm Task Priority" default 100 ---help--- - Priority of the NxConsole task. Default: 100. + Priority of the NxTerm task. Default: 100. NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else there may be data overrun errors. Such errors would most likely appear as duplicated rows of data on the display. config NXWM_NXTERM_STACKSIZE - int "NxConsole Task Stack Size" + int "NxTerm Task Stack Size" default 2048 ---help--- - The stack size to use when starting the NxConsole task. Default: + The stack size to use when starting the NxTerm task. Default: 2048 bytes. config NXWM_NXTERM_CUSTOM_COLORS - bool "Custom NxConsole Colors" + bool "Custom NxTerm Colors" default n ---help--- - Select custom default colors for the NxConsole window. If defined, - the hexadecimal values for all NxConsole colors must be provided + Select custom default colors for the NxTerm window. If defined, + the hexadecimal values for all NxTerm colors must be provided (there are no default colors because the hexadecimal representation of the default colors depend on the pixel depth). Default: n if NXWM_NXTERM_CUSTOM_COLORS config NXWM_NXTERM_WCOLOR - hex "NxConsole Background Color" + hex "NxTerm Background Color" ---help--- - The color of the NxConsole window background. Default: + The color of the NxTerm window background. Default: RGB(192,192,192) config NXWM_NXTERM_FONTCOLOR - hex "NxConsole Font Color" + hex "NxTerm Font Color" ---help--- - The color of the fonts to use in the NxConsole window. + The color of the fonts to use in the NxTerm window. Default: RGB(0,0,0) endif # NXWM_NXTERM_CUSTOM_COLORS @@ -737,31 +737,31 @@ config NXWM_NXTERM_CUSTOM_FONTID if NXWM_NXTERM_CUSTOM_FONTID config NXWM_NXTERM_FONTID - int "NxConsole Font ID" + int "NxTerm Font ID" default 0 ---help--- - Use this default font ID in the NxConsole window instead of the + Use this default font ID in the NxTerm window instead of the NxWM font ID (NXWM_DEFAULT_FONTID). Default: 0 endif # NXWM_NXTERM_CUSTOM_FONTID config NXWM_CUSTOM_NXTERM_ICON - bool "Custom NxConsole Icon" + bool "Custom NxTerm Icon" default n ---help--- - Select to override the default NxConsole Window Icon: NxWM::g_cmdBitmap + Select to override the default NxTerm Window Icon: NxWM::g_cmdBitmap if NXWM_CUSTOM_NXTERM_ICON config NXWM_NXTERM_ICON - string "NxConsole Icon" + string "NxTerm Icon" default "NxWM::g_cmdBitmap" ---help--- - The glyph to use as the NxConsole icon. Default: NxWM::g_cmdBitmap + The glyph to use as the NxTerm icon. Default: NxWM::g_cmdBitmap endif # NXWM_NXTERM_ICON endif # NXWM_NXTERM -endmenu # NxConsole Window Settings +endmenu # NxTerm Window Settings menu "NxWM Touchscreen Configuration" diff --git a/README.txt b/README.txt index 635bbbea6..98cd535cc 100644 --- a/README.txt +++ b/README.txt @@ -91,7 +91,7 @@ nxwm There is a base class that defines an add-on application and an interface that supports incorporation of new application. The only - application that is provided is NxConsole. This is an NSH session + application that is provided is NxTerm. This is an NSH session running in a window. You should be able to select the NX icon in the start menu and create as many NSH sessions in windows as you want. (keybard input still comes through serial). diff --git a/TODO.txt b/TODO.txt index 374c5b388..bafd7b708 100644 --- a/TODO.txt +++ b/TODO.txt @@ -27,7 +27,7 @@ NxWM ---- (4) General NxWMIssues - (0) NxConsole Issues + (0) NxTerm Issues (0) CHexCalculator Issues (3) CMediaPlayer Issues (1) Platform specific Issues @@ -83,7 +83,7 @@ o General NxWM Issues to be productized, this change should be done in order to reduce stack memory consumption. -o NxConsole Issues +o NxTerm Issues ---------------- o CHexCalculator Issues diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 379b03186..298724a51 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -52,7 +52,7 @@ #include "cstartwindow.hxx" #ifdef CONFIG_NXWM_NXTERM -# include "cnxconsole.hxx" +# include "cnxterm.hxx" #endif #include "chexcalculator.hxx" @@ -545,32 +545,32 @@ static bool createCalibration(void) #endif ///////////////////////////////////////////////////////////////////////////// -// Name: createNxConsole +// Name: createNxTerm ///////////////////////////////////////////////////////////////////////////// #ifdef CONFIG_NXWM_NXTERM -static bool createNxConsole(void) +static bool createNxTerm(void) { - // Add the NxConsole application to the start window + // Add the NxTerm application to the start window - printf("createNxConsole: Creating the NxConsole application\n"); - NxWM::CNxConsoleFactory *console = new NxWM::CNxConsoleFactory(g_nxwmtest.taskbar); + printf("createNxTerm: Creating the NxTerm application\n"); + NxWM::CNxTermFactory *console = new NxWM::CNxTermFactory(g_nxwmtest.taskbar); if (!console) { - printf("createNxConsole: ERROR: Failed to instantiate CNxConsoleFactory\n"); + printf("createNxTerm: ERROR: Failed to instantiate CNxTermFactory\n"); return false; } - showTestCaseMemory("createNxConsole: After creating the NxConsole application"); + showTestCaseMemory("createNxTerm: After creating the NxTerm application"); - printf("createNxConsole: Adding the NxConsole application to the start window\n"); + printf("createNxTerm: Adding the NxTerm application to the start window\n"); if (!g_nxwmtest.startwindow->addApplication(console)) { - printf("createNxConsole: ERROR: Failed to add CNxConsoleFactory to the start window\n"); + printf("createNxTerm: ERROR: Failed to add CNxTermFactory to the start window\n"); delete console; return false; } - showTestCaseMemory("createNxConsole: After adding the NxConsole application"); + showTestCaseMemory("createNxTerm: After adding the NxTerm application"); return true; } #endif @@ -734,12 +734,12 @@ int nxwm_main(int argc, char *argv[]) } #endif - // Create the NxConsole application and add it to the start window + // Create the NxTerm application and add it to the start window #ifdef CONFIG_NXWM_NXTERM - if (!createNxConsole()) + if (!createNxTerm()) { - printf("nxwm_main: ERROR: Failed to create the NxConsole application\n"); + printf("nxwm_main: ERROR: Failed to create the NxTerm application\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -832,14 +832,14 @@ int nxwm_main(int argc, char *argv[]) showTestCaseMemory("nxwm_main: After clicking the start window icon"); // Wait bit to see the result of the button press. Then press the first icon - // in the start menu. That should be the NxConsole icon (if the NXCONSOLE + // in the start menu. That should be the NxTerm icon (if the NxTerm // is not disabled). sleep(2); g_nxwmtest.startwindow->clickIcon(0, true); usleep(500*1000); g_nxwmtest.startwindow->clickIcon(0, false); - showTestCaseMemory("nxwm_main: After clicking the NxConsole icon"); + showTestCaseMemory("nxwm_main: After clicking the NxTerm icon"); #endif // Wait bit to see the result of the button press. diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index ccd399e6a..80168b028 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -70,7 +70,7 @@ * * There is a base class that defines an add-on application and an interface * that supports incorporation of new applications. The only application - * that is provided is NxConsole. This is an NSH session running in a window. + * that is provided is NxTerm. This is an NSH session running in a window. * You should be able to select the NX icon in the start menu and create as * many NSH sessions in windows as you want. (keybard input still comes * through serial). diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 57c0a1675..90113cfe9 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -209,21 +209,21 @@ namespace NXWidgets /** * Each window implementation also inherits from CCallback. CCallback, * by default, forwards NX keyboard input to the various widgets residing - * in the window. But NxConsole is a different usage model; In this case, - * keyboard input needs to be directed to the NxConsole character driver. + * 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 NxConsole + * keyboard input from the window widgets to the NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - inline void redirectNxConsole(NXCONSOLE handle) + inline void redirectNxTerm(NXTERM handle) { - setNxConsole(handle); + setNxTerm(handle); } #endif diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 8d96f0022..ef1d3f81d 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -50,7 +50,7 @@ #include #ifdef CONFIG_NXTERM_NXKBDIN -# include +# include #endif #include "crect.hxx" @@ -94,7 +94,7 @@ namespace NXWidgets CWidgetControl *m_widgetControl; /**< The widget control instance for this window */ struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ #ifdef CONFIG_NXTERM_NXKBDIN - NXCONSOLE m_nxconsole; /**< The NxConsole handle for redirection of keyboard input */ + NXTERM m_nxterm; /**< The NxTerm handle for redirection of keyboard input */ #endif // Methods in the callback vtable @@ -245,22 +245,22 @@ namespace NXWidgets /** * By default, NX keyboard input is given to the various widgets - * residing in the window. But NxConsole is a different usage model; - * In this case, keyboard input needs to be directed to the NxConsole + * 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 - * NxConsole + * NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - inline void setNxConsole(NXCONSOLE handle) + inline void setNxTerm(NXTERM handle) { - m_nxconsole = handle; + m_nxterm = handle; } #endif }; diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 5bf2a1a03..b20bc2a24 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -230,21 +230,21 @@ namespace NXWidgets /** * Each window implementation also inherits from CCallback. CCallback, * by default, forwards NX keyboard input to the various widgets residing - * in the window. But NxConsole is a different usage model; In this case, - * keyboard input needs to be directed to the NxConsole character driver. + * 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 NxConsole + * keyboard input from the window widgets to the NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - inline void redirectNxConsole(NXCONSOLE handle) + inline void redirectNxTerm(NXTERM handle) { - setNxConsole(handle); + setNxTerm(handle); } #endif diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index 7a8a783b2..fd635b206 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -199,21 +199,21 @@ namespace NXWidgets /** * Each window implementation also inherits from CCallback. CCallback, * by default, forwards NX keyboard input to the various widgets residing - * in the window. But NxConsole is a different usage model; In this case, - * keyboard input needs to be directed to the NxConsole character driver. + * 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 NxConsole + * keyboard input from the window widgets to the NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - inline void redirectNxConsole(NXCONSOLE handle) + inline void redirectNxTerm(NXTERM handle) { - setNxConsole(handle); + setNxTerm(handle); } #endif diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 525a0c851..98f89acc0 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -203,21 +203,21 @@ namespace NXWidgets /** * Each window implementation also inherits from CCallback. CCallback, * by default, forwards NX keyboard input to the various widgets residing - * in the window. But NxConsole is a different usage model; In this case, - * keyboard input needs to be directed to the NxConsole character driver. + * 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 NxConsole + * keyboard input from the window widgets to the NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - inline void redirectNxConsole(NXCONSOLE handle) + inline void redirectNxTerm(NXTERM handle) { - setNxConsole(handle); + setNxTerm(handle); } #endif diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 4aa2c519b..3e2f6c4a1 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -48,7 +48,7 @@ #include #ifdef CONFIG_NXTERM_NXKBDIN -# include +# include #endif /**************************************************************************** @@ -175,19 +175,19 @@ namespace NXWidgets /** * Each window implementation also inherits from CCallback. CCallback, * by default, forwards NX keyboard input to the various widgets residing - * in the window. But NxConsole is a different usage model; In this case, - * keyboard input needs to be directed to the NxConsole character driver. + * 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 NxConsole + * keyboard input from the window widgets to the NxTerm * - * @param handle. The NXCONSOLE handle. If non-NULL, NX keyboard - * input will be directed to the NxConsole driver using this + * @param 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. */ #ifdef CONFIG_NXTERM_NXKBDIN - virtual void redirectNxConsole(NXCONSOLE handle) = 0; + virtual void redirectNxTerm(NXTERM handle) = 0; #endif /** diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index f6c9ead90..6043811a6 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -184,7 +184,7 @@ # error "Only a single color plane is supported (CONFIG_NX_NPLANES)" #endif -/* NxConsole checks. This just simplifies the conditional compilation by +/* NxTerm checks. This just simplifies the conditional compilation by * reducing the AND of these three conditions to a single condition. */ diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index cec7ea1bf..46108acf3 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -45,7 +45,7 @@ #include #ifdef CONFIG_NXTERM_NXKBDIN -# include +# include #endif #include "cwidgetcontrol.hxx" @@ -88,7 +88,7 @@ CCallback::CCallback(CWidgetControl *widgetControl) // Keyboard input is initially direct to the widgets within the window #ifdef CONFIG_NXTERM_NXKBDIN - m_nxconsole = (NXCONSOLE)0; + m_nxterm = (NXTERM)0; #endif } @@ -206,15 +206,15 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, CCallback *This = (CCallback *)arg; // Is NX keyboard input being directed to the widgets within the window - // (default) OR is NX keyboard input being re-directed to an NxConsole + // (default) OR is NX keyboard input being re-directed to an NxTerm // driver? #ifdef CONFIG_NXTERM_NXKBDIN - if (This->m_nxconsole) + if (This->m_nxterm) { - // Keyboard input is going to an NxConsole + // Keyboard input is going to an NxTerm - nxcon_kbdin(This->m_nxconsole, str, nCh); + nxcon_kbdin(This->m_nxterm, str, nCh); } else #endif From 84ef986ae50d787d6c2e1be11ac5319996aea41b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 15:53:28 -0600 Subject: [PATCH 294/390] More naming changes to get the stm3240g-eval/nxterm configuration building again --- libnxwidgets/src/ccallback.cxx | 2 +- libnxwidgets/src/cnxserver.cxx | 2 +- nxwm/include/cnxterm.h | 2 +- nxwm/src/cnxterm.cxx | 92 +++++++++++++++++----------------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 46108acf3..77714d208 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -214,7 +214,7 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, { // Keyboard input is going to an NxTerm - nxcon_kbdin(This->m_nxterm, str, nCh); + nxterm_kbdin(This->m_nxterm, str, nCh); } else #endif diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index e87c0fdf6..d47fa74c1 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -393,7 +393,7 @@ int CNxServer::server(int argc, char *argv[]) ret = up_fbinitialize(); if (ret < 0) { - gdbg("nxcon_server: up_fbinitialize failed: %d\n", -ret); + gdbg("nxterm_server: up_fbinitialize failed: %d\n", -ret); return EXIT_FAILURE; } diff --git a/nxwm/include/cnxterm.h b/nxwm/include/cnxterm.h index c97e3b911..ab188f237 100644 --- a/nxwm/include/cnxterm.h +++ b/nxwm/include/cnxterm.h @@ -80,7 +80,7 @@ namespace NxWM private: CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ CApplicationWindow *m_window; /**< Reference to the application window */ - NXTERMi m_nxcon; /**< NxTerm handle */ + NXTERMi m_nxterm; /**< NxTerm handle */ pid_t m_pid; /**< Task ID of the NxTerm thread */ /** diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index a26009a4d..84fc69109 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -79,14 +79,14 @@ namespace NxWM struct SNxTerm { - FAR void *console; /**< The console 'this' pointer use with on_exit() */ - sem_t exclSem; /**< Sem that gives exclusive access to this structure */ - sem_t waitSem; /**< Sem that posted when the task is initialized */ - NXTKWINDOW hwnd; /**< Window handle */ - NXTERM nxcon; /**< NxTerm handle */ - int minor; /**< Next device minor number */ - struct nxcon_window_s wndo; /**< Describes the NxTerm window */ - bool result; /**< True if successfully initialized */ + FAR void *console; /**< The console 'this' pointer use with on_exit() */ + sem_t exclSem; /**< Sem that gives exclusive access to this structure */ + sem_t waitSem; /**< Sem that posted when the task is initialized */ + NXTKWINDOW hwnd; /**< Window handle */ + NXTERM nxterm; /**< NxTerm handle */ + int minor; /**< Next device minor number */ + struct nxterm_window_s wndo; /**< Describes the NxTerm window */ + bool result; /**< True if successfully initialized */ }; /******************************************************************************************** @@ -98,7 +98,7 @@ namespace NxWM * assure that the NxTerm is successfully started. */ - static struct SNxTerm g_nxconvars; + static struct SNxTerm g_nxtermvars; } /******************************************************************************************** @@ -127,7 +127,7 @@ CNxTerm::CNxTerm(CTaskbar *taskbar, CApplicationWindow *window) // The NxTerm is not runing m_pid = -1; - m_nxcon = 0; + m_nxterm = 0; // Add our personalized window label @@ -205,7 +205,7 @@ bool CNxTerm::run(void) { // Some sanity checking - if (m_pid >= 0 || m_nxcon != 0) + if (m_pid >= 0 || m_nxterm != 0) { gdbg("ERROR: All ready running or connected\n"); return false; @@ -213,7 +213,7 @@ bool CNxTerm::run(void) // Get exclusive access to the global data structure - if (sem_wait(&g_nxconvars.exclSem) != 0) + if (sem_wait(&g_nxtermvars.exclSem) != 0) { // This might fail if a signal is received while we are waiting. @@ -231,23 +231,23 @@ bool CNxTerm::run(void) // Get the window handle from the widget control - g_nxconvars.hwnd = control->getWindowHandle(); + g_nxtermvars.hwnd = control->getWindowHandle(); // Describe the NxTerm - g_nxconvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR; - g_nxconvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR; - g_nxconvars.wndo.fontid = CONFIG_NXWM_NXTERM_FONTID; + g_nxtermvars.wndo.wcolor[0] = CONFIG_NXWM_NXTERM_WCOLOR; + g_nxtermvars.wndo.fcolor[0] = CONFIG_NXWM_NXTERM_FONTCOLOR; + g_nxtermvars.wndo.fontid = CONFIG_NXWM_NXTERM_FONTID; // Get the size of the window - (void)window->getSize(&g_nxconvars.wndo.wsize); + (void)window->getSize(&g_nxtermvars.wndo.wsize); // Start the NxTerm task - g_nxconvars.console = (FAR void *)this; - g_nxconvars.result = false; - g_nxconvars.nxcon = 0; + g_nxtermvars.console = (FAR void *)this; + g_nxtermvars.result = false; + g_nxtermvars.nxterm = 0; sched_lock(); m_pid = task_create("NxTerm", CONFIG_NXWM_NXTERM_PRIO, @@ -270,20 +270,20 @@ bool CNxTerm::run(void) clock_gettime(CLOCK_REALTIME, &abstime); abstime.tv_sec += 2; - int ret = sem_timedwait(&g_nxconvars.waitSem, &abstime); + int ret = sem_timedwait(&g_nxtermvars.waitSem, &abstime); sched_unlock(); - if (ret == OK && g_nxconvars.result) + if (ret == OK && g_nxtermvars.result) { // Re-direct NX keyboard input to the new NxTerm driver - DEBUGASSERT(g_nxconvars.nxcon != 0); + DEBUGASSERT(g_nxtermvars.nxterm != 0); #ifdef CONFIG_NXTERM_NXKBDIN - window->redirectNxTerm(g_nxconvars.nxcon); + window->redirectNxTerm(g_nxtermvars.nxterm); #endif // Save the handle to use in the stop method - m_nxcon = g_nxconvars.nxcon; + m_nxterm = g_nxtermvars.nxterm; } else { @@ -296,7 +296,7 @@ bool CNxTerm::run(void) } } - sem_post(&g_nxconvars.exclSem); + sem_post(&g_nxtermvars.exclSem); return result; } @@ -327,7 +327,7 @@ void CNxTerm::stop(void) // Destroy the NX console device - if (m_nxcon) + if (m_nxterm) { // Re-store NX keyboard input routing @@ -338,8 +338,8 @@ void CNxTerm::stop(void) // Unregister the NxTerm driver - nxcon_unregister(m_nxcon); - m_nxcon = 0; + nxterm_unregister(m_nxterm); + m_nxterm = 0; } } @@ -398,7 +398,7 @@ void CNxTerm::redraw(void) rect.pt2.x = windowSize.w - 1; rect.pt2.y = windowSize.h - 1; - nxcon_redraw(m_nxcon, &rect, false); + nxterm_redraw(m_nxterm, &rect, false); } /** @@ -428,7 +428,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) // Set up an on_exit() event that will be called when this task exits - if (on_exit(exitHandler, g_nxconvars.console) != 0) + if (on_exit(exitHandler, g_nxtermvars.console) != 0) { gdbg("ERROR: on_exit failed\n"); goto errout; @@ -436,9 +436,9 @@ int CNxTerm::nxterm(int argc, char *argv[]) // Use the window handle to create the NX console - g_nxconvars.nxcon = nxtk_register(g_nxconvars.hwnd, &g_nxconvars.wndo, - g_nxconvars.minor); - if (!g_nxconvars.nxcon) + g_nxtermvars.nxterm = nxtk_register(g_nxtermvars.hwnd, &g_nxtermvars.wndo, + g_nxtermvars.minor); + if (!g_nxtermvars.nxterm) { gdbg("ERROR: Failed register the console device\n"); goto errout; @@ -447,11 +447,11 @@ int CNxTerm::nxterm(int argc, char *argv[]) // Construct the driver name using this minor number char devname[32]; - snprintf(devname, 32, "/dev/nxcon%d", g_nxconvars.minor); + snprintf(devname, 32, "/dev/nxterm%d", g_nxtermvars.minor); // Increment the minor number while it is protect by the semaphore - g_nxconvars.minor++; + g_nxtermvars.minor++; // Open the NxTerm driver @@ -463,7 +463,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) if (fd < 0) { gdbg("ERROR: Failed open the console device\n"); - goto errout_with_nxcon; + goto errout_with_nxterm; } // Now re-direct stdout and stderr so that they use the NX console driver. @@ -498,8 +498,8 @@ int CNxTerm::nxterm(int argc, char *argv[]) // Inform the parent thread that we successfully initialized - g_nxconvars.result = true; - sem_post(&g_nxconvars.waitSem); + g_nxtermvars.result = true; + sem_post(&g_nxtermvars.waitSem); // Run the NSH console @@ -513,13 +513,13 @@ int CNxTerm::nxterm(int argc, char *argv[]) return EXIT_SUCCESS; -errout_with_nxcon: - nxcon_unregister(g_nxconvars.nxcon); +errout_with_nxterm: + nxterm_unregister(g_nxtermvars.nxterm); errout: - g_nxconvars.nxcon = 0; - g_nxconvars.result = false; - sem_post(&g_nxconvars.waitSem); + g_nxtermvars.nxterm = 0; + g_nxtermvars.result = false; + sem_post(&g_nxtermvars.waitSem); return EXIT_FAILURE; } @@ -645,8 +645,8 @@ bool NxWM::nshlibInitialize(void) { // Initialize the global data structure - sem_init(&g_nxconvars.exclSem, 0, 1); - sem_init(&g_nxconvars.waitSem, 0, 0); + sem_init(&g_nxtermvars.exclSem, 0, 1); + sem_init(&g_nxtermvars.waitSem, 0, 0); // Initialize the NSH library From cc1a7498949c9fc4d2d88e8d06cce4e2a539cb2c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Sep 2014 16:19:06 -0600 Subject: [PATCH 295/390] Changes to get an NxWM configuration building correctly after all of the naming changes --- nxwm/include/{cnxterm.h => cnxterm.hxx} | 2 +- nxwm/src/cmediaplayer.cxx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename nxwm/include/{cnxterm.h => cnxterm.hxx} (99%) diff --git a/nxwm/include/cnxterm.h b/nxwm/include/cnxterm.hxx similarity index 99% rename from nxwm/include/cnxterm.h rename to nxwm/include/cnxterm.hxx index ab188f237..0b35f5449 100644 --- a/nxwm/include/cnxterm.h +++ b/nxwm/include/cnxterm.hxx @@ -80,7 +80,7 @@ namespace NxWM private: CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */ CApplicationWindow *m_window; /**< Reference to the application window */ - NXTERMi m_nxterm; /**< NxTerm handle */ + NXTERM m_nxterm; /**< NxTerm handle */ pid_t m_pid; /**< Task ID of the NxTerm thread */ /** diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 32c67c807..f173fb56f 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -461,6 +461,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) { int errcode = errno; dbg("ERROR: Could not stat file %s: %d\n", filePath, errcode); + UNUSED(errcode); // Make sure there is no previous file information From 0c64afce3547cb527c5d9c137b67d1ee44329aa5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 27 Sep 2014 09:53:57 -0600 Subject: [PATCH 296/390] Update ChangeLogs in preparation for the 7.5 release --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index c560d2183..4a574b807 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -532,7 +532,9 @@ functionality is there, but there are conditions were the keyboard gets lost (2014-7-30). -1.13 2014-xx-xx Gregory Nutt +1.13 2014-09-28 Gregory Nutt * Change all references to NxConsole to NxTerm. This introduces an incompatibility with versions prior to NuttX-7.5 (2014-9-20). + +1.14 2014-xx-xx Gregory Nutt From 05b7674b08aaf0ef5bf433003ff5be4a2b309785 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 27 Sep 2014 13:24:21 -0600 Subject: [PATCH 297/390] Update ReleaseNotes in preparation for the 7.5 release --- ReleaseNotes.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 7999c18c4..0c854fa46 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -449,3 +449,20 @@ Bugfixes: * NxWM::IApplicationFactory: Add a do-nothing, virtual destructor to eliminate a warning. * XWidgets::CNxWidget: Remove an unused bit field. + +NxWidgets-1.13 +============== + +The 14th release of the NxWidgets package was made on September 17, 2014. This +release depends on NuttX-7.5 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.12: + +* There are no new features in this release. This release simply updates + some naming that is necessary for NxWidgets to build successfully with + NuttX-7.5 and above. + +Bugfixes: + +* There are no new bug fixes in this release. From 38af1a529d80900335e5a9039b58d1e03fd8048a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 27 Sep 2014 14:11:12 -0600 Subject: [PATCH 298/390] Fix typos in release notes --- ReleaseNotes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 0c854fa46..fdd3736bf 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -453,11 +453,11 @@ Bugfixes: NxWidgets-1.13 ============== -The 14th release of the NxWidgets package was made on September 17, 2014. This +The 14th release of the NxWidgets package was made on September 28, 2014. This release depends on NuttX-7.5 or above and should not be used with older NuttX releases. -Additional new features and extended functionality in Version 1.12: +Additional new features and extended functionality in Version 1.13: * There are no new features in this release. This release simply updates some naming that is necessary for NxWidgets to build successfully with From b6c84f5b45487827eb14d3803da9c1747ebc42bc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 15:50:31 -0600 Subject: [PATCH 299/390] Fix files under NxWidgets to use the corrected syslog interfaces --- UnitTests/CButtonArray/cbuttonarray_main.cxx | 6 +-- UnitTests/CButtonArray/cbuttonarraytest.cxx | 8 ++-- UnitTests/CButtonArray/cbuttonarraytest.hxx | 9 ---- UnitTests/CCheckBox/ccheckbox_main.cxx | 25 +++++----- UnitTests/CCheckBox/ccheckboxtest.cxx | 12 ++--- UnitTests/CCheckBox/ccheckboxtest.hxx | 9 ---- UnitTests/CGlyphButton/cglyphbutton_main.cxx | 28 +++++------ UnitTests/CGlyphButton/cglyphbuttontest.cxx | 8 ++-- UnitTests/CGlyphButton/cglyphbuttontest.hxx | 9 ---- .../cglyphsliderhorizontal_main.cxx | 32 ++++++------- .../cglyphsliderhorizontaltest.cxx | 6 +-- .../cglyphsliderhorizontaltest.hxx | 9 ---- UnitTests/CImage/cimage_main.cxx | 30 ++++++------ UnitTests/CImage/cimagetest.cxx | 8 ++-- UnitTests/CImage/cimagetest.hxx | 9 ---- UnitTests/CKeypad/ckeypad_main.cxx | 6 +-- UnitTests/CKeypad/ckeypadtest.cxx | 12 ++--- UnitTests/CKeypad/ckeypadtest.hxx | 9 ---- .../clatchbuttonarray_main.cxx | 6 +-- .../clatchbuttonarraytest.cxx | 8 ++-- .../clatchbuttonarraytest.hxx | 9 ---- UnitTests/CListBox/clistbox_main.cxx | 48 +++++++++---------- UnitTests/CListBox/clistboxtest.cxx | 6 +-- UnitTests/CListBox/clistboxtest.hxx | 9 ---- UnitTests/CProgressBar/cprogressbar_main.cxx | 32 ++++++------- UnitTests/CProgressBar/cprogressbartest.cxx | 6 +-- UnitTests/CProgressBar/cprogressbartest.hxx | 9 ---- UnitTests/CRadioButton/cradiobutton_main.cxx | 30 ++++++------ UnitTests/CRadioButton/cradiobuttontest.cxx | 14 +++--- UnitTests/CRadioButton/cradiobuttontest.hxx | 9 ---- .../cscrollbarhorizontal_main.cxx | 32 ++++++------- .../cscrollbarhorizontaltest.cxx | 6 +-- .../cscrollbarhorizontaltest.hxx | 9 ---- .../cscrollbarvertical_main.cxx | 32 ++++++------- .../cscrollbarverticaltest.cxx | 6 +-- .../cscrollbarverticaltest.hxx | 9 ---- .../csliderhorizontal_main.cxx | 32 ++++++------- .../csliderhorizontaltest.cxx | 6 +-- .../csliderhorizontaltest.hxx | 9 ---- .../CSliderVertical/cslidervertical_main.cxx | 32 ++++++------- .../CSliderVertical/csliderverticaltest.cxx | 6 +-- .../CSliderVertical/csliderverticaltest.hxx | 9 ---- 42 files changed, 241 insertions(+), 368 deletions(-) diff --git a/UnitTests/CButtonArray/cbuttonarray_main.cxx b/UnitTests/CButtonArray/cbuttonarray_main.cxx index b9bb47a4b..b1a2cf41d 100644 --- a/UnitTests/CButtonArray/cbuttonarray_main.cxx +++ b/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -107,8 +107,8 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("%s: Before: %8d After: %8d Change: %8d\n", - msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -321,7 +321,7 @@ int cbuttonarray_main(int argc, char *argv[]) delete test; updateMemoryUsage(g_mmPrevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); - message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + printf("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); return 0; } diff --git a/UnitTests/CButtonArray/cbuttonarraytest.cxx b/UnitTests/CButtonArray/cbuttonarraytest.cxx index c1ad0e7a4..1b029e311 100644 --- a/UnitTests/CButtonArray/cbuttonarraytest.cxx +++ b/UnitTests/CButtonArray/cbuttonarraytest.cxx @@ -103,7 +103,7 @@ bool CButtonArrayTest::connect(void) if (!setBackgroundColor(CONFIG_CBUTTONARRAYTEST_BGCOLOR)) { - message("CButtonArrayTest::connect: setBackgroundColor failed\n"); + printf("CButtonArrayTest::connect: setBackgroundColor failed\n"); } } @@ -157,7 +157,7 @@ bool CButtonArrayTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -167,7 +167,7 @@ bool CButtonArrayTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CButtonArrayTest::createGraphics: Failed to open background window\n"); + printf("CButtonArrayTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -185,7 +185,7 @@ CButtonArray *CButtonArrayTest::createButtonArray(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CButtonArrayTest::createGraphics: Failed to get window size\n"); + printf("CButtonArrayTest::createGraphics: Failed to get window size\n"); return (CButtonArray *)NULL; } diff --git a/UnitTests/CButtonArray/cbuttonarraytest.hxx b/UnitTests/CButtonArray/cbuttonarraytest.hxx index 1dc794a48..1bcbd0767 100644 --- a/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -75,15 +75,6 @@ # define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - // The geometry of the button array #define BUTTONARRAY_NCOLUMNS 4 diff --git a/UnitTests/CCheckBox/ccheckbox_main.cxx b/UnitTests/CCheckBox/ccheckbox_main.cxx index e2c4bc148..b0a74fc14 100644 --- a/UnitTests/CCheckBox/ccheckbox_main.cxx +++ b/UnitTests/CCheckBox/ccheckbox_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int ccheckbox_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("ccheckbox_main: Create CCheckBoxTest instance\n"); + printf("ccheckbox_main: Create CCheckBoxTest instance\n"); CCheckBoxTest *test = new CCheckBoxTest(); updateMemoryUsage(g_mmprevious, "After creating CCheckBoxTest"); // Connect the NX server - message("ccheckbox_main: Connect the CCheckBoxTest instance to the NX server\n"); + printf("ccheckbox_main: Connect the CCheckBoxTest instance to the NX server\n"); if (!test->connect()) { - message("ccheckbox_main: Failed to connect the CCheckBoxTest instance to the NX server\n"); + printf("ccheckbox_main: Failed to connect the CCheckBoxTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int ccheckbox_main(int argc, char *argv[]) // Create a window to draw into - message("ccheckbox_main: Create a Window\n"); + printf("ccheckbox_main: Create a Window\n"); if (!test->createWindow()) { - message("ccheckbox_main: Failed to create a window\n"); + printf("ccheckbox_main: Failed to create a window\n"); delete test; return 1; } @@ -177,21 +177,21 @@ int ccheckbox_main(int argc, char *argv[]) // Now click the checkbox - message("ccheckbox_main: Click 1\n"); + printf("ccheckbox_main: Click 1\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 1"); usleep(500*1000); - message("ccheckbox_main: Click 2\n"); + printf("ccheckbox_main: Click 2\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 2"); usleep(500*1000); - message("ccheckbox_main: Click 3\n"); + printf("ccheckbox_main: Click 3\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); @@ -200,10 +200,9 @@ int ccheckbox_main(int argc, char *argv[]) // Clean up and exit - message("ccheckbox_main: Clean-up and exit\n"); + printf("ccheckbox_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); return 0; } - diff --git a/UnitTests/CCheckBox/ccheckboxtest.cxx b/UnitTests/CCheckBox/ccheckboxtest.cxx index e9ccc7628..0f8fb46ad 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.cxx +++ b/UnitTests/CCheckBox/ccheckboxtest.cxx @@ -108,7 +108,7 @@ bool CCheckBoxTest::connect(void) if (!setBackgroundColor(CONFIG_CCHECKBOXTEST_BGCOLOR)) { - message("CCheckBoxTest::connect: setBackgroundColor failed\n"); + printf("CCheckBoxTest::connect: setBackgroundColor failed\n"); } } @@ -172,7 +172,7 @@ bool CCheckBoxTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CCheckBoxTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CCheckBoxTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -182,7 +182,7 @@ bool CCheckBoxTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CCheckBoxTest::createWindow: Failed to open background window\n"); + printf("CCheckBoxTest::createWindow: Failed to open background window\n"); disconnect(); return false; } @@ -282,16 +282,16 @@ void CCheckBoxTest::showCheckBoxState(void) switch (state) { case CCheckBox::CHECK_BOX_STATE_OFF: // Checkbox is unticked - message("CCheckBoxTest::showCheckBoxState Checkbox is in the unticked state\n"); + printf("CCheckBoxTest::showCheckBoxState Checkbox is in the unticked state\n"); break; case CCheckBox::CHECK_BOX_STATE_ON: // Checkbox is ticked - message("CCheckBoxTest::showCheckBoxState Check is in the ticked state\n"); + printf("CCheckBoxTest::showCheckBoxState Check is in the ticked state\n"); break; default: case CCheckBox::CHECK_BOX_STATE_MU: // Checkbox is in the third state - message("CCheckBoxTest::showCheckBoxState Checkbox is in the 3rd state\n"); + printf("CCheckBoxTest::showCheckBoxState Checkbox is in the 3rd state\n"); break; } } diff --git a/UnitTests/CCheckBox/ccheckboxtest.hxx b/UnitTests/CCheckBox/ccheckboxtest.hxx index 58099acdf..338be4fb2 100644 --- a/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CGlyphButton/cglyphbutton_main.cxx b/UnitTests/CGlyphButton/cglyphbutton_main.cxx index 9cf8a73f5..fb25c2172 100644 --- a/UnitTests/CGlyphButton/cglyphbutton_main.cxx +++ b/UnitTests/CGlyphButton/cglyphbutton_main.cxx @@ -97,9 +97,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -142,16 +142,16 @@ int cglyphbutton_main(int argc, char *argv[]) // Create an instance of the font test - message("cglyphbutton_main: Create CGlyphButtonTest instance\n"); + printf("cglyphbutton_main: Create CGlyphButtonTest instance\n"); CGlyphButtonTest *test = new CGlyphButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CGlyphButtonTest"); // Connect the NX server - message("cglyphbutton_main: Connect the CGlyphButtonTest instance to the NX server\n"); + printf("cglyphbutton_main: Connect the CGlyphButtonTest instance to the NX server\n"); if (!test->connect()) { - message("cglyphbutton_main: Failed to connect the CGlyphButtonTest instance to the NX server\n"); + printf("cglyphbutton_main: Failed to connect the CGlyphButtonTest instance to the NX server\n"); delete test; return 1; } @@ -159,10 +159,10 @@ int cglyphbutton_main(int argc, char *argv[]) // Create a window to draw into - message("cglyphbutton_main: Create a Window\n"); + printf("cglyphbutton_main: Create a Window\n"); if (!test->createWindow()) { - message("cglyphbutton_main: Failed to create a window\n"); + printf("cglyphbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -173,7 +173,7 @@ int cglyphbutton_main(int argc, char *argv[]) CGlyphButton *button = test->createButton(&g_arrowDown, &g_arrowUp); if (!button) { - message("cglyphbutton_main: Failed to create a button\n"); + printf("cglyphbutton_main: Failed to create a button\n"); delete test; return 1; } @@ -181,21 +181,21 @@ int cglyphbutton_main(int argc, char *argv[]) // Show the button - message("cglyphbutton_main: Show the button\n"); + printf("cglyphbutton_main: Show the button\n"); test->showButton(button); updateMemoryUsage(g_mmprevious, "After showing the glyph button"); // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - message("cglyphbutton_main: Click the button\n"); + printf("cglyphbutton_main: Click the button\n"); test->click(); updateMemoryUsage(g_mmprevious, "After clicking glyph button"); // Poll for the mouse click event (of course this can hang if something fails) bool clicked = test->poll(button); - message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); + printf("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a second, then release the mouse buttone @@ -206,7 +206,7 @@ int cglyphbutton_main(int argc, char *argv[]) // Poll for the mouse release event (of course this can hang if something fails) clicked = test->poll(button); - message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); + printf("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a few more seconds so that the tester can ponder the result @@ -214,7 +214,7 @@ int cglyphbutton_main(int argc, char *argv[]) // Clean up and exit - message("cglyphbutton_main: Clean-up and exit\n"); + printf("cglyphbutton_main: Clean-up and exit\n"); delete button; updateMemoryUsage(g_mmprevious, "After deleting the glyph button"); delete test; diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.cxx b/UnitTests/CGlyphButton/cglyphbuttontest.cxx index 801da7289..61bea46fa 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.cxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.cxx @@ -105,7 +105,7 @@ bool CGlyphButtonTest::connect(void) if (!setBackgroundColor(CONFIG_CGLYPHBUTTONTEST_BGCOLOR)) { - message("CGlyphButtonTest::connect: setBackgroundColor failed\n"); + printf("CGlyphButtonTest::connect: setBackgroundColor failed\n"); } } @@ -159,7 +159,7 @@ bool CGlyphButtonTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CGlyphButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CGlyphButtonTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -169,7 +169,7 @@ bool CGlyphButtonTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CGlyphButtonTest::createGraphics: Failed to open background window\n"); + printf("CGlyphButtonTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -188,7 +188,7 @@ CGlyphButton *CGlyphButtonTest::createButton(FAR const struct SBitmap *clickGlyp struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CGlyphButtonTest::createGraphics: Failed to get window size\n"); + printf("CGlyphButtonTest::createGraphics: Failed to get window size\n"); return (CGlyphButton *)NULL; } diff --git a/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/UnitTests/CGlyphButton/cglyphbuttontest.hxx index 2c21d4cb1..a2751461e 100644 --- a/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -76,15 +76,6 @@ # define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - // Helper macros #ifndef MAX diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx index 24450fcfd..22dceb5da 100644 --- a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("csliderhorizontal_main: Create CGlyphSliderHorizontalTest instance\n"); + printf("csliderhorizontal_main: Create CGlyphSliderHorizontalTest instance\n"); CGlyphSliderHorizontalTest *test = new CGlyphSliderHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CGlyphSliderHorizontalTest"); // Connect the NX server - message("csliderhorizontal_main: Connect the CGlyphSliderHorizontalTest instance to the NX server\n"); + printf("csliderhorizontal_main: Connect the CGlyphSliderHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message("csliderhorizontal_main: Failed to connect the CGlyphSliderHorizontalTest instance to the NX server\n"); + printf("csliderhorizontal_main: Failed to connect the CGlyphSliderHorizontalTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) // Create a window to draw into - message("csliderhorizontal_main: Create a Window\n"); + printf("csliderhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message("csliderhorizontal_main: Failed to create a window\n"); + printf("csliderhorizontal_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) // Create a slider - message("csliderhorizontal_main: Create a Slider\n"); + printf("csliderhorizontal_main: Create a Slider\n"); CGlyphSliderHorizontal *slider = test->createSlider(); if (!slider) { - message("csliderhorizontal_main: Failed to create a slider\n"); + printf("csliderhorizontal_main: Failed to create a slider\n"); delete test; return 1; } @@ -187,9 +187,9 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", - slider->getMinimumValue(), slider->getMaximumValue(), - slider->getValue()); + printf("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); // Show the initial state of the checkbox @@ -201,7 +201,7 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + printf("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000 * 50); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider up"); @@ -212,7 +212,7 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + printf("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000 * 50); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider down"); @@ -220,7 +220,7 @@ int cglyphsliderhorizontal_main(int argc, char *argv[]) // Clean up and exit - message("csliderhorizontal_main: Clean-up and exit\n"); + printf("csliderhorizontal_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx index 28f47af36..aaee77d8f 100644 --- a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx @@ -151,7 +151,7 @@ bool CGlyphSliderHorizontalTest::connect(void) if (!setBackgroundColor(CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR)) { - message("CGlyphSliderHorizontalTest::connect: setBackgroundColor failed\n"); + printf("CGlyphSliderHorizontalTest::connect: setBackgroundColor failed\n"); } } @@ -207,7 +207,7 @@ bool CGlyphSliderHorizontalTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CGlyphSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CGlyphSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -217,7 +217,7 @@ bool CGlyphSliderHorizontalTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CGlyphSliderHorizontalTest::createWindow: Failed to open background window\n"); + printf("CGlyphSliderHorizontalTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx index 3311abe50..fa491720c 100644 --- a/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx +++ b/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CGLYPHSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CImage/cimage_main.cxx b/UnitTests/CImage/cimage_main.cxx index 74bfd767f..b4d6fce65 100644 --- a/UnitTests/CImage/cimage_main.cxx +++ b/UnitTests/CImage/cimage_main.cxx @@ -86,13 +86,13 @@ extern "C" int cimage_main(int argc, char *argv[]); static void showMemoryUsage(FAR struct mallinfo *mmbefore, FAR struct mallinfo *mmafter) { - message("VARIABLE BEFORE AFTER\n"); - message("======== ======== ========\n"); - message("arena %8d %8d\n", mmbefore->arena, mmafter->arena); - message("ordblks %8d %8d\n", mmbefore->ordblks, mmafter->ordblks); - message("mxordblk %8d %8d\n", mmbefore->mxordblk, mmafter->mxordblk); - message("uordblks %8d %8d\n", mmbefore->uordblks, mmafter->uordblks); - message("fordblks %8d %8d\n", mmbefore->fordblks, mmafter->fordblks); + printf("VARIABLE BEFORE AFTER\n"); + printf("======== ======== ========\n"); + printf("arena %8d %8d\n", mmbefore->arena, mmafter->arena); + printf("ordblks %8d %8d\n", mmbefore->ordblks, mmafter->ordblks); + printf("mxordblk %8d %8d\n", mmbefore->mxordblk, mmafter->mxordblk); + printf("uordblks %8d %8d\n", mmbefore->uordblks, mmafter->uordblks); + printf("fordblks %8d %8d\n", mmbefore->fordblks, mmafter->fordblks); } ///////////////////////////////////////////////////////////////////////////// @@ -114,7 +114,7 @@ static void updateMemoryUsage(FAR struct mallinfo *previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); + printf("\n%s:\n", msg); showMemoryUsage(previous, &mmcurrent); /* Set up for the next test */ @@ -157,16 +157,16 @@ int cimage_main(int argc, char *argv[]) // Create an instance of the font test - message("cimage_main: Create CImageTest instance\n"); + printf("cimage_main: Create CImageTest instance\n"); CImageTest *test = new CImageTest(); updateMemoryUsage(&g_mmprevious, "After creating CImageTest"); // Connect the NX server - message("cimage_main: Connect the CImageTest instance to the NX server\n"); + printf("cimage_main: Connect the CImageTest instance to the NX server\n"); if (!test->connect()) { - message("cimage_main: Failed to connect the CImageTest instance to the NX server\n"); + printf("cimage_main: Failed to connect the CImageTest instance to the NX server\n"); delete test; return 1; } @@ -174,10 +174,10 @@ int cimage_main(int argc, char *argv[]) // Create a window to draw into - message("cimage_main: Create a Window\n"); + printf("cimage_main: Create a Window\n"); if (!test->createWindow()) { - message("cimage_main: Failed to create a window\n"); + printf("cimage_main: Failed to create a window\n"); delete test; return 1; } @@ -193,7 +193,7 @@ int cimage_main(int argc, char *argv[]) CImage *image = test->createImage(static_cast(nuttxBitmap)); if (!image) { - message("cimage_main: Failed to create a image\n"); + printf("cimage_main: Failed to create a image\n"); delete test; return 1; } @@ -207,7 +207,7 @@ int cimage_main(int argc, char *argv[]) // Clean up and exit - message("cimage_main: Clean-up and exit\n"); + printf("cimage_main: Clean-up and exit\n"); delete image; updateMemoryUsage(&g_mmprevious, "After deleting CImage"); diff --git a/UnitTests/CImage/cimagetest.cxx b/UnitTests/CImage/cimagetest.cxx index 48814c4ce..c141b4fa5 100644 --- a/UnitTests/CImage/cimagetest.cxx +++ b/UnitTests/CImage/cimagetest.cxx @@ -104,7 +104,7 @@ bool CImageTest::connect(void) if (!setBackgroundColor(CONFIG_CIMAGETEST_BGCOLOR)) { - message("CImageTest::connect: setBackgroundColor failed\n"); + printf("CImageTest::connect: setBackgroundColor failed\n"); } } @@ -158,7 +158,7 @@ bool CImageTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CImageTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CImageTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -168,7 +168,7 @@ bool CImageTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CImageTest::createGraphics: Failed to open background window\n"); + printf("CImageTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -186,7 +186,7 @@ CImage *CImageTest::createImage(IBitmap *bitmap) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CImageTest::createGraphics: Failed to get window size\n"); + printf("CImageTest::createGraphics: Failed to get window size\n"); return (CImage *)NULL; } diff --git a/UnitTests/CImage/cimagetest.hxx b/UnitTests/CImage/cimagetest.hxx index 5b5901bb1..6bef55e4c 100644 --- a/UnitTests/CImage/cimagetest.hxx +++ b/UnitTests/CImage/cimagetest.hxx @@ -71,15 +71,6 @@ # define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CKeypad/ckeypad_main.cxx b/UnitTests/CKeypad/ckeypad_main.cxx index c103da9ed..0056a8feb 100644 --- a/UnitTests/CKeypad/ckeypad_main.cxx +++ b/UnitTests/CKeypad/ckeypad_main.cxx @@ -97,8 +97,8 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("%s: Before: %8d After: %8d Change: %8d\n", - msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -268,7 +268,7 @@ int ckeypad_main(int argc, char *argv[]) delete test; updateMemoryUsage(g_mmPrevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); - message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + printf("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); return 0; } diff --git a/UnitTests/CKeypad/ckeypadtest.cxx b/UnitTests/CKeypad/ckeypadtest.cxx index 62e01a93c..f6a1ca5e3 100644 --- a/UnitTests/CKeypad/ckeypadtest.cxx +++ b/UnitTests/CKeypad/ckeypadtest.cxx @@ -109,7 +109,7 @@ bool CKeypadTest::connect(void) if (!setBackgroundColor(CONFIG_CKEYPADTEST_BGCOLOR)) { - message("CKeypadTest::connect: setBackgroundColor failed\n"); + printf("CKeypadTest::connect: setBackgroundColor failed\n"); } } @@ -170,7 +170,7 @@ bool CKeypadTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CKeypadTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CKeypadTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -180,7 +180,7 @@ bool CKeypadTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CKeypadTest::createGraphics: Failed to open background window\n"); + printf("CKeypadTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -201,7 +201,7 @@ void CKeypadTest::setDisplaySize(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CKeypadTest::createGraphics: Failed to get window size\n"); + printf("CKeypadTest::createGraphics: Failed to get window size\n"); return; } @@ -248,7 +248,7 @@ CKeypad *CKeypadTest::createKeypad(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CKeypadTest::createGraphics: Failed to get window size\n"); + printf("CKeypadTest::createGraphics: Failed to get window size\n"); return (CKeypad *)NULL; } @@ -308,7 +308,7 @@ CTextBox *CKeypadTest::createTextBox(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CKeypadTest::createGraphics: Failed to get window size\n"); + printf("CKeypadTest::createGraphics: Failed to get window size\n"); return (CTextBox *)NULL; } diff --git a/UnitTests/CKeypad/ckeypadtest.hxx b/UnitTests/CKeypad/ckeypadtest.hxx index 12d7e18fa..200f40a1b 100644 --- a/UnitTests/CKeypad/ckeypadtest.hxx +++ b/UnitTests/CKeypad/ckeypadtest.hxx @@ -72,15 +72,6 @@ # define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - // This is the size of the keypad #define KEYPAD_NROWS 7 diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index 1b038412c..7b935a49c 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -133,8 +133,8 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("%s: Before: %8d After: %8d Change: %8d\n", - msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -295,7 +295,7 @@ int clatchbuttonarray_main(int argc, char *argv[]) delete test; updateMemoryUsage(g_mmPrevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); - message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + printf("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); return 0; } diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx index cf41c1608..0629bfdcc 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx @@ -103,7 +103,7 @@ bool CLatchButtonArrayTest::connect(void) if (!setBackgroundColor(CONFIG_CLATCHBUTTONARRAYTEST_BGCOLOR)) { - message("CLatchButtonArrayTest::connect: setBackgroundColor failed\n"); + printf("CLatchButtonArrayTest::connect: setBackgroundColor failed\n"); } } @@ -157,7 +157,7 @@ bool CLatchButtonArrayTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CLatchButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CLatchButtonArrayTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -167,7 +167,7 @@ bool CLatchButtonArrayTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CLatchButtonArrayTest::createGraphics: Failed to open background window\n"); + printf("CLatchButtonArrayTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -185,7 +185,7 @@ CLatchButtonArray *CLatchButtonArrayTest::createButtonArray(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CLatchButtonArrayTest::createGraphics: Failed to get window size\n"); + printf("CLatchButtonArrayTest::createGraphics: Failed to get window size\n"); return (CLatchButtonArray *)NULL; } diff --git a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index 80bf8fb71..43b5a7964 100644 --- a/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -75,15 +75,6 @@ # define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - // The geometry of the button array #define BUTTONARRAY_NCOLUMNS 4 diff --git a/UnitTests/CListBox/clistbox_main.cxx b/UnitTests/CListBox/clistbox_main.cxx index 5bbcb1da5..09938e0a2 100644 --- a/UnitTests/CListBox/clistbox_main.cxx +++ b/UnitTests/CListBox/clistbox_main.cxx @@ -133,8 +133,8 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("%s: Before: %8d After: %8d Change: %8d\n", - msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("%s: Before: %8d After: %8d Change: %8d\n", + msg, previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -182,16 +182,16 @@ int clistbox_main(int argc, char *argv[]) // Create an instance of the listbox test - message("clistbox_main: Create CListBoxTest instance\n"); + printf("clistbox_main: Create CListBoxTest instance\n"); CListBoxTest *test = new CListBoxTest(); updateMemoryUsage(g_mmPrevious, "After creating CListBoxTest"); // Connect the NX server - message("clistbox_main: Connect the CListBoxTest instance to the NX server\n"); + printf("clistbox_main: Connect the CListBoxTest instance to the NX server\n"); if (!test->connect()) { - message("clistbox_main: Failed to connect the CListBoxTest instance to the NX server\n"); + printf("clistbox_main: Failed to connect the CListBoxTest instance to the NX server\n"); delete test; return 1; } @@ -199,10 +199,10 @@ int clistbox_main(int argc, char *argv[]) // Create a window to draw into - message("clistbox_main: Create a Window\n"); + printf("clistbox_main: Create a Window\n"); if (!test->createWindow()) { - message("clistbox_main: Failed to create a window\n"); + printf("clistbox_main: Failed to create a window\n"); delete test; return 1; } @@ -210,11 +210,11 @@ int clistbox_main(int argc, char *argv[]) // Create a listbox - message("clistbox_main: Create a ListBox\n"); + printf("clistbox_main: Create a ListBox\n"); CListBox *listbox = test->createListBox(); if (!listbox) { - message("clistbox_main: Failed to create a listbox\n"); + printf("clistbox_main: Failed to create a listbox\n"); delete test; return 1; } @@ -228,12 +228,12 @@ int clistbox_main(int argc, char *argv[]) // Now add items to the list box (in reverse alphabetical order) - message("clistbox_main: Add options to the ListBox\n"); + printf("clistbox_main: Add options to the ListBox\n"); for (int i = NOPTIONS - 1; i >= 0; i--) { listbox->addOption(g_options[i],i); test->showListBox(listbox); - message("clistbox_main: %d. New option %s\n", i, g_options[i]); + printf("clistbox_main: %d. New option %s\n", i, g_options[i]); usleep(500000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmPrevious, "clistbox_main: After adding the listbox items"); @@ -241,7 +241,7 @@ int clistbox_main(int argc, char *argv[]) // Sort the list box - message("clistbox_main: Sort the ListBox\n"); + printf("clistbox_main: Sort the ListBox\n"); listbox->sort(); test->showListBox(listbox); updateMemoryUsage(g_mmPrevious, "clistbox_main: After sorting the listbox"); @@ -253,16 +253,16 @@ int clistbox_main(int argc, char *argv[]) int nOptions; while ((nOptions = listbox->getOptionCount()) > 0) { - message("clistbox_main: Option count: %d\n", nOptions); + printf("clistbox_main: Option count: %d\n", nOptions); if (nOptions <= 5) { - message("clistbox_main: Selecting all remaining options\n"); + printf("clistbox_main: Selecting all remaining options\n"); listbox->selectAllOptions(); test->showListBox(listbox); updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting all options"); sleep(1); - message("clistbox_main: Removing all remaining options\n"); + printf("clistbox_main: Removing all remaining options\n"); listbox->removeAllOptions(); updateMemoryUsage(g_mmPrevious, "clistbox_main: After removing all options"); test->showListBox(listbox); @@ -271,37 +271,37 @@ int clistbox_main(int argc, char *argv[]) { int selected[5]; - message("clistbox_main: Selecting five options\n"); + printf("clistbox_main: Selecting five options\n"); for (int i = 0; i < 5; i++) { selected[i] = ((nOptions - 1) * rand()) / MAX_RAND; - message("clistbox_main: Selecting option %d\n", selected[i]); + printf("clistbox_main: Selecting option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); } updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting five options"); - message("clistbox_main: De-selecting options\n"); + printf("clistbox_main: De-selecting options\n"); int index; int count = 0; while ((index = listbox->getSelectedIndex()) >= 0) { - message("clistbox_main: De-selecting option %d\n", index); + printf("clistbox_main: De-selecting option %d\n", index); listbox->deselectOption(index); test->showListBox(listbox); count++; usleep(500000); } - message("clistbox_main: %s: %d options de-selected\n", + printf("clistbox_main: %s: %d options de-selected\n", count == 5 ? "OK" : "ERROR", count); updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options"); - message("clistbox_main: Removing the selected options\n"); + printf("clistbox_main: Removing the selected options\n"); for (int i = 0; i < 5; i++) { - message("clistbox_main: Removing option %d\n", selected[i]); + printf("clistbox_main: Removing option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); @@ -315,13 +315,13 @@ int clistbox_main(int argc, char *argv[]) // Clean up and exit - message("clistbox_main: Clean-up and exit\n"); + printf("clistbox_main: Clean-up and exit\n"); delete listbox; updateMemoryUsage(g_mmPrevious, "After deleting the listbox"); delete test; updateMemoryUsage(g_mmPrevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); - message("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); + printf("Peak memory usage: %8d\n", g_mmPeak - g_mmInitial); return 0; } diff --git a/UnitTests/CListBox/clistboxtest.cxx b/UnitTests/CListBox/clistboxtest.cxx index cd41dacc7..92c784573 100644 --- a/UnitTests/CListBox/clistboxtest.cxx +++ b/UnitTests/CListBox/clistboxtest.cxx @@ -105,7 +105,7 @@ bool CListBoxTest::connect(void) if (!setBackgroundColor(CONFIG_CLISTBOXTEST_BGCOLOR)) { - message("CListBoxTest::connect: setBackgroundColor failed\n"); + printf("CListBoxTest::connect: setBackgroundColor failed\n"); } } @@ -161,7 +161,7 @@ bool CListBoxTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CListBoxTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CListBoxTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -171,7 +171,7 @@ bool CListBoxTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CListBoxTest::createWindow: Failed to open background window\n"); + printf("CListBoxTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CListBox/clistboxtest.hxx b/UnitTests/CListBox/clistboxtest.hxx index dfe179503..d7c51421b 100644 --- a/UnitTests/CListBox/clistboxtest.hxx +++ b/UnitTests/CListBox/clistboxtest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CProgressBar/cprogressbar_main.cxx b/UnitTests/CProgressBar/cprogressbar_main.cxx index 4343d887c..746866ee5 100644 --- a/UnitTests/CProgressBar/cprogressbar_main.cxx +++ b/UnitTests/CProgressBar/cprogressbar_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cprogressbar_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("cprogressbar_main: Create CProgressBarTest instance\n"); + printf("cprogressbar_main: Create CProgressBarTest instance\n"); CProgressBarTest *test = new CProgressBarTest(); updateMemoryUsage(g_mmprevious, "After creating CProgressBarTest"); // Connect the NX server - message("cprogressbar_main: Connect the CProgressBarTest instance to the NX server\n"); + printf("cprogressbar_main: Connect the CProgressBarTest instance to the NX server\n"); if (!test->connect()) { - message("cprogressbar_main: Failed to connect the CProgressBarTest instance to the NX server\n"); + printf("cprogressbar_main: Failed to connect the CProgressBarTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cprogressbar_main(int argc, char *argv[]) // Create a window to draw into - message("cprogressbar_main: Create a Window\n"); + printf("cprogressbar_main: Create a Window\n"); if (!test->createWindow()) { - message("cprogressbar_main: Failed to create a window\n"); + printf("cprogressbar_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int cprogressbar_main(int argc, char *argv[]) // Create a progress bar - message("cprogressbar_main: Create a ProgressBar\n"); + printf("cprogressbar_main: Create a ProgressBar\n"); CProgressBar *bar = test->createProgressBar(); if (!bar) { - message("cprogressbar_main: Failed to create a progress bar\n"); + printf("cprogressbar_main: Failed to create a progress bar\n"); delete test; return 1; } @@ -187,9 +187,9 @@ int cprogressbar_main(int argc, char *argv[]) bar->setMaximumValue(MAX_PROGRESSBAR); bar->setValue(0); bar->hidePercentageText(); - message("cprogressbar_main: ProgressBar range %d->%d Initial value %d\n", - bar->getMinimumValue(), bar->getMaximumValue(), - bar->getValue()); + printf("cprogressbar_main: ProgressBar range %d->%d Initial value %d\n", + bar->getMinimumValue(), bar->getMaximumValue(), + bar->getValue()); // Show the initial state of the checkbox @@ -202,7 +202,7 @@ int cprogressbar_main(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); + printf("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #1"); @@ -219,7 +219,7 @@ int cprogressbar_main(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); + printf("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #2"); @@ -227,7 +227,7 @@ int cprogressbar_main(int argc, char *argv[]) // Clean up and exit - message("cprogressbar_main: Clean-up and exit\n"); + printf("cprogressbar_main: Clean-up and exit\n"); delete bar; updateMemoryUsage(g_mmprevious, "After deleting the progress bar"); delete test; diff --git a/UnitTests/CProgressBar/cprogressbartest.cxx b/UnitTests/CProgressBar/cprogressbartest.cxx index 60821d751..2e1108fd9 100644 --- a/UnitTests/CProgressBar/cprogressbartest.cxx +++ b/UnitTests/CProgressBar/cprogressbartest.cxx @@ -105,7 +105,7 @@ bool CProgressBarTest::connect(void) if (!setBackgroundColor(CONFIG_CPROGRESSBARTEST_BGCOLOR)) { - message("CProgressBarTest::connect: setBackgroundColor failed\n"); + printf("CProgressBarTest::connect: setBackgroundColor failed\n"); } } @@ -161,7 +161,7 @@ bool CProgressBarTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CProgressBarTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CProgressBarTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -171,7 +171,7 @@ bool CProgressBarTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CProgressBarTest::createWindow: Failed to open background window\n"); + printf("CProgressBarTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CProgressBar/cprogressbartest.hxx b/UnitTests/CProgressBar/cprogressbartest.hxx index 2223d8081..3d1f3c527 100644 --- a/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/UnitTests/CProgressBar/cprogressbartest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CRadioButton/cradiobutton_main.cxx b/UnitTests/CRadioButton/cradiobutton_main.cxx index f2dc30844..bbb400404 100644 --- a/UnitTests/CRadioButton/cradiobutton_main.cxx +++ b/UnitTests/CRadioButton/cradiobutton_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cradiobutton_main(int argc, char *argv[]) // Create an instance of the radio button test - message("cradiobutton_main: Create CRadioButtonTest instance\n"); + printf("cradiobutton_main: Create CRadioButtonTest instance\n"); CRadioButtonTest *test = new CRadioButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CRadioButtonTest"); // Connect the NX server - message("cradiobutton_main: Connect the CRadioButtonTest instance to the NX server\n"); + printf("cradiobutton_main: Connect the CRadioButtonTest instance to the NX server\n"); if (!test->connect()) { - message("cradiobutton_main: Failed to connect the CRadioButtonTest instance to the NX server\n"); + printf("cradiobutton_main: Failed to connect the CRadioButtonTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cradiobutton_main(int argc, char *argv[]) // Create a window to draw into - message("cradiobutton_main: Create a Window\n"); + printf("cradiobutton_main: Create a Window\n"); if (!test->createWindow()) { - message("cradiobutton_main: Failed to create a window\n"); + printf("cradiobutton_main: Failed to create a window\n"); delete test; return 1; } @@ -174,7 +174,7 @@ int cradiobutton_main(int argc, char *argv[]) CRadioButton *button1 = test->newRadioButton(); if (!button1) { - message("cradiobutton_main: Failed to create radio button 1\n"); + printf("cradiobutton_main: Failed to create radio button 1\n"); delete test; return 1; } @@ -183,7 +183,7 @@ int cradiobutton_main(int argc, char *argv[]) CRadioButton *button2 = test->newRadioButton(); if (!button2) { - message("cradiobutton_main: Failed to create radio button 2\n"); + printf("cradiobutton_main: Failed to create radio button 2\n"); delete test; return 1; } @@ -192,7 +192,7 @@ int cradiobutton_main(int argc, char *argv[]) CRadioButton *button3 = test->newRadioButton(); if (!button3) { - message("cradiobutton_main: Failed to create radio button 3\n"); + printf("cradiobutton_main: Failed to create radio button 3\n"); delete test; return 1; } @@ -206,21 +206,21 @@ int cradiobutton_main(int argc, char *argv[]) // Now push some buttons - message("cradiobutton_main: Pushing button 1\n"); + printf("cradiobutton_main: Pushing button 1\n"); test->pushButton(button1); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 1"); usleep(500*1000); - message("cradiobutton_main: Pushing button 2\n"); + printf("cradiobutton_main: Pushing button 2\n"); test->pushButton(button2); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 2"); usleep(500*1000); - message("cradiobutton_main: Pushing button 3\n"); + printf("cradiobutton_main: Pushing button 3\n"); test->pushButton(button3); usleep(500*1000); test->showButtonState(); @@ -229,7 +229,7 @@ int cradiobutton_main(int argc, char *argv[]) // Clean up and exit - message("cradiobutton_main: Clean-up and exit\n"); + printf("cradiobutton_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); diff --git a/UnitTests/CRadioButton/cradiobuttontest.cxx b/UnitTests/CRadioButton/cradiobuttontest.cxx index 5c1d2966e..bfcdd1c9f 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.cxx +++ b/UnitTests/CRadioButton/cradiobuttontest.cxx @@ -112,7 +112,7 @@ bool CRadioButtonTest::connect(void) if (!setBackgroundColor(CONFIG_CRADIOBUTTONTEST_BGCOLOR)) { - message("CRadioButtonTest::connect: setBackgroundColor failed\n"); + printf("CRadioButtonTest::connect: setBackgroundColor failed\n"); } } @@ -174,7 +174,7 @@ bool CRadioButtonTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CRadioButtonTest::createGraphics: Failed to create CBgWindow instance\n"); + printf("CRadioButtonTest::createGraphics: Failed to create CBgWindow instance\n"); delete m_widgetControl; return false; } @@ -184,7 +184,7 @@ bool CRadioButtonTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CRadioButtonTest::createGraphics: Failed to open background window\n"); + printf("CRadioButtonTest::createGraphics: Failed to open background window\n"); delete m_bgWindow; m_bgWindow = (CBgWindow*)0; return false; @@ -202,7 +202,7 @@ CRadioButton *CRadioButtonTest::newRadioButton(void) struct nxgl_size_s windowSize; if (!m_bgWindow->getSize(&windowSize)) { - message("CRadioButtonTest::newRadioButton: Failed to get window size\n"); + printf("CRadioButtonTest::newRadioButton: Failed to get window size\n"); return (CRadioButton *)NULL; } @@ -219,7 +219,7 @@ CRadioButton *CRadioButtonTest::newRadioButton(void) m_radioButtonGroup = new CRadioButtonGroup(m_widgetControl, groupX, groupY); if (!m_radioButtonGroup) { - message("CRadioButtonTest::newRadioButton: Failed to create the radio button group\n"); + printf("CRadioButtonTest::newRadioButton: Failed to create the radio button group\n"); return (CRadioButton *)NULL; } } @@ -296,10 +296,10 @@ void CRadioButtonTest::showButtonState(void) int index = m_radioButtonGroup->getSelectedIndex(); if (index < 0) { - message("CRadioButtonTest::showButtonState No button is pressed\n"); + printf("CRadioButtonTest::showButtonState No button is pressed\n"); } else { - message("CRadioButtonTest::showButtonState button%d is selected\n", index+1); + printf("CRadioButtonTest::showButtonState button%d is selected\n", index+1); } } diff --git a/UnitTests/CRadioButton/cradiobuttontest.hxx b/UnitTests/CRadioButton/cradiobuttontest.hxx index 3f81371db..a7464a1c9 100644 --- a/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -70,15 +70,6 @@ # define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx index f9c322299..da919612c 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("cscrollbarhorizontal_main: Create CScrollbarHorizontalTest instance\n"); + printf("cscrollbarhorizontal_main: Create CScrollbarHorizontalTest instance\n"); CScrollbarHorizontalTest *test = new CScrollbarHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CScrollbarHorizontalTest"); // Connect the NX server - message("cscrollbarhorizontal_main: Connect the CScrollbarHorizontalTest instance to the NX server\n"); + printf("cscrollbarhorizontal_main: Connect the CScrollbarHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message("cscrollbarhorizontal_main: Failed to connect the CScrollbarHorizontalTest instance to the NX server\n"); + printf("cscrollbarhorizontal_main: Failed to connect the CScrollbarHorizontalTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) // Create a window to draw into - message("cscrollbarhorizontal_main: Create a Window\n"); + printf("cscrollbarhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message("cscrollbarhorizontal_main: Failed to create a window\n"); + printf("cscrollbarhorizontal_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) // Create a scrollbar - message("cscrollbarhorizontal_main: Create a Scrollbar\n"); + printf("cscrollbarhorizontal_main: Create a Scrollbar\n"); CScrollbarHorizontal *scrollbar = test->createScrollbar(); if (!scrollbar) { - message("cscrollbarhorizontal_main: Failed to create a scrollbar\n"); + printf("cscrollbarhorizontal_main: Failed to create a scrollbar\n"); delete test; return 1; } @@ -186,9 +186,9 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) scrollbar->setMinimumValue(0); scrollbar->setMaximumValue(MAX_SCROLLBAR); scrollbar->setValue(0); - message("cscrollbarhorizontal_main: Scrollbar range %d->%d Initial value %d\n", - scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), - scrollbar->getValue()); + printf("cscrollbarhorizontal_main: Scrollbar range %d->%d Initial value %d\n", + scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), + scrollbar->getValue()); // Show the initial state of the checkbox @@ -201,7 +201,7 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); + printf("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After moving the scrollbar up"); @@ -212,7 +212,7 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); + printf("cscrollbarhorizontal_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cscrollbarhorizontal_main: After moving the scrollbar down"); @@ -220,7 +220,7 @@ int cscrollbarhorizontal_main(int argc, char *argv[]) // Clean up and exit - message("cscrollbarhorizontal_main: Clean-up and exit\n"); + printf("cscrollbarhorizontal_main: Clean-up and exit\n"); delete scrollbar; updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); delete test; diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx index 06673f080..42571a574 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx @@ -105,7 +105,7 @@ bool CScrollbarHorizontalTest::connect(void) if (!setBackgroundColor(CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR)) { - message("CScrollbarHorizontalTest::connect: setBackgroundColor failed\n"); + printf("CScrollbarHorizontalTest::connect: setBackgroundColor failed\n"); } } @@ -161,7 +161,7 @@ bool CScrollbarHorizontalTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CScrollbarHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CScrollbarHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -171,7 +171,7 @@ bool CScrollbarHorizontalTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CScrollbarHorizontalTest::createWindow: Failed to open background window\n"); + printf("CScrollbarHorizontalTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index 30f66ca45..7047eb861 100644 --- a/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx index 2bcb3f0d1..64bc5e732 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx +++ b/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cscrollbarvertical_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("cscrollbarvertical_main: Create CScrollbarVerticalTest instance\n"); + printf("cscrollbarvertical_main: Create CScrollbarVerticalTest instance\n"); CScrollbarVerticalTest *test = new CScrollbarVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CScrollbarVerticalTest"); // Connect the NX server - message("cscrollbarvertical_main: Connect the CScrollbarVerticalTest instance to the NX server\n"); + printf("cscrollbarvertical_main: Connect the CScrollbarVerticalTest instance to the NX server\n"); if (!test->connect()) { - message("cscrollbarvertical_main: Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); + printf("cscrollbarvertical_main: Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cscrollbarvertical_main(int argc, char *argv[]) // Create a window to draw into - message("cscrollbarvertical_main: Create a Window\n"); + printf("cscrollbarvertical_main: Create a Window\n"); if (!test->createWindow()) { - message("cscrollbarvertical_main: Failed to create a window\n"); + printf("cscrollbarvertical_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int cscrollbarvertical_main(int argc, char *argv[]) // Create a scrollbar - message("cscrollbarvertical_main: Create a Scrollbar\n"); + printf("cscrollbarvertical_main: Create a Scrollbar\n"); CScrollbarVertical *scrollbar = test->createScrollbar(); if (!scrollbar) { - message("cscrollbarvertical_main: Failed to create a scrollbar\n"); + printf("cscrollbarvertical_main: Failed to create a scrollbar\n"); delete test; return 1; } @@ -186,9 +186,9 @@ int cscrollbarvertical_main(int argc, char *argv[]) scrollbar->setMinimumValue(0); scrollbar->setMaximumValue(MAX_SCROLLBAR); scrollbar->setValue(0); - message("cscrollbarvertical_main: Scrollbar range %d->%d Initial value %d\n", - scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), - scrollbar->getValue()); + printf("cscrollbarvertical_main: Scrollbar range %d->%d Initial value %d\n", + scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), + scrollbar->getValue()); // Show the initial state of the checkbox @@ -201,7 +201,7 @@ int cscrollbarvertical_main(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); + printf("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar up"); @@ -212,7 +212,7 @@ int cscrollbarvertical_main(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); + printf("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(5000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar down"); @@ -220,7 +220,7 @@ int cscrollbarvertical_main(int argc, char *argv[]) // Clean up and exit - message("cscrollbarvertical_main: Clean-up and exit\n"); + printf("cscrollbarvertical_main: Clean-up and exit\n"); delete scrollbar; updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); delete test; diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx index df317adcd..cb642a992 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx @@ -105,7 +105,7 @@ bool CScrollbarVerticalTest::connect(void) if (!setBackgroundColor(CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR)) { - message("CScrollbarVerticalTest::connect: setBackgroundColor failed\n"); + printf("CScrollbarVerticalTest::connect: setBackgroundColor failed\n"); } } @@ -161,7 +161,7 @@ bool CScrollbarVerticalTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CScrollbarVerticalTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CScrollbarVerticalTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -171,7 +171,7 @@ bool CScrollbarVerticalTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CScrollbarVerticalTest::createWindow: Failed to open background window\n"); + printf("CScrollbarVerticalTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index 6323b0f26..2a87449db 100644 --- a/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx index fc57ab98c..0d63ed20a 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int csliderhorizontal_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("csliderhorizontal_main: Create CSliderHorizontalTest instance\n"); + printf("csliderhorizontal_main: Create CSliderHorizontalTest instance\n"); CSliderHorizontalTest *test = new CSliderHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderHorizontalTest"); // Connect the NX server - message("csliderhorizontal_main: Connect the CSliderHorizontalTest instance to the NX server\n"); + printf("csliderhorizontal_main: Connect the CSliderHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message("csliderhorizontal_main: Failed to connect the CSliderHorizontalTest instance to the NX server\n"); + printf("csliderhorizontal_main: Failed to connect the CSliderHorizontalTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int csliderhorizontal_main(int argc, char *argv[]) // Create a window to draw into - message("csliderhorizontal_main: Create a Window\n"); + printf("csliderhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message("csliderhorizontal_main: Failed to create a window\n"); + printf("csliderhorizontal_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int csliderhorizontal_main(int argc, char *argv[]) // Create a slider - message("csliderhorizontal_main: Create a Slider\n"); + printf("csliderhorizontal_main: Create a Slider\n"); CSliderHorizontal *slider = test->createSlider(); if (!slider) { - message("csliderhorizontal_main: Failed to create a slider\n"); + printf("csliderhorizontal_main: Failed to create a slider\n"); delete test; return 1; } @@ -186,9 +186,9 @@ int csliderhorizontal_main(int argc, char *argv[]) slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", - slider->getMinimumValue(), slider->getMaximumValue(), - slider->getValue()); + printf("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); // Show the initial state of the checkbox @@ -201,7 +201,7 @@ int csliderhorizontal_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + printf("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider up"); @@ -212,7 +212,7 @@ int csliderhorizontal_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); + printf("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider down"); @@ -220,7 +220,7 @@ int csliderhorizontal_main(int argc, char *argv[]) // Clean up and exit - message("csliderhorizontal_main: Clean-up and exit\n"); + printf("csliderhorizontal_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx index 1687448db..581478841 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx @@ -105,7 +105,7 @@ bool CSliderHorizontalTest::connect(void) if (!setBackgroundColor(CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR)) { - message("CSliderHorizontalTest::connect: setBackgroundColor failed\n"); + printf("CSliderHorizontalTest::connect: setBackgroundColor failed\n"); } } @@ -161,7 +161,7 @@ bool CSliderHorizontalTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CSliderHorizontalTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -171,7 +171,7 @@ bool CSliderHorizontalTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CSliderHorizontalTest::createWindow: Failed to open background window\n"); + printf("CSliderHorizontalTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index fd333af5c..8d5db0772 100644 --- a/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/UnitTests/CSliderVertical/cslidervertical_main.cxx b/UnitTests/CSliderVertical/cslidervertical_main.cxx index cc106cbf0..966ecb85d 100644 --- a/UnitTests/CSliderVertical/cslidervertical_main.cxx +++ b/UnitTests/CSliderVertical/cslidervertical_main.cxx @@ -98,9 +98,9 @@ static void updateMemoryUsage(unsigned int previous, /* Show the change from the previous time */ - message("\n%s:\n", msg); - message(" Before: %8d After: %8d Change: %8d\n\n", - previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); + printf("\n%s:\n", msg); + printf(" Before: %8d After: %8d Change: %8d\n\n", + previous, mmcurrent.uordblks, mmcurrent.uordblks - previous); /* Set up for the next test */ @@ -143,16 +143,16 @@ int cslidervertical_main(int argc, char *argv[]) // Create an instance of the checkbox test - message("cslidervertical_main: Create CSliderVerticalTest instance\n"); + printf("cslidervertical_main: Create CSliderVerticalTest instance\n"); CSliderVerticalTest *test = new CSliderVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderVerticalTest"); // Connect the NX server - message("cslidervertical_main: Connect the CSliderVerticalTest instance to the NX server\n"); + printf("cslidervertical_main: Connect the CSliderVerticalTest instance to the NX server\n"); if (!test->connect()) { - message("cslidervertical_main: Failed to connect the CSliderVerticalTest instance to the NX server\n"); + printf("cslidervertical_main: Failed to connect the CSliderVerticalTest instance to the NX server\n"); delete test; return 1; } @@ -160,10 +160,10 @@ int cslidervertical_main(int argc, char *argv[]) // Create a window to draw into - message("cslidervertical_main: Create a Window\n"); + printf("cslidervertical_main: Create a Window\n"); if (!test->createWindow()) { - message("cslidervertical_main: Failed to create a window\n"); + printf("cslidervertical_main: Failed to create a window\n"); delete test; return 1; } @@ -171,11 +171,11 @@ int cslidervertical_main(int argc, char *argv[]) // Create a slider - message("cslidervertical_main: Create a Slider\n"); + printf("cslidervertical_main: Create a Slider\n"); CSliderVertical *slider = test->createSlider(); if (!slider) { - message("cslidervertical_main: Failed to create a slider\n"); + printf("cslidervertical_main: Failed to create a slider\n"); delete test; return 1; } @@ -186,9 +186,9 @@ int cslidervertical_main(int argc, char *argv[]) slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message("cslidervertical_main: Slider range %d->%d Initial value %d\n", - slider->getMinimumValue(), slider->getMaximumValue(), - slider->getValue()); + printf("cslidervertical_main: Slider range %d->%d Initial value %d\n", + slider->getMinimumValue(), slider->getMaximumValue(), + slider->getValue()); // Show the initial state of the checkbox @@ -201,7 +201,7 @@ int cslidervertical_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); + printf("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider up"); @@ -212,7 +212,7 @@ int cslidervertical_main(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); + printf("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider down"); @@ -220,7 +220,7 @@ int cslidervertical_main(int argc, char *argv[]) // Clean up and exit - message("cslidervertical_main: Clean-up and exit\n"); + printf("cslidervertical_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/UnitTests/CSliderVertical/csliderverticaltest.cxx b/UnitTests/CSliderVertical/csliderverticaltest.cxx index d0691c52d..1a41ae72e 100644 --- a/UnitTests/CSliderVertical/csliderverticaltest.cxx +++ b/UnitTests/CSliderVertical/csliderverticaltest.cxx @@ -106,7 +106,7 @@ bool CSliderVerticalTest::connect(void) if (!setBackgroundColor(CONFIG_CSLIDERVERTICALTEST_BGCOLOR)) { - message("CSliderVerticalTest::connect: setBackgroundColor failed\n"); + printf("CSliderVerticalTest::connect: setBackgroundColor failed\n"); } } @@ -162,7 +162,7 @@ bool CSliderVerticalTest::createWindow(void) m_bgWindow = getBgWindow(m_widgetControl); if (!m_bgWindow) { - message("CSliderVerticalTest::createWindow: Failed to create CBgWindow instance\n"); + printf("CSliderVerticalTest::createWindow: Failed to create CBgWindow instance\n"); disconnect(); return false; } @@ -172,7 +172,7 @@ bool CSliderVerticalTest::createWindow(void) bool success = m_bgWindow->open(); if (!success) { - message("CSliderVerticalTest::createWindow: Failed to open background window\n"); + printf("CSliderVerticalTest::createWindow: Failed to open background window\n"); disconnect(); return false; } diff --git a/UnitTests/CSliderVertical/csliderverticaltest.hxx b/UnitTests/CSliderVertical/csliderverticaltest.hxx index 6a893e395..04fd9627c 100644 --- a/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -69,15 +69,6 @@ # define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// If debug is enabled, use the debug function, syslog() instead -// of printf() so that the output is synchronized. - -#ifdef CONFIG_DEBUG -# define message lowsyslog -#else -# define message printf -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// From 350b065329a1baae3356ac232b2faf634e0c8818 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 15:52:11 -0600 Subject: [PATCH 300/390] Update ChangeLog --- ChangeLog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4a574b807..f8e459d9f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -538,3 +538,8 @@ incompatibility with versions prior to NuttX-7.5 (2014-9-20). 1.14 2014-xx-xx Gregory Nutt + +* Fix all UnitTest/ files to account for the corrected syslog() prototype. + This change to the NuttX syslog introduces an incompatibility between + NuttX 7.6 and previous verisions of the UnitTest code. + From d7831f37b8eb35167be9f742620ce6ee9df9f799 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 12 Oct 2014 10:53:29 -0600 Subject: [PATCH 301/390] Cosmetic update to comments --- nxwm/src/ccalibration.cxx | 4 ++-- nxwm/src/ctouchscreen.cxx | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 74be1fd09..2a65662ff 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -1010,7 +1010,7 @@ void CCalibration::stateMachine(void) m_calibData[CALIB_LOWER_LEFT_INDEX].y = m_touchPos.y; #endif - // Clear the previous screen by re-drawing it using the backgro9und + // Clear the previous screen by re-drawing it using the background // color. That is much faster than clearing the whole display m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR; @@ -1289,7 +1289,7 @@ CCalibrationFactory::CCalibrationFactory(CTaskbar *taskbar, CTouchscreen *touchs IApplication *CCalibrationFactory::create(void) { // Call CTaskBar::openFullScreenWindow to create a full screen window for - // the calibation application + // the calibration application CFullScreenWindow *window = m_taskbar->openFullScreenWindow(); if (!window) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 545405b81..dc462727d 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -228,7 +228,7 @@ void CTouchscreen::setCalibrationData(const struct SCalibrationData &caldata) * This function is not re-entrant: There may be only one thread waiting for * raw touchscreen data. * - * @return True if the raw touchscreen data was sucessfully obtained + * @return True if the raw touchscreen data was successfully obtained */ bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) @@ -265,7 +265,7 @@ bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) /** * The touchscreen listener thread. This is the entry point of a thread that - * listeners for and dispatches touchscreens events to the NX server. + * listeners for and dispatches touchscreen events to the NX server. * * @param arg. The CTouchscreen 'this' pointer cast to a void*. * @return This function normally does not return but may return NULL on @@ -320,7 +320,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) // 3. Normal operation, reading touchscreen data and forwarding it to NX // Check if we need to collect touchscreen data. That is, that we are enabled, - // AND have calibratation data OR if we need to collect data for the calbration + // AND have calibration data OR if we need to collect data for the calibration // process. while ((!This->m_enabled || !This->m_calibrated) && !This->m_capture) @@ -431,7 +431,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) DEBUGASSERT(sample == &m_sample); - // Check if normal processing of touchscreen data is enaable. Check if + // Check if normal processing of touchscreen data is enabled. Check if // we have been given calibration data. if (!m_enabled || !m_calibrated) @@ -443,7 +443,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) } // Now we will inject the touchscreen into NX as mouse input. First - // massage the data a litle so that it behaves a little more like a + // massage the data a little so that it behaves a little more like a // mouse with only a left button // // Was the button up or down? @@ -592,4 +592,3 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) NXHANDLE handle = m_server->getServer(); (void)nx_mousein(handle, x, y, buttons); } - From 1d840fd976e43b6d99e40f3d31160b4496a1fdef Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 26 Nov 2014 10:06:43 -0600 Subject: [PATCH 302/390] Preparing for NuttX-7.6 Release --- ChangeLog.txt | 7 ++++--- ReleaseNotes.txt | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f8e459d9f..ff21d8852 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -537,9 +537,10 @@ * Change all references to NxConsole to NxTerm. This introduces an incompatibility with versions prior to NuttX-7.5 (2014-9-20). -1.14 2014-xx-xx Gregory Nutt +1.14 2014-11-26 Gregory Nutt * Fix all UnitTest/ files to account for the corrected syslog() prototype. This change to the NuttX syslog introduces an incompatibility between - NuttX 7.6 and previous verisions of the UnitTest code. - + NuttX 7.6 and previous versions of the UnitTest code. + +1.15 2015-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index fdd3736bf..0de05691b 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -466,3 +466,21 @@ Additional new features and extended functionality in Version 1.13: Bugfixes: * There are no new bug fixes in this release. + +NxWidgets-1.14 +============== + +The 15th release of the NxWidgets package was made on November 26, 2014. This +release depends on NuttX-7.6 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.14: + +* There are no new features in this release. This release simply correct + all UnitTest/ files to account for the corrected syslog() prototype in + NuttX 7.6. That change introduced an incompatibility between NuttX 7.6 + and previous versions of the UnitTest code. + +Bugfixes: + +* There are no new bug fixes in this release. From ebb17341d04388eff4ddc08d2852357e38629268 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Mar 2015 13:21:25 -0600 Subject: [PATCH 303/390] rch_tcinitialize() and arch_tcunitinitialize() renamed to board_tsc_setup() and board_tsc_teardown(). These are not long called directly by applications but only indirectly throught the crappy boardctl() OS interface. --- ChangeLog.txt | 5 +++++ Kconfig | 11 +++++------ nxwm/src/ctouchscreen.cxx | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ff21d8852..6cf53f54c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -544,3 +544,8 @@ NuttX 7.6 and previous versions of the UnitTest code. 1.15 2015-xx-xx Gregory Nutt + +* In NuttX 7.9, the interface arch_tcinitialize() was replaced with the + boardctl() interface. Old versions of NxWM will then be incompatible + with Versions of NuttX at 7.9 and beyond (2015-03-31). + diff --git a/Kconfig b/Kconfig index 89e7e222d..066cdb2da 100644 --- a/Kconfig +++ b/Kconfig @@ -782,12 +782,11 @@ config NXWM_TOUCHSCREEN_DEVINIT depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- It this option is selected, then the NxWM:CTouchscreen listener - thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO) - in order to instantiate the touchscreen driver at path - NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not - selected, then the NxWM:CTouchscreen listener thread will assume - that the driver has already been initialized at - NXWM_TOUCHSCREEN_DEVPATH. + thread will call a function boardctl() in order to instantiate the + touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If + NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen + listener thread will assume that the driver has already been + initialized at NXWM_TOUCHSCREEN_DEVPATH. NOTE that in the kernel build, all touchscreen initialize must be performed in kernel logic prior to the execution of NxWM. diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index dc462727d..3792811a4 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -281,7 +282,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) #ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT // Initialize the touchscreen device - int ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO); + int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { dbg("ERROR Failed initialize the touchscreen device: %d\n", ret); From 8ab1540770497bf60124dc623618b50be9590d8b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Mar 2015 16:20:21 -0600 Subject: [PATCH 304/390] Rename up_nxdrvinit() to board_graphics_setup(). Add CONFIG_BOARDCTL_GRAPHICS that will enabled calls to board_graphics_setup() from boardctrl(). In apps/ and NxWidgts/, replace all calls to up_nxdrvinit with calls to boardctl(). --- libnxwidgets/src/cnxserver.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index d47fa74c1..1c28a6b4a 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxserver.cxx * - * Copyright (C) 2012, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -125,10 +126,10 @@ bool CNxServer::connect(void) #if defined(CONFIG_NXWIDGETS_EXTERNINIT) // Use external graphics driver initialization - m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); + m_hDevice = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_NXWIDGETS_DEVNO); if (!m_hDevice) { - gdbg("up_nxdrvinit failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("boardctl failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return false; } @@ -357,10 +358,10 @@ int CNxServer::server(int argc, char *argv[]) #if defined(CONFIG_NXWIDGETS_EXTERNINIT) // Use external graphics driver initialization - dev = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO); + dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_NXWIDGETS_DEVNO); if (!dev) { - gdbg("up_nxdrvinit failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("boardctl failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return EXIT_FAILURE; } From e25fb828ef43f1c466724afcbed4a1dc92c651de Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Mar 2015 16:41:48 -0600 Subject: [PATCH 305/390] Kconfig files: If external graphics initialization is required, it depends on CONFIG_LIB_BOARDCTL and should set CONFIG_BOARDCTL_GRAPHICS --- Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kconfig b/Kconfig index 066cdb2da..accff524c 100644 --- a/Kconfig +++ b/Kconfig @@ -29,6 +29,8 @@ config NXWIDGETS_FLICKERFREE config NXWIDGETS_EXTERNINIT bool "External display Initialization" default n + depends on LIB_BOARDCTL + select BOARDCTL_GRAPHICS ---help--- Define to support external display initialization. From 3542cd02828f37169a0c8408d7610770a8096fb8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Apr 2015 11:49:15 -0600 Subject: [PATCH 306/390] More renaming: up_lcdinitialize->board_lcd_initialize, up_lcdgetdev->board_lcd_getdev, up_lcduninitialize->board_lcd_uninitialize --- libnxwidgets/src/cnxserver.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 1c28a6b4a..3ac00e7fb 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -41,6 +41,7 @@ #include #include + #include #include #include @@ -48,6 +49,8 @@ #include #include +#include + #ifdef CONFIG_NX_MULTIUSER # include # include @@ -138,19 +141,19 @@ bool CNxServer::connect(void) // Initialize the LCD device - ret = up_lcdinitialize(); + ret = board_lcd_initialize(); if (ret < 0) { - gdbg("up_lcdinitialize failed: %d\n", -ret); + gdbg("board_lcd_initialize failed: %d\n", -ret); return false; } // Get the device instance - m_hDevice = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO); + m_hDevice = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!m_hDevice) { - gdbg("up_lcdgetdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return false; } @@ -368,19 +371,19 @@ int CNxServer::server(int argc, char *argv[]) #elif defined(CONFIG_NX_LCDDRIVER) // Initialize the LCD device - ret = up_lcdinitialize(); + ret = board_lcd_initialize(); if (ret < 0) { - gdbg("up_lcdinitialize failed: %d\n", -ret); + gdbg("board_lcd_initialize failed: %d\n", -ret); return EXIT_FAILURE; } // Get the device instance - dev = up_lcdgetdev(CONFIG_NXWIDGETS_DEVNO); + dev = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!dev) { - gdbg("up_lcdgetdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return EXIT_FAILURE; } From d488dd11ee1c60d64f287074a7be17d626045685 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Apr 2015 11:52:18 -0600 Subject: [PATCH 307/390] Upate ChangeLogs --- ChangeLog.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6cf53f54c..8df8121eb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -524,7 +524,7 @@ selection (2014-7-27). * NxWM::CMediaPlayer: Correct handling of increments to sub-sampling rate (2014-7-27). -* XWidgets::CNxWidget: Remove an unused bit field (2014-7-28). +* NxWidgets::CNxWidget: Remove an unused bit field (2014-7-28). * NxWM::CMediaPlayer: Add a CLabel that show the current fast forward/rewind speed (2014-7-28). * NxWM::CKeyboard: Add support for a USB keyboard as the NxConsole and text @@ -548,4 +548,6 @@ * In NuttX 7.9, the interface arch_tcinitialize() was replaced with the boardctl() interface. Old versions of NxWM will then be incompatible with Versions of NuttX at 7.9 and beyond (2015-03-31). - +* NxWidgets::CNxServer: More renaming: up_lcdinitialize->board_lcd_initialize, + up_lcdgetdev->board_lcd_getdev, up_lcduninitialize->board_lcd_uninitialize + (2015-04-04). From a7ebc37b03ca2ef154191137b6548396485f1822 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Apr 2015 08:50:01 -0600 Subject: [PATCH 308/390] Add a 'capped' boolean parameter to all drawline/drawLine functions/methods. The idea is that this will produce better joining between lines --- libnxwidgets/include/cbgwindow.hxx | 8 +++++--- libnxwidgets/include/cgraphicsport.hxx | 6 ++++-- libnxwidgets/include/cnxtkwindow.hxx | 8 +++++--- libnxwidgets/include/cnxtoolbar.hxx | 8 +++++--- libnxwidgets/include/cnxwindow.hxx | 7 +++++-- libnxwidgets/include/inxwindow.hxx | 8 +++++--- libnxwidgets/src/cbgwindow.cxx | 9 ++++++--- libnxwidgets/src/cgraphicsport.cxx | 18 ++++++++++-------- libnxwidgets/src/cnxtkwindow.cxx | 9 ++++++--- libnxwidgets/src/cnxtoolbar.cxx | 9 ++++++--- libnxwidgets/src/cnxwindow.cxx | 9 ++++++--- 11 files changed, 63 insertions(+), 36 deletions(-) diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 90113cfe9..8a63633bd 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cbgwindow.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -285,13 +285,15 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, - nxgl_mxpixel_t color); + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index c5148c8bc..4d529c94d 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cgraphicsport.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -242,11 +242,13 @@ namespace NXWidgets * @param x2 The x coordinate of the end point of the line. * @param y2 The y coordinate of the end point of the line. * @param color The color of the line. + * @param capped Draw a circular cap both ends of the line to support + * better line joins */ void drawLine(nxgl_coord_t x1, nxgl_coord_t y1, nxgl_coord_t x2, nxgl_coord_t y2, - nxgl_mxpixel_t color); + nxgl_mxpixel_t color, bool capped); /** * Draw a filled rectangle of the specified start position, end position, diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index b20bc2a24..1ac801b95 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cnxtkwindow.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -306,13 +306,15 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, - nxgl_mxpixel_t color); + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index fd635b206..c7107678e 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cnxtoolbar.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -275,13 +275,15 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to suppor + * better line joins * * @return True on success; false on failure. */ bool drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, - nxgl_mxpixel_t color); + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 98f89acc0..21a077954 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cnxwindow.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -279,12 +279,15 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color); + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 3e2f6c4a1..23b99fe90 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/inxwindow.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -249,13 +249,15 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ virtual bool drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, - nxgl_mxpixel_t color) = 0; + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped) = 0; /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx index 2cb3d2389..979cb3aeb 100644 --- a/libnxwidgets/src/cbgwindow.cxx +++ b/libnxwidgets/src/cbgwindow.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cbgwindow.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -308,16 +308,19 @@ bool CBgWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool CBgWindow::drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color) + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped) { // Draw a line with the specified color - return nx_drawline(m_hWindow, vector, width, &color) == OK; + return nx_drawline(m_hWindow, vector, width, &color, capped) == OK; } /** diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index 5791ab773..d3fcdd3b5 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cgraphicsport.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -241,16 +241,18 @@ void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, /** * Draw a line of a fixed color in the window. * - * @param x1 The x coordinate of the start point of the line. - * @param y1 The y coordinate of the start point of the line. - * @param x2 The x coordinate of the end point of the line. - * @param y2 The y coordinate of the end point of the line. - * @param color The color of the line. + * @param x1 - The x coordinate of the start point of the line. + * @param y1 - The y coordinate of the start point of the line. + * @param x2 - The x coordinate of the end point of the line. + * @param y2 - The y coordinate of the end point of the line. + * @param color - The color of the line. + * @param capped - Draw a circular cap both ends of the line to support + * - better line joins */ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, nxgl_coord_t x2, nxgl_coord_t y2, - nxgl_mxpixel_t color) + nxgl_mxpixel_t color, bool capped) { struct nxgl_vector_s vector; @@ -259,7 +261,7 @@ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, vector.pt2.x = x2; vector.pt2.y = y2; - if (!m_pNxWnd->drawLine(&vector, 1, color)) + if (!m_pNxWnd->drawLine(&vector, 1, color, capped)) { gdbg("INxWindow::drawLine failed\n"); } diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 57ca5eb2b..14e07dbbb 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxtkwindow.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -442,16 +442,19 @@ bool CNxTkWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool CNxTkWindow::drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color) + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped) { // Draw a line with the specified color - return nxtk_drawlinewindow(m_hNxTkWindow, vector, width, &color) == OK; + return nxtk_drawlinewindow(m_hNxTkWindow, vector, width, &color, capped) == OK; } /** diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 3c336f06a..01b72e32f 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxtoolbar.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -313,16 +313,19 @@ bool CNxToolbar::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool CNxToolbar::drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color) + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped) { // Draw a line with the specified color - return nxtk_drawlinetoolbar(m_hNxTkWindow, vector, width, &color) == OK; + return nxtk_drawlinetoolbar(m_hNxTkWindow, vector, width, &color, capped) == OK; } /** diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index 046660774..c600ecd1b 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxwindow.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -286,16 +286,19 @@ bool CNxWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line + * @param capped - Draw a circular cap both ends of the line to support + * better line joins * * @return True on success; false on failure. */ bool CNxWindow::drawLine(FAR struct nxgl_vector_s *vector, - nxgl_coord_t width, nxgl_mxpixel_t color) + nxgl_coord_t width, nxgl_mxpixel_t color, + bool capped) { // Draw a line with the specified color - return nx_drawline(m_hNxWindow, vector, width, &color) == OK; + return nx_drawline(m_hNxWindow, vector, width, &color, capped) == OK; } /** From a13cdd2c39be2fb761abf9587e5186ba6d5c19e8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Apr 2015 09:46:39 -0600 Subject: [PATCH 309/390] Update ChangeLogs --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8df8121eb..df1ca697e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -551,3 +551,7 @@ * NxWidgets::CNxServer: More renaming: up_lcdinitialize->board_lcd_initialize, up_lcdgetdev->board_lcd_getdev, up_lcduninitialize->board_lcd_uninitialize (2015-04-04). +* NxWidgets:: INxWindow, CNxWindow, CBgWindow, CNxTkWindow, CNxToolbar, + CGraphicsPort: Add a capped parameter to all drawLine() methods. Pass on + to NX nx_drawline() and NXTK nxtk_drawlinetoolbar() and nxtk_drawlinewindow() + functions (2015-04-05). From f6604c7e5c25fffd630ffbb661fca23e931d8e55 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Apr 2015 16:53:51 -0600 Subject: [PATCH 310/390] drawline/drawLine should not take a boolean to select non lines caps or capping at both ends. drawline/drawLine also needs to be able to put a line cap on one one end of a line --- libnxwidgets/include/cbgwindow.hxx | 4 ++-- libnxwidgets/include/cgraphicsport.hxx | 4 ++-- libnxwidgets/include/cnxtkwindow.hxx | 4 ++-- libnxwidgets/include/cnxtoolbar.hxx | 4 ++-- libnxwidgets/include/cnxwindow.hxx | 4 ++-- libnxwidgets/include/inxwindow.hxx | 12 ++++++++++-- libnxwidgets/src/cbgwindow.cxx | 6 +++--- libnxwidgets/src/cgraphicsport.cxx | 6 +++--- libnxwidgets/src/cnxtkwindow.cxx | 6 +++--- libnxwidgets/src/cnxtoolbar.cxx | 6 +++--- libnxwidgets/src/cnxwindow.cxx | 6 +++--- 11 files changed, 35 insertions(+), 27 deletions(-) diff --git a/libnxwidgets/include/cbgwindow.hxx b/libnxwidgets/include/cbgwindow.hxx index 8a63633bd..41184e43e 100644 --- a/libnxwidgets/include/cbgwindow.hxx +++ b/libnxwidgets/include/cbgwindow.hxx @@ -285,7 +285,7 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -293,7 +293,7 @@ namespace NXWidgets bool drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped); + enum ELineCaps caps); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cgraphicsport.hxx b/libnxwidgets/include/cgraphicsport.hxx index 4d529c94d..df250f478 100644 --- a/libnxwidgets/include/cgraphicsport.hxx +++ b/libnxwidgets/include/cgraphicsport.hxx @@ -242,13 +242,13 @@ namespace NXWidgets * @param x2 The x coordinate of the end point of the line. * @param y2 The y coordinate of the end point of the line. * @param color The color of the line. - * @param capped Draw a circular cap both ends of the line to support + * @param caps Draw a circular cap on the ends of the line to support * better line joins */ void drawLine(nxgl_coord_t x1, nxgl_coord_t y1, nxgl_coord_t x2, nxgl_coord_t y2, - nxgl_mxpixel_t color, bool capped); + nxgl_mxpixel_t color, enum INxWindow::ELineCaps caps); /** * Draw a filled rectangle of the specified start position, end position, diff --git a/libnxwidgets/include/cnxtkwindow.hxx b/libnxwidgets/include/cnxtkwindow.hxx index 1ac801b95..bf0af4ad0 100644 --- a/libnxwidgets/include/cnxtkwindow.hxx +++ b/libnxwidgets/include/cnxtkwindow.hxx @@ -306,7 +306,7 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -314,7 +314,7 @@ namespace NXWidgets bool drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped); + enum ELineCaps caps); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cnxtoolbar.hxx b/libnxwidgets/include/cnxtoolbar.hxx index c7107678e..6d16bad3e 100644 --- a/libnxwidgets/include/cnxtoolbar.hxx +++ b/libnxwidgets/include/cnxtoolbar.hxx @@ -275,7 +275,7 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to suppor + * @param caps - Draw a circular cap on the ends of the line to suppor * better line joins * * @return True on success; false on failure. @@ -283,7 +283,7 @@ namespace NXWidgets bool drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped); + enum ELineCaps caps); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/cnxwindow.hxx b/libnxwidgets/include/cnxwindow.hxx index 21a077954..092c38c32 100644 --- a/libnxwidgets/include/cnxwindow.hxx +++ b/libnxwidgets/include/cnxwindow.hxx @@ -279,7 +279,7 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -287,7 +287,7 @@ namespace NXWidgets bool drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped); + enum ELineCaps caps); /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/include/inxwindow.hxx b/libnxwidgets/include/inxwindow.hxx index 23b99fe90..95de31cd8 100644 --- a/libnxwidgets/include/inxwindow.hxx +++ b/libnxwidgets/include/inxwindow.hxx @@ -83,6 +83,14 @@ namespace NXWidgets class INxWindow { public: + enum ELineCaps + { + LINECAP_NONE = NX_LINECAP_NONE, // No line caps + LINECAP_PT1 = NX_LINECAP_PT1, // Line cap on pt1 of the vector only + LINECAP_PT2 = NX_LINECAP_PT2, // Line cap on pt2 of the vector only + LINECAP_BOTH = NX_LINECAP_BOTH // Line cap on both ends of the vector only + }; + /** * A virtual destructor is required in order to override the INxWindow * destructor. We do this because if we delete INxWindow, we want the @@ -249,7 +257,7 @@ namespace NXWidgets * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -257,7 +265,7 @@ namespace NXWidgets virtual bool drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped) = 0; + enum ELineCaps caps) = 0; /** * Draw a filled circle at the specified position, size, and color. diff --git a/libnxwidgets/src/cbgwindow.cxx b/libnxwidgets/src/cbgwindow.cxx index 979cb3aeb..6c849aacf 100644 --- a/libnxwidgets/src/cbgwindow.cxx +++ b/libnxwidgets/src/cbgwindow.cxx @@ -308,7 +308,7 @@ bool CBgWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -316,11 +316,11 @@ bool CBgWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, bool CBgWindow::drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped) + enum ELineCaps caps) { // Draw a line with the specified color - return nx_drawline(m_hWindow, vector, width, &color, capped) == OK; + return nx_drawline(m_hWindow, vector, width, &color, (uint8_t)caps) == OK; } /** diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index d3fcdd3b5..62e3a6eb0 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -246,13 +246,13 @@ void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, * @param x2 - The x coordinate of the end point of the line. * @param y2 - The y coordinate of the end point of the line. * @param color - The color of the line. - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap one the ends of the line to support * - better line joins */ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, nxgl_coord_t x2, nxgl_coord_t y2, - nxgl_mxpixel_t color, bool capped) + nxgl_mxpixel_t color, enum INxWindow::ELineCaps caps) { struct nxgl_vector_s vector; @@ -261,7 +261,7 @@ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, vector.pt2.x = x2; vector.pt2.y = y2; - if (!m_pNxWnd->drawLine(&vector, 1, color, capped)) + if (!m_pNxWnd->drawLine(&vector, 1, color, caps)) { gdbg("INxWindow::drawLine failed\n"); } diff --git a/libnxwidgets/src/cnxtkwindow.cxx b/libnxwidgets/src/cnxtkwindow.cxx index 14e07dbbb..fecedbb5a 100644 --- a/libnxwidgets/src/cnxtkwindow.cxx +++ b/libnxwidgets/src/cnxtkwindow.cxx @@ -442,7 +442,7 @@ bool CNxTkWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on both ends of the line to support * better line joins * * @return True on success; false on failure. @@ -450,11 +450,11 @@ bool CNxTkWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, bool CNxTkWindow::drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped) + enum ELineCaps caps) { // Draw a line with the specified color - return nxtk_drawlinewindow(m_hNxTkWindow, vector, width, &color, capped) == OK; + return nxtk_drawlinewindow(m_hNxTkWindow, vector, width, &color, (uint8_t)caps) == OK; } /** diff --git a/libnxwidgets/src/cnxtoolbar.cxx b/libnxwidgets/src/cnxtoolbar.cxx index 01b72e32f..3c4e22a32 100644 --- a/libnxwidgets/src/cnxtoolbar.cxx +++ b/libnxwidgets/src/cnxtoolbar.cxx @@ -313,7 +313,7 @@ bool CNxToolbar::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -321,11 +321,11 @@ bool CNxToolbar::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, bool CNxToolbar::drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped) + enum ELineCaps caps) { // Draw a line with the specified color - return nxtk_drawlinetoolbar(m_hNxTkWindow, vector, width, &color, capped) == OK; + return nxtk_drawlinetoolbar(m_hNxTkWindow, vector, width, &color, (uint8_t)caps) == OK; } /** diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index c600ecd1b..ba558bac0 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -286,7 +286,7 @@ bool CNxWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, * @param vector - Describes the line to be drawn * @param width - The width of the line * @param color - The color to use to fill the line - * @param capped - Draw a circular cap both ends of the line to support + * @param caps - Draw a circular cap on the ends of the line to support * better line joins * * @return True on success; false on failure. @@ -294,11 +294,11 @@ bool CNxWindow::fillTrapezoid(FAR const struct nxgl_rect_s *pClip, bool CNxWindow::drawLine(FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, - bool capped) + enum ELineCaps caps) { // Draw a line with the specified color - return nx_drawline(m_hNxWindow, vector, width, &color, capped) == OK; + return nx_drawline(m_hNxWindow, vector, width, &color, (uint8_t)caps) == OK; } /** From 03900c9e47e643534de6802ed95d0f0a79b7f65e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 9 Apr 2015 16:13:03 -0600 Subject: [PATCH 311/390] Fix several typos in comments --- Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index accff524c..a6ccaf8c1 100644 --- a/Kconfig +++ b/Kconfig @@ -163,7 +163,7 @@ config NXWIDGETS_TNXARRAY_SIZEINCREMENT int "Dyanamic Array Reallocation Size Increment" default 8 ---help--- - Default dynamic array realloctino increment (in entries). Default: 8 + Default dynamic array reallocation increment (in entries). Default: 8 config NXWIDGETS_CUSTOM_FILLCOLORS bool "Custom Default Fill Colors" From e69e6e445e8af9ab87706f08eaa698d5ed38a56c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Apr 2015 14:17:55 -0600 Subject: [PATCH 312/390] Prep for 7.9 release --- ChangeLog.txt | 4 +++- ReleaseNotes.txt | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index df1ca697e..6bf237f29 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -543,7 +543,7 @@ This change to the NuttX syslog introduces an incompatibility between NuttX 7.6 and previous versions of the UnitTest code. -1.15 2015-xx-xx Gregory Nutt +1.15 2015-04-14 Gregory Nutt * In NuttX 7.9, the interface arch_tcinitialize() was replaced with the boardctl() interface. Old versions of NxWM will then be incompatible @@ -555,3 +555,5 @@ CGraphicsPort: Add a capped parameter to all drawLine() methods. Pass on to NX nx_drawline() and NXTK nxtk_drawlinetoolbar() and nxtk_drawlinewindow() functions (2015-04-05). + +1.16 2015-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 0de05691b..40ed12bb3 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -484,3 +484,25 @@ Additional new features and extended functionality in Version 1.14: Bugfixes: * There are no new bug fixes in this release. + + +NxWidgets-1.15 +============== + +The 16th release of the NxWidgets package was made on April 14, 2015. This +release depends on NuttX-7.9 or above and should not be used with older +NuttX releases. + +Additional new features and extended functionality in Version 1.15: + +* The primary purpose of this release is update the NxWidgets and NxWM + implementations to reflect changes in naming and interfaces in the + NuttX 7.9 release +* NxWidgets:: INxWindow, CNxWindow, CBgWindow, CNxTkWindow, CNxToolbar, + CGraphicsPort updated to include a "caps" parameter in all drawLine() + methods. This permits drawing a circular cap at the end of lines and + better supports joining of line segments. + +Bugfixes: + +* There are no new bug fixes in this release. From 90d0300d46ea7ddb5914dc00e5af9bc23f5acad1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Apr 2015 07:36:02 -0600 Subject: [PATCH 313/390] When boardctl() fails, need to print errno not the returned value which will always be -1. --- nxwm/src/ctouchscreen.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 3792811a4..b3f71bbb9 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/ctouchscreen.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -285,7 +285,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { - dbg("ERROR Failed initialize the touchscreen device: %d\n", ret); + dbg("ERROR Failed initialize the touchscreen device: %d\n", errno); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); return (FAR void *)0; From b76ec96bfbe3413a228cfe00cbd1ac7b73b29b1b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Apr 2015 07:39:00 -0600 Subject: [PATCH 314/390] Correct use of the BOARDIOC_GRAPHICS_SETUP boardctl() call --- libnxwidgets/src/cnxserver.cxx | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 3ac00e7fb..19b87a043 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -127,15 +127,25 @@ CNxServer::~CNxServer(void) bool CNxServer::connect(void) { #if defined(CONFIG_NXWIDGETS_EXTERNINIT) + struct boardioc_graphics_s devinfo; + int ret; + // Use external graphics driver initialization - m_hDevice = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_NXWIDGETS_DEVNO); - if (!m_hDevice) + printf("nxtext_initialize: Initializing external graphics device\n"); + + devinfo.devno = CONFIG_NXWIDGETS_DEVNO; + devinfo.dev = NULL; + + ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); + if (ret < 0) { - gdbg("boardctl failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return false; } + m_hDevice = devinfo.dev; + #elif defined(CONFIG_NX_LCDDRIVER) int ret; @@ -359,15 +369,25 @@ int CNxServer::server(int argc, char *argv[]) int ret; #if defined(CONFIG_NXWIDGETS_EXTERNINIT) + struct boardioc_graphics_s devinfo; + int ret; + // Use external graphics driver initialization - dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_NXWIDGETS_DEVNO); - if (!dev) + printf("nxtext_initialize: Initializing external graphics device\n"); + + devinfo.devno = CONFIG_NXWIDGETS_DEVNO; + devinfo.dev = NULL; + + ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); + if (ret < 0) { - gdbg("boardctl failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return EXIT_FAILURE; } + dev = devinfo.dev; + #elif defined(CONFIG_NX_LCDDRIVER) // Initialize the LCD device From 0bf5e9378dbc4b4deeb896227542044aa9712056 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Apr 2015 07:43:37 -0600 Subject: [PATCH 315/390] Update ChangeLogs --- ChangeLog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6bf237f29..734346dec 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -557,3 +557,8 @@ functions (2015-04-05). 1.16 2015-xx-xx Gregory Nutt + +* NxWM::CTouchscreen: When boardctl() fails, need to print errno not the + returned value which will always be -1 (2015-04-16). +* NxWidgets::CNxServer: Correct use of the BOARDIOC_GRAPHICS_SETUP + boardctl() call (2015-04-16). \ No newline at end of file From d2d5d42a7e9dbdeec1a8a45929b60c21c137c16a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Apr 2015 09:34:13 -0600 Subject: [PATCH 316/390] Reference to MAX_RAND should be RAND_MAX --- UnitTests/CListBox/clistbox_main.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitTests/CListBox/clistbox_main.cxx b/UnitTests/CListBox/clistbox_main.cxx index 09938e0a2..737d3bbaf 100644 --- a/UnitTests/CListBox/clistbox_main.cxx +++ b/UnitTests/CListBox/clistbox_main.cxx @@ -274,7 +274,7 @@ int clistbox_main(int argc, char *argv[]) printf("clistbox_main: Selecting five options\n"); for (int i = 0; i < 5; i++) { - selected[i] = ((nOptions - 1) * rand()) / MAX_RAND; + selected[i] = ((nOptions - 1) * rand()) / RAND_MAX; printf("clistbox_main: Selecting option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); From 564a0f6b900d4ecd68bd3bf19bdcbd381bcdfa50 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Apr 2015 09:36:10 -0600 Subject: [PATCH 317/390] Update ChangeLogs --- ChangeLog.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 734346dec..aafad64ae 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -561,4 +561,6 @@ * NxWM::CTouchscreen: When boardctl() fails, need to print errno not the returned value which will always be -1 (2015-04-16). * NxWidgets::CNxServer: Correct use of the BOARDIOC_GRAPHICS_SETUP - boardctl() call (2015-04-16). \ No newline at end of file + boardctl() call (2015-04-16). +* CListBox unit test: Should use RAND_MAX, not MAX_RAND (2015-04-16). + From 5a6fc783f5ff7bf84a564d6ba22d58508596a848 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 26 Jun 2015 18:13:20 -0600 Subject: [PATCH 318/390] This cleans up most of the remaining SourceForge references --- libnxwidgets/doc/mainpage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index 80168b028..85749df2f 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -4,7 +4,7 @@ * interface has been created called NXWidgets. NXWidgets is written in C++ * and integrates seamlessly with the NuttX NX graphics subystem in order to * provide graphic objects, or "widgets", in the + * Subsystem" href="https://bitbucket.org/patacongo/nuttx/src/master/nuttx/Documentation/NXGraphicsSubsystem.html?at=master"> * NX Graphics Subsystem. * * \section feature Features From 81f76a508872f17019aa59cf7aaf7d6344566346 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 28 Jun 2015 08:16:27 -0600 Subject: [PATCH 319/390] Fix references to the no-longer-existent misc/ directory in comments, README files, and documentation --- ChangeLog.txt | 3 ++- Kconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index aafad64ae..9b9b6cbbc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -563,4 +563,5 @@ * NxWidgets::CNxServer: Correct use of the BOARDIOC_GRAPHICS_SETUP boardctl() call (2015-04-16). * CListBox unit test: Should use RAND_MAX, not MAX_RAND (2015-04-16). - +* The NxWidgets/ directory has been removed from the NuttX GIT repository + and now stands alone in its own repository (2015-06-27). diff --git a/Kconfig b/Kconfig index a6ccaf8c1..018e5f9b6 100644 --- a/Kconfig +++ b/Kconfig @@ -1,6 +1,6 @@ # # For a description of the syntax of this configuration file, -# see misc/tools/kconfig-language.txt. +# see the file kconfig-language.txt in the NuttX tools repository. # config NXWIDGETS From 07d9b92d76b93d1aebd860915bbafafceaa42831 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 28 Jun 2015 09:59:40 -0600 Subject: [PATCH 320/390] Add top-level .gitignore --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..638021f38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.o +*.a +*.d +*.i +*~ +.swp +.*.swp +core +.gdbinit +cscope.out From f805f673a0a409682e40d4ea15cc504e312e026b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 29 Jun 2015 11:25:15 -0600 Subject: [PATCH 321/390] Update some URLs due to movement of the Documentation repository --- libnxwidgets/doc/mainpage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index 85749df2f..2ae13b4fd 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -4,7 +4,7 @@ * interface has been created called NXWidgets. NXWidgets is written in C++ * and integrates seamlessly with the NuttX NX graphics subystem in order to * provide graphic objects, or "widgets", in the + * Subsystem" href="https://bitbucket.org/nuttx/documentation/src/master/NXGraphicsSubsystem.html"> * NX Graphics Subsystem. * * \section feature Features From c04d72b74911b337789f21022bbbcc77aba28a79 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 12 Aug 2015 08:33:42 -0600 Subject: [PATCH 322/390] Kconfig: Put options in a menu --- Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Kconfig b/Kconfig index 018e5f9b6..2bc96a875 100644 --- a/Kconfig +++ b/Kconfig @@ -3,6 +3,8 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menu "NxWidgets/NxWM" + config NXWIDGETS bool "Enable NxWidgets" default n @@ -1281,3 +1283,5 @@ endif # NXWM_MEDIAPLAYER endmenu # NxWM Media Player Display Settings endif # NXWM +endmenu # NxWidgets/NxWM + From 527385da42569fcffbc0dd565a47e3b3d43e44d6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 17 Nov 2015 08:26:17 -0600 Subject: [PATCH 323/390] Update Doxygen PROJECT_NUMBER; Fix name CScaledImage->CScaledBitmap --- ChangeLog.txt | 4 ++-- Doxygen/Doxyfile | 2 +- ReleaseNotes.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9b9b6cbbc..75710127c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -387,11 +387,11 @@ * NxWM::CCalibration.cxx/hxx: Add options to collect and average multiple samples at each location. Also logic to discard the most extreme samples before averaging (2013-10-14). -* NxWidgets::CScaledImage: This new class is a wrapper for an class +* NxWidgets::CScaledBitmap: This new class is a wrapper for an class the exports IBitMap. It will perform scaling via bi-linear interpolation so that images can be scaled to any size desired (2013-10-15). * NxWM::CTaskbar:: Can now be configured to scale taskbar icons using - NxWidgets::CScaledImage (2013-10-15) + NxWidgets::CScaledBitmap (2013-10-15) * NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 NuttX logo image. The older, smaller NuttX logo was renamed from nxlogo to nxlogo160x160 in all places (2015-10-15). diff --git a/Doxygen/Doxyfile b/Doxygen/Doxyfile index 979f5720f..399fa553b 100644 --- a/Doxygen/Doxyfile +++ b/Doxygen/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = NXWidgets # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.1" +PROJECT_NUMBER = "1.15" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 40ed12bb3..46ab5366f 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -335,11 +335,11 @@ Additional new features and extended functionality in Version 1.9: * NxWM::CCalibration.cxx/hxx: Add options to collect and average multiple samples at each location. Also logic to discard the most extreme samples before averaging. -* NxWidgets::CScaledImage: This new class is a wrapper for an class +* NxWidgets::CScaledBitmap: This new class is a wrapper for an class the exports IBitMap. It will perform scaling via bi-linear interpolation so that images can be scaled to any size desired. * NxWM::CTaskbar:: Can now be configured to scale taskbar icons using - NxWidgets::CScaledImage. + NxWidgets::CScaledBitmap. * NxWidgets/libnxwidgets/src/glyph_nxlogo320x320.cxx: Add a big, 320x320 NuttX logo image. The older, smaller NuttX logo was renamed from nxlogo to nxlogo160x160 in all places. From f8507e7e42db051c8eaed0644c7ee16bb21d071d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 17 Nov 2015 10:10:18 -0600 Subject: [PATCH 324/390] Minor updates to README --- README.txt | 3 +++ libnxwidgets/doc/mainpage.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 98cd535cc..1ddce0887 100644 --- a/README.txt +++ b/README.txt @@ -95,3 +95,6 @@ nxwm running in a window. You should be able to select the NX icon in the start menu and create as many NSH sessions in windows as you want. (keybard input still comes through serial). + + Note 1: NwWM requires NuttX-7.9 or above to work with the current + NxWidgets-1.15 release. diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index 2ae13b4fd..d11f05563 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -75,7 +75,7 @@ * many NSH sessions in windows as you want. (keybard input still comes * through serial). * - * Note 1: NwWM requires NuttX-6.18 or above. + * Note 1: The current release of NwWM requires NuttX-7.9 or above. * * Note 2: Many of the fundamental classes in NxWidgets derive from the Antony * Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style From 7f1ddaedc5218a7838cb875462638d2c90fad8a9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 24 Nov 2015 23:00:03 +0000 Subject: [PATCH 325/390] Fixed some very minor spacing issues --- libnxwidgets/include/ccallback.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index ef1d3f81d..9b641f8e7 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -94,7 +94,7 @@ namespace NXWidgets CWidgetControl *m_widgetControl; /**< The widget control instance for this window */ struct nx_callback_s m_callbacks; /**< C-callable vtable of callback function pointers */ #ifdef CONFIG_NXTERM_NXKBDIN - NXTERM m_nxterm; /**< The NxTerm handle for redirection of keyboard input */ + NXTERM m_nxterm; /**< The NxTerm handle for redirection of keyboard input */ #endif // Methods in the callback vtable @@ -208,7 +208,7 @@ namespace NXWidgets */ #ifdef CONFIG_NX_MULTIUSER - static void windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2); + static void windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2); #endif public: From d6a76e798fb9a99fea5ed3bbc388b85e159e1589 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 14 Apr 2016 12:24:04 -0600 Subject: [PATCH 326/390] Framebuffer driver: Add a display number to each interface in order to support multiple displays --- libnxwidgets/src/cnxserver.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 19b87a043..06e979f22 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxserver.cxx * - * Copyright (C) 2012, 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2013, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -175,15 +175,16 @@ bool CNxServer::connect(void) int ret; // Initialize the frame buffer device + // REVISIT: display == 0 is assumed - ret = up_fbinitialize(); + ret = up_fbinitialize(0); if (ret < 0) { gdbg("up_fbinitialize failed: %d\n", -ret); return false; } - m_hDevice = up_fbgetvplane(CONFIG_NXWIDGETS_VPLANE); + m_hDevice = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!m_hDevice) { gdbg("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", @@ -414,14 +415,14 @@ int CNxServer::server(int argc, char *argv[]) #else // CONFIG_NX_LCDDRIVER // Initialize the frame buffer device - ret = up_fbinitialize(); + ret = up_fbinitialize(0); if (ret < 0) { gdbg("nxterm_server: up_fbinitialize failed: %d\n", -ret); return EXIT_FAILURE; } - dev = up_fbgetvplane(CONFIG_NXWIDGETS_VPLANE); + dev = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!dev) { gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); From c436fbab0d76a209e001f58ff3fedf5cabfc226b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 14 Apr 2016 16:22:17 -0600 Subject: [PATCH 327/390] Update ChangeLog --- ChangeLog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 75710127c..031b32635 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -565,3 +565,6 @@ * CListBox unit test: Should use RAND_MAX, not MAX_RAND (2015-04-16). * The NxWidgets/ directory has been removed from the NuttX GIT repository and now stands alone in its own repository (2015-06-27). +* Framebuffer driver parameters have changed. This introduces an + incompatibility with versions of NuttX prior to 7.16 (2016-04-14). + From 909b08111329abfc99443372c5f4efcb439d2dc9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Apr 2016 08:56:01 -0600 Subject: [PATCH 328/390] Add configuration option to select greyscale image --- Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Kconfig b/Kconfig index 2bc96a875..9474cacc9 100644 --- a/Kconfig +++ b/Kconfig @@ -129,6 +129,13 @@ config NXWIDGETS_BPP Supported bits-per-pixel {8, 16, 24, 32}. Default: The smallest BPP configuration supported by NX. +config NXWIDGETS_GREYSCALE + bool "Greyscale (vs RGB)" + default n + ---help--- + Select to use a greyscale vs RGB color image. This option is ignored if + CONFIG_NXWIDGETS_BPP > 8 + config NXWIDGETS_SIZEOFCHAR int "Size of a character (1 or 2 bytes)" range 1 2 From d7226cc6baa0529a63ee74ed19b76c6b347e556b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Apr 2016 13:39:12 -0600 Subject: [PATCH 329/390] VNC: Finish initializing the VNC server once we have the NX handle --- libnxwidgets/src/cnxserver.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 06e979f22..5c70bda57 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -56,6 +56,10 @@ # include #endif +#ifdef CONFIG_VNCSERVER +# include +#endif + #include "nxconfig.hxx" #include "singletons.hxx" #include "cnxserver.hxx" @@ -203,6 +207,18 @@ bool CNxServer::connect(void) return false; } +#ifdef CONFIG_VNCSERVER + // Setup the VNC server to support keyboard/mouse inputs + + ret = vnc_default_fbinitialize(0, m_hNxServer); + if (ret < 0) + { + gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + disconnect(); + return false; + } +#endif + return true; } #endif // CONFIG_NX_MULTIUSER @@ -254,6 +270,19 @@ bool CNxServer::connect(void) { pthread_attr_t attr; +#ifdef CONFIG_VNCSERVER + // Setup the VNC server to support keyboard/mouse inputs + + ret = vnc_default_fbinitialize(0, m_hNxServer); + if (ret < 0) + { + gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + m_running = false; + disconnect(); + return false; + } +#endif + // Start a separate thread to listen for server events. This is probably // the least efficient way to do this, but it makes this logic flow more // smoothly. From bc069b3b41430c78c5cd1f6797301e2c7ad762b4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 23 Apr 2016 08:06:25 -0600 Subject: [PATCH 330/390] UnitTests directories need Make.defs files in order to build with the current apps/ Makefile --- ChangeLog.txt | 4 +++ UnitTests/CButton/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CButtonArray/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CCheckBox/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CGlyphButton/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CGlyphSliderHorizontal/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CImage/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CKeypad/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CLabel/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CLatchButton/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CLatchButtonArray/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CListBox/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CProgressBar/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CRadioButton/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CScrollbarHorizontal/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CScrollbarVertical/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CSliderHorizonal/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CSliderVertical/Make.defs | 40 ++++++++++++++++++++++ UnitTests/CTextBox/Make.defs | 40 ++++++++++++++++++++++ UnitTests/nxwm/Make.defs | 40 ++++++++++++++++++++++ 20 files changed, 764 insertions(+) create mode 100644 UnitTests/CButton/Make.defs create mode 100644 UnitTests/CButtonArray/Make.defs create mode 100644 UnitTests/CCheckBox/Make.defs create mode 100644 UnitTests/CGlyphButton/Make.defs create mode 100644 UnitTests/CGlyphSliderHorizontal/Make.defs create mode 100644 UnitTests/CImage/Make.defs create mode 100644 UnitTests/CKeypad/Make.defs create mode 100644 UnitTests/CLabel/Make.defs create mode 100644 UnitTests/CLatchButton/Make.defs create mode 100644 UnitTests/CLatchButtonArray/Make.defs create mode 100644 UnitTests/CListBox/Make.defs create mode 100644 UnitTests/CProgressBar/Make.defs create mode 100644 UnitTests/CRadioButton/Make.defs create mode 100644 UnitTests/CScrollbarHorizontal/Make.defs create mode 100644 UnitTests/CScrollbarVertical/Make.defs create mode 100644 UnitTests/CSliderHorizonal/Make.defs create mode 100644 UnitTests/CSliderVertical/Make.defs create mode 100644 UnitTests/CTextBox/Make.defs create mode 100644 UnitTests/nxwm/Make.defs diff --git a/ChangeLog.txt b/ChangeLog.txt index 031b32635..1c7c2eb77 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -567,4 +567,8 @@ and now stands alone in its own repository (2015-06-27). * Framebuffer driver parameters have changed. This introduces an incompatibility with versions of NuttX prior to 7.16 (2016-04-14). +* UnitTests: Add Make.defs files to all UnitTests directories. This is + required by the current apps/Makefile. Hmmm.. This means that no one + has built the NxWidgets packages in the last several realeases! + (2016-04-23). diff --git a/UnitTests/CButton/Make.defs b/UnitTests/CButton/Make.defs new file mode 100644 index 000000000..743c14d16 --- /dev/null +++ b/UnitTests/CButton/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CButton/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CButtonArray/Make.defs b/UnitTests/CButtonArray/Make.defs new file mode 100644 index 000000000..b73daa80c --- /dev/null +++ b/UnitTests/CButtonArray/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CButtonArray/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CCheckBox/Make.defs b/UnitTests/CCheckBox/Make.defs new file mode 100644 index 000000000..2edee9eb8 --- /dev/null +++ b/UnitTests/CCheckBox/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CCheckBox/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CGlyphButton/Make.defs b/UnitTests/CGlyphButton/Make.defs new file mode 100644 index 000000000..3d77c6539 --- /dev/null +++ b/UnitTests/CGlyphButton/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CGlyphButton/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CGlyphSliderHorizontal/Make.defs b/UnitTests/CGlyphSliderHorizontal/Make.defs new file mode 100644 index 000000000..ef428868d --- /dev/null +++ b/UnitTests/CGlyphSliderHorizontal/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CGlyphSliderHorizontal/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CImage/Make.defs b/UnitTests/CImage/Make.defs new file mode 100644 index 000000000..176cc6d94 --- /dev/null +++ b/UnitTests/CImage/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CImage/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CKeypad/Make.defs b/UnitTests/CKeypad/Make.defs new file mode 100644 index 000000000..888533a2a --- /dev/null +++ b/UnitTests/CKeypad/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CKeypad/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CLabel/Make.defs b/UnitTests/CLabel/Make.defs new file mode 100644 index 000000000..7a53d5172 --- /dev/null +++ b/UnitTests/CLabel/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CLabel/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CLatchButton/Make.defs b/UnitTests/CLatchButton/Make.defs new file mode 100644 index 000000000..7b6063bc4 --- /dev/null +++ b/UnitTests/CLatchButton/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CLatchButton/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CLatchButtonArray/Make.defs b/UnitTests/CLatchButtonArray/Make.defs new file mode 100644 index 000000000..0813dd8eb --- /dev/null +++ b/UnitTests/CLatchButtonArray/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CLatchButtonArray/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CListBox/Make.defs b/UnitTests/CListBox/Make.defs new file mode 100644 index 000000000..4d1fd1db3 --- /dev/null +++ b/UnitTests/CListBox/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CListBox/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CProgressBar/Make.defs b/UnitTests/CProgressBar/Make.defs new file mode 100644 index 000000000..adc0ed2a8 --- /dev/null +++ b/UnitTests/CProgressBar/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CProgressBar/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CRadioButton/Make.defs b/UnitTests/CRadioButton/Make.defs new file mode 100644 index 000000000..ae720fe0a --- /dev/null +++ b/UnitTests/CRadioButton/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CRadioButton/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CScrollbarHorizontal/Make.defs b/UnitTests/CScrollbarHorizontal/Make.defs new file mode 100644 index 000000000..3b60dd704 --- /dev/null +++ b/UnitTests/CScrollbarHorizontal/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CScrollbarHorizontal/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CScrollbarVertical/Make.defs b/UnitTests/CScrollbarVertical/Make.defs new file mode 100644 index 000000000..afc733607 --- /dev/null +++ b/UnitTests/CScrollbarVertical/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CScrollbarVertical/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CSliderHorizonal/Make.defs b/UnitTests/CSliderHorizonal/Make.defs new file mode 100644 index 000000000..04983595e --- /dev/null +++ b/UnitTests/CSliderHorizonal/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CSliderHorizonal/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CSliderVertical/Make.defs b/UnitTests/CSliderVertical/Make.defs new file mode 100644 index 000000000..c40842fed --- /dev/null +++ b/UnitTests/CSliderVertical/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CSliderVertical/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/CTextBox/Make.defs b/UnitTests/CTextBox/Make.defs new file mode 100644 index 000000000..eef62f70f --- /dev/null +++ b/UnitTests/CTextBox/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/CTextBox/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + diff --git a/UnitTests/nxwm/Make.defs b/UnitTests/nxwm/Make.defs new file mode 100644 index 000000000..1ea0db7f3 --- /dev/null +++ b/UnitTests/nxwm/Make.defs @@ -0,0 +1,40 @@ +############################################################################ +# NxWidgets/UnitTests/nxwm/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_BUILTIN),y) +CONFIGURED_APPS += external +endif + From 0ccaac395947f19982dade7cbabf0978d755807a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 10 May 2016 15:36:50 -0600 Subject: [PATCH 331/390] UnitTests: Handle the unusual case where 'make clean' is executed with no .config or Make.defs file --- ChangeLog.txt | 3 +++ UnitTests/CButton/Makefile | 6 +++++- UnitTests/CButtonArray/Makefile | 6 +++++- UnitTests/CCheckBox/Makefile | 6 +++++- UnitTests/CGlyphButton/Makefile | 6 +++++- UnitTests/CGlyphSliderHorizontal/Makefile | 6 +++++- UnitTests/CImage/Makefile | 6 +++++- UnitTests/CKeypad/Makefile | 6 +++++- UnitTests/CLabel/Makefile | 6 +++++- UnitTests/CLatchButton/Makefile | 6 +++++- UnitTests/CLatchButtonArray/Makefile | 6 +++++- UnitTests/CListBox/Makefile | 6 +++++- UnitTests/CProgressBar/Makefile | 6 +++++- UnitTests/CRadioButton/Makefile | 6 +++++- UnitTests/CScrollbarHorizontal/Makefile | 6 +++++- UnitTests/CScrollbarVertical/Makefile | 6 +++++- UnitTests/CSliderHorizonal/Makefile | 6 +++++- UnitTests/CSliderVertical/Makefile | 6 +++++- UnitTests/CTextBox/Makefile | 6 +++++- UnitTests/nxwm/Makefile | 4 ++++ 20 files changed, 97 insertions(+), 18 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1c7c2eb77..f8afa4668 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -571,4 +571,7 @@ required by the current apps/Makefile. Hmmm.. This means that no one has built the NxWidgets packages in the last several realeases! (2016-04-23). +* UnitTests: Add some default definitions to handle the (unusual) case + where 'make clean' is called with no .config or Make.defs file installed + (2016-05-10). diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 4b31857a1..7cb4142f7 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/Unitests/CButton/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index 22d2390c3..cf58f548b 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CButtonArray/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index bc7c2da6d..5efaaa0ce 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CCheckBox/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 4e0975e9b..2ee9463b9 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CGlyphButton/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CGlyphSliderHorizontal/Makefile b/UnitTests/CGlyphSliderHorizontal/Makefile index 96d825953..9bbe295a0 100644 --- a/UnitTests/CGlyphSliderHorizontal/Makefile +++ b/UnitTests/CGlyphSliderHorizontal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CGlyphSliderHorizontal/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index 7fc9cd9af..f15308dc0 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CImage/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 28571f2b2..0dcc1136a 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CKeyPad/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index 44c21b801..e1519a76e 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLabel/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 5dde0324c..79dcd8967 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLatchButton/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index 1280727e9..e5cde9f25 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CLatchButtonArray/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index b30278cc3..f31c3528e 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CListBox/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index d05b7311a..221f45c1b 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CProgressBar/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index a977b4e95..44afdee4a 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CRadioButton/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index 5a7038790..d0d10c963 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CScrollbarHorizontal/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index 290e9736c..f7bd98840 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CScrollbarVertical/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 3d4881d03..1b8d0cd4d 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CSliderHorizontal/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index 1fc39d29a..a22c4ba18 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CSliderVertical/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index 3d96662a6..da229542d 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/UnitTests/CTextBox/Makefile # -# Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 22fab3194..8789e972c 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -36,6 +36,10 @@ TESTDIR := ${shell pwd | sed -e 's/ /\\ /g'} -include $(TOPDIR)/Make.defs + +OBJEXT ?= .o +DELIM ?= / + include $(APPDIR)$(DELIM)Make.defs # Add the path to the NXWidget include directory to the CFLAGS From ad952adb763e484117075e13408b7ecab81bc461 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 1 Jun 2016 10:54:06 -0600 Subject: [PATCH 332/390] Prep for 1.16 release --- ChangeLog.txt | 3 ++- ReleaseNotes.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index f8afa4668..c2513121e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -556,7 +556,7 @@ to NX nx_drawline() and NXTK nxtk_drawlinetoolbar() and nxtk_drawlinewindow() functions (2015-04-05). -1.16 2015-xx-xx Gregory Nutt +1.16 2016-06-01 Gregory Nutt * NxWM::CTouchscreen: When boardctl() fails, need to print errno not the returned value which will always be -1 (2015-04-16). @@ -575,3 +575,4 @@ where 'make clean' is called with no .config or Make.defs file installed (2016-05-10). +1.17 2016-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 46ab5366f..e930027b9 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -506,3 +506,32 @@ Additional new features and extended functionality in Version 1.15: Bugfixes: * There are no new bug fixes in this release. + +NxWidgets-1.16 +============== + +The 17th release of the NxWidgets package was made on June 1, 2016. This +release depends on NuttX-7.16 or above and should not be used with older +NuttX releases. + +The TAG for this release is nuttx-7.16 + +Additional new features and extended functionality in Version 1.15: + +* The NxWidgets/ directory has been removed from the NuttX GIT repository + and now stands alone in its own repository (2015-06-27). + +Bugfixes\: + +* NxWM::CTouchscreen: When boardctl() fails, need to print errno not the + returned value which will always be -1. +* NxWidgets::CNxServer: Correct use of the BOARDIOC_GRAPHICS_SETUP + boardctl() call. +* CListBox unit test: Should use RAND_MAX, not MAX_RAND. +* Framebuffer driver parameters have changed. This introduces an + incompatibility with versions of NuttX prior to 7.16. +* UnitTests: Add Make.defs files to all UnitTests directories. This is + required by the current apps/Makefile. Hmmm.. This means that no one + has built the NxWidgets packages in the last several realeases! +* UnitTests: Add some default definitions to handle the (unusual) case + where 'make clean' is called with no .config or Make.defs file installed From b99f42ace6447c1ebd66b944f545f10397972c3f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 11:57:52 -0600 Subject: [PATCH 333/390] Eliminate some warnings --- nxwm/include/ccalibration.hxx | 4 ++-- nxwm/src/ccalibration.cxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nxwm/include/ccalibration.hxx b/nxwm/include/ccalibration.hxx index d9cf3a7de..798a4fc72 100644 --- a/nxwm/include/ccalibration.hxx +++ b/nxwm/include/ccalibration.hxx @@ -182,7 +182,7 @@ namespace NxWM bool m_stop; /**< True: We have been asked to stop the calibration */ bool m_touched; /**< True: The screen is touched */ uint8_t m_touchId; /**< The ID of the touch */ -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE uint8_t m_nsamples; /**< Number of samples collected so far at this position */ struct nxgl_point_s m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES]; #endif @@ -278,7 +278,7 @@ namespace NxWM * @return True: Average data is available; False: Need to collect more samples */ -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE bool averageSamples(struct nxgl_point_s &average); #endif diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 2a65662ff..6ef8c4275 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -690,7 +690,7 @@ FAR void *CCalibration::calibration(FAR void *arg) * @return True: Average data is available; False: Need to collect more samples */ -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE bool CCalibration::averageSamples(struct nxgl_point_s &average) { // Have we started collecting sample data? */ @@ -801,7 +801,7 @@ void CCalibration::stateMachine(void) { gvdbg("Old m_calphase=%d\n", m_calphase); -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE // Are we collecting samples? struct nxgl_point_s average; @@ -891,7 +891,7 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_UPPER_LEFT state. // Save the touch data and set up the next calibration display -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE m_calibData[CALIB_UPPER_LEFT_INDEX].x = average.x; m_calibData[CALIB_UPPER_LEFT_INDEX].y = average.y; #else @@ -928,7 +928,7 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_UPPER_RIGHT state. // Save the touch data and set up the next calibration display -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE m_calibData[CALIB_UPPER_RIGHT_INDEX].x = average.x; m_calibData[CALIB_UPPER_RIGHT_INDEX].y = average.y; #else @@ -965,7 +965,7 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_LOWER_RIGHT state. // Save the touch data and set up the next calibration display -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE m_calibData[CALIB_LOWER_RIGHT_INDEX].x = average.x; m_calibData[CALIB_LOWER_RIGHT_INDEX].y = average.y; #else @@ -1002,7 +1002,7 @@ void CCalibration::stateMachine(void) // A touch has been received while in the CALPHASE_LOWER_LEFT state. // Save the touch data and set up the next calibration display -#if CONFIG_NXWM_CALIBRATION_AVERAGE +#ifdef CONFIG_NXWM_CALIBRATION_AVERAGE m_calibData[CALIB_LOWER_LEFT_INDEX].x = average.x; m_calibData[CALIB_LOWER_LEFT_INDEX].y = average.y; #else From 0e5c3ecd0fa7bd67e36e2f1dc0a3a11c51e3e600 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 14:31:51 -0600 Subject: [PATCH 334/390] Back conditional logic out of UnitTest Make.defs file. It should not be there. --- UnitTests/CButton/Make.defs | 2 -- UnitTests/CButtonArray/Make.defs | 2 -- UnitTests/CCheckBox/Make.defs | 2 -- UnitTests/CGlyphButton/Make.defs | 2 -- UnitTests/CGlyphSliderHorizontal/Make.defs | 2 -- UnitTests/CImage/Make.defs | 2 -- UnitTests/CKeypad/Make.defs | 2 -- UnitTests/CLabel/Make.defs | 2 -- UnitTests/CLatchButton/Make.defs | 2 -- UnitTests/CLatchButtonArray/Make.defs | 2 -- UnitTests/CListBox/Make.defs | 2 -- UnitTests/CProgressBar/Make.defs | 2 -- UnitTests/CRadioButton/Make.defs | 2 -- UnitTests/CScrollbarHorizontal/Make.defs | 2 -- UnitTests/CScrollbarVertical/Make.defs | 2 -- UnitTests/CSliderHorizonal/Make.defs | 2 -- UnitTests/CSliderVertical/Make.defs | 2 -- UnitTests/CTextBox/Make.defs | 2 -- UnitTests/nxwm/Make.defs | 2 -- 19 files changed, 38 deletions(-) diff --git a/UnitTests/CButton/Make.defs b/UnitTests/CButton/Make.defs index 743c14d16..e59371f84 100644 --- a/UnitTests/CButton/Make.defs +++ b/UnitTests/CButton/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CButtonArray/Make.defs b/UnitTests/CButtonArray/Make.defs index b73daa80c..cab14c796 100644 --- a/UnitTests/CButtonArray/Make.defs +++ b/UnitTests/CButtonArray/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CCheckBox/Make.defs b/UnitTests/CCheckBox/Make.defs index 2edee9eb8..3fe28b5d3 100644 --- a/UnitTests/CCheckBox/Make.defs +++ b/UnitTests/CCheckBox/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CGlyphButton/Make.defs b/UnitTests/CGlyphButton/Make.defs index 3d77c6539..843e04a52 100644 --- a/UnitTests/CGlyphButton/Make.defs +++ b/UnitTests/CGlyphButton/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CGlyphSliderHorizontal/Make.defs b/UnitTests/CGlyphSliderHorizontal/Make.defs index ef428868d..c5b09a167 100644 --- a/UnitTests/CGlyphSliderHorizontal/Make.defs +++ b/UnitTests/CGlyphSliderHorizontal/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CImage/Make.defs b/UnitTests/CImage/Make.defs index 176cc6d94..11b39da0e 100644 --- a/UnitTests/CImage/Make.defs +++ b/UnitTests/CImage/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CKeypad/Make.defs b/UnitTests/CKeypad/Make.defs index 888533a2a..bb880d1ef 100644 --- a/UnitTests/CKeypad/Make.defs +++ b/UnitTests/CKeypad/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CLabel/Make.defs b/UnitTests/CLabel/Make.defs index 7a53d5172..59b5cd442 100644 --- a/UnitTests/CLabel/Make.defs +++ b/UnitTests/CLabel/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CLatchButton/Make.defs b/UnitTests/CLatchButton/Make.defs index 7b6063bc4..bde3d6172 100644 --- a/UnitTests/CLatchButton/Make.defs +++ b/UnitTests/CLatchButton/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CLatchButtonArray/Make.defs b/UnitTests/CLatchButtonArray/Make.defs index 0813dd8eb..c13bfe36e 100644 --- a/UnitTests/CLatchButtonArray/Make.defs +++ b/UnitTests/CLatchButtonArray/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CListBox/Make.defs b/UnitTests/CListBox/Make.defs index 4d1fd1db3..26d95e53f 100644 --- a/UnitTests/CListBox/Make.defs +++ b/UnitTests/CListBox/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CProgressBar/Make.defs b/UnitTests/CProgressBar/Make.defs index adc0ed2a8..acdd0523c 100644 --- a/UnitTests/CProgressBar/Make.defs +++ b/UnitTests/CProgressBar/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CRadioButton/Make.defs b/UnitTests/CRadioButton/Make.defs index ae720fe0a..20b7028a4 100644 --- a/UnitTests/CRadioButton/Make.defs +++ b/UnitTests/CRadioButton/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CScrollbarHorizontal/Make.defs b/UnitTests/CScrollbarHorizontal/Make.defs index 3b60dd704..fed968e03 100644 --- a/UnitTests/CScrollbarHorizontal/Make.defs +++ b/UnitTests/CScrollbarHorizontal/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CScrollbarVertical/Make.defs b/UnitTests/CScrollbarVertical/Make.defs index afc733607..613a798e6 100644 --- a/UnitTests/CScrollbarVertical/Make.defs +++ b/UnitTests/CScrollbarVertical/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CSliderHorizonal/Make.defs b/UnitTests/CSliderHorizonal/Make.defs index 04983595e..5db6470cb 100644 --- a/UnitTests/CSliderHorizonal/Make.defs +++ b/UnitTests/CSliderHorizonal/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CSliderVertical/Make.defs b/UnitTests/CSliderVertical/Make.defs index c40842fed..5b807e184 100644 --- a/UnitTests/CSliderVertical/Make.defs +++ b/UnitTests/CSliderVertical/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/CTextBox/Make.defs b/UnitTests/CTextBox/Make.defs index eef62f70f..f884dd791 100644 --- a/UnitTests/CTextBox/Make.defs +++ b/UnitTests/CTextBox/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif diff --git a/UnitTests/nxwm/Make.defs b/UnitTests/nxwm/Make.defs index 1ea0db7f3..62892bbfd 100644 --- a/UnitTests/nxwm/Make.defs +++ b/UnitTests/nxwm/Make.defs @@ -34,7 +34,5 @@ # ############################################################################ -ifeq ($(CONFIG_BUILTIN),y) CONFIGURED_APPS += external -endif From ab936de4fc52277c37aeba8f3020d68681bfc448 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 14:46:25 -0600 Subject: [PATCH 335/390] Update ChangeLog --- ChangeLog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index c2513121e..5e1e01d88 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -576,3 +576,8 @@ (2016-05-10). 1.17 2016-xx-xx Gregory Nutt + +* UnitTests: Back conditional logic out of UnitTest Make.defs files. It + does not belong there and causes link failures like "Cannot find nxwm_main" + (2016-06-05). + From a5e7009008b1160009a6a5446e05a4bd36d4c7fb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 Jun 2016 11:55:17 -0600 Subject: [PATCH 336/390] Replace all occurrences of vdbg with vinfo --- libnxwidgets/src/ccallback.cxx | 10 ++++---- libnxwidgets/src/cgraphicsport.cxx | 4 ++-- libnxwidgets/src/cimage.cxx | 2 +- libnxwidgets/src/cnxserver.cxx | 6 ++--- libnxwidgets/src/cscrollingpanel.cxx | 2 +- nxwm/src/ccalibration.cxx | 34 ++++++++++++++-------------- nxwm/src/ckeyboard.cxx | 14 ++++++------ nxwm/src/cmediaplayer.cxx | 6 ++--- nxwm/src/ctaskbar.cxx | 8 +++---- nxwm/src/ctouchscreen.cxx | 26 ++++++++++----------- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 77714d208..4bc96dbeb 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -107,7 +107,7 @@ void CCallback::redraw(NXHANDLE hwnd, FAR const struct nxgl_rect_s *rect, bool bMore, FAR void *arg) { - gvdbg("hwnd=%p rect={(%d,%d),(%d,%d)} bMore=%s\n", + ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} bMore=%s\n", hwnd, rect->pt1.x, rect->pt1.y, rect->pt2.x, rect->pt2.y, bMore ? "true" : "false"); @@ -140,7 +140,7 @@ void CCallback::position(NXHANDLE hwnd, FAR const struct nxgl_rect_s *bounds, FAR void *arg) { - gvdbg("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)} arg=%p\n", + ginfo("hwnd=%p size=(%d,%d) pos=(%d,%d) bounds={(%d,%d),(%d,%d)} arg=%p\n", hwnd, size->w, size->h, pos->x, pos->y, bounds->pt1.x, bounds->pt1.y, bounds->pt2.x, bounds->pt2.y, arg); @@ -170,7 +170,7 @@ void CCallback::newMouseEvent(NXHANDLE hwnd, FAR const struct nxgl_point_s *pos, uint8_t buttons, FAR void *arg) { - gvdbg("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", + ginfo("hwnd=%p pos=(%d,%d) buttons=%02x arg=%p\n", hwnd, pos->x, pos->y, buttons, arg); // The argument must be the CCallback instance @@ -199,7 +199,7 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, FAR const uint8_t *str, FAR void *arg) { - gvdbg("hwnd=%p nCh=%d arg=%p\n", hwnd, nCh, arg); + ginfo("hwnd=%p nCh=%d arg=%p\n", hwnd, nCh, arg); // The argument must be the CCallback instance @@ -249,7 +249,7 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, #ifdef CONFIG_NX_MULTIUSER void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) { - gvdbg("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); + ginfo("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); // The first argument must be the CCallback instance diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index 62e3a6eb0..fa1f3f36d 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -535,7 +535,7 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, FAR nxwidget_pixel_t *run = new nxwidget_pixel_t[width]; if (!run) { - gvdbg("ERROR: Failed to allocated run buffer\n"); + ginfo("ERROR: Failed to allocated run buffer\n"); return; } @@ -829,7 +829,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, if (!m_pNxWnd->bitmap(&intersection, (FAR const void *)bitmap.data, pos, bitmap.stride)) { - gvdbg("nx_bitmapwindow failed: %d\n", errno); + ginfo("nx_bitmapwindow failed: %d\n", errno); } } } diff --git a/libnxwidgets/src/cimage.cxx b/libnxwidgets/src/cimage.cxx index 291552217..37dcd2707 100644 --- a/libnxwidgets/src/cimage.cxx +++ b/libnxwidgets/src/cimage.cxx @@ -268,7 +268,7 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) if (!m_bitmap->getRun(0, srcRow, nLeftPixels, &buffer[m_origin.x])) { - gvdbg("IBitmap::getRun failed at image row\n", srcRow); + ginfo("IBitmap::getRun failed at image row\n", srcRow); delete buffer; return; } diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 5c70bda57..8736f20a2 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -247,7 +247,7 @@ bool CNxServer::connect(void) #ifdef CONFIG_NXWIDGET_SERVERINIT // Start the server task - gvdbg("CNxServer::connect: Starting server task\n"); + ginfo("CNxServer::connect: Starting server task\n"); pid_t serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, CONFIG_NXWIDGETS_SERVERSTACK, server, (FAR char * const *)0); @@ -463,7 +463,7 @@ int CNxServer::server(int argc, char *argv[]) // Then start the server ret = nx_run(dev); - gvdbg("nx_run returned: %d\n", errno); + ginfo("nx_run returned: %d\n", errno); return EXIT_FAILURE; } #endif // CONFIG_NX_MULTIUSER && CONFIG_NXWIDGET_SERVERINIT @@ -507,7 +507,7 @@ FAR void *CNxServer::listener(FAR void *arg) { This->m_connected = true; sem_post(&This->m_connsem); - gvdbg("Connected\n"); + ginfo("Connected\n"); } } diff --git a/libnxwidgets/src/cscrollingpanel.cxx b/libnxwidgets/src/cscrollingpanel.cxx index c93d113a6..59a0c9056 100644 --- a/libnxwidgets/src/cscrollingpanel.cxx +++ b/libnxwidgets/src/cscrollingpanel.cxx @@ -227,7 +227,7 @@ void CScrollingPanel::scroll(int32_t dx, int32_t dy) { CRect &rrect = revealedRects[i]; - gvdbg("Redrawing %d,%d,%d,%d after scroll\n", + ginfo("Redrawing %d,%d,%d,%d after scroll\n", rrect.getX(), rrect.getY(), rrect.getWidth(), rrect.getHeight()); diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 6ef8c4275..cf691b81e 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -84,8 +84,8 @@ #ifndef CONFIG_DEBUG_INPUT # undef idbg # define idbg gdbg -# undef ivdbg -# define ivdbg gvdbg +# undef iinfo +# define iinfo ginfo #endif /**************************************************************************** @@ -197,7 +197,7 @@ NXWidgets::CNxString CCalibration::getName(void) bool CCalibration::run(void) { - gvdbg("Starting calibration: m_calthread=%d\n", (int)m_calthread); + ginfo("Starting calibration: m_calthread=%d\n", (int)m_calthread); return startCalibration(CALTHREAD_STARTED); } @@ -208,7 +208,7 @@ bool CCalibration::run(void) void CCalibration::stop(void) { - gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); + ginfo("Stopping calibration: m_calthread=%d\n", (int)m_calthread); // Was the calibration thread created? @@ -227,7 +227,7 @@ void CCalibration::stop(void) // Try to wake up the calibration thread so that it will see our // termination request - gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread); + ginfo("Stopping calibration: m_calthread=%d\n", (int)m_calthread); (void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO); // Wait for the calibration thread to exit @@ -265,7 +265,7 @@ void CCalibration::destroy(void) void CCalibration::hide(void) { - gvdbg("Entry\n"); + ginfo("Entry\n"); // Is the calibration thread running? @@ -288,7 +288,7 @@ void CCalibration::redraw(void) { uint8_t waitcount = 0; - gvdbg("Entry\n"); + ginfo("Entry\n"); // Is the calibration thread still running? We might have to restart // it if we have completed the calibration early but are being brought @@ -296,7 +296,7 @@ void CCalibration::redraw(void) if (!isStarted()) { - gvdbg("Starting calibration: m_calthread=%d\n", (int)m_calthread); + ginfo("Starting calibration: m_calthread=%d\n", (int)m_calthread); (void)startCalibration(CALTHREAD_SHOW); } @@ -356,7 +356,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) m_touchPos.x = sample.point[0].x; m_touchPos.y = sample.point[0].y; - ivdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + iinfo("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", sample.point[0].id, sample.point[0].flags, sample.point[0].x, sample.point[0].y, sample.point[0].h, sample.point[0].w, sample.point[0].pressure); @@ -394,7 +394,7 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample) { // Yes.. invoke the state machine. - ivdbg("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", + iinfo("State: %d Screen x: %d y: %d Touch x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y, m_touchPos.x, m_touchPos.y); @@ -567,7 +567,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) return false; } - gvdbg("Calibration thread m_calthread=%d\n", (int)m_calthread); + ginfo("Calibration thread m_calthread=%d\n", (int)m_calthread); return true; } @@ -602,7 +602,7 @@ FAR void *CCalibration::calibration(FAR void *arg) This->m_calthread = CALTHREAD_RUNNING; This->m_calphase = CALPHASE_NOT_STARTED; - gvdbg("Started: m_calthread=%d\n", (int)This->m_calthread); + ginfo("Started: m_calthread=%d\n", (int)This->m_calthread); // Loop until calibration completes or we have been requested to terminate @@ -679,7 +679,7 @@ FAR void *CCalibration::calibration(FAR void *arg) This->destroyWidgets(); #endif - gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread); + ginfo("Terminated: m_calthread=%d\n", (int)This->m_calthread); return (FAR void *)0; } @@ -697,7 +697,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) // Save the sample data - ivdbg("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); + iinfo("Sample %d: Touch x: %d y: %d\n", m_nsamples+1, m_touchPos.x, m_touchPos.y); m_sampleData[m_nsamples].x = m_touchPos.x; m_sampleData[m_nsamples].y = m_touchPos.y; @@ -786,7 +786,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) average.y = m_sampleData[0].y; #endif - ivdbg("Average: Touch x: %d y: %d\n", average.x, average.y); + iinfo("Average: Touch x: %d y: %d\n", average.x, average.y); m_nsamples = 0; return true; } @@ -799,7 +799,7 @@ bool CCalibration::averageSamples(struct nxgl_point_s &average) void CCalibration::stateMachine(void) { - gvdbg("Old m_calphase=%d\n", m_calphase); + ginfo("Old m_calphase=%d\n", m_calphase); #ifdef CONFIG_NXWM_CALIBRATION_AVERAGE // Are we collecting samples? @@ -1031,7 +1031,7 @@ void CCalibration::stateMachine(void) break; } - ivdbg("New m_calphase=%d Screen x: %d y: %d\n", + iinfo("New m_calphase=%d Screen x: %d y: %d\n", m_calphase, m_screenInfo.pos.x, m_screenInfo.pos.y); } diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index f643fbf6b..7ca1d9610 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -113,7 +113,7 @@ bool CKeyboard::start(void) { pthread_attr_t attr; - gvdbg("Starting listener\n"); + ginfo("Starting listener\n"); // Start a separate thread to listen for keyboard events @@ -152,7 +152,7 @@ bool CKeyboard::start(void) // Then return true only if the listener thread reported successful // initialization. - gvdbg("Listener m_state=%d\n", (int)m_state); + ginfo("Listener m_state=%d\n", (int)m_state); return m_state == LISTENER_RUNNING; } @@ -207,7 +207,7 @@ int CKeyboard::open(void) // Sleep a bit and try again - gvdbg("WAITING for a USB device\n"); + ginfo("WAITING for a USB device\n"); std::sleep(2); } @@ -246,7 +246,7 @@ int CKeyboard::open(void) int CKeyboard::session(void) { - gvdbg("Session started\n"); + ginfo("Session started\n"); // Loop, reading and dispatching keyboard data @@ -254,7 +254,7 @@ int CKeyboard::session(void) { // Read one keyboard sample - gvdbg("Listening for keyboard input\n"); + ginfo("Listening for keyboard input\n"); uint8_t rxbuffer[CONFIG_NXWM_KEYBOARD_BUFSIZE]; ssize_t nbytes = read(m_kbdFd, rxbuffer, @@ -326,7 +326,7 @@ FAR void *CKeyboard::listener(FAR void *arg) { CKeyboard *This = (CKeyboard *)arg; - gvdbg("Listener started\n"); + ginfo("Listener started\n"); #ifdef CONFIG_NXWM_KEYBOARD_USBHOST // Indicate that we have successfully started. We might be stuck waiting @@ -389,7 +389,7 @@ FAR void *CKeyboard::listener(FAR void *arg) // m_state = LISTENER_STOPREQUESTED (or perhaps if some irrecoverable // error has occurred). - gvdbg("Listener exiting\n"); + ginfo("Listener exiting\n"); This->m_state = LISTENER_TERMINATED; return (FAR void *)0; } diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index f173fb56f..ad72e383f 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -66,13 +66,13 @@ #if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS) # undef dbg -# undef vdbg +# undef info # ifdef CONFIG_CPP_HAVE_VARARGS # define dbg(x...) -# define vdbg(x...) +# define info(x...) # else # define dbg (void) -# define vdbg (void) +# define info (void) # endif #endif diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 1bc39aebd..6b578109d 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -274,7 +274,7 @@ bool CTaskbar::startWindowManager(void) break; } } - gvdbg("m_topApp=%p topIndex=%d\n", m_topApp, topIndex); + ginfo("m_topApp=%p topIndex=%d\n", m_topApp, topIndex); // Now start each application (whatever that means to the application) @@ -282,7 +282,7 @@ bool CTaskbar::startWindowManager(void) { IApplication *app = m_slots.at(i).app; - gvdbg("Starting app[%d]\n", i); + ginfo("Starting app[%d]\n", i); if (!app->run()) { // Call stopApplication on a failure to start. This will call @@ -309,14 +309,14 @@ bool CTaskbar::startWindowManager(void) // application may or may not be minimized, but it is not // visible now). - gvdbg("Hiding app[%d]\n", i); + ginfo("Hiding app[%d]\n", i); hideApplicationWindow(app); } else { // Bring up the application as the new top application - gvdbg("Showing app[%d]\n", i); + ginfo("Showing app[%d]\n", i); topApplication(app); } diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index b3f71bbb9..ca9a99c2e 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -68,13 +68,13 @@ #if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS) # undef dbg -# undef vdbg +# undef info # ifdef CONFIG_CPP_HAVE_VARARGS # define dbg(x...) -# define vdbg(x...) +# define info(x...) # else # define dbg (void) -# define vdbg (void) +# define info (void) # endif #endif @@ -153,7 +153,7 @@ bool CTouchscreen::start(void) { pthread_attr_t attr; - vdbg("Starting listener\n"); + info("Starting listener\n"); // Start a separate thread to listen for touchscreen events @@ -192,7 +192,7 @@ bool CTouchscreen::start(void) // Then return true only if the listener thread reported successful // initialization. - vdbg("Listener m_state=%d\n", (int)m_state); + info("Listener m_state=%d\n", (int)m_state); return m_state == LISTENER_RUNNING; } @@ -234,7 +234,7 @@ void CTouchscreen::setCalibrationData(const struct SCalibrationData &caldata) bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) { - vdbg("Capturing touch input\n"); + info("Capturing touch input\n"); // Setup to cpature raw data into the user provided buffer @@ -260,7 +260,7 @@ bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) // And return success. The listener thread will have (1) reset both // m_touch and m_capture and (2) posted m_waitSem - vdbg("Returning touch input: %d\n", ret); + info("Returning touch input: %d\n", ret); return ret == OK; } @@ -277,7 +277,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) { CTouchscreen *This = (CTouchscreen *)arg; - vdbg("Listener started\n"); + info("Listener started\n"); #ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT // Initialize the touchscreen device @@ -345,7 +345,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) // Read one touchscreen sample - vdbg("Listening for sample %p\n", sample); + info("Listening for sample %p\n", sample); DEBUGASSERT(sample); ssize_t nbytes = read(This->m_touchFd, sample, sizeof(struct touch_sample_s)); @@ -385,7 +385,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) // We should get here only if we were asked to terminate via // m_state = LISTENER_STOPREQUESTED - vdbg("Listener exiting\n"); + info("Listener exiting\n"); This->m_state = LISTENER_TERMINATED; return (FAR void *)0; } @@ -396,7 +396,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) { - vdbg("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + info("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", sample->point[0].id, sample->point[0].flags, sample->point[0].x, sample->point[0].y, sample->point[0].h, sample->point[0].w, sample->point[0].pressure); @@ -536,7 +536,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) x = (nxgl_coord_t)scaledX; y = (nxgl_coord_t)scaledY; - vdbg("raw: (%6.2f, %6.2f) scaled: (%6.2f, %6.2f) (%d, %d)\n", + info("raw: (%6.2f, %6.2f) scaled: (%6.2f, %6.2f) (%d, %d)\n", rawX, rawY, scaledX, scaledY, x, y); #else // We have valid coordinates. Get the raw touch @@ -584,7 +584,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) y = (nxgl_coord_t)bigY; } - vdbg("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); + info("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); #endif } From e1b19736bd66efd4a681b057eb44a1399d68021b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 Jun 2016 14:16:01 -0600 Subject: [PATCH 337/390] Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES --- nxwm/src/ctouchscreen.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index ca9a99c2e..41d383fb1 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -355,7 +355,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) if (nbytes < 0) { // The only expect error is to be interrupt by a signal -#ifdef CONFIG_DEBUG +#ifdef CONFIG_DEBUG_FEATURES int errval = errno; dbg("read %s failed: %d\n", From b739d60ff6815610ba3b54e4a4f8567ee2dc91b2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 11 Jun 2016 15:54:33 -0600 Subject: [PATCH 338/390] Change names of *dbg() * *err() --- UnitTests/nxwm/nxwm_main.cxx | 2 +- libnxwidgets/src/cgraphicsport.cxx | 6 +-- libnxwidgets/src/cnxserver.cxx | 36 +++++++------- libnxwidgets/src/cnxtimer.cxx | 4 +- libnxwidgets/src/cscaledbitmap.cxx | 10 ++-- nxwm/src/ccalibration.cxx | 38 +++++++-------- nxwm/src/chexcalculator.cxx | 18 +++---- nxwm/src/ckeyboard.cxx | 14 +++--- nxwm/src/cmediaplayer.cxx | 76 +++++++++++++++--------------- nxwm/src/cnxterm.cxx | 20 ++++---- nxwm/src/ctouchscreen.cxx | 16 +++---- nxwm/src/cwindowmessenger.cxx | 8 ++-- 12 files changed, 124 insertions(+), 124 deletions(-) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 298724a51..60c6fcab0 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -358,7 +358,7 @@ static bool createStartWindow(void) g_nxwmtest.startwindow = new NxWM::CStartWindow(g_nxwmtest.taskbar, window); if (!g_nxwmtest.startwindow) { - gdbg("ERROR: Failed to instantiate CStartWindow\n"); + gerr("ERROR: Failed to instantiate CStartWindow\n"); delete window; return false; } diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index fa1f3f36d..b1c2b2f15 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -204,7 +204,7 @@ void CGraphicsPort::drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gdbg("INxWindow::fill failed\n"); + gerr("INxWindow::fill failed\n"); } } @@ -234,7 +234,7 @@ void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gdbg("INxWindow::fill failed\n"); + gerr("INxWindow::fill failed\n"); } } @@ -263,7 +263,7 @@ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, if (!m_pNxWnd->drawLine(&vector, 1, color, caps)) { - gdbg("INxWindow::drawLine failed\n"); + gerr("INxWindow::drawLine failed\n"); } } diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 8736f20a2..a1fd45e1b 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -144,7 +144,7 @@ bool CNxServer::connect(void) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return false; } @@ -158,7 +158,7 @@ bool CNxServer::connect(void) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("board_lcd_initialize failed: %d\n", -ret); + gerr("board_lcd_initialize failed: %d\n", -ret); return false; } @@ -167,7 +167,7 @@ bool CNxServer::connect(void) m_hDevice = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!m_hDevice) { - gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return false; } @@ -184,14 +184,14 @@ bool CNxServer::connect(void) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("up_fbinitialize failed: %d\n", -ret); + gerr("up_fbinitialize failed: %d\n", -ret); return false; } m_hDevice = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!m_hDevice) { - gdbg("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", + gerr("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return false; } @@ -203,7 +203,7 @@ bool CNxServer::connect(void) m_hNxServer = nx_open(m_hDevice); if (!m_hNxServer) { - gdbg("CNxServer::connect: nx_open failed: %d\n", errno); + gerr("CNxServer::connect: nx_open failed: %d\n", errno); return false; } @@ -213,7 +213,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); disconnect(); return false; } @@ -240,7 +240,7 @@ bool CNxServer::connect(void) ret = sched_setparam(0, ¶m); if (ret < 0) { - gdbg("CNxServer::connect: sched_setparam failed: %d\n" , ret); + gerr("CNxServer::connect: sched_setparam failed: %d\n" , ret); return false; } @@ -253,7 +253,7 @@ bool CNxServer::connect(void) (FAR char * const *)0); if (serverId < 0) { - gdbg("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + gerr("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); return false; } @@ -276,7 +276,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gdbg("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -298,7 +298,7 @@ bool CNxServer::connect(void) ret = pthread_create(&thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gdbg("NxServer::connect: pthread_create failed: %d\n", ret); + gerr("NxServer::connect: pthread_create failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -329,7 +329,7 @@ bool CNxServer::connect(void) } else { - gdbg("NxServer::connect: nx_connect failed: %d\n", errno); + gerr("NxServer::connect: nx_connect failed: %d\n", errno); return false; } @@ -412,7 +412,7 @@ int CNxServer::server(int argc, char *argv[]) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gdbg("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return EXIT_FAILURE; } @@ -424,7 +424,7 @@ int CNxServer::server(int argc, char *argv[]) ret = board_lcd_initialize(); if (ret < 0) { - gdbg("board_lcd_initialize failed: %d\n", -ret); + gerr("board_lcd_initialize failed: %d\n", -ret); return EXIT_FAILURE; } @@ -433,7 +433,7 @@ int CNxServer::server(int argc, char *argv[]) dev = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!dev) { - gdbg("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return EXIT_FAILURE; } @@ -447,14 +447,14 @@ int CNxServer::server(int argc, char *argv[]) ret = up_fbinitialize(0); if (ret < 0) { - gdbg("nxterm_server: up_fbinitialize failed: %d\n", -ret); + gerr("nxterm_server: up_fbinitialize failed: %d\n", -ret); return EXIT_FAILURE; } dev = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!dev) { - gdbg("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); + gerr("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return 2; } @@ -497,7 +497,7 @@ FAR void *CNxServer::listener(FAR void *arg) // An error occurred... assume that we have lost connection with // the server. - gdbg("Lost server connection: %d\n", errno); + gerr("Lost server connection: %d\n", errno); break; } diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index 5a08a6f52..b0f907ddf 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -162,7 +162,7 @@ void CNxTimer::start(void) if (ret < 0) { - gdbg("work_queue failed: %d\n", ret); + gerr("work_queue failed: %d\n", ret); } m_isRunning = true; @@ -181,7 +181,7 @@ void CNxTimer::stop(void) if (ret < 0) { - gdbg("work_cancel failed: %d\n", ret); + gerr("work_cancel failed: %d\n", ret); } m_isRunning = false; diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index eb8217434..376a47f42 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -249,7 +249,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color1; if (!rowColor(m_rowCache[0], column, color1)) { - gdbg("ERROR rowColor failed for the first row\n"); + gerr("ERROR rowColor failed for the first row\n"); return false; } @@ -258,7 +258,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color2; if (!rowColor(m_rowCache[1], column, color2)) { - gdbg("ERROR rowColor failed for the second row\n"); + gerr("ERROR rowColor failed for the second row\n"); return false; } @@ -389,7 +389,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } } @@ -408,7 +408,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[0])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } @@ -425,7 +425,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gdbg("Failed to read bitmap row %d\n", row); + gerr("Failed to read bitmap row %d\n", row); return false; } } diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index cf691b81e..4e2a468f9 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -82,8 +82,8 @@ */ #ifndef CONFIG_DEBUG_INPUT -# undef idbg -# define idbg gdbg +# undef ierr +# define ierr gerr # undef iinfo # define iinfo ginfo #endif @@ -434,7 +434,7 @@ bool CCalibration::createWidgets(void) CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR failed to create font\n"); + gerr("ERROR failed to create font\n"); return false; } @@ -447,7 +447,7 @@ bool CCalibration::createWidgets(void) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gdbg("ERROR: Failed to get window size\n"); + gerr("ERROR: Failed to get window size\n"); delete m_font; m_font = (NXWidgets::CNxFont *)0; return false; @@ -486,7 +486,7 @@ bool CCalibration::createWidgets(void) if (!m_text) { - gdbg("ERROR: Failed to create CLabel\n"); + gerr("ERROR: Failed to create CLabel\n"); delete m_font; m_font = (NXWidgets::CNxFont *)0; return false; @@ -539,7 +539,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) if (isRunning()) { - gdbg("The calibration thread is already running\n"); + gerr("The calibration thread is already running\n"); return false; } @@ -563,7 +563,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) int ret = pthread_create(&m_thread, &attr, calibration, (FAR void *)this); if (ret != 0) { - gdbg("pthread_create failed: %d\n", ret); + gerr("pthread_create failed: %d\n", ret); return false; } @@ -589,7 +589,7 @@ FAR void *CCalibration::calibration(FAR void *arg) if (!This->createWidgets()) { - gdbg("ERROR failed to create widgets\n"); + gerr("ERROR failed to create widgets\n"); return false; } @@ -1112,7 +1112,7 @@ void CCalibration::finishCalibration(void) sizeof(struct SCalibrationData)); if (ret != 0) { - gdbg("ERROR: Failed to save calibration data\n"); + gerr("ERROR: Failed to save calibration data\n"); } #endif // And provide the calibration data to the touchscreen, enabling @@ -1152,7 +1152,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gdbg("NXWidgets::INxWindow::getSize failed\n"); + gerr("NXWidgets::INxWindow::getSize failed\n"); return false; } @@ -1173,7 +1173,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - idbg("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); + ierr("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1184,7 +1184,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - idbg("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); + ierr("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1202,7 +1202,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - idbg("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); + ierr("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1213,7 +1213,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - idbg("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); + ierr("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions @@ -1241,7 +1241,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - idbg("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + ierr("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); // Similarly for Y // @@ -1262,7 +1262,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - idbg("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + ierr("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); #endif return true; @@ -1294,7 +1294,7 @@ IApplication *CCalibrationFactory::create(void) CFullScreenWindow *window = m_taskbar->openFullScreenWindow(); if (!window) { - gdbg("ERROR: Failed to create CFullScreenWindow\n"); + gerr("ERROR: Failed to create CFullScreenWindow\n"); return (IApplication *)0; } @@ -1302,7 +1302,7 @@ IApplication *CCalibrationFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CFullScreenWindow \n"); + gerr("ERROR: Failed to open CFullScreenWindow \n"); delete window; return (IApplication *)0; } @@ -1313,7 +1313,7 @@ IApplication *CCalibrationFactory::create(void) CCalibration *calibration = new CCalibration(m_taskbar, window, m_touchscreen); if (!calibration) { - gdbg("ERROR: Failed to instantiate CCalibration\n"); + gerr("ERROR: Failed to instantiate CCalibration\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/chexcalculator.cxx b/nxwm/src/chexcalculator.cxx index d0a4eb285..aa8dbc5b0 100644 --- a/nxwm/src/chexcalculator.cxx +++ b/nxwm/src/chexcalculator.cxx @@ -323,7 +323,7 @@ bool CHexCalculator::run(void) if (!createCalculator()) { - gdbg("ERROR: Failed to create widgets\n"); + gerr("ERROR: Failed to create widgets\n"); return false; } @@ -505,7 +505,7 @@ bool CHexCalculator::createCalculator(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - gdbg("ERROR failed to create font\n"); + gerr("ERROR failed to create font\n"); return false; } @@ -522,7 +522,7 @@ bool CHexCalculator::createCalculator(void) m_buttonSize.w, m_buttonSize.h); if (!m_keypad) { - gdbg("ERROR: Failed to create CButtonArray\n"); + gerr("ERROR: Failed to create CButtonArray\n"); return false; } @@ -548,7 +548,7 @@ bool CHexCalculator::createCalculator(void) "0"); if (!m_text) { - gdbg("ERROR: Failed to create CLabel\n"); + gerr("ERROR: Failed to create CLabel\n"); return false; } @@ -658,7 +658,7 @@ int64_t CHexCalculator::evaluateBinaryOperation(uint8_t operation, int64_t value return value1 + value2; default: - gdbg("ERROR: Unexpected pending operation %d\n", operation); + gerr("ERROR: Unexpected pending operation %d\n", operation); return 0; } } @@ -945,7 +945,7 @@ void CHexCalculator::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) case KEY_NONE: default: - gdbg("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); + gerr("ERROR: Invalid key type %d\n", g_keyDesc[index].keyType); break; } @@ -978,7 +978,7 @@ IApplication *CHexCalculatorFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - gdbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -986,7 +986,7 @@ IApplication *CHexCalculatorFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -997,7 +997,7 @@ IApplication *CHexCalculatorFactory::create(void) CHexCalculator *hexCalculator = new CHexCalculator(m_taskbar, window); if (!hexCalculator) { - gdbg("ERROR: Failed to instantiate CHexCalculator\n"); + gerr("ERROR: Failed to instantiate CHexCalculator\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index 7ca1d9610..23631007c 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -130,7 +130,7 @@ bool CKeyboard::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gdbg("CKeyboard::start: pthread_create failed: %d\n", ret); + gerr("CKeyboard::start: pthread_create failed: %d\n", ret); return false; } @@ -219,7 +219,7 @@ int CKeyboard::open(void) // Let the top-level logic decide what it wants to do // about all really bad things - gdbg("ERROR: Failed to open %s for reading: %d\n", + gerr("ERROR: Failed to open %s for reading: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); return -errcode; } @@ -276,12 +276,12 @@ int CKeyboard::session(void) // Let the top-level listener logic decide what to do about // the read failure. - gdbg("ERROR: read %s failed: %d\n", + gerr("ERROR: read %s failed: %d\n", CONFIG_NXWM_KEYBOARD_DEVPATH, errcode); return -errcode; } - fdbg("Awakened with EINTR\n"); + ferr("Awakened with EINTR\n"); } // Give the keyboard input to NX @@ -298,7 +298,7 @@ int CKeyboard::session(void) int ret = nx_kbdin(handle, (uint8_t)nbytes, rxbuffer); if (ret < 0) { - gdbg("ERROR: nx_kbdin failed: %d\n", ret); + gerr("ERROR: nx_kbdin failed: %d\n", ret); //break; ignore the error } } @@ -345,7 +345,7 @@ FAR void *CKeyboard::listener(FAR void *arg) This->m_kbdFd = This->open(); if (This->m_kbdFd < 0) { - gdbg("ERROR: open failed: %d\n", This->m_kbdFd); + gerr("ERROR: open failed: %d\n", This->m_kbdFd); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); return (FAR void *)0; @@ -370,7 +370,7 @@ FAR void *CKeyboard::listener(FAR void *arg) #ifdef CONFIG_NXWM_KEYBOARD_USBHOST if (ret < 0) { - fdbg("ERROR: CKeyboard::session() returned %d\n", ret); + ferr("ERROR: CKeyboard::session() returned %d\n", ret); } #else // No errors from session() are expected diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index ad72e383f..e6c075e06 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -65,13 +65,13 @@ /* We want debug output from this file if either audio or graphics debug is enabled. */ #if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef dbg +# undef gerr # undef info # ifdef CONFIG_CPP_HAVE_VARARGS -# define dbg(x...) +# define gerr(x...) # define info(x...) # else -# define dbg (void) +# define gerr (void) # define info (void) # endif #endif @@ -312,7 +312,7 @@ bool CMediaPlayer::run(void) if (!configureNxPlayer()) { - dbg("ERROR: Failed to configure NxPlayer\n"); + gerr("ERROR: Failed to configure NxPlayer\n"); return false; } @@ -320,7 +320,7 @@ bool CMediaPlayer::run(void) if (!createPlayer()) { - dbg("ERROR: Failed to create widgets\n"); + gerr("ERROR: Failed to create widgets\n"); return false; } } @@ -442,7 +442,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (!filePath) { - dbg("ERROR: Failed to allocate file path\n"); + gerr("ERROR: Failed to allocate file path\n"); return false; } @@ -460,7 +460,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (ret < 0) { int errcode = errno; - dbg("ERROR: Could not stat file %s: %d\n", filePath, errcode); + gerr("ERROR: Could not stat file %s: %d\n", filePath, errcode); UNUSED(errcode); // Make sure there is no previous file information @@ -472,7 +472,7 @@ bool CMediaPlayer::getMediaFile(const NXWidgets::CListBoxDataItem *item) if (S_ISDIR(buf.st_mode) || S_ISBLK(buf.st_mode)) { - dbg("ERROR: Not a regular file\n"); + gerr("ERROR: Not a regular file\n"); // Make sure there is no previous file information @@ -503,7 +503,7 @@ void CMediaPlayer::stopPlaying(void) int ret = nxplayer_stop(m_player); if (ret < 0) { - auddbg("ERROR: nxplayer_stop failed: %d\n", ret); + auderr("ERROR: nxplayer_stop failed: %d\n", ret); } #endif @@ -659,7 +659,7 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) { // Device doesn't exit. Report an error - dbg("ERROR: Device %s not found\n", devPath); + gerr("ERROR: Device %s not found\n", devPath); return false; } @@ -667,13 +667,13 @@ bool CMediaPlayer::setDevice(FAR const char *devPath) if (ret == -ENODEV) { - dbg("ERROR: Device %s is not an audio device\n", devPath); + gerr("ERROR: Device %s is not an audio device\n", devPath); return false; } if (ret < 0) { - dbg("ERROR: Error selecting device %s\n", devPath); + gerr("ERROR: Error selecting device %s\n", devPath); return false; } @@ -694,7 +694,7 @@ bool CMediaPlayer::configureNxPlayer(void) m_player = nxplayer_create(); if (!m_player) { - dbg("ERROR: Failed get NxPlayer handle\n"); + gerr("ERROR: Failed get NxPlayer handle\n"); return false; } @@ -703,7 +703,7 @@ bool CMediaPlayer::configureNxPlayer(void) if (!setDevice(CONFIG_NXWM_MEDIAPLAYER_PREFERRED_DEVICE)) { - dbg("ERROR: Failed select NxPlayer audio device\n"); + gerr("ERROR: Failed select NxPlayer audio device\n"); return false; } #endif @@ -725,7 +725,7 @@ bool CMediaPlayer::createPlayer(void) CONFIG_NXWM_TRANSPARENT_COLOR); if (!m_font) { - dbg("ERROR: Failed to create font\n"); + gerr("ERROR: Failed to create font\n"); return false; } @@ -746,7 +746,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_playBitmap || !m_pauseBitmap || !m_rewindBitmap || !m_fforwardBitmap || !m_volumeBitmap) { - dbg("ERROR: Failed to one or more bitmaps\n"); + gerr("ERROR: Failed to one or more bitmaps\n"); return false; } @@ -796,7 +796,7 @@ bool CMediaPlayer::createPlayer(void) m_listbox = new NXWidgets::CListBox(control, 0, 0, m_windowSize.w, listHeight); if (!m_listbox) { - dbg("ERROR: Failed to create CListBox\n"); + gerr("ERROR: Failed to create CListBox\n"); return false; } @@ -877,7 +877,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_play) { - dbg("ERROR: Failed to create play control\n"); + gerr("ERROR: Failed to create play control\n"); return false; } @@ -904,7 +904,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_pause) { - dbg("ERROR: Failed to create pause control\n"); + gerr("ERROR: Failed to create pause control\n"); return false; } @@ -934,7 +934,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_rewind) { - dbg("ERROR: Failed to create rewind control\n"); + gerr("ERROR: Failed to create rewind control\n"); return false; } @@ -966,7 +966,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_fforward) { - dbg("ERROR: Failed to create fast forward control\n"); + gerr("ERROR: Failed to create fast forward control\n"); return false; } @@ -1007,7 +1007,7 @@ bool CMediaPlayer::createPlayer(void) if (!m_volume) { - dbg("ERROR: Failed to create volume control\n"); + gerr("ERROR: Failed to create volume control\n"); return false; } @@ -1422,7 +1422,7 @@ void CMediaPlayer::setVolumeLevel(void) int newLevel = m_volume->getValue(); if (newLevel < 0 || newLevel > 100) { - dbg("ERROR: volume is out of range: %d\n", newLevel); + gerr("ERROR: volume is out of range: %d\n", newLevel); } // Has the volume level changed? @@ -1434,7 +1434,7 @@ void CMediaPlayer::setVolumeLevel(void) int ret = nxplayer_setvolume(m_player, (uint16_t)newLevel); if (ret < OK) { - dbg("ERROR: nxplayer_setvolume failed: %d\n", ret); + gerr("ERROR: nxplayer_setvolume failed: %d\n", ret); } else { @@ -1506,7 +1506,7 @@ void CMediaPlayer::checkFileSelection(void) // The play button will be disabled because m_fileReady is false. // No harm done if we were already STOPPED. - dbg("ERROR: getMediaFile failed\n"); + gerr("ERROR: getMediaFile failed\n"); setMediaPlayerState(MPLAYER_STOPPED); } else @@ -1628,7 +1628,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_rewind failed: %d\n", ret); + gerr("ERROR: nxplayer_rewind failed: %d\n", ret); } // Update the speed indicator @@ -1647,7 +1647,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_rewind(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_rewind failed: %d\n", ret); + gerr("ERROR: nxplayer_rewind failed: %d\n", ret); } else { @@ -1678,7 +1678,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_fforward failed: %d\n", ret); + gerr("ERROR: nxplayer_fforward failed: %d\n", ret); } // Update the speed indicator @@ -1697,7 +1697,7 @@ void CMediaPlayer::handleActionEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_fforward(m_player, g_motionSteps[m_subSample]); if (ret < 0) { - dbg("ERROR: nxplayer_fforward failed: %d\n", ret); + gerr("ERROR: nxplayer_fforward failed: %d\n", ret); } else { @@ -1734,7 +1734,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_resume(m_player); if (ret < 0) { - dbg("ERROR: nxplayer_resume() failed: %d\n", ret); + gerr("ERROR: nxplayer_resume() failed: %d\n", ret); } else { @@ -1757,7 +1757,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) if (!filePath) { - dbg("ERROR: Failed to allocate file path\n"); + gerr("ERROR: Failed to allocate file path\n"); return; } @@ -1769,7 +1769,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) AUDIO_FMT_UNDEF, AUDIO_FMT_UNDEF); if (ret < 0) { - dbg("ERROR: nxplayer_playfile %s failed: %d\n", filePath, ret); + gerr("ERROR: nxplayer_playfile %s failed: %d\n", filePath, ret); } else { @@ -1796,7 +1796,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + gerr("ERROR: nxplayer_cancel_motion failed: %d\n", ret); } else { @@ -1826,7 +1826,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_pause(m_player); if (ret < 0) { - dbg("ERROR: nxplayer_pause() failed: %d\n", ret); + gerr("ERROR: nxplayer_pause() failed: %d\n", ret); } else { @@ -1849,7 +1849,7 @@ void CMediaPlayer::handleReleaseEvent(const NXWidgets::CWidgetEventArgs &e) int ret = nxplayer_cancel_motion(m_player, m_prevState == MPLAYER_PAUSED); if (ret < 0) { - dbg("ERROR: nxplayer_cancel_motion failed: %d\n", ret); + gerr("ERROR: nxplayer_cancel_motion failed: %d\n", ret); } else { @@ -1912,7 +1912,7 @@ IApplication *CMediaPlayerFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - dbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -1920,7 +1920,7 @@ IApplication *CMediaPlayerFactory::create(void) if (!window->open()) { - dbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -1931,7 +1931,7 @@ IApplication *CMediaPlayerFactory::create(void) CMediaPlayer *mediaPlayer = new CMediaPlayer(m_taskbar, window); if (!mediaPlayer) { - dbg("ERROR: Failed to instantiate CMediaPlayer\n"); + gerr("ERROR: Failed to instantiate CMediaPlayer\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index 84fc69109..da2a249d5 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -207,7 +207,7 @@ bool CNxTerm::run(void) if (m_pid >= 0 || m_nxterm != 0) { - gdbg("ERROR: All ready running or connected\n"); + gerr("ERROR: All ready running or connected\n"); return false; } @@ -217,7 +217,7 @@ bool CNxTerm::run(void) { // This might fail if a signal is received while we are waiting. - gdbg("ERROR: Failed to get semaphore\n"); + gerr("ERROR: Failed to get semaphore\n"); return false; } @@ -259,7 +259,7 @@ bool CNxTerm::run(void) bool result = true; if (m_pid < 0) { - gdbg("ERROR: Failed to create the NxTerm task\n"); + gerr("ERROR: Failed to create the NxTerm task\n"); result = false; } else @@ -290,7 +290,7 @@ bool CNxTerm::run(void) // sem_timedwait failed OR the NxTerm task reported a // failure. Stop the application - gdbg("ERROR: Failed start the NxTerm task\n"); + gerr("ERROR: Failed start the NxTerm task\n"); stop(); result = false; } @@ -430,7 +430,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) if (on_exit(exitHandler, g_nxtermvars.console) != 0) { - gdbg("ERROR: on_exit failed\n"); + gerr("ERROR: on_exit failed\n"); goto errout; } @@ -440,7 +440,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) g_nxtermvars.minor); if (!g_nxtermvars.nxterm) { - gdbg("ERROR: Failed register the console device\n"); + gerr("ERROR: Failed register the console device\n"); goto errout; } @@ -462,7 +462,7 @@ int CNxTerm::nxterm(int argc, char *argv[]) #endif if (fd < 0) { - gdbg("ERROR: Failed open the console device\n"); + gerr("ERROR: Failed open the console device\n"); goto errout_with_nxterm; } @@ -591,7 +591,7 @@ IApplication *CNxTermFactory::create(void) CApplicationWindow *window = m_taskbar->openApplicationWindow(); if (!window) { - gdbg("ERROR: Failed to create CApplicationWindow\n"); + gerr("ERROR: Failed to create CApplicationWindow\n"); return (IApplication *)0; } @@ -599,7 +599,7 @@ IApplication *CNxTermFactory::create(void) if (!window->open()) { - gdbg("ERROR: Failed to open CApplicationWindow\n"); + gerr("ERROR: Failed to open CApplicationWindow\n"); delete window; return (IApplication *)0; } @@ -610,7 +610,7 @@ IApplication *CNxTermFactory::create(void) CNxTerm *nxterm = new CNxTerm(m_taskbar, window); if (!nxterm) { - gdbg("ERROR: Failed to instantiate CNxTerm\n"); + gerr("ERROR: Failed to instantiate CNxTerm\n"); delete window; return (IApplication *)0; } diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 41d383fb1..d362aa8fc 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -67,13 +67,13 @@ */ #if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS) -# undef dbg +# undef gerr # undef info # ifdef CONFIG_CPP_HAVE_VARARGS -# define dbg(x...) +# define gerr(x...) # define info(x...) # else -# define dbg (void) +# define gerr (void) # define info (void) # endif #endif @@ -170,7 +170,7 @@ bool CTouchscreen::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - dbg("CTouchscreen::start: pthread_create failed: %d\n", ret); + gerr("CTouchscreen::start: pthread_create failed: %d\n", ret); return false; } @@ -285,7 +285,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { - dbg("ERROR Failed initialize the touchscreen device: %d\n", errno); + gerr("ERROR Failed initialize the touchscreen device: %d\n", errno); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); return (FAR void *)0; @@ -297,7 +297,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) This->m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); if (This->m_touchFd < 0) { - dbg("ERROR Failed to open %s for reading: %d\n", + gerr("ERROR Failed to open %s for reading: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errno); This->m_state = LISTENER_FAILED; sem_post(&This->m_waitSem); @@ -358,7 +358,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) #ifdef CONFIG_DEBUG_FEATURES int errval = errno; - dbg("read %s failed: %d\n", + gerr("read %s failed: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errval); DEBUGASSERT(errval == EINTR); #endif @@ -377,7 +377,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) } else { - dbg("ERROR Unexpected read size=%d, expected=%d\n", + gerr("ERROR Unexpected read size=%d, expected=%d\n", nbytes, sizeof(struct touch_sample_s)); } } diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 2ffc309b3..7a003d6db 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -125,7 +125,7 @@ void CWindowMessenger::handleMouseEvent(void) int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -143,7 +143,7 @@ void CWindowMessenger::handleKeyboardEvent(void) int ret = work_queue(USRWORK, &state->work, &inputWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } #endif @@ -173,7 +173,7 @@ void CWindowMessenger::handleBlockedEvent(FAR void *arg) int ret = work_queue(USRWORK, &state->work, &destroyWorkCallback, state, 0); if (ret < 0) { - gdbg("ERROR: work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } } @@ -196,7 +196,7 @@ void CWindowMessenger::destroyWorkCallback(FAR void *arg) // Then release the memory. - gdbg("Deleting app=%p\n", state->instance); + gerr("Deleting app=%p\n", state->instance); IApplication *app = (IApplication *)state->instance; delete app; delete state; From 1a48f82d6b7c0fcee6e466255627ca5434f96d48 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 13 Jun 2016 12:06:59 -0600 Subject: [PATCH 339/390] Fix some warnings --- nxwm/src/ctouchscreen.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index d362aa8fc..778daa2f8 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -355,7 +355,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) if (nbytes < 0) { // The only expect error is to be interrupt by a signal -#ifdef CONFIG_DEBUG_FEATURES +#if defined(CONFIG_DEBUG_GRAPHICS_ERROR) || defined(CONFIG_DEBUG_ASSERTIONS) int errval = errno; gerr("read %s failed: %d\n", From 837d5044e9ecd51077667c5ad773c385a32ddcda Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Jun 2016 18:29:34 -0600 Subject: [PATCH 340/390] Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. --- libnxwidgets/src/cgraphicsport.cxx | 6 ++--- libnxwidgets/src/cnxserver.cxx | 36 +++++++++++++++--------------- libnxwidgets/src/cnxtimer.cxx | 4 ++-- libnxwidgets/src/cscaledbitmap.cxx | 10 ++++----- nxwm/src/ccalibration.cxx | 20 ++++++++--------- nxwm/src/ckeyboard.cxx | 4 ++-- nxwm/src/ctouchscreen.cxx | 4 ++-- nxwm/src/cwindowmessenger.cxx | 2 +- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libnxwidgets/src/cgraphicsport.cxx b/libnxwidgets/src/cgraphicsport.cxx index b1c2b2f15..9a6dfd9ec 100644 --- a/libnxwidgets/src/cgraphicsport.cxx +++ b/libnxwidgets/src/cgraphicsport.cxx @@ -204,7 +204,7 @@ void CGraphicsPort::drawHorizLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gerr("INxWindow::fill failed\n"); + gerr("ERROR: INxWindow::fill failed\n"); } } @@ -234,7 +234,7 @@ void CGraphicsPort::drawVertLine(nxgl_coord_t x, nxgl_coord_t y, if (!m_pNxWnd->fill(&dest, color)) { - gerr("INxWindow::fill failed\n"); + gerr("ERROR: INxWindow::fill failed\n"); } } @@ -263,7 +263,7 @@ void CGraphicsPort::drawLine(nxgl_coord_t x1, nxgl_coord_t y1, if (!m_pNxWnd->drawLine(&vector, 1, color, caps)) { - gerr("INxWindow::drawLine failed\n"); + gerr("ERROR: INxWindow::drawLine failed\n"); } } diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index a1fd45e1b..d412988eb 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -144,7 +144,7 @@ bool CNxServer::connect(void) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("ERROR: boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return false; } @@ -158,7 +158,7 @@ bool CNxServer::connect(void) ret = board_lcd_initialize(); if (ret < 0) { - gerr("board_lcd_initialize failed: %d\n", -ret); + gerr("ERROR: board_lcd_initialize failed: %d\n", -ret); return false; } @@ -167,7 +167,7 @@ bool CNxServer::connect(void) m_hDevice = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!m_hDevice) { - gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return false; } @@ -184,14 +184,14 @@ bool CNxServer::connect(void) ret = up_fbinitialize(0); if (ret < 0) { - gerr("up_fbinitialize failed: %d\n", -ret); + gerr("ERROR: up_fbinitialize failed: %d\n", -ret); return false; } m_hDevice = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!m_hDevice) { - gerr("CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", + gerr("ERROR: CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return false; } @@ -203,7 +203,7 @@ bool CNxServer::connect(void) m_hNxServer = nx_open(m_hDevice); if (!m_hNxServer) { - gerr("CNxServer::connect: nx_open failed: %d\n", errno); + gerr("ERROR: CNxServer::connect: nx_open failed: %d\n", errno); return false; } @@ -213,7 +213,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("ERROR: CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); disconnect(); return false; } @@ -240,7 +240,7 @@ bool CNxServer::connect(void) ret = sched_setparam(0, ¶m); if (ret < 0) { - gerr("CNxServer::connect: sched_setparam failed: %d\n" , ret); + gerr("ERROR: CNxServer::connect: sched_setparam failed: %d\n" , ret); return false; } @@ -253,7 +253,7 @@ bool CNxServer::connect(void) (FAR char * const *)0); if (serverId < 0) { - gerr("NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + gerr("ERROR: NxServer::connect: Failed to create nx_servertask task: %d\n", errno); return false; } @@ -276,7 +276,7 @@ bool CNxServer::connect(void) ret = vnc_default_fbinitialize(0, m_hNxServer); if (ret < 0) { - gerr("CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); + gerr("ERROR: CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -298,7 +298,7 @@ bool CNxServer::connect(void) ret = pthread_create(&thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gerr("NxServer::connect: pthread_create failed: %d\n", ret); + gerr("ERROR: NxServer::connect: pthread_create failed: %d\n", ret); m_running = false; disconnect(); return false; @@ -329,7 +329,7 @@ bool CNxServer::connect(void) } else { - gerr("NxServer::connect: nx_connect failed: %d\n", errno); + gerr("ERROR: NxServer::connect: nx_connect failed: %d\n", errno); return false; } @@ -412,7 +412,7 @@ int CNxServer::server(int argc, char *argv[]) ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); if (ret < 0) { - gerr("boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); + gerr("ERROR: boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); return EXIT_FAILURE; } @@ -424,7 +424,7 @@ int CNxServer::server(int argc, char *argv[]) ret = board_lcd_initialize(); if (ret < 0) { - gerr("board_lcd_initialize failed: %d\n", -ret); + gerr("ERROR: board_lcd_initialize failed: %d\n", -ret); return EXIT_FAILURE; } @@ -433,7 +433,7 @@ int CNxServer::server(int argc, char *argv[]) dev = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); if (!dev) { - gerr("board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); + gerr("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); return EXIT_FAILURE; } @@ -447,14 +447,14 @@ int CNxServer::server(int argc, char *argv[]) ret = up_fbinitialize(0); if (ret < 0) { - gerr("nxterm_server: up_fbinitialize failed: %d\n", -ret); + gerr("ERROR: nxterm_server: up_fbinitialize failed: %d\n", -ret); return EXIT_FAILURE; } dev = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); if (!dev) { - gerr("up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); + gerr("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); return 2; } @@ -497,7 +497,7 @@ FAR void *CNxServer::listener(FAR void *arg) // An error occurred... assume that we have lost connection with // the server. - gerr("Lost server connection: %d\n", errno); + gwarn("WARNING: Lost server connection: %d\n", errno); break; } diff --git a/libnxwidgets/src/cnxtimer.cxx b/libnxwidgets/src/cnxtimer.cxx index b0f907ddf..9f0bc6c66 100644 --- a/libnxwidgets/src/cnxtimer.cxx +++ b/libnxwidgets/src/cnxtimer.cxx @@ -162,7 +162,7 @@ void CNxTimer::start(void) if (ret < 0) { - gerr("work_queue failed: %d\n", ret); + gerr("ERROR: work_queue failed: %d\n", ret); } m_isRunning = true; @@ -181,7 +181,7 @@ void CNxTimer::stop(void) if (ret < 0) { - gerr("work_cancel failed: %d\n", ret); + gerr("ERROR: work_cancel failed: %d\n", ret); } m_isRunning = false; diff --git a/libnxwidgets/src/cscaledbitmap.cxx b/libnxwidgets/src/cscaledbitmap.cxx index 376a47f42..41922a2ed 100644 --- a/libnxwidgets/src/cscaledbitmap.cxx +++ b/libnxwidgets/src/cscaledbitmap.cxx @@ -249,7 +249,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color1; if (!rowColor(m_rowCache[0], column, color1)) { - gerr("ERROR rowColor failed for the first row\n"); + gerr("ERROR: rowColor failed for the first row\n"); return false; } @@ -258,7 +258,7 @@ bool CScaledBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, struct rgbcolor_s color2; if (!rowColor(m_rowCache[1], column, color2)) { - gerr("ERROR rowColor failed for the second row\n"); + gerr("ERROR: rowColor failed for the second row\n"); return false; } @@ -389,7 +389,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gerr("Failed to read bitmap row %d\n", row); + gerr("ERROR: Failed to read bitmap row %d\n", row); return false; } } @@ -408,7 +408,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[0])) { - gerr("Failed to read bitmap row %d\n", row); + gerr("ERROR: Failed to read bitmap row %d\n", row); return false; } @@ -425,7 +425,7 @@ bool CScaledBitmap::cacheRows(unsigned int row) if (!m_bitmap->getRun(0, row, bitmapWidth, m_rowCache[1])) { - gerr("Failed to read bitmap row %d\n", row); + gerr("ERROR: Failed to read bitmap row %d\n", row); return false; } } diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 4e2a468f9..41189cee6 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -539,7 +539,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) if (isRunning()) { - gerr("The calibration thread is already running\n"); + gwarn("WARNING: The calibration thread is already running\n"); return false; } @@ -563,7 +563,7 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState) int ret = pthread_create(&m_thread, &attr, calibration, (FAR void *)this); if (ret != 0) { - gerr("pthread_create failed: %d\n", ret); + gerr("ERROR: pthread_create failed: %d\n", ret); return false; } @@ -589,7 +589,7 @@ FAR void *CCalibration::calibration(FAR void *arg) if (!This->createWidgets()) { - gerr("ERROR failed to create widgets\n"); + gerr("ERROR: failed to create widgets\n"); return false; } @@ -1152,7 +1152,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) struct nxgl_size_s windowSize; if (!window->getSize(&windowSize)) { - gerr("NXWidgets::INxWindow::getSize failed\n"); + gerr("ERROR: NXWidgets::INxWindow::getSize failed\n"); return false; } @@ -1173,7 +1173,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.left.slope = (bottomX - topX) / (bottomY - topY); data.left.offset = topX - topY * data.left.slope; - ierr("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); + iinfo("Left slope: %6.2f offset: %6.2f\n", data.left.slope, data.left.offset); topX = (float)m_calibData[CALIB_UPPER_RIGHT_INDEX].x; bottomX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1184,7 +1184,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.right.slope = (bottomX - topX) / (bottomY - topY); data.right.offset = topX - topY * data.right.slope; - ierr("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); + iinfo("Right slope: %6.2f offset: %6.2f\n", data.right.slope, data.right.offset); // Y lines: // @@ -1202,7 +1202,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.top.slope = (rightY - leftY) / (rightX - leftX); data.top.offset = leftY - leftX * data.top.slope; - ierr("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); + iinfo("Top slope: %6.2f offset: %6.2f\n", data.top.slope, data.top.offset); leftX = (float)m_calibData[CALIB_LOWER_LEFT_INDEX].x; rightX = (float)m_calibData[CALIB_LOWER_RIGHT_INDEX].x; @@ -1213,7 +1213,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.bottom.slope = (rightY - leftY) / (rightX - leftX); data.bottom.offset = leftY - leftX * data.bottom.slope; - ierr("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); + iinfo("Bottom slope: %6.2f offset: %6.2f\n", data.bottom.slope, data.bottom.offset); // Save also the calibration screen positions @@ -1241,7 +1241,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.xSlope = b16divb16(itob16(CALIBRATION_RIGHTX - CALIBRATION_LEFTX), (rightX - leftX)); data.xOffset = itob16(CALIBRATION_LEFTX) - b16mulb16(leftX, data.xSlope); - ierr("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); + iinfo("New xSlope: %08x xOffset: %08x\n", data.xSlope, data.xOffset); // Similarly for Y // @@ -1262,7 +1262,7 @@ bool CCalibration::createCalibrationData(struct SCalibrationData &data) data.ySlope = b16divb16(itob16(CALIBRATION_BOTTOMY - CALIBRATION_TOPY), (bottomY - topY)); data.yOffset = itob16(CALIBRATION_TOPY) - b16mulb16(topY, data.ySlope); - ierr("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); + iinfo("New ySlope: %08x yOffset: %08x\n", data.ySlope, data.yOffset); #endif return true; diff --git a/nxwm/src/ckeyboard.cxx b/nxwm/src/ckeyboard.cxx index 23631007c..eef5bb33d 100644 --- a/nxwm/src/ckeyboard.cxx +++ b/nxwm/src/ckeyboard.cxx @@ -130,7 +130,7 @@ bool CKeyboard::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gerr("CKeyboard::start: pthread_create failed: %d\n", ret); + gerr("ERROR: CKeyboard::start: pthread_create failed: %d\n", ret); return false; } @@ -281,7 +281,7 @@ int CKeyboard::session(void) return -errcode; } - ferr("Awakened with EINTR\n"); + fwarn("WARNING: Awakened with EINTR\n"); } // Give the keyboard input to NX diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 778daa2f8..4d2c6d2ad 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -170,7 +170,7 @@ bool CTouchscreen::start(void) int ret = pthread_create(&m_thread, &attr, listener, (FAR void *)this); if (ret != 0) { - gerr("CTouchscreen::start: pthread_create failed: %d\n", ret); + ginfo("CTouchscreen::start: pthread_create failed: %d\n", ret); return false; } @@ -358,7 +358,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) #if defined(CONFIG_DEBUG_GRAPHICS_ERROR) || defined(CONFIG_DEBUG_ASSERTIONS) int errval = errno; - gerr("read %s failed: %d\n", + gerr("ERROR: read %s failed: %d\n", CONFIG_NXWM_TOUCHSCREEN_DEVPATH, errval); DEBUGASSERT(errval == EINTR); #endif diff --git a/nxwm/src/cwindowmessenger.cxx b/nxwm/src/cwindowmessenger.cxx index 7a003d6db..28e85a916 100644 --- a/nxwm/src/cwindowmessenger.cxx +++ b/nxwm/src/cwindowmessenger.cxx @@ -196,7 +196,7 @@ void CWindowMessenger::destroyWorkCallback(FAR void *arg) // Then release the memory. - gerr("Deleting app=%p\n", state->instance); + ginfo("Deleting app=%p\n", state->instance); IApplication *app = (IApplication *)state->instance; delete app; delete state; From f5febf7ff211c1ff7359fb6e5ffdf14a0e0dda52 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Jun 2016 12:01:43 -0600 Subject: [PATCH 341/390] Replace info() with _info() --- nxwm/src/cmediaplayer.cxx | 6 +++--- nxwm/src/ctouchscreen.cxx | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index e6c075e06..7ac6189da 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -66,13 +66,13 @@ #if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS) # undef gerr -# undef info +# undef _info # ifdef CONFIG_CPP_HAVE_VARARGS # define gerr(x...) -# define info(x...) +# define _info(x...) # else # define gerr (void) -# define info (void) +# define _info (void) # endif #endif diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 4d2c6d2ad..6d7031ebb 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -68,13 +68,13 @@ #if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS) # undef gerr -# undef info +# undef _info # ifdef CONFIG_CPP_HAVE_VARARGS # define gerr(x...) -# define info(x...) +# define _info(x...) # else # define gerr (void) -# define info (void) +# define _info (void) # endif #endif @@ -153,7 +153,7 @@ bool CTouchscreen::start(void) { pthread_attr_t attr; - info("Starting listener\n"); + _info("Starting listener\n"); // Start a separate thread to listen for touchscreen events @@ -192,7 +192,7 @@ bool CTouchscreen::start(void) // Then return true only if the listener thread reported successful // initialization. - info("Listener m_state=%d\n", (int)m_state); + _info("Listener m_state=%d\n", (int)m_state); return m_state == LISTENER_RUNNING; } @@ -234,7 +234,7 @@ void CTouchscreen::setCalibrationData(const struct SCalibrationData &caldata) bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) { - info("Capturing touch input\n"); + _info("Capturing touch input\n"); // Setup to cpature raw data into the user provided buffer @@ -260,7 +260,7 @@ bool CTouchscreen::waitRawTouchData(struct touch_sample_s *touch) // And return success. The listener thread will have (1) reset both // m_touch and m_capture and (2) posted m_waitSem - info("Returning touch input: %d\n", ret); + _info("Returning touch input: %d\n", ret); return ret == OK; } @@ -277,7 +277,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) { CTouchscreen *This = (CTouchscreen *)arg; - info("Listener started\n"); + _info("Listener started\n"); #ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT // Initialize the touchscreen device @@ -345,7 +345,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) // Read one touchscreen sample - info("Listening for sample %p\n", sample); + _info("Listening for sample %p\n", sample); DEBUGASSERT(sample); ssize_t nbytes = read(This->m_touchFd, sample, sizeof(struct touch_sample_s)); @@ -385,7 +385,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) // We should get here only if we were asked to terminate via // m_state = LISTENER_STOPREQUESTED - info("Listener exiting\n"); + _info("Listener exiting\n"); This->m_state = LISTENER_TERMINATED; return (FAR void *)0; } @@ -396,7 +396,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) { - info("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", + _info("Touch id: %d flags: %02x x: %d y: %d h: %d w: %d pressure: %d\n", sample->point[0].id, sample->point[0].flags, sample->point[0].x, sample->point[0].y, sample->point[0].h, sample->point[0].w, sample->point[0].pressure); @@ -536,7 +536,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) x = (nxgl_coord_t)scaledX; y = (nxgl_coord_t)scaledY; - info("raw: (%6.2f, %6.2f) scaled: (%6.2f, %6.2f) (%d, %d)\n", + _info("raw: (%6.2f, %6.2f) scaled: (%6.2f, %6.2f) (%d, %d)\n", rawX, rawY, scaledX, scaledY, x, y); #else // We have valid coordinates. Get the raw touch @@ -584,7 +584,7 @@ void CTouchscreen::handleMouseInput(struct touch_sample_s *sample) y = (nxgl_coord_t)bigY; } - info("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); + _info("raw: (%d, %d) scaled: (%d, %d)\n", rawX, rawY, x, y); #endif } From c7baec7430c10784cdfb4773d16f3e67ccf7bbb7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 17 Jun 2016 18:13:55 -0600 Subject: [PATCH 342/390] Update ChangeLog --- ChangeLog.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 5e1e01d88..010d7961f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -580,4 +580,8 @@ * UnitTests: Back conditional logic out of UnitTest Make.defs files. It does not belong there and causes link failures like "Cannot find nxwm_main" (2016-06-05). +* Change dbg() and vdbg() to err() and info() (2016-06-11). +* Change some *err() message to *info() messages if what was a *dbg() + message does not indicate and error condition (2016-06-14). +* Add _ to front of debug macros (2016-06-16). From 4ab219e3c5c7b33801e875a4f86ff56dc226a78a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 29 Jun 2016 10:39:40 -0600 Subject: [PATCH 343/390] Unittests: All Makefiles must include a (dummy) preconfig target to be compatible with recent changes to the apps/ configuration system --- ChangeLog.txt | 3 +++ UnitTests/CButton/Makefile | 2 ++ UnitTests/CButtonArray/Makefile | 2 ++ UnitTests/CCheckBox/Makefile | 2 ++ UnitTests/CGlyphButton/Makefile | 2 ++ UnitTests/CGlyphSliderHorizontal/Makefile | 2 ++ UnitTests/CImage/Makefile | 2 ++ UnitTests/CKeypad/Makefile | 2 ++ UnitTests/CLabel/Makefile | 2 ++ UnitTests/CLatchButton/Makefile | 2 ++ UnitTests/CLatchButtonArray/Makefile | 2 ++ UnitTests/CListBox/Makefile | 2 ++ UnitTests/CProgressBar/Makefile | 2 ++ UnitTests/CRadioButton/Makefile | 2 ++ UnitTests/CScrollbarHorizontal/Makefile | 2 ++ UnitTests/CScrollbarVertical/Makefile | 2 ++ UnitTests/CSliderHorizonal/Makefile | 2 ++ UnitTests/CSliderVertical/Makefile | 2 ++ UnitTests/CTextBox/Makefile | 2 ++ UnitTests/nxwm/Makefile | 2 ++ 20 files changed, 41 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 010d7961f..cdfde91ce 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -584,4 +584,7 @@ * Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition (2016-06-14). * Add _ to front of debug macros (2016-06-16). +* Unittests: All Makefiles must provided a (dummy) prefconfig target to be + compatible with changes to the apps/ configuration system that will be + be released in NuttX-7.17. diff --git a/UnitTests/CButton/Makefile b/UnitTests/CButton/Makefile index 7cb4142f7..bb2035685 100644 --- a/UnitTests/CButton/Makefile +++ b/UnitTests/CButton/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CButtonArray/Makefile b/UnitTests/CButtonArray/Makefile index cf58f548b..ce3b4718f 100644 --- a/UnitTests/CButtonArray/Makefile +++ b/UnitTests/CButtonArray/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CCheckBox/Makefile b/UnitTests/CCheckBox/Makefile index 5efaaa0ce..e068bbcce 100644 --- a/UnitTests/CCheckBox/Makefile +++ b/UnitTests/CCheckBox/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CGlyphButton/Makefile b/UnitTests/CGlyphButton/Makefile index 2ee9463b9..d9f133227 100644 --- a/UnitTests/CGlyphButton/Makefile +++ b/UnitTests/CGlyphButton/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CGlyphSliderHorizontal/Makefile b/UnitTests/CGlyphSliderHorizontal/Makefile index 9bbe295a0..2c06b85c7 100644 --- a/UnitTests/CGlyphSliderHorizontal/Makefile +++ b/UnitTests/CGlyphSliderHorizontal/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CImage/Makefile b/UnitTests/CImage/Makefile index f15308dc0..04bdb8a62 100644 --- a/UnitTests/CImage/Makefile +++ b/UnitTests/CImage/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CKeypad/Makefile b/UnitTests/CKeypad/Makefile index 0dcc1136a..b1d5edc6d 100644 --- a/UnitTests/CKeypad/Makefile +++ b/UnitTests/CKeypad/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CLabel/Makefile b/UnitTests/CLabel/Makefile index e1519a76e..50e017f52 100644 --- a/UnitTests/CLabel/Makefile +++ b/UnitTests/CLabel/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CLatchButton/Makefile b/UnitTests/CLatchButton/Makefile index 79dcd8967..47803b54a 100644 --- a/UnitTests/CLatchButton/Makefile +++ b/UnitTests/CLatchButton/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CLatchButtonArray/Makefile b/UnitTests/CLatchButtonArray/Makefile index e5cde9f25..b79fe1021 100644 --- a/UnitTests/CLatchButtonArray/Makefile +++ b/UnitTests/CLatchButtonArray/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CListBox/Makefile b/UnitTests/CListBox/Makefile index f31c3528e..ef9718914 100644 --- a/UnitTests/CListBox/Makefile +++ b/UnitTests/CListBox/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CProgressBar/Makefile b/UnitTests/CProgressBar/Makefile index 221f45c1b..bc63d82e0 100644 --- a/UnitTests/CProgressBar/Makefile +++ b/UnitTests/CProgressBar/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CRadioButton/Makefile b/UnitTests/CRadioButton/Makefile index 44afdee4a..cbd73c9e7 100644 --- a/UnitTests/CRadioButton/Makefile +++ b/UnitTests/CRadioButton/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CScrollbarHorizontal/Makefile b/UnitTests/CScrollbarHorizontal/Makefile index d0d10c963..192a86707 100644 --- a/UnitTests/CScrollbarHorizontal/Makefile +++ b/UnitTests/CScrollbarHorizontal/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CScrollbarVertical/Makefile b/UnitTests/CScrollbarVertical/Makefile index f7bd98840..917c5022f 100644 --- a/UnitTests/CScrollbarVertical/Makefile +++ b/UnitTests/CScrollbarVertical/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CSliderHorizonal/Makefile b/UnitTests/CSliderHorizonal/Makefile index 1b8d0cd4d..ae63999ac 100644 --- a/UnitTests/CSliderHorizonal/Makefile +++ b/UnitTests/CSliderHorizonal/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CSliderVertical/Makefile b/UnitTests/CSliderVertical/Makefile index a22c4ba18..f27c3d9c8 100644 --- a/UnitTests/CSliderVertical/Makefile +++ b/UnitTests/CSliderVertical/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/CTextBox/Makefile b/UnitTests/CTextBox/Makefile index da229542d..a407b7069 100644 --- a/UnitTests/CTextBox/Makefile +++ b/UnitTests/CTextBox/Makefile @@ -157,6 +157,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) diff --git a/UnitTests/nxwm/Makefile b/UnitTests/nxwm/Makefile index 8789e972c..cc2d312c8 100644 --- a/UnitTests/nxwm/Makefile +++ b/UnitTests/nxwm/Makefile @@ -187,6 +187,8 @@ else context: endif +preconfig: + # Standard housekeeping targets .depend: Makefile $(SRCS) From 07e1ff3aca45eddca94a5e6ec397311b8fd49bc0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 1 Jul 2016 06:50:38 -0600 Subject: [PATCH 344/390] Changes for movement of header files from apps/system to apps/include/system --- nxwm/src/cmediaplayer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 7ac6189da..360f296b7 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include #include #include "cwidgetcontrol.hxx" From 5c88a33feae091cb81cf93cbf91d3e7ca519f5c4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 1 Jul 2016 07:00:06 -0600 Subject: [PATCH 345/390] apps/include/nsh.h moved to apps/include/nshlib/nshlib.h --- nxwm/src/cnxterm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index da2a249d5..b17e0eb43 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include #include "cwidgetcontrol.hxx" From b5cb8a2453c8d6665d625b5ff7c1d6b6f7a4b1e9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 4 Jul 2016 09:56:52 -0600 Subject: [PATCH 346/390] Update ChangeLog --- ChangeLog.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index cdfde91ce..37ff7b3f7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -586,5 +586,6 @@ * Add _ to front of debug macros (2016-06-16). * Unittests: All Makefiles must provided a (dummy) prefconfig target to be compatible with changes to the apps/ configuration system that will be - be released in NuttX-7.17. - + be released in NuttX-7.17 (2016-06-29). +* Changes to pre-processor include statments needed to handle reorganization + of the apps/include directory (2016-07-01). From 49cbf69c914611d27ba84c0f6a7721fa557f0538 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 21 Jul 2016 15:38:52 -0600 Subject: [PATCH 347/390] Fix include path to nshlib.h --- nxwm/src/cnxterm.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index b17e0eb43..e84d55d3c 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include "nshlib/nshlib.h" #include "cwidgetcontrol.hxx" From 4ffdfac6a266d48352c0b3a2dc45aff1c7d32f0f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 21 Jul 2016 15:42:13 -0600 Subject: [PATCH 348/390] Fix more paths to apps/include header files --- UnitTests/nxwm/nxwm_main.cxx | 2 +- nxwm/src/ccalibration.cxx | 2 +- nxwm/src/cmediaplayer.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 60c6fcab0..ba47da251 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -45,7 +45,7 @@ #include #ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA -# include +# include "platform/configdata.hr" #endif #include "ctaskbar.hxx" diff --git a/nxwm/src/ccalibration.cxx b/nxwm/src/ccalibration.cxx index 41189cee6..b4c9d3827 100644 --- a/nxwm/src/ccalibration.cxx +++ b/nxwm/src/ccalibration.cxx @@ -46,7 +46,7 @@ #include #ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA -# include +# include "platform/configdata.h" #endif #include "nxwmconfig.hxx" diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index 360f296b7..e502e11db 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -49,7 +49,7 @@ #include #include -#include +#include "system/nxplayer.h" #include #include "cwidgetcontrol.hxx" From 3a7469b2b9b546395dce869f976d6d484f4d9523 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Jul 2016 11:10:07 -0600 Subject: [PATCH 349/390] libnxwidges and nwxm Makefiles should include paths to apps/include --- libnxwidgets/Makefile | 5 ++++- nxwm/Makefile | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 30b4b8583..656e48801 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -89,8 +89,11 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} + DEPPATH = --dep-path src VPATH = src diff --git a/nxwm/Makefile b/nxwm/Makefile index 7e5705c7a..5eeb6e6fd 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -50,6 +50,7 @@ ASRCS = CSRCS = # Window Manager + CXXSRCS = capplicationwindow.cxx cfullscreenwindow.cxx ctaskbar.cxx cwindowmessenger.cxx # Device support @@ -76,7 +77,6 @@ endif # Images - ifeq ($(CONFIG_NXWM_LARGE_ICONS),y) CXXSRCS += glyph_calculator47x49.cxx glyph_calibration48x42.cxx glyph_cmd49x43.cxx CXXSRCS += glyph_minimize42x42.cxx glyph_play48x48.cxx glyph_stop42x42.cxx @@ -108,8 +108,10 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} From 9dc1886f211761bb6cbd26d617871305b4cec06b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 Jul 2016 16:26:35 -0600 Subject: [PATCH 350/390] Backout last change for last apps/include path. Oddly, it is neither necesary nor correct. --- libnxwidgets/Makefile | 2 -- nxwm/Makefile | 2 -- 2 files changed, 4 deletions(-) diff --git a/libnxwidgets/Makefile b/libnxwidgets/Makefile index 656e48801..4ad4d9a10 100644 --- a/libnxwidgets/Makefile +++ b/libnxwidgets/Makefile @@ -89,9 +89,7 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} -CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} DEPPATH = --dep-path src diff --git a/nxwm/Makefile b/nxwm/Makefile index 5eeb6e6fd..4f7981681 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -108,10 +108,8 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} -CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} From f2bd4a0ba789a07b4d4fd164659a20c45d47159f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 24 Jul 2016 14:07:30 -0600 Subject: [PATCH 351/390] Update ChangeLog and README --- ChangeLog.txt | 2 ++ README.txt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 37ff7b3f7..dd4a89c97 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -589,3 +589,5 @@ be released in NuttX-7.17 (2016-06-29). * Changes to pre-processor include statments needed to handle reorganization of the apps/include directory (2016-07-01). +* Update include paths to adapt to changes made to apps/ include path logic + (2016-07-22). diff --git a/README.txt b/README.txt index 1ddce0887..aaaae3166 100644 --- a/README.txt +++ b/README.txt @@ -96,5 +96,5 @@ nxwm menu and create as many NSH sessions in windows as you want. (keybard input still comes through serial). - Note 1: NwWM requires NuttX-7.9 or above to work with the current - NxWidgets-1.15 release. + Note 1: NwWM requires NuttX-7.17 or above to work with the current + NxWidgets-1.17 release. From 04d04d6fbdd1011e8b40f23833b826ecbf282859 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 25 Jul 2016 07:23:26 -0600 Subject: [PATCH 352/390] Prep for 1.17 release --- ChangeLog.txt | 4 +++- ReleaseNotes.txt | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index dd4a89c97..4c971e0e9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -575,7 +575,7 @@ where 'make clean' is called with no .config or Make.defs file installed (2016-05-10). -1.17 2016-xx-xx Gregory Nutt +1.17 2016-08-25 Gregory Nutt * UnitTests: Back conditional logic out of UnitTest Make.defs files. It does not belong there and causes link failures like "Cannot find nxwm_main" @@ -591,3 +591,5 @@ of the apps/include directory (2016-07-01). * Update include paths to adapt to changes made to apps/ include path logic (2016-07-22). + +1.18 2016-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index e930027b9..c481db859 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -535,3 +535,31 @@ Bugfixes\: has built the NxWidgets packages in the last several realeases! * UnitTests: Add some default definitions to handle the (unusual) case where 'make clean' is called with no .config or Make.defs file installed + +NxWidgets-1.17 +============== + +The 18th release of the NxWidgets package was made on July 25, 2016. This +release depends on NuttX-7.17 or above and should not be used with older +NuttX releases. + +The TAG for this release is nuttx-7.17 + +Additional new features and extended functionality in Version 1.17: + +* There are no new features in this release. There are only updates + necessary to use NxWidgets with other changes to NuttX-7.17. These + changes include: + + - Changes to debug macro names. dbg() and vdbg() are replaces with + info(), warn(), and err(). + - Changes to Unittests/ Makefiles to deal with changes in the apps/ + build system. + - Changes to pre-processor include statments needed to handle + reorganization of the apps/include directory. + - Update include paths to adapt to changes made to apps/ include path + logic + +Bugfixes\: + +* None in this release From 2a8bca761910222e2d5b88d8b48d77d7f85a2907 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 25 Jul 2016 07:30:04 -0600 Subject: [PATCH 353/390] Fix date of 1.17 release. --- ChangeLog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4c971e0e9..11fc11762 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -575,7 +575,7 @@ where 'make clean' is called with no .config or Make.defs file installed (2016-05-10). -1.17 2016-08-25 Gregory Nutt +1.17 2016-07-25 Gregory Nutt * UnitTests: Back conditional logic out of UnitTest Make.defs files. It does not belong there and causes link failures like "Cannot find nxwm_main" From 8f305416ed1c0b8e087c78c4ccbb66c217a4d3b6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 28 Jul 2016 12:05:38 -0600 Subject: [PATCH 354/390] NxWM needs the path to the apps/include directory --- nxwm/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nxwm/Makefile b/nxwm/Makefile index 4f7981681..cf4285670 100644 --- a/nxwm/Makefile +++ b/nxwm/Makefile @@ -1,7 +1,7 @@ ################################################################################# # NxWidgets/nxwm/Makefile # -# Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. +# Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -33,6 +33,7 @@ # ################################################################################# +-include $(TOPDIR)/.config -include $(TOPDIR)/Make.defs # Control build verbosity @@ -113,6 +114,10 @@ CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWMDIR)$(DELIM)include} CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(NXWIDGETDIR)$(DELIM)include} +APPDIR = $(TOPDIR)$(DELIM)$(CONFIG_APPS_DIR) +CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} +CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)$(DELIM)include"} + DEPPATH = --dep-path src VPATH = src From cb3dc4d54444ff6c710c8ac1e7dd5e78049c1320 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 11:17:37 -0600 Subject: [PATCH 355/390] NxWidgets: Fix CListBox crash when clicked below the last item --- libnxwidgets/include/clistdata.hxx | 11 +++++++++-- libnxwidgets/src/clistbox.cxx | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/include/clistdata.hxx b/libnxwidgets/include/clistdata.hxx index da46a6acd..ad8ec3803 100644 --- a/libnxwidgets/include/clistdata.hxx +++ b/libnxwidgets/include/clistdata.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/clistdata.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -259,7 +259,14 @@ namespace NXWidgets virtual inline const CListDataItem *getItem(const int index) const { - return m_items[index]; + if (index < 0 || index >= m_items.size()) + { + return nullptr; + } + else + { + return m_items[index]; + } } /** diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index 1c5d1e507..bcf612343 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -607,6 +607,11 @@ void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y) const CListBoxDataItem *item = (const CListBoxDataItem*)m_options.getItem(m_lastSelectedIndex); + if (!item) + { + return; // No item at click position + } + // Are we selecting or de-selecting? if (item->isSelected()) From c450feed48c7b8c9f28088233602e86af21fba6e Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 11:47:49 -0600 Subject: [PATCH 356/390] libnxwdigets: Fix memory leak in CNxWindow and make behaviour match CNxTkWindow. --- libnxwidgets/src/cnxwindow.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/src/cnxwindow.cxx b/libnxwidgets/src/cnxwindow.cxx index ba558bac0..c7fbe2bc9 100644 --- a/libnxwidgets/src/cnxwindow.cxx +++ b/libnxwidgets/src/cnxwindow.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cnxwindow.cxx * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -77,11 +77,17 @@ CNxWindow::CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl) CNxWindow::~CNxWindow(void) { - // Release the window. We do not release the widget control - // instance. The lifetime of that instance is owned by he-who- - // constructed-us. + // Release the window. (void)nx_closewindow(m_hNxWindow); + + // Release the widget control instance. Whether its lifetime + // should be handled by the window, or the owner-of-the-window + // is debatable. However in general the widget control is stored + // only in the window, so it makes sense to release it here also. + + delete m_widgetControl; + m_widgetControl = NULL; } /** From 5ea0785c16ff1aac737d1c8356d22366d6dab388 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 11:50:03 -0600 Subject: [PATCH 357/390] libnxwidgets: Fix default text colors in NxWidgets::CListBox --- libnxwidgets/src/clistbox.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index bcf612343..bf8511b5e 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -143,8 +143,8 @@ CListBox::~CListBox(void) void CListBox::addOption(const CNxString &text, const uint32_t value) { addOption(text, value, - getShadowEdgeColor(), getBackgroundColor(), - getShadowEdgeColor(), getHighlightColor()); + getEnabledTextColor(), getBackgroundColor(), + getSelectedTextColor(), getSelectedBackgroundColor()); } /** From 334122ac8db9418f42635967c7689459625409e9 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 11:52:52 -0600 Subject: [PATCH 358/390] libnxwidgets: Avoid unnecessary redraw in NxWidgets::CListBox. The ListData will raise an event that will cause a redraw anyway. Redrawing in click() caused double redraws. --- libnxwidgets/src/clistbox.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libnxwidgets/src/clistbox.cxx b/libnxwidgets/src/clistbox.cxx index bf8511b5e..67a085e39 100644 --- a/libnxwidgets/src/clistbox.cxx +++ b/libnxwidgets/src/clistbox.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/clistbox.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -628,7 +628,6 @@ void CListBox::onClick(nxgl_coord_t x, nxgl_coord_t y) } startDragging(x, y); - redraw(); } /** From 3437a00fab722f7a0f07a7dac6c9a68811707f88 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 11:56:59 -0600 Subject: [PATCH 359/390] libnxwidgets: Fix coordinate handling in NxWidgets::CMultiLineTextBox. Related to 'Thu Feb 21 16:47:01 2013 Fix text placement in CMultiLineTextbox.' There was a few similar bugs remaining in calculating of rows to show and in clearing the background. --- libnxwidgets/src/cmultilinetextbox.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/src/cmultilinetextbox.cxx b/libnxwidgets/src/cmultilinetextbox.cxx index e7af8f23d..0b406d129 100644 --- a/libnxwidgets/src/cmultilinetextbox.cxx +++ b/libnxwidgets/src/cmultilinetextbox.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/cmultilinetextbox.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -691,13 +691,14 @@ void CMultiLineTextBox::drawContents(CGraphicsPort *port) void CMultiLineTextBox::drawBorder(CGraphicsPort *port) { - port->drawFilledRect(0, 0, getWidth(), getHeight(), getBackgroundColor()); + port->drawFilledRect(getX(), getY(), getWidth(), getHeight(), + getBackgroundColor()); // Stop drawing if the widget indicates it should not have an outline if (!isBorderless()) { - port->drawBevelledRect(0, 0, getWidth(), getHeight(), + port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), getShadowEdgeColor(), getShineEdgeColor()); } } @@ -1173,7 +1174,7 @@ void CMultiLineTextBox::drawText(CGraphicsPort *port) // Determine the top and bottom rows within the graphicsport's clip rect. // We only draw these rows in order to increase the speed of the routine. - int regionY = -m_canvasY + m_rect.getY(); // Y coord of canvas visible region + int regionY = -m_canvasY; // Y coord of canvas visible region int topRow = getRowContainingCoordinate(regionY); int bottomRow = getRowContainingCoordinate(regionY + m_rect.getHeight()); From 2bc22450d245829529c9345c156e0f6575b79512 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 12:06:23 -0600 Subject: [PATCH 360/390] libnxwidgets: Allow NxWidgets::CListDataItems subclasses access to text and value --- libnxwidgets/include/clistdataitem.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/include/clistdataitem.hxx b/libnxwidgets/include/clistdataitem.hxx index 5cb60f3e7..b1dc6a276 100644 --- a/libnxwidgets/include/clistdataitem.hxx +++ b/libnxwidgets/include/clistdataitem.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/clistdataitem.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -102,7 +102,7 @@ namespace NXWidgets class CListDataItem { - private: + protected: CNxString m_text; /**< Text to display for option. */ uint32_t m_value; /**< Option value. */ bool m_isSelected; /**< True if the option is selected. */ From a910c967bad302b2b56ace56366c4c060e4e69e9 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 12:07:26 -0600 Subject: [PATCH 361/390] Add task name to NxWidgets::CNxServer and NxWM:CTouchScreen --- libnxwidgets/src/cnxserver.cxx | 3 +++ nxwm/src/ctouchscreen.cxx | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index d412988eb..f8d2dfe9c 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -480,6 +481,8 @@ FAR void *CNxServer::listener(FAR void *arg) CNxServer *This = (CNxServer*)arg; + prctl(PR_SET_NAME, "CNxServer::listener", 0); + // Process events forever while (!This->m_stop) diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 6d7031ebb..9a4b777b8 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -1,7 +1,7 @@ /******************************************************************************************** * NxWidgets/nxwm/src/ctouchscreen.cxx * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,8 @@ #include #include +#include + #include #include #include @@ -277,6 +279,8 @@ FAR void *CTouchscreen::listener(FAR void *arg) { CTouchscreen *This = (CTouchscreen *)arg; + prctl(PR_SET_NAME, "CTouchScreen::listener", 0); + _info("Listener started\n"); #ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT From 9a85276218929d21698cba980a5cc812e97dc360 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 12:11:32 -0600 Subject: [PATCH 362/390] libnxwidgets: In NxWidgets::CText, allow setting negative line spacing. This is useful to have text take up less space, as quite many fonts have large line spacings built-in. --- libnxwidgets/include/ctext.hxx | 6 +++--- libnxwidgets/src/ctext.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libnxwidgets/include/ctext.hxx b/libnxwidgets/include/ctext.hxx index 8f691082d..aa4b303a7 100644 --- a/libnxwidgets/include/ctext.hxx +++ b/libnxwidgets/include/ctext.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/ctext.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -126,7 +126,7 @@ namespace NXWidgets TNxArray m_longestLines; /**< Array containing data describing successively longer wrapped lines */ - uint8_t m_lineSpacing; /**< Spacing between lines of text */ + nxgl_coord_t m_lineSpacing; /**< Spacing between lines of text */ int32_t m_textPixelHeight; /**< Total height of the wrapped text in pixels */ uint8_t m_textPixelWidth; /**< Total width of the wrapped text @@ -216,7 +216,7 @@ namespace NXWidgets * @param lineSpacing The line spacing. */ - void setLineSpacing(uint8_t lineSpacing); + void setLineSpacing(nxgl_coord_t lineSpacing); /** * Sets the pixel width of the text; text wider than diff --git a/libnxwidgets/src/ctext.cxx b/libnxwidgets/src/ctext.cxx index 60b726ca3..fa34079c6 100644 --- a/libnxwidgets/src/ctext.cxx +++ b/libnxwidgets/src/ctext.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/ctext.cxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -199,7 +199,7 @@ void CText::remove(const int startIndex, const int count) * @param lineSpacing The line spacing. */ -void CText::setLineSpacing(uint8_t lineSpacing) +void CText::setLineSpacing(nxgl_coord_t lineSpacing) { m_lineSpacing = lineSpacing; wrap(); From 37ef33883b68a4310640767988af53e974854366 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Thu, 22 Sep 2016 12:14:52 -0600 Subject: [PATCH 363/390] libnxwidgets: Allow setting line spacing in NxWidgets::CMultiLineTextBox. --- libnxwidgets/include/cmultilinetextbox.hxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libnxwidgets/include/cmultilinetextbox.hxx b/libnxwidgets/include/cmultilinetextbox.hxx index e10440cb5..3d725e382 100644 --- a/libnxwidgets/include/cmultilinetextbox.hxx +++ b/libnxwidgets/include/cmultilinetextbox.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/cmultilinetextbox.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -529,6 +529,17 @@ namespace NXWidgets virtual void setFont(CNxFont *font); + /** + * Set the line spacing of the text. + * + * @param spacing Extra space (in pixels) to add between lines. + */ + + virtual inline void setLineSpacing(nxgl_coord_t lineSpacing) + { + m_text->setLineSpacing(lineSpacing); + } + /** * Get the length of the text string. * From 1a71720006d2fd3273673badd946ab5fb7c5c4c5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Oct 2016 10:22:07 -0600 Subject: [PATCH 364/390] Remove use of nullptr. That is a C++11-ism that is not supported by many toolchains. --- libnxwidgets/include/clistdata.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/include/clistdata.hxx b/libnxwidgets/include/clistdata.hxx index ad8ec3803..c424bc8bd 100644 --- a/libnxwidgets/include/clistdata.hxx +++ b/libnxwidgets/include/clistdata.hxx @@ -261,7 +261,7 @@ namespace NXWidgets { if (index < 0 || index >= m_items.size()) { - return nullptr; + return (const CListDataItem *)0; } else { From 98855649c2676263e4bb1c3bc991d055631569ad Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Oct 2016 10:40:15 -0600 Subject: [PATCH 365/390] Can't use prctl is CONFIG_TASK_NAME_SIZE==0 --- libnxwidgets/src/cnxserver.cxx | 2 ++ nxwm/src/ctouchscreen.cxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index f8d2dfe9c..d5d499e67 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -481,7 +481,9 @@ FAR void *CNxServer::listener(FAR void *arg) CNxServer *This = (CNxServer*)arg; +#ifdef CONFIG_TASK_NAME_SIZE > 0 prctl(PR_SET_NAME, "CNxServer::listener", 0); +#endif // Process events forever diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 9a4b777b8..5cf18f94c 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -279,7 +279,9 @@ FAR void *CTouchscreen::listener(FAR void *arg) { CTouchscreen *This = (CTouchscreen *)arg; +#if CONFIG_TASK_NAME_SIZE > 0 prctl(PR_SET_NAME, "CTouchScreen::listener", 0); +#endif _info("Listener started\n"); From 861f935a70097e5aa1d4903906aec69ae7cc28eb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 6 Oct 2016 10:52:43 -0600 Subject: [PATCH 366/390] Fix a typo in the last commit --- libnxwidgets/src/cnxserver.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index d5d499e67..69e1d874c 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -481,7 +481,7 @@ FAR void *CNxServer::listener(FAR void *arg) CNxServer *This = (CNxServer*)arg; -#ifdef CONFIG_TASK_NAME_SIZE > 0 +#if CONFIG_TASK_NAME_SIZE > 0 prctl(PR_SET_NAME, "CNxServer::listener", 0); #endif From c5f8817904fb1dfd98e2a884655b1a26f9526993 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 8 Oct 2016 08:13:03 -0600 Subject: [PATCH 367/390] Update ChangeLog --- ChangeLog.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 11fc11762..a4ddd8fce 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -593,3 +593,29 @@ (2016-07-22). 1.18 2016-xx-xx Gregory Nutt + +* NxWM needs the path to the apps/include directory (2016-07-28). +* NxWidgets: Fix CListBox crash when clicked below the last item. From + Petteri Aimonen (2016-09-22). +* libnxwdigets: Fix memory leak in CNxWindow and make behaviour match + CNxTkWindow. From Petteri Aimonen (2016-09-22). +* libnxwidgets: Fix default text colors in NxWidgets::CListBox. From + Petteri Aimonen (2016-09-22). +* libnxwidgets: Avoid unnecessary redraw in NxWidgets::CListBox. The + ListData will raise an event that will cause a redraw anyway. Redrawing + in click() caused double redraws. From Petteri Aimonen (2016-09-22). +* libnxwidgets: Fix coordinate handling in NxWidgets::CMultiLineTextBox. + Related to 'Thu Feb 21 16:47:01 2013 Fix text placement in + CMultiLineTextbox.' There was a few similar bugs remaining in calculating + of rows to show and in clearing the background. From Petteri Aimonen + (2016-09-22). +* libnxwidgets: Allow NxWidgets::CListDataItems subclasses access to text + and value. From Petteri Aimonen (2016-09-22). +* Add setting task name via prctl() to NxWidgets::CNxServer and + NxWM:CTouchScreen. From Petteri Aimonen (2016-09-22). +* libnxwidgets: In NxWidgets::CText, allow setting negative line spacing. + This is useful to have text take up less space, as quite many fonts have + large line spacings built-in. From Petteri Aimonen (2016-09-22). +* libnxwidgets: Allow setting line spacing in NxWidgets::CMultiLineTextBox. + From Petteri Aimonen (2016-09-22). + From 7e7b6a5e4c49be2c39993c9b8dc0e2110af44144 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Dec 2016 17:07:25 -0600 Subject: [PATCH 368/390] CNxServer: Remove NX server task. Instead, call nx_start (indirectly via boardctl(BOARDIOC_NX_START) to start the NX server as a kernel thread. --- ChangeLog.txt | 4 ++ Kconfig | 30 ++------- libnxwidgets/include/cnxserver.hxx | 9 --- libnxwidgets/include/nxconfig.hxx | 26 ++------ libnxwidgets/src/cnxserver.cxx | 99 ++---------------------------- nxwm/include/nxwmconfig.hxx | 12 ++-- 6 files changed, 25 insertions(+), 155 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index a4ddd8fce..eb854d6c1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -618,4 +618,8 @@ large line spacings built-in. From Petteri Aimonen (2016-09-22). * libnxwidgets: Allow setting line spacing in NxWidgets::CMultiLineTextBox. From Petteri Aimonen (2016-09-22). +* CNxServer: Remove NX server task. Now calls nx_start (indirectly through + boardctrl(BOARDIOC_NX_START) to start the NX Server kernel thread + (2016-12-01). + diff --git a/Kconfig b/Kconfig index 9474cacc9..8fbb24fe8 100644 --- a/Kconfig +++ b/Kconfig @@ -39,7 +39,7 @@ config NXWIDGETS_EXTERNINIT config NXWIDGETS_DEVNO int "LCD Device Number" default 0 - depends on NXWIDGETS_EXTERNINIT || NX_LCDDRIVER + depends on (NXWIDGETS_EXTERNINIT || NX_LCDDRIVER) && !NX_MULTIUSER ---help--- LCD device number (in case there are more than one LCDs connected). Default: 0 @@ -47,7 +47,7 @@ config NXWIDGETS_DEVNO config NXWIDGETS_VPLANE int "Plane Number" default 0 - depends on !NX_LCDDRIVER && !NXWIDGETS_EXTERNINIT + depends on !NX_LCDDRIVER && !NXWIDGETS_EXTERNINIT && !NX_MULTIUSER ---help--- Only a single video plane is supported. Default: 0 @@ -65,28 +65,6 @@ config NXWIDGET_SERVERINIT by other, external logic and will simply attempt to connect to the server. -if NXWIDGET_SERVERINIT - -config NXWIDGETS_SERVERPRIO - int "NX Server priority" - default 110 - ---help--- - Priority of the NX server. This applies only if NX is configured in - multi-user mode (NX_MULTIUSER=y). Default: 110. - - NOTE: Of the three priority definitions here, NXWIDGETS_SERVERPRIO - should have the highest priority to avoid data overrun race conditions. - Such errors would most likely appear as duplicated rows of data on the - display. - -config NXWIDGETS_SERVERSTACK - int "NX Server Stack Size" - default 2048 - ---help--- - NX server thread stack size (in multi-user mode). Default 2048 - -endif # NXWIDGET_SERVERINIT - config NXWIDGETS_CLIENTPRIO int "NX Client Priority" default 100 @@ -673,7 +651,7 @@ config NXWM_STARTWINDOW_PRIO ---help--- Priority of the StartWindow task. Default: 100. - NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or else + NOTE: This priority should be less than NXSTART_SERVERPRIO or else there may be data overrun errors. Such errors would most likely appear as duplicated rows of data on the display. @@ -703,7 +681,7 @@ config NXWM_NXTERM_PRIO ---help--- Priority of the NxTerm task. Default: 100. - NOTE: This priority should be less than NXWIDGETS_SERVERPRIO or + NOTE: This priority should be less than NXSTART_SERVERPRIO or else there may be data overrun errors. Such errors would most likely appear as duplicated rows of data on the display. diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index 380594190..3c07f24b2 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -90,15 +90,6 @@ namespace NXWidgets #endif static uint8_t m_nServers; /**< The number of NX server instances */ - /** - * NX server thread. This is the entry point into the server thread that - * serializes the multi-threaded accesses to the display. - */ - -#if defined(CONFIG_NX_MULTIUSER) && defined(CONFIG_NXWIDGET_SERVERINIT) - static int server(int argc, char *argv[]); -#endif - /** * NX listener thread. This is the entry point of a thread that listeners for and * dispatches events from the NX server. diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 6043811a6..8548052ec 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -66,10 +66,10 @@ * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than * one LCDs connected. Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 - * CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server. This applies + * CONFIG_NXSTART_SERVERPRIO - Priority of the NX server. This applies * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). * Default: (SCHED_PRIORITY_DEFAULT+10). NOTE: Of the three priority - * definitions here, CONFIG_NXWIDGETS_SERVERPRIO should have the highest + * definitions here, CONFIG_NXSTART_SERVERPRIO should have the highest * priority to avoid data overrun race conditions. Such errors would most * likely appear as duplicated rows of data on the display. * CONFIG_NXWIDGETS_CLIENTPRIO - The thread that calls CNxServer::connect() @@ -81,8 +81,6 @@ * (CONFIG_NX_MULTIUSER=y). Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display * initialization. - * CONFIG_NXWIDGETS_SERVERSTACK - NX server thread stack size (in multi-user - * mode). Default 2048 * CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user * mode). Default 2048 * CONFIG_NXWIDGET_EVENTWAIT - Build in support for external window event, modal @@ -213,27 +211,15 @@ * Priority of the NX server (in multi-user mode) */ -#ifndef CONFIG_NXWIDGETS_SERVERPRIO -# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+10) -#endif - #ifndef CONFIG_NXWIDGETS_CLIENTPRIO # define CONFIG_NXWIDGETS_CLIENTPRIO SCHED_PRIORITY_DEFAULT #endif -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" +#if CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO +# warning "CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWIDGETS_CLIENTPRIO" # warning" -- This can result in data overrun errors" #endif -/** - * NX server thread stack size (in multi-user mode) - */ - -#ifndef CONFIG_NXWIDGETS_SERVERSTACK -# define CONFIG_NXWIDGETS_SERVERSTACK 2048 -#endif - /** * Priority of the NX event listener thread (in multi-user mode) */ @@ -242,8 +228,8 @@ # define CONFIG_NXWIDGETS_LISTENERPRIO SCHED_PRIORITY_DEFAULT #endif -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" +#if CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO +# warning "CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWIDGETS_LISTENERPRIO" # warning" -- This can result in data overrun errors" #endif diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 69e1d874c..7856854d4 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -246,24 +246,16 @@ bool CNxServer::connect(void) } #ifdef CONFIG_NXWIDGET_SERVERINIT - // Start the server task + // Start the NX server kernel thread - ginfo("CNxServer::connect: Starting server task\n"); - pid_t serverId = task_create("NX Server", CONFIG_NXWIDGETS_SERVERPRIO, - CONFIG_NXWIDGETS_SERVERSTACK, server, - (FAR char * const *)0); - if (serverId < 0) + printf("CNxServer::connect: Starting NX server\n"); + ret = boardctl(BOARDIOC_NX_START, 0); + if (ret < 0) { - gerr("ERROR: NxServer::connect: Failed to create nx_servertask task: %d\n", errno); + printf("ERROR: CNxServer::connect: Failed to start the NX server: %d\n", errno); return false; } - // Wait a bit to let the server get started - - usleep(50*1000); - -#endif // CONFIG_NXWIDGET_SERVERINIT - // Connect to the server m_hNxServer = nx_connect(); @@ -388,87 +380,6 @@ void CNxServer::disconnect(void) } #endif // CONFIG_NX_MULTIUSER -/** - * NX server thread. This is the entry point into the server thread that - * serializes the multi-threaded accesses to the display. - */ - -#if defined(CONFIG_NX_MULTIUSER) && defined(CONFIG_NXWIDGET_SERVERINIT) -int CNxServer::server(int argc, char *argv[]) -{ - FAR NX_DRIVERTYPE *dev; - int ret; - -#if defined(CONFIG_NXWIDGETS_EXTERNINIT) - struct boardioc_graphics_s devinfo; - int ret; - - // Use external graphics driver initialization - - printf("nxtext_initialize: Initializing external graphics device\n"); - - devinfo.devno = CONFIG_NXWIDGETS_DEVNO; - devinfo.dev = NULL; - - ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); - if (ret < 0) - { - gerr("ERROR: boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); - return EXIT_FAILURE; - } - - dev = devinfo.dev; - -#elif defined(CONFIG_NX_LCDDRIVER) - // Initialize the LCD device - - ret = board_lcd_initialize(); - if (ret < 0) - { - gerr("ERROR: board_lcd_initialize failed: %d\n", -ret); - return EXIT_FAILURE; - } - - // Get the device instance - - dev = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); - if (!dev) - { - gerr("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); - return EXIT_FAILURE; - } - - // Turn the LCD on at 75% power - - (void)dev->setpower(dev, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); - -#else // CONFIG_NX_LCDDRIVER - // Initialize the frame buffer device - - ret = up_fbinitialize(0); - if (ret < 0) - { - gerr("ERROR: nxterm_server: up_fbinitialize failed: %d\n", -ret); - return EXIT_FAILURE; - } - - dev = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); - if (!dev) - { - gerr("ERROR: up_fbgetvplane failed, vplane=%d\n", CONFIG_NXWIDGETS_VPLANE); - return 2; - } - -#endif // CONFIG_NX_LCDDRIVER - - // Then start the server - - ret = nx_run(dev); - ginfo("nx_run returned: %d\n", errno); - return EXIT_FAILURE; -} -#endif // CONFIG_NX_MULTIUSER && CONFIG_NXWIDGET_SERVERINIT - /** * This is the entry point of a thread that listeners for and dispatches * events from the NX server. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index 42b091b27..aa9a727bc 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -307,7 +307,7 @@ * CONFIG_NXWM_STARTWINDOW_MXMPRIO - The message priority. Default: 42. * CONFIG_NXWM_STARTWINDOW_PRIO - Priority of the StartWindoW task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than - * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. + * CONFIG_NXSTART_SERVERPRIO or else there may be data overrun errors. * Such errors would most likely appear as duplicated rows of data on the * display. * CONFIG_NXWM_STARTWINDOW_STACKSIZE - The stack size to use when starting the @@ -354,8 +354,8 @@ # define CONFIG_NXWM_STARTWINDOW_PRIO SCHED_PRIORITY_DEFAULT #endif -#if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO" +#if CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO +# warning "CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWM_STARTWINDOW_PRIO" # warning" -- This can result in data overrun errors" #endif @@ -369,7 +369,7 @@ * * CONFIG_NXWM_NXTERM_PRIO - Priority of the NxTerm task. Default: * SCHED_PRIORITY_DEFAULT. NOTE: This priority should be less than - * CONFIG_NXWIDGETS_SERVERPRIO or else there may be data overrun errors. + * CONFIG_NXSTART_SERVERPRIO or else there may be data overrun errors. * Such errors would most likely appear as duplicated rows of data on the * display. * CONFIG_NXWM_NXTERM_STACKSIZE - The stack size to use when starting the @@ -388,8 +388,8 @@ # define CONFIG_NXWM_NXTERM_PRIO SCHED_PRIORITY_DEFAULT # endif -# if CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO -# warning "CONFIG_NXWIDGETS_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO" +# if CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO +# warning "CONFIG_NXSTART_SERVERPRIO <= CONFIG_NXWM_NXTERM_PRIO" # warning" -- This can result in data overrun errors" # endif From 15ee00996a493e4ac4d293ab317566e201a17be8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Dec 2016 18:20:56 -0600 Subject: [PATCH 369/390] Resotre an #endif that was accidentally removed in the last commit. --- libnxwidgets/src/cnxserver.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 7856854d4..7673d3aab 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -255,6 +255,7 @@ bool CNxServer::connect(void) printf("ERROR: CNxServer::connect: Failed to start the NX server: %d\n", errno); return false; } +#endif // CONFIG_NXWIDGET_SERVERINIT // Connect to the server From 62d15ba6fb996161a26de0033070bde663a81606 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 1 Dec 2016 18:59:18 -0600 Subject: [PATCH 370/390] CNxServer: Can't use printf in this context. --- libnxwidgets/src/cnxserver.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index 7673d3aab..eab149f2d 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -248,11 +248,11 @@ bool CNxServer::connect(void) #ifdef CONFIG_NXWIDGET_SERVERINIT // Start the NX server kernel thread - printf("CNxServer::connect: Starting NX server\n"); + ginfo("CNxServer::connect: Starting NX server\n"); ret = boardctl(BOARDIOC_NX_START, 0); if (ret < 0) { - printf("ERROR: CNxServer::connect: Failed to start the NX server: %d\n", errno); + gerr("ERROR: CNxServer::connect: Failed to start the NX server: %d\n", errno); return false; } #endif // CONFIG_NXWIDGET_SERVERINIT From 275a9281b1c782912b7bb02ff033d0713171f8b8 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 6 Dec 2016 15:32:14 -0600 Subject: [PATCH 371/390] Update comment --- libnxwidgets/include/nxconfig.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 8548052ec..f7452f873 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -64,7 +64,7 @@ * NX Server/Device Configuration * * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than - * one LCDs connected. Default: 0 + * one LCDs connected (single user mode only). Default: 0 * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 * CONFIG_NXSTART_SERVERPRIO - Priority of the NX server. This applies * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). From f5d65bd2d7a2169f93f179f8627bd73285e2bcb5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 11 Dec 2016 11:00:00 -0600 Subject: [PATCH 372/390] Update ChangeLog --- ChangeLog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index eb854d6c1..817b97803 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -621,5 +621,6 @@ * CNxServer: Remove NX server task. Now calls nx_start (indirectly through boardctrl(BOARDIOC_NX_START) to start the NX Server kernel thread (2016-12-01). +* CNxServer: Can't use printf in this context (2016-12-01) From a695a6fa07debc9d700dc987e8354478515c4a07 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 25 Dec 2016 14:29:29 -0600 Subject: [PATCH 373/390] Prep for 1.18 release --- ChangeLog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 817b97803..303e8dc2d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -592,7 +592,7 @@ * Update include paths to adapt to changes made to apps/ include path logic (2016-07-22). -1.18 2016-xx-xx Gregory Nutt +1.18 2016-12-26 Gregory Nutt * NxWM needs the path to the apps/include directory (2016-07-28). * NxWidgets: Fix CListBox crash when clicked below the last item. From @@ -623,4 +623,4 @@ (2016-12-01). * CNxServer: Can't use printf in this context (2016-12-01) - +1.19 2017-xx-xx Gregory Nutt From b8f53f6d04c3f91aa0c6e11c9d59e6e135a16bf7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 26 Dec 2016 12:45:10 -0600 Subject: [PATCH 374/390] Update ReleaseNotes in prep for 1.18 release. --- README.txt | 4 ++-- ReleaseNotes.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index aaaae3166..b3932743f 100644 --- a/README.txt +++ b/README.txt @@ -96,5 +96,5 @@ nxwm menu and create as many NSH sessions in windows as you want. (keybard input still comes through serial). - Note 1: NwWM requires NuttX-7.17 or above to work with the current - NxWidgets-1.17 release. + Note 1: NwWM requires NuttX-7.19 or above to work with the current + NxWidgets-1.18 release. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index c481db859..54d62493a 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -563,3 +563,45 @@ Additional new features and extended functionality in Version 1.17: Bugfixes\: * None in this release + +NxWidgets-1.18 +============== + +The 19th release of the NxWidgets package was made on December 26, 2016. This +release depends on NuttX-7.19 or above and should not be used with older +NuttX releases. + +The TAG for this release is nuttx-7.19 + +Additional new features and extended functionality in Version 1.18: + +* libnxwidgets: Allow NxWidgets::CListDataItems subclasses access to text + and value. From Petteri Aimonen. +* Add setting task name via prctl() to NxWidgets::CNxServer and + NxWM:CTouchScreen. From Petteri Aimonen. +* libnxwidgets: In NxWidgets::CText, allow setting negative line spacing. + This is useful to have text take up less space, as quite many fonts have + large line spacings built-in. From Petteri Aimonen. +* libnxwidgets: Allow setting line spacing in NxWidgets::CMultiLineTextBox. + From Petteri Aimonen. +* CNxServer: Remove NX server task. Now calls nx_start (indirectly through + boardctrl(BOARDIOC_NX_START) to start the NX Server kernel thread. + +Bugfixes: + +* NxWM needs the path to the apps/include directory. +* NxWidgets: Fix CListBox crash when clicked below the last item. From + Petteri Aimonen. +* libnxwdigets: Fix memory leak in CNxWindow and make behaviour match + CNxTkWindow. From Petteri Aimonen. +* libnxwidgets: Fix default text colors in NxWidgets::CListBox. From + Petteri Aimonen. +* libnxwidgets: Avoid unnecessary redraw in NxWidgets::CListBox. The + ListData will raise an event that will cause a redraw anyway. Redrawing + in click() caused double redraws. From Petteri Aimonen. +* libnxwidgets: Fix coordinate handling in NxWidgets::CMultiLineTextBox. + Related to 'Thu Feb 21 16:47:01 2013 Fix text placement in + CMultiLineTextbox.' There was a few similar bugs remaining in calculating + of rows to show and in clearing the background. From Petteri Aimonen. +* CNxServer: Can't use printf in this context. + From 16ad6dff26a09e15551eef80d6fc949a3e754dbc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 8 Jan 2017 09:14:39 -0600 Subject: [PATCH 375/390] NX server: Correct message queue names. Should not be at /dev, but rather relative to /var/mqueue. --- Kconfig | 4 ++-- nxwm/include/nxwmconfig.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kconfig b/Kconfig index 8fbb24fe8..68ba99a5d 100644 --- a/Kconfig +++ b/Kconfig @@ -628,10 +628,10 @@ endif # NXWM_CUSTOM_STARTWINDOW_ICON config NXWM_STARTWINDOW_MQNAME string "Message Queue Name" - default "/dev/nxwm" + default "nxwm" ---help--- The well known name of the message queue. Used to communicated from - CWindowMessenger to the start window thread. Default: "/dev/nxwm" + CWindowMessenger to the start window thread. Default: "nxwm" config NXWM_STARTWINDOW_MXMSGS int "Max Messages" diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index aa9a727bc..c039f5663 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -301,7 +301,7 @@ * CONFIG_NXWM_STARTWINDOW_ICON - The glyph to use as the start window icon * CONFIG_NXWM_STARTWINDOW_MQNAME - The well known name of the message queue * Used to communicated from CWindowMessenger to the start window thread. - * Default: "/dev/nxwm" + * Default: "nxwm" * CONFIG_NXWM_STARTWINDOW_MXMSGS - The maximum number of messages to queue * before blocking. Default 32 * CONFIG_NXWM_STARTWINDOW_MXMPRIO - The message priority. Default: 42. @@ -335,7 +335,7 @@ */ #ifndef CONFIG_NXWM_STARTWINDOW_MQNAME -# define CONFIG_NXWM_STARTWINDOW_MQNAME "/dev/nxwm" +# define CONFIG_NXWM_STARTWINDOW_MQNAME "nxwm" #endif #ifndef CONFIG_NXWM_STARTWINDOW_MXMSGS From eb93aff49bfe8566b7c1a9c1b0c368a801209200 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 9 Jan 2017 14:09:31 -0600 Subject: [PATCH 376/390] Update ChangeLog --- ChangeLog.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 303e8dc2d..d183e22c1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -624,3 +624,8 @@ * CNxServer: Can't use printf in this context (2016-12-01) 1.19 2017-xx-xx Gregory Nutt + +* Correct NX Server message queue names. Should not be /dev/nx*. They + must be relative to /dev/mqueue so "nxabc" will appear at "/var/nxabc" + (2017-01-08). + From 9a89d0eb9efec6f88b65f1c67988d4a6b5447a43 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 16 Feb 2017 15:59:54 -0600 Subject: [PATCH 377/390] strcasecmp, strncasecmp, bzero, bcmp, and bcopy should be defined in strings.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the contemporary counterparts should be used instead. --- nxwm/src/cmediaplayer.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/nxwm/src/cmediaplayer.cxx b/nxwm/src/cmediaplayer.cxx index e502e11db..92b57bba2 100644 --- a/nxwm/src/cmediaplayer.cxx +++ b/nxwm/src/cmediaplayer.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include From 438bda042a4f24102c93360e5f11a1ea731777af Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 13 May 2017 18:11:42 -0600 Subject: [PATCH 378/390] Unitests/nxwm: Change includes because up_cxxinitialize() is now prototypes in apps/include/platfor/cxxinitialize.h --- UnitTests/nxwm/nxwm_main.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index ba47da251..07fa8f464 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -38,7 +38,6 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include #include #include @@ -48,6 +47,10 @@ # include "platform/configdata.hr" #endif +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) +# include "platform/cxxinitialize.h" +#endif + #include "ctaskbar.hxx" #include "cstartwindow.hxx" From f1dea7a1c3b5b0934a6c8598a2b2dc9e500364b6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 5 Jul 2017 13:00:10 -0600 Subject: [PATCH 379/390] Prototype of nsh_telnetstart() has changed. --- nxwm/src/cnxterm.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nxwm/src/cnxterm.cxx b/nxwm/src/cnxterm.cxx index e84d55d3c..3ccf42a48 100644 --- a/nxwm/src/cnxterm.cxx +++ b/nxwm/src/cnxterm.cxx @@ -66,6 +66,15 @@ # warning You probably do not really want CONFIG_NSH_USBKBD, try CONFIG_NXWM_KEYBOARD_USBHOST #endif +/* If Telnet is used and both IPv6 and IPv4 are enabled, then we need to + * pick one. + */ + +#ifdef CONFIG_NET_IPv6 +# define ADDR_FAMILY AF_INET6 +#else +# define ADDR_FAMILY AF_INET +#endif /******************************************************************************************** * Private Types ********************************************************************************************/ @@ -656,7 +665,7 @@ bool NxWM::nshlibInitialize(void) // Telnet daemon. #ifdef CONFIG_NSH_TELNET - int ret = nsh_telnetstart(); + int ret = nsh_telnetstart(ADDR_FAMILY); if (ret < 0) { // The daemon is NOT running! From 64898d7a48fa09be07ee5ba85eb0d6c7a345026c Mon Sep 17 00:00:00 2001 From: Sakari Kapanen Date: Sun, 24 Sep 2017 06:20:45 -0600 Subject: [PATCH 380/390] NxWidgets: fix work_s initialization in cwindowmessenger.hxx --- nxwm/include/cwindowmessenger.hxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nxwm/include/cwindowmessenger.hxx b/nxwm/include/cwindowmessenger.hxx index bfe6e9d08..0f7ddb6e4 100644 --- a/nxwm/include/cwindowmessenger.hxx +++ b/nxwm/include/cwindowmessenger.hxx @@ -90,6 +90,8 @@ namespace NxWM work_s work; CWindowMessenger *windowMessenger; void *instance; + + work_state_t() : work() {} }; /** Work queue callback functions */ From f4298e0aa867f79829a7ca0c630a4f32c10b8023 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 14 Oct 2017 10:13:34 -0600 Subject: [PATCH 381/390] Remove all support for single user mode. --- Kconfig | 29 +---- libnxwidgets/include/ccallback.hxx | 2 - libnxwidgets/include/cnxserver.hxx | 8 -- libnxwidgets/include/cwidgetcontrol.hxx | 16 --- libnxwidgets/include/nxconfig.hxx | 30 +----- libnxwidgets/src/ccallback.cxx | 2 - libnxwidgets/src/cnxserver.cxx | 137 +----------------------- libnxwidgets/src/cwidgetcontrol.cxx | 6 -- 8 files changed, 13 insertions(+), 217 deletions(-) diff --git a/Kconfig b/Kconfig index 68ba99a5d..886830ce9 100644 --- a/Kconfig +++ b/Kconfig @@ -8,7 +8,7 @@ menu "NxWidgets/NxWM" config NXWIDGETS bool "Enable NxWidgets" default n - depends on NX && HAVE_CXX + depends on NX && HAVE_CXX && NX_MULTIUSER ---help--- Enable support for NxWidgets @@ -36,23 +36,6 @@ config NXWIDGETS_EXTERNINIT ---help--- Define to support external display initialization. -config NXWIDGETS_DEVNO - int "LCD Device Number" - default 0 - depends on (NXWIDGETS_EXTERNINIT || NX_LCDDRIVER) && !NX_MULTIUSER - ---help--- - LCD device number (in case there are more than one LCDs connected). - Default: 0 - -config NXWIDGETS_VPLANE - int "Plane Number" - default 0 - depends on !NX_LCDDRIVER && !NXWIDGETS_EXTERNINIT && !NX_MULTIUSER - ---help--- - Only a single video plane is supported. Default: 0 - -if NX_MULTIUSER - config NXWIDGET_SERVERINIT bool "Start server" default y @@ -70,15 +53,13 @@ config NXWIDGETS_CLIENTPRIO default 100 ---help--- The thread that calls CNxServer::connect() will be re-prioritized to - this priority. This applies only if NX is configured in multi-user - mode (NX_MULTIUSER=y). Default: 100 + this priority. Default: 100 config NXWIDGETS_LISTENERPRIO int "NX Listener Priority" default 100 ---help--- - Priority of the NX event listener thread. This applies only if NX - is configured in multi-user mode (NX_MULTIUSER=y). Default: 100 + Priority of the NX event listener thread. Default: 100 config NXWIDGETS_LISTENERSTACK int "NX Listener Stack Size" @@ -86,8 +67,6 @@ config NXWIDGETS_LISTENERSTACK ---help--- NX listener thread stack size (in multi-user mode). Default 2048 -endif # NX_MULTIUSER - config NXWIDGET_EVENTWAIT bool "Event Waiting" default n @@ -294,7 +273,7 @@ endif # NxWidgets config NXWM bool "Enable NxWM" default n - depends on NXWIDGETS && NX_MULTIUSER + depends on NXWIDGETS ---help--- Enable support for the NuttX Tiny Window Manager (NxWM) diff --git a/libnxwidgets/include/ccallback.hxx b/libnxwidgets/include/ccallback.hxx index 9b641f8e7..28e309c9b 100644 --- a/libnxwidgets/include/ccallback.hxx +++ b/libnxwidgets/include/ccallback.hxx @@ -207,9 +207,7 @@ namespace NXWidgets * @param arg2 - User provided argument (see nx_block or nxtk_block) */ -#ifdef CONFIG_NX_MULTIUSER static void windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2); -#endif public: diff --git a/libnxwidgets/include/cnxserver.hxx b/libnxwidgets/include/cnxserver.hxx index 3c07f24b2..251048ce9 100644 --- a/libnxwidgets/include/cnxserver.hxx +++ b/libnxwidgets/include/cnxserver.hxx @@ -82,12 +82,10 @@ namespace NXWidgets private: FAR NX_DRIVERTYPE *m_hDevice; /**< LCD/Framebuffer device handle */ NXHANDLE m_hNxServer; /**< NX server handle */ -#ifdef CONFIG_NX_MULTIUSER volatile bool m_running; /**< True: The listener thread is running */ volatile bool m_connected; /**< True: Connected to the server */ volatile bool m_stop; /**< True: Waiting for the listener thread to stop */ sem_t m_connsem; /**< Wait for server connection */ -#endif static uint8_t m_nServers; /**< The number of NX server instances */ /** @@ -95,9 +93,7 @@ namespace NXWidgets * dispatches events from the NX server. */ -#ifdef CONFIG_NX_MULTIUSER static FAR void *listener(FAR void *arg); -#endif public: @@ -147,11 +143,7 @@ namespace NXWidgets inline bool connected(void) { -#ifdef CONFIG_NX_MULTIUSER return m_connected; -#else - return true; -#endif } /** diff --git a/libnxwidgets/include/cwidgetcontrol.hxx b/libnxwidgets/include/cwidgetcontrol.hxx index 69bbd1798..c80ce068b 100644 --- a/libnxwidgets/include/cwidgetcontrol.hxx +++ b/libnxwidgets/include/cwidgetcontrol.hxx @@ -215,10 +215,8 @@ namespace NXWidgets struct nxgl_size_s m_size; /**< Size of the window */ struct nxgl_point_s m_pos; /**< Position in display space */ struct nxgl_rect_s m_bounds; /**< Size of the display */ -#ifdef CONFIG_NX_MULTIUSER sem_t m_geoSem; /**< Posted when geometry is valid */ sem_t m_boundsSem; /**< Posted when bounds are valid */ -#endif CWindowEventHandlerList m_eventHandlers; /**< List of event handlers. */ /** @@ -312,11 +310,7 @@ namespace NXWidgets * Take the geometry semaphore (handling signal interruptions) */ -#ifdef CONFIG_NX_MULTIUSER void takeGeoSem(void); -#else - inline void takeGeoSem(void) {} -#endif /** * Give the geometry semaphore @@ -324,9 +318,7 @@ namespace NXWidgets inline void giveGeoSem(void) { -#ifdef CONFIG_NX_MULTIUSER sem_post(&m_geoSem); -#endif } /** @@ -343,11 +335,7 @@ namespace NXWidgets * Take the bounds semaphore (handling signal interruptions) */ -#ifdef CONFIG_NX_MULTIUSER void takeBoundsSem(void); -#else - inline void takeBoundsSem(void) {} -#endif /** * Give the bounds semaphore @@ -355,9 +343,7 @@ namespace NXWidgets inline void giveBoundsSem(void) { -#ifdef CONFIG_NX_MULTIUSER sem_post(&m_boundsSem); -#endif } /** @@ -660,12 +646,10 @@ namespace NXWidgets * @param arg - User provided argument (see nx_block or nxtk_block) */ -#ifdef CONFIG_NX_MULTIUSER inline void windowBlocked(FAR void *arg) { m_eventHandlers.raiseBlockedEvent(arg); } -#endif /** * This event means that cursor control data is available for the window. diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index f7452f873..0836e746f 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/nxconfig.hxx * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -63,22 +63,16 @@ * * NX Server/Device Configuration * - * CONFIG_NXWIDGETS_DEVNO - LCD device number (in case there are more than - * one LCDs connected (single user mode only). Default: 0 - * CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0 - * CONFIG_NXSTART_SERVERPRIO - Priority of the NX server. This applies - * only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y). + * CONFIG_NXSTART_SERVERPRIO - Priority of the NX server. * Default: (SCHED_PRIORITY_DEFAULT+10). NOTE: Of the three priority * definitions here, CONFIG_NXSTART_SERVERPRIO should have the highest * priority to avoid data overrun race conditions. Such errors would most * likely appear as duplicated rows of data on the display. * CONFIG_NXWIDGETS_CLIENTPRIO - The thread that calls CNxServer::connect() - * will be re-prioritized to this priority. This applies only if NX is - * configured in multi-user mode (CONFIG_NX_MULTIUSER=y). Default: + * will be re-prioritized to this priority. Default: * SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread. - * This applies only if NX is configured in multi-user mode - * (CONFIG_NX_MULTIUSER=y). Default: SCHED_PRIORITY_DEFAULT + * Default: SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display * initialization. * CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user @@ -191,22 +185,6 @@ #endif /* NX Server/Device Configuration *******************************************/ -/** - * LCD device number (in case there are more than one LCDs connected) - */ - -#ifndef CONFIG_NXWIDGETS_DEVNO -# define CONFIG_NXWIDGETS_DEVNO 0 -#endif - -/** - * Only a single video plane is supported - */ - -#ifndef CONFIG_NXWIDGETS_VPLANE -# define CONFIG_NXWIDGETS_VPLANE 0 -#endif - /** * Priority of the NX server (in multi-user mode) */ diff --git a/libnxwidgets/src/ccallback.cxx b/libnxwidgets/src/ccallback.cxx index 4bc96dbeb..36eb2f85b 100644 --- a/libnxwidgets/src/ccallback.cxx +++ b/libnxwidgets/src/ccallback.cxx @@ -246,7 +246,6 @@ void CCallback::newKeyboardEvent(NXHANDLE hwnd, uint8_t nCh, * @param arg2 - User provided argument (see nx_block or nxtk_block) */ -#ifdef CONFIG_NX_MULTIUSER void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) { ginfo("hwnd=%p arg1=%p arg2=%p\n", hwnd, arg1, arg2); @@ -259,5 +258,4 @@ void CCallback::windowBlocked(NXWINDOW hwnd, FAR void *arg1, FAR void *arg2) This->m_widgetControl->windowBlocked(arg2); } -#endif diff --git a/libnxwidgets/src/cnxserver.cxx b/libnxwidgets/src/cnxserver.cxx index eab149f2d..3cc56e3c8 100644 --- a/libnxwidgets/src/cnxserver.cxx +++ b/libnxwidgets/src/cnxserver.cxx @@ -48,15 +48,12 @@ #include #include #include +#include +#include #include #include -#ifdef CONFIG_NX_MULTIUSER -# include -# include -#endif - #ifdef CONFIG_VNCSERVER # include #endif @@ -87,10 +84,8 @@ CNxServer::CNxServer(void) m_hDevice = (FAR NX_DRIVERTYPE *)NULL; // LCD/Framebuffer device handle m_hNxServer = (NXHANDLE)NULL; // NX server handle -#ifdef CONFIG_NX_MULTIUSER m_connected = false; // True: Connected to the server sem_init(&m_connsem, 0, 0); // Wait for server connection -#endif // Increment the global count of NX servers. Normally there is only one // but we don't want to preclude the case where there might be multiple @@ -125,110 +120,9 @@ CNxServer::~CNxServer(void) } /** - * Connect to the NX Server -- Single user version + * Connect to the NX Server */ -#ifndef CONFIG_NX_MULTIUSER -bool CNxServer::connect(void) -{ -#if defined(CONFIG_NXWIDGETS_EXTERNINIT) - struct boardioc_graphics_s devinfo; - int ret; - - // Use external graphics driver initialization - - printf("nxtext_initialize: Initializing external graphics device\n"); - - devinfo.devno = CONFIG_NXWIDGETS_DEVNO; - devinfo.dev = NULL; - - ret = boardctl(BOARDIOC_GRAPHICS_SETUP, (uintptr_t)&devinfo); - if (ret < 0) - { - gerr("ERROR: boardctl failed, devno=%d: %d\n", CONFIG_NXWIDGETS_DEVNO, errno); - return false; - } - - m_hDevice = devinfo.dev; - -#elif defined(CONFIG_NX_LCDDRIVER) - int ret; - - // Initialize the LCD device - - ret = board_lcd_initialize(); - if (ret < 0) - { - gerr("ERROR: board_lcd_initialize failed: %d\n", -ret); - return false; - } - - // Get the device instance - - m_hDevice = board_lcd_getdev(CONFIG_NXWIDGETS_DEVNO); - if (!m_hDevice) - { - gerr("ERROR: board_lcd_getdev failed, devno=%d\n", CONFIG_NXWIDGETS_DEVNO); - return false; - } - - // Turn the LCD on at 75% power - - (void)m_hDevice->setpower(m_hDevice, ((3*CONFIG_LCD_MAXPOWER + 3)/4)); - -#else // CONFIG_NX_LCDDRIVER - int ret; - - // Initialize the frame buffer device - // REVISIT: display == 0 is assumed - - ret = up_fbinitialize(0); - if (ret < 0) - { - gerr("ERROR: up_fbinitialize failed: %d\n", -ret); - return false; - } - - m_hDevice = up_fbgetvplane(0, CONFIG_NXWIDGETS_VPLANE); - if (!m_hDevice) - { - gerr("ERROR: CNxServer::connect: up_fbgetvplane failed, vplane=%d\n", - CONFIG_NXWIDGETS_VPLANE); - return false; - } - -#endif // CONFIG_NX_LCDDRIVER - - // Then open NX - - m_hNxServer = nx_open(m_hDevice); - if (!m_hNxServer) - { - gerr("ERROR: CNxServer::connect: nx_open failed: %d\n", errno); - return false; - } - -#ifdef CONFIG_VNCSERVER - // Setup the VNC server to support keyboard/mouse inputs - - ret = vnc_default_fbinitialize(0, m_hNxServer); - if (ret < 0) - { - gerr("ERROR: CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret); - disconnect(); - return false; - } -#endif - - return true; -} -#endif // CONFIG_NX_MULTIUSER - -/** - * Connect to the NX Server -- Multi user version - */ - -#ifdef CONFIG_NX_MULTIUSER bool CNxServer::connect(void) { struct sched_param param; @@ -329,30 +223,11 @@ bool CNxServer::connect(void) return true; } -#endif // CONFIG_NX_MULTIUSER /** - * Disconnect to the NX Server -- Single user version + * Disconnect from the NX Server */ -#ifndef CONFIG_NX_MULTIUSER -void CNxServer::disconnect(void) -{ - // Close the server - - if (m_hNxServer) - { - nx_close(m_hNxServer); - m_hNxServer = NULL; - } -} -#endif // CONFIG_NX_MULTIUSER - -/** - * Disconnect to the NX Server -- Single user version - */ - -#ifdef CONFIG_NX_MULTIUSER void CNxServer::disconnect(void) { // Is the listener running? @@ -379,14 +254,12 @@ void CNxServer::disconnect(void) m_hNxServer = NULL; } } -#endif // CONFIG_NX_MULTIUSER /** * This is the entry point of a thread that listeners for and dispatches * events from the NX server. */ -#ifdef CONFIG_NX_MULTIUSER FAR void *CNxServer::listener(FAR void *arg) { // The argument must be the CNxServer instance @@ -436,4 +309,4 @@ FAR void *CNxServer::listener(FAR void *arg) sem_post(&This->m_connsem); return NULL; } -#endif // CONFIG_NX_MULTIUSER + diff --git a/libnxwidgets/src/cwidgetcontrol.cxx b/libnxwidgets/src/cwidgetcontrol.cxx index 989cb5293..24dbaec76 100644 --- a/libnxwidgets/src/cwidgetcontrol.cxx +++ b/libnxwidgets/src/cwidgetcontrol.cxx @@ -118,10 +118,8 @@ CWidgetControl::CWidgetControl(FAR const CWidgetStyle *style) m_waiting = false; sem_init(&m_waitSem, 0, 0); #endif -#ifdef CONFIG_NX_MULTIUSER sem_init(&m_boundsSem, 0, 0); sem_init(&m_geoSem, 0, 0); -#endif // Do we need to fetch the default style? @@ -908,7 +906,6 @@ bool CWidgetControl::pollCursorControlEvents(void) * Take the geometry semaphore (handling signal interruptions) */ -#ifdef CONFIG_NX_MULTIUSER void CWidgetControl::takeGeoSem(void) { // Take the geometry semaphore. Retry is an error occurs (only if @@ -921,13 +918,11 @@ void CWidgetControl::takeGeoSem(void) } while (ret < 0 && errno == EINTR); } -#endif /** * Take the bounds semaphore (handling signal interruptions) */ -#ifdef CONFIG_NX_MULTIUSER void CWidgetControl::takeBoundsSem(void) { // Take the bounds semaphore. Retry is an error occurs (only if @@ -940,7 +935,6 @@ void CWidgetControl::takeBoundsSem(void) } while (ret < 0 && errno == EINTR); } -#endif /** * Clear all mouse events From 5877d74089887cecd2373c3a66e37bde59d47793 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 15 Oct 2017 08:04:17 -0600 Subject: [PATCH 382/390] Remove unused CONFIG_NXWIDGETS_EXTERNINIT configuration variable. --- Kconfig | 8 -------- libnxwidgets/include/nxconfig.hxx | 2 -- 2 files changed, 10 deletions(-) diff --git a/Kconfig b/Kconfig index 886830ce9..2100fb032 100644 --- a/Kconfig +++ b/Kconfig @@ -28,14 +28,6 @@ config NXWIDGETS_FLICKERFREE lower-performance flicker-reductions measures where-ever thay may be available. -config NXWIDGETS_EXTERNINIT - bool "External display Initialization" - default n - depends on LIB_BOARDCTL - select BOARDCTL_GRAPHICS - ---help--- - Define to support external display initialization. - config NXWIDGET_SERVERINIT bool "Start server" default y diff --git a/libnxwidgets/include/nxconfig.hxx b/libnxwidgets/include/nxconfig.hxx index 0836e746f..2a86193df 100644 --- a/libnxwidgets/include/nxconfig.hxx +++ b/libnxwidgets/include/nxconfig.hxx @@ -73,8 +73,6 @@ * SCHED_PRIORITY_DEFAULT * CONFIG_NXWIDGETS_LISTENERPRIO - Priority of the NX event listener thread. * Default: SCHED_PRIORITY_DEFAULT - * CONFIG_NXWIDGETS_EXTERNINIT - Define to support external display - * initialization. * CONFIG_NXWIDGETS_LISTENERSTACK - NX listener thread stack size (in multi-user * mode). Default 2048 * CONFIG_NXWIDGET_EVENTWAIT - Build in support for external window event, modal From ec05d491e1bdc91899e55ff7daf32fcc10ecbf79 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 15 Oct 2017 09:37:32 -0600 Subject: [PATCH 383/390] This removes the last traces of single-user mode. --- Kconfig | 2 +- UnitTests/README.txt | 1 - nxwm/include/nxwmconfig.hxx | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Kconfig b/Kconfig index 2100fb032..2b10ec5a3 100644 --- a/Kconfig +++ b/Kconfig @@ -8,7 +8,7 @@ menu "NxWidgets/NxWM" config NXWIDGETS bool "Enable NxWidgets" default n - depends on NX && HAVE_CXX && NX_MULTIUSER + depends on NX && HAVE_CXX ---help--- Enable support for NxWidgets diff --git a/UnitTests/README.txt b/UnitTests/README.txt index 044fcc175..5af0d99f6 100644 --- a/UnitTests/README.txt +++ b/UnitTests/README.txt @@ -88,7 +88,6 @@ Installing and Building the Unit Tests d) Special configuration requirements for the nxwm unit test: CONFIG_NXTERM=y - CONFIG_NX_MULTIUSER=y e) Other .config file changes -- NSH configurations only. diff --git a/nxwm/include/nxwmconfig.hxx b/nxwm/include/nxwmconfig.hxx index c039f5663..7edf5d972 100644 --- a/nxwm/include/nxwmconfig.hxx +++ b/nxwm/include/nxwmconfig.hxx @@ -56,7 +56,6 @@ * * CONFIG_HAVE_CXX : C++ support is required * CONFIG_NX : NX must enabled - * CONFIG_NX_MULTIUSER=y : NX must be configured in multiuse mode * CONFIG_NXTERM=y : For NxTerm support * CONFIG_SCHED_ONEXIT : Support for on_exit() * @@ -80,10 +79,6 @@ # error "NX support is required (CONFIG_NX)" #endif -#ifndef CONFIG_NX_MULTIUSER -# error "NX multi-user support is required (CONFIG_NX_MULTIUSER)" -#endif - /** * NxTerm support is (probably) required if CONFIG_NXWM_NXTERM is * selected From ac52348e795de004b3814215684ae0e15c64f7af Mon Sep 17 00:00:00 2001 From: Sakari Kapanen Date: Wed, 8 Nov 2017 07:23:01 -0600 Subject: [PATCH 384/390] CTaskBar: Fix type checking issue with GCC 6 --- Doxygen/Doxyfile | 2 +- nxwm/src/ctaskbar.cxx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Doxygen/Doxyfile b/Doxygen/Doxyfile index 399fa553b..c1f344df6 100644 --- a/Doxygen/Doxyfile +++ b/Doxygen/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = NXWidgets # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.15" +PROJECT_NUMBER = "1.18" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/nxwm/src/ctaskbar.cxx b/nxwm/src/ctaskbar.cxx index 6b578109d..bf24c3dcb 100644 --- a/nxwm/src/ctaskbar.cxx +++ b/nxwm/src/ctaskbar.cxx @@ -855,7 +855,7 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) if (!window) { delete control; - return false; + return (NXWidgets::CNxTkWindow *)0; } // Open (and initialize) the window @@ -865,7 +865,6 @@ NXWidgets::CNxTkWindow *CTaskbar::openFramedWindow(void) { delete window; window = (NXWidgets::CNxTkWindow *)0; - return false; } return window; From de7d74a1537671a2984532d799e01b4ba66b57f9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 17 Jan 2018 09:32:05 -0600 Subject: [PATCH 385/390] nxwm: Elimint BOARDIOC_TSCTEST_SETUP. --- Kconfig | 15 --------------- nxwm/src/ctouchscreen.cxx | 14 -------------- 2 files changed, 29 deletions(-) diff --git a/Kconfig b/Kconfig index 2b10ec5a3..c841707a4 100644 --- a/Kconfig +++ b/Kconfig @@ -736,21 +736,6 @@ if NXWM_TOUCHSCREEN comment "Touchscreen Device Settings" -config NXWM_TOUCHSCREEN_DEVINIT - bool "Touchscreen Device Initialization" - default y - depends on !BUILD_PROTECTED && !BUILD_KERNEL - ---help--- - It this option is selected, then the NxWM:CTouchscreen listener - thread will call a function boardctl() in order to instantiate the - touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If - NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen - listener thread will assume that the driver has already been - initialized at NXWM_TOUCHSCREEN_DEVPATH. - - NOTE that in the kernel build, all touchscreen initialize must be - performed in kernel logic prior to the execution of NxWM. - config NXWM_TOUCHSCREEN_DEVNO int "Touchscreen Device Number" default 0 diff --git a/nxwm/src/ctouchscreen.cxx b/nxwm/src/ctouchscreen.cxx index 5cf18f94c..dc329ad3d 100644 --- a/nxwm/src/ctouchscreen.cxx +++ b/nxwm/src/ctouchscreen.cxx @@ -43,7 +43,6 @@ #include #include -#include #include #include @@ -285,19 +284,6 @@ FAR void *CTouchscreen::listener(FAR void *arg) _info("Listener started\n"); -#ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT - // Initialize the touchscreen device - - int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); - if (ret < 0) - { - gerr("ERROR Failed initialize the touchscreen device: %d\n", errno); - This->m_state = LISTENER_FAILED; - sem_post(&This->m_waitSem); - return (FAR void *)0; - } -#endif - // Open the touchscreen device that we just created. This->m_touchFd = std::open(CONFIG_NXWM_TOUCHSCREEN_DEVPATH, O_RDONLY); From e69358670cafecfd6304d75263491e8dea5f33c5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 17 Jan 2018 12:02:39 -0600 Subject: [PATCH 386/390] In NxWM unit test, call boardctl(BOARDIOC_INIT) if available and appropriate. --- UnitTests/nxwm/nxwm_main.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 07fa8f464..3dddea009 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -43,6 +43,8 @@ #include #include +#include + #ifdef CONFIG_NXWM_TOUCHSCREEN_CONFIGDATA # include "platform/configdata.hr" #endif @@ -675,6 +677,16 @@ int nxwm_main(int argc, char *argv[]) up_cxxinitialize(); #endif + // Should we perform board-specific initialization? There are two ways + // that board initialization can occur: 1) automatically via + // board_initialize() durring bootup if CONFIG_BOARD_INITIALIZE, or + // 2) here via a call to boardctl() if the interface is enabledi + // (CONFIG_LIB_BOARDCTL=y). + +#if defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITIALIZE) + (void)boardctl(BOARDIOC_INIT, 0); +#endif + // Initialize memory monitor logic initMemoryUsage(); @@ -688,6 +700,7 @@ int nxwm_main(int argc, char *argv[]) printf("nxwm_main: ERROR: Failed to initialize the NSH library\n"); return EXIT_FAILURE; } + showTestCaseMemory("nxwm_main: After initializing the NSH library"); #endif From 94393aa719cccd70cba91c4ad02753115c5af775 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 18 Jan 2018 06:55:24 -0600 Subject: [PATCH 387/390] Fix a dependency in Kconfig: CONFIG_NXWIDGET_SERVERINIT is definitely supported in the PROTECTED and KERNEL build modes. --- Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/Kconfig b/Kconfig index c841707a4..1b8392907 100644 --- a/Kconfig +++ b/Kconfig @@ -31,7 +31,6 @@ config NXWIDGETS_FLICKERFREE config NXWIDGET_SERVERINIT bool "Start server" default y - depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- If this option is selected, then the NxWidgets::CNxServer class will bring up the NX server when it is initialized. If this option is From 4d11aaabb1b2c3643fe5bb73a6c244dc28f34ca6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 18 Jan 2018 07:13:49 -0600 Subject: [PATCH 388/390] Fix some typos in commments --- UnitTests/nxwm/nxwm_main.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitTests/nxwm/nxwm_main.cxx b/UnitTests/nxwm/nxwm_main.cxx index 3dddea009..6fa01cb86 100644 --- a/UnitTests/nxwm/nxwm_main.cxx +++ b/UnitTests/nxwm/nxwm_main.cxx @@ -679,8 +679,8 @@ int nxwm_main(int argc, char *argv[]) // Should we perform board-specific initialization? There are two ways // that board initialization can occur: 1) automatically via - // board_initialize() durring bootup if CONFIG_BOARD_INITIALIZE, or - // 2) here via a call to boardctl() if the interface is enabledi + // board_initialize() during bootup if CONFIG_BOARD_INITIALIZE, or + // 2) here via a call to boardctl() if the interface is enabled // (CONFIG_LIB_BOARDCTL=y). #if defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITIALIZE) From c26b57de63077019d80b0f74f6cb9f683e73b896 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Mar 2018 12:28:23 -0600 Subject: [PATCH 389/390] Update ChangeLog and ReleaseNotes in preparation for the 1.19 release. --- ChangeLog.txt | 25 ++++++++++++++++++++++--- ReleaseNotes.txt | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index d183e22c1..6762520d3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -623,9 +623,28 @@ (2016-12-01). * CNxServer: Can't use printf in this context (2016-12-01) -1.19 2017-xx-xx Gregory Nutt +1.19 2018-03-02 Gregory Nutt -* Correct NX Server message queue names. Should not be /dev/nx*. They - must be relative to /dev/mqueue so "nxabc" will appear at "/var/nxabc" +* Correct NX Server message queue names. Should not be /dev/nx*. They must + be relative to /dev/mqueue so "nxabc" will appear at "/var/nxabc" (2017-01-08). +* strcasecmp, strncasecmp, bzero, bcmp, and bcopy should be defined in + strings.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the + contemporary counterparts should be used instead (2017-02-16). +* Unitests/nxwm: Change includes because up_cxxinitialize() is now + prototyped in apps/include/platfor/cxxinitialize.h (2017-05-13). +* Prototype of nsh_telnetstart() has changed (2017-07-05). +* NxWidgets: fix work_s initialization in cwindowmessenger.hxx. From Sakari + Kapanen (2017-09-24). +* Remove all support for single user mode (2017-10-14). +* Remove unused CONFIG_NXWIDGETS_EXTERNINIT configuration variable + (2017-10-15). +* CTaskBar: Fix type checking issue with GCC 6 From Sakari Kapanen + (2017-11-08). +* nxwm: Eliminate BOARDIOC_TSCTEST_SETUP (2018-01-17). +* In NxWM unit test, call boardctl(BOARDIOC_INIT) if available and + appropriate (2018-01-17). +* Fix a dependency in Kconfig: CONFIG_NXWIDGET_SERVERINIT is definitely + supported in the PROTECTED and KERNEL build modes (2018-01-18). +1.20 2018-xx-xx Gregory Nutt diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 54d62493a..91c073772 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -605,3 +605,38 @@ Bugfixes: of rows to show and in clearing the background. From Petteri Aimonen. * CNxServer: Can't use printf in this context. +NxWidgets-1.19 +============== + +The 20th release of the NxWidgets package was made on March 2, 2018. This +release depends on NuttX-7.24 or above and should not be used with older +NuttX releases. + +The TAG for this release is nuttx-7.24 + +Additional new features and extended functionality in Version 1.19: + + (There are no new graphics features. This release is for NuttX + compatibility only and includes a few additional bugfixes) + +Bugfixes and Updates for Compatibility with NuttX-7.24: + +* Correct NX Server message queue names. Should not be /dev/nx*. They must + be relative to /dev/mqueue so "nxabc" will appear at "/var/nxabc". +* strcasecmp, strncasecmp, bzero, bcmp, and bcopy should be defined in + strings.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the + contemporary counterparts should be used instead. +* Unitests/nxwm: Change includes because up_cxxinitialize() is now + prototyped in apps/include/platfor/cxxinitialize.h. +* Prototype of nsh_telnetstart() has changed. +* NxWidgets: Fix work_s initialization in cwindowmessenger.hxx. From Sakari + Kapanen. +* Remove all support for single user mode. +* Remove unused CONFIG_NXWIDGETS_EXTERNINIT configuration variable. +* CTaskBar: Fix type checking issue with GCC 6 From Sakari Kapanen. +* nxwm: Eliminate BOARDIOC_TSCTEST_SETUP (2018-01-17). +* In NxWM unit test, call boardctl(BOARDIOC_INIT) if available and + appropriate (2018-01-17). +* Fix a dependency in Kconfig: CONFIG_NXWIDGET_SERVERINIT is definitely + supported in the PROTECTED and KERNEL build modes (2018-01-18). + From 795bc250ad1c8ae65a6bae314a70db34cdf6b12c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 2 Mar 2018 14:46:55 -0600 Subject: [PATCH 390/390] Fix some old version numbers in documents that have never been updated. --- Doxygen/Doxyfile | 2 +- ReleaseNotes.txt | 4 ++-- libnxwidgets/doc/mainpage.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doxygen/Doxyfile b/Doxygen/Doxyfile index c1f344df6..75585cfba 100644 --- a/Doxygen/Doxyfile +++ b/Doxygen/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = NXWidgets # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = "1.18" +PROJECT_NUMBER = "1.19" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 91c073772..46c04137d 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -490,14 +490,14 @@ NxWidgets-1.15 ============== The 16th release of the NxWidgets package was made on April 14, 2015. This -release depends on NuttX-7.9 or above and should not be used with older +release depends on NuttX-7.24 or above and should not be used with older NuttX releases. Additional new features and extended functionality in Version 1.15: * The primary purpose of this release is update the NxWidgets and NxWM implementations to reflect changes in naming and interfaces in the - NuttX 7.9 release + NuttX 7.24 release * NxWidgets:: INxWindow, CNxWindow, CBgWindow, CNxTkWindow, CNxToolbar, CGraphicsPort updated to include a "caps" parameter in all drawLine() methods. This permits drawing a circular cap at the end of lines and diff --git a/libnxwidgets/doc/mainpage.h b/libnxwidgets/doc/mainpage.h index d11f05563..53c1c7bba 100644 --- a/libnxwidgets/doc/mainpage.h +++ b/libnxwidgets/doc/mainpage.h @@ -75,7 +75,7 @@ * many NSH sessions in windows as you want. (keybard input still comes * through serial). * - * Note 1: The current release of NwWM requires NuttX-7.9 or above. + * Note 1: The current release of NwWM requires NuttX-7.24 or above. * * Note 2: Many of the fundamental classes in NxWidgets derive from the Antony * Dzeryn's "Woopsi" project: http://woopsi.org/ which also has a BSD style